ReactOS  0.4.13-dev-990-g6d23816
Interface.c File Reference
#include "fltmgr.h"
#include "fltmgrint.h"
#include <debug.h>
Include dependency graph for Interface.c:

Go to the source code of this file.

Classes

struct  _DETACH_DEVICE_WORK_ITEM
 

Macros

#define VALID_FAST_IO_DISPATCH_HANDLER(_FastIoDispatchPtr, _FieldName)
 
#define IS_MY_DEVICE_OBJECT(_devObj)
 

Typedefs

typedef struct _DETACH_DEVICE_WORK_ITEM DETACH_DEVICE_WORK_ITEM
 
typedef struct _DETACH_DEVICE_WORK_ITEMPDETACH_DEVICE_WORK_ITEM
 

Functions

NTSTATUS NTAPI DriverEntry (_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath)
 
static NTSTATUS SetupDispatchAndCallbacksTables (_In_ PDRIVER_OBJECT DriverObject)
 
static NTSTATUS FltpAttachDeviceObject (_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice, _Out_ PDEVICE_OBJECT *AttachedToDeviceObject)
 
static VOID FltpCleanupDeviceObject (_In_ PDEVICE_OBJECT DeviceObject)
 
static BOOLEAN FltpIsAttachedToDevice (_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PDEVICE_OBJECT *AttachedDeviceObject)
 
static NTSTATUS FltpEnumerateFileSystemVolumes (_In_ PDEVICE_OBJECT DeviceObject)
 
static NTSTATUS FltpAttachToFileSystemDevice (_In_ PDEVICE_OBJECT DeviceObject, _In_ PUNICODE_STRING DeviceName)
 
static LONG_PTR FltpDetachFromFileSystemDevice (_In_ PDEVICE_OBJECT DeviceObject)
 
VOID NTAPI FltpFsNotification (_In_ PDEVICE_OBJECT DeviceObject, _In_ BOOLEAN FsActive)
 
NTSTATUS NTAPI FltpDispatch (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS NTAPI FltpCreate (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS NTAPI FltpFsControl (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS NTAPI FltpDeviceControl (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
BOOLEAN NTAPI FltpFastIoCheckIfPossible (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _In_ BOOLEAN CheckForReadOperation, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoRead (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _Out_ PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoWrite (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _In_ PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoQueryBasicInfo (_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_BASIC_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoQueryStandardInfo (_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_STANDARD_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoLock (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PLARGE_INTEGER Length, _In_ PEPROCESS ProcessId, _In_ ULONG Key, _In_ BOOLEAN FailImmediately, _In_ BOOLEAN ExclusiveLock, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoUnlockSingle (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PLARGE_INTEGER Length, _In_ PEPROCESS ProcessId, _In_ ULONG Key, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoUnlockAll (_In_ PFILE_OBJECT FileObject, _In_ PEPROCESS ProcessId, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoUnlockAllByKey (_In_ PFILE_OBJECT FileObject, _In_ PVOID ProcessId, _In_ ULONG Key, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoDeviceControl (_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _In_opt_ PVOID InputBuffer, _In_ ULONG InputBufferLength, _Out_opt_ PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _In_ ULONG IoControlCode, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
VOID NTAPI FltpFastIoDetachDevice (_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice)
 
BOOLEAN NTAPI FltpFastIoQueryNetworkOpenInfo (_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_NETWORK_OPEN_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoMdlRead (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoMdlReadComplete (_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoPrepareMdlWrite (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoMdlWriteComplete (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoReadCompressed (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _Out_ PVOID Buffer, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _Out_ PCOMPRESSED_DATA_INFO CompressedDataInfo, _In_ ULONG CompressedDataInfoLength, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoWriteCompressed (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _In_ PVOID Buffer, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PCOMPRESSED_DATA_INFO CompressedDataInfo, _In_ ULONG CompressedDataInfoLength, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoMdlReadCompleteCompressed (_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoMdlWriteCompleteCompressed (_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI FltpFastIoQueryOpen (_Inout_ PIRP Irp, _Out_ PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, _In_ PDEVICE_OBJECT DeviceObject)
 
NTSTATUS NTAPI FltpPreFsFilterOperation (_In_ PFS_FILTER_CALLBACK_DATA Data, _Out_ PVOID *CompletionContext)
 
VOID NTAPI FltpPostFsFilterOperation (_In_ PFS_FILTER_CALLBACK_DATA Data, _In_ NTSTATUS OperationStatus, _In_ PVOID CompletionContext)
 
VOID NTAPI FltpFastIoDetachDeviceWorker (_In_ PVOID Parameter)
 

Variables

PDEVICE_OBJECT CommsDeviceObject
 
LIST_ENTRY FilterList
 
ERESOURCE FilterListLock
 
DRIVER_INITIALIZE DriverEntry
 
DRIVER_FS_NOTIFICATION FltpFsNotification
 
DRIVER_DATA DriverData
 

Macro Definition Documentation

◆ IS_MY_DEVICE_OBJECT

#define IS_MY_DEVICE_OBJECT (   _devObj)
Value:
(((_devObj) != NULL) && \
((_devObj)->DeviceExtension != NULL))
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42

Definition at line 26 of file Interface.c.

◆ VALID_FAST_IO_DISPATCH_HANDLER

#define VALID_FAST_IO_DISPATCH_HANDLER (   _FastIoDispatchPtr,
  _FieldName 
)
Value:
(((_FastIoDispatchPtr) != NULL) && \
(((_FastIoDispatchPtr)->SizeOfFastIoDispatch) >= \
(FIELD_OFFSET(FAST_IO_DISPATCH, _FieldName) + sizeof(void *))) && \
((_FastIoDispatchPtr)->_FieldName != NULL))
smooth NULL
Definition: ftsmooth.c:416
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 20 of file Interface.c.

Typedef Documentation

◆ DETACH_DEVICE_WORK_ITEM

◆ PDETACH_DEVICE_WORK_ITEM

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ PUNICODE_STRING  RegistryPath 
)

Definition at line 2072 of file Interface.c.

2074 {
2075  UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\FileSystem\\Filters\\"DRIVER_NAME);
2076  PDEVICE_OBJECT RawDeviceObject;
2078  PFILE_OBJECT RawFileObject;
2080  UNICODE_STRING SymLink;
2081 
2082  NTSTATUS Status;
2083 
2086 
2087  /* Save the registry key for this driver */
2095 
2096  /* Do some initialization */
2098 
2099  /* Create the main filter manager device object */
2101  0,
2102  &DeviceName,
2105  FALSE,
2106  &DeviceObject);
2107  if (!NT_SUCCESS(Status))
2108  {
2109  DPRINT1("fltmgr IoCreateDevice failed. Status = %X\n", Status);
2110  goto Cleanup;
2111  }
2112 
2113  /* Store a global reference so we can access from callbacks */
2115 
2116  /* Generate the symbolic link name */
2117  RtlInitUnicodeString(&SymLink, L"\\??\\"DRIVER_NAME);
2118  Status = IoCreateSymbolicLink(&SymLink, &DeviceName);
2119  if (!NT_SUCCESS(Status)) goto Cleanup;
2120 
2121  /* Create the callbacks for the dispatch table, FastIo and FS callbacks */
2123  if (!NT_SUCCESS(Status)) goto Cleanup;
2124 
2125  /* Initialize the comms objects */
2127  if (!NT_SUCCESS(Status)) goto Cleanup;
2128 
2129  /* Register for notifications when a new file system is loaded. This also enumerates any existing file systems */
2131  FLT_ASSERT(Status != STATUS_DEVICE_ALREADY_ATTACHED); // Windows checks for this, I'm not sure how it can happen. Needs investigation??
2132  if (!NT_SUCCESS(Status)) goto Cleanup;
2133 
2136 
2137  /* IoRegisterFsRegistrationChange isn't notified about the raw file systems, so we attach to them manually */
2138  RtlInitUnicodeString(&ObjectName, L"\\Device\\RawDisk");
2141  &RawFileObject,
2142  &RawDeviceObject);
2143  if (NT_SUCCESS(Status))
2144  {
2145  FltpFsNotification(RawDeviceObject, TRUE);
2146  ObDereferenceObject(RawFileObject);
2147  }
2148 
2149  RtlInitUnicodeString(&ObjectName, L"\\Device\\RawCdRom");
2152  &RawFileObject,
2153  &RawDeviceObject);
2154  if (NT_SUCCESS(Status))
2155  {
2156  FltpFsNotification(RawDeviceObject, TRUE);
2157  ObDereferenceObject(RawFileObject);
2158  }
2159 
2160  /* We're done, clear the initializing flag */
2163 
2164 Cleanup:
2165 
2166  if (!NT_SUCCESS(Status))
2167  {
2169  {
2172  }
2173 
2174  IoDeleteSymbolicLink(&SymLink);
2175 
2176  if (DeviceObject)
2178 
2181  }
2182 
2183  return Status;
2184 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define STATUS_DEVICE_ALREADY_ATTACHED
Definition: ntstatus.h:278
#define FM_TAG_DISPATCH_TABLE
Definition: fltmgr.h:15
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LIST_ENTRY FilterList
Definition: Filter.c:24
USHORT MaximumLength
Definition: env_spec_w32.h:370
FAST_MUTEX FilterAttachLock
Definition: fltmgr.h:37
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1435
ERESOURCE FilterListLock
Definition: Filter.c:25
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
uint16_t * PWCHAR
Definition: typedefs.h:54
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
Definition: cmfuncs.h:62
WCHAR DeviceName[]
Definition: adapter.cpp:21
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
DRIVER_DATA DriverData
Definition: Interface.c:396
#define FM_TAG_REGISTRY_DATA
Definition: fltmgr.h:16
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:113
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
DRIVER_FS_NOTIFICATION FltpFsNotification
Definition: Interface.c:90
* PFILE_OBJECT
Definition: iotypes.h:1954
#define FILE_READ_ATTRIBUTES
Definition: nt_native.h:647
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
#define DRIVER_NAME
Definition: ext2fs.h:136
static const WCHAR Cleanup[]
Definition: register.c:80
PDEVICE_OBJECT DeviceObject
Definition: fltmgr.h:30
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DPRINT1
Definition: precomp.h:8
struct _FAST_IO_DISPATCH * FastIoDispatch
Definition: iotypes.h:2176
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
return STATUS_SUCCESS
Definition: btrfs.c:2777
NTSTATUS FltpSetupCommunicationObjects(_In_ PDRIVER_OBJECT DriverObject)
Definition: Messaging.c:377
UNICODE_STRING ServiceKey
Definition: fltmgr.h:31
NTSTATUS NTAPI IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine)
Definition: volume.c:1094
PFAST_IO_DISPATCH FastIoDispatch
Definition: fltmgr.h:35
static NTSTATUS SetupDispatchAndCallbacksTables(_In_ PDRIVER_OBJECT DriverObject)
Definition: Interface.c:2189
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

◆ FltpAttachDeviceObject()

static NTSTATUS FltpAttachDeviceObject ( _In_ PDEVICE_OBJECT  SourceDevice,
_In_ PDEVICE_OBJECT  TargetDevice,
_Out_ PDEVICE_OBJECT AttachedToDeviceObject 
)
static

Definition at line 1630 of file Interface.c.

1633 {
1634  NTSTATUS Status;
1635 
1636  PAGED_CODE();
1637 
1638  /* Before attaching, copy the flags from the device we're going to attach to */
1640  {
1642  }
1644  {
1646  }
1648  {
1649  SetFlag(TargetDevice->Characteristics, FILE_DEVICE_SECURE_OPEN);
1650  }
1651 
1652  /* Attach this device to the top of the driver stack */
1654  TargetDevice,
1655  AttachedToDeviceObject);
1656 
1657  return Status;
1658 }
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:688
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
Definition: iofuncs.h:688
#define PAGED_CODE()
Definition: video.h:57
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
#define DO_SYSTEM_BOOT_PARTITION
Definition: env_spec_w32.h:400
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: device.c:980
#define DO_BUFFERED_IO
Definition: env_spec_w32.h:394
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
Status
Definition: gdiplustypes.h:24
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46

Referenced by FltpAttachToFileSystemDevice(), and FltpEnumerateFileSystemVolumes().

◆ FltpAttachToFileSystemDevice()

static NTSTATUS FltpAttachToFileSystemDevice ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PUNICODE_STRING  DeviceName 
)
static

Definition at line 1888 of file Interface.c.

1890 {
1892  PDEVICE_OBJECT NewDeviceObject;
1894  UNICODE_STRING FileSystemDeviceName;
1895  UNICODE_STRING FsRecDeviceName;
1896  NTSTATUS Status;
1897 
1898  PAGED_CODE();
1899 
1900  /* Only handle device types we're interested in */
1901  if (DeviceObject->DeviceType != FILE_DEVICE_DISK_FILE_SYSTEM &&
1904  {
1905  return STATUS_SUCCESS;
1906  }
1907 
1908  /* Setup the buffer to hold the device name */
1909  RtlInitEmptyUnicodeString(&FileSystemDeviceName,
1910  Buffer,
1911  MAX_DEVNAME_LENGTH * sizeof(WCHAR));
1912 
1913  /* Get the the name of the file system device */
1914  Status = FltpGetObjectName(DeviceObject->DriverObject, &FileSystemDeviceName);
1915  if (!NT_SUCCESS(Status)) return Status;
1916 
1917  DPRINT("Found device %wZ, checking if we need to attach...\n", &FileSystemDeviceName);
1918 
1919  /* Build up the name of the file system recognizer device */
1920  RtlInitUnicodeString(&FsRecDeviceName, L"\\FileSystem\\Fs_Rec");
1921 
1922  /* We don't attach to recognizer devices, so bail if this is one */
1923  if (RtlCompareUnicodeString(&FileSystemDeviceName, &FsRecDeviceName, TRUE) == 0)
1924  {
1925  return STATUS_SUCCESS;
1926  }
1927 
1928  /* Create a device object which we can attach to this file system */
1930  sizeof(FLTMGR_DEVICE_EXTENSION),
1931  NULL,
1932  DeviceObject->DeviceType,
1933  0,
1934  FALSE,
1935  &NewDeviceObject);
1936  if (!NT_SUCCESS(Status))
1937  {
1938  DPRINT1("Failed to create a DO for attaching to a FS : 0x%X\n", Status);
1939  return Status;
1940  }
1941 
1942  /* Cast the device extension to something we understand */
1943  DeviceExtension = NewDeviceObject->DeviceExtension;
1944 
1945  /* Attach this device to the top of the driver stack and store the DO we attached to in the DE */
1946  Status = FltpAttachDeviceObject(NewDeviceObject,
1947  DeviceObject,
1948  &DeviceExtension->AttachedToDeviceObject);
1949  if (NT_SUCCESS(Status))
1950  {
1951  DPRINT("Attached to %wZ\n", &FileSystemDeviceName);
1952  }
1953  else
1954  {
1955  DPRINT1("Failed to attach to the driver stack : 0x%X\n", Status);
1956  goto Cleanup;
1957  }
1958 
1959  /* Setup the unicode string buffer and copy the device name to the device extension */
1960  RtlInitEmptyUnicodeString(&DeviceExtension->DeviceName,
1961  DeviceExtension->DeviceNameBuffer,
1962  MAX_DEVNAME_LENGTH * sizeof(WCHAR));
1964 
1965  /* We're done, remove the initializing flag */
1966  ClearFlag(NewDeviceObject->Flags, DO_DEVICE_INITIALIZING);
1967 
1968  /* Look for existing mounted devices for this file system */
1970  if (!NT_SUCCESS(Status))
1971  {
1972  DPRINT1("Failed to enumerate file system volumes for this file system : 0x%X\n", Status);
1973  IoDetachDevice(DeviceExtension->AttachedToDeviceObject);
1974  }
1975 
1976 Cleanup:
1977 
1978  if (!NT_SUCCESS(Status))
1979  {
1980  IoDeleteDevice(NewDeviceObject);
1981  }
1982 
1983  return Status;
1984 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
static NTSTATUS FltpAttachDeviceObject(_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice, _Out_ PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: Interface.c:1630
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
static NTSTATUS FltpEnumerateFileSystemVolumes(_In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1711
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define PAGED_CODE()
Definition: video.h:57
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:113
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define MAX_DEVNAME_LENGTH
Definition: fltmgr.h:24
static const WCHAR L[]
Definition: oid.c:1250
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
static const WCHAR Cleanup[]
Definition: register.c:80
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define FILE_DEVICE_NETWORK_FILE_SYSTEM
Definition: winioctl.h:125
#define DPRINT1
Definition: precomp.h:8
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:108
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
return STATUS_SUCCESS
Definition: btrfs.c:2777
NTSTATUS FltpGetObjectName(_In_ PVOID Object, _Inout_ PUNICODE_STRING ObjectName)
Definition: Object.c:263

Referenced by FltpFsNotification().

◆ FltpCleanupDeviceObject()

static VOID FltpCleanupDeviceObject ( _In_ PDEVICE_OBJECT  DeviceObject)
static

Definition at line 1617 of file Interface.c.

1618 {
1620 
1622  if (DeviceExtension)
1623  {
1624  // cleanup device extension
1625  }
1626 }
PVOID DeviceExtension
Definition: env_spec_w32.h:418
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560

Referenced by FltpEnumerateFileSystemVolumes(), FltpFastIoDetachDevice(), and FltpFastIoDetachDeviceWorker().

◆ FltpCreate()

NTSTATUS NTAPI FltpCreate ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 486 of file Interface.c.

488 {
490 
491  PAGED_CODE();
492 
494 
495  /* Check if this is a request for us */
497  {
500 
501  /* Someone wants a handle to the fltmgr, allow it */
502  Irp->IoStatus.Status = STATUS_SUCCESS;
503  Irp->IoStatus.Information = 0;
505  return STATUS_SUCCESS;
506  }
507 
508  /* Check if this is a request for a the new comms connection */
510  {
511  /* Hand off to our internal routine */
512  return FltpMsgCreate(DeviceObject, Irp);
513  }
514 
516  DeviceExtension->AttachedToDeviceObject);
517 
518  DPRINT1("Received create from %wZ (%lu)\n", &DeviceExtension->DeviceName, PsGetCurrentProcessId());
519 
520  /* Just pass the IRP down the stack */
522  return IoCallDriver(DeviceExtension->AttachedToDeviceObject, Irp);
523 }
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
_In_ PIRP Irp
Definition: csq.h:116
PDEVICE_OBJECT CommsDeviceObject
Definition: Messaging.c:22
#define PAGED_CODE()
Definition: video.h:57
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
VOID FASTCALL IofCompleteRequest(IN PIRP Irp, IN CCHAR PriorityBoost)
Definition: irp.c:1308
NTSTATUS FltpMsgCreate(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Messaging.c:223
PDEVICE_OBJECT DeviceObject
Definition: fltmgr.h:30
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define DPRINT1
Definition: precomp.h:8
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpDetachFromFileSystemDevice()

static LONG_PTR FltpDetachFromFileSystemDevice ( _In_ PDEVICE_OBJECT  DeviceObject)
static

Definition at line 1988 of file Interface.c.

1989 {
1990  PDEVICE_OBJECT AttachedDevice, NextDevice;
1992  LONG_PTR Count;
1993 
1994  PAGED_CODE();
1995 
1996  /* Get the top device in the chain and increment the ref count on it */
1997  AttachedDevice = IoGetAttachedDeviceReference(DeviceObject);
1998 
1999  /* Loop all attached devices looking for our file system driver */
2000  while (AttachedDevice->DriverObject != DriverData.DriverObject)
2001  {
2002  FLT_ASSERT(AttachedDevice != NULL);
2003 
2004  /* Get the next lower device object. This adds a ref on NextDevice */
2005  NextDevice = IoGetLowerDeviceObject(AttachedDevice);
2006 
2007  /* Remove the reference we added */
2008  Count = ObDereferenceObject(AttachedDevice);
2009 
2010  /* Bail if this is the last one */
2011  if (NextDevice == NULL) return Count;
2012 
2013  /* Try the next one */
2014  AttachedDevice = NextDevice;
2015  }
2016 
2017 
2018  DeviceExtension = AttachedDevice->DeviceExtension;
2019  if (DeviceExtension)
2020  {
2021  //
2022  // FIXME: Put any device extension cleanup code here
2023  //
2024  }
2025 
2026  /* Detach the device from the chain and delete the object */
2028  IoDeleteDevice(AttachedDevice);
2029 
2030  /* Remove the reference we added so the delete can complete */
2031  return ObDereferenceObject(AttachedDevice);
2032 }
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
#define PAGED_CODE()
Definition: video.h:57
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
PDEVICE_OBJECT NTAPI IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1507
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
Definition: device.c:1406
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by FltpFsNotification().

◆ FltpDeviceControl()

NTSTATUS NTAPI FltpDeviceControl ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 556 of file Interface.c.

558 {
561 
562  /* Check if the request was meant for us */
564  {
566  if (Status != STATUS_REPARSE)
567  {
568  Irp->IoStatus.Status = Status;
569  Irp->IoStatus.Information = 0;
571  }
572 
573  return Status;
574  }
575 
577 
579  DeviceExtension->AttachedToDeviceObject);
580 
581  /* Just pass the IRP down the stack */
583  return IoCallDriver(DeviceExtension->AttachedToDeviceObject, Irp);
584 }
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
NTSTATUS FltpDeviceControlHandler(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Dispatch.c:37
PDEVICE_OBJECT DeviceObject
Definition: fltmgr.h:30
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define STATUS_REPARSE
Definition: ntstatus.h:83
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpDispatch()

NTSTATUS NTAPI FltpDispatch ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 435 of file Interface.c.

437 {
439  PIO_STACK_LOCATION StackPtr;
441 
443 
444  /* Check if this is a request for us */
446  {
449 
450  /* Hand it off to our internal handler */
452  if (Status != STATUS_REPARSE)
453  {
454  Irp->IoStatus.Status = Status;
455  Irp->IoStatus.Information = 0;
457  }
458  return Status;
459  }
460 
461  /* Check if this is a request for a the messaging device */
463  {
464  /* Hand off to our internal routine */
466  }
467 
469  DeviceExtension->AttachedToDeviceObject);
470 
471  StackPtr = IoGetCurrentIrpStackLocation(Irp);
472  if (StackPtr->MajorFunction == IRP_MJ_SHUTDOWN)
473  {
474  // handle shutdown request
475  }
476 
477  DPRINT1("Received %X from %wZ\n", StackPtr->MajorFunction, &DeviceExtension->DeviceName);
478 
479  /* Just pass the IRP down the stack */
481  return IoCallDriver(DeviceExtension->AttachedToDeviceObject, Irp);
482 }
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
#define IRP_MJ_SHUTDOWN
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
PDEVICE_OBJECT CommsDeviceObject
Definition: Messaging.c:22
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
PDEVICE_OBJECT DeviceObject
Definition: fltmgr.h:30
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define STATUS_REPARSE
Definition: ntstatus.h:83
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
NTSTATUS FltpDispatchHandler(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Dispatch.c:103
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define DPRINT1
Definition: precomp.h:8
NTSTATUS FltpMsgDispatch(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Messaging.c:256
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpEnumerateFileSystemVolumes()

static NTSTATUS FltpEnumerateFileSystemVolumes ( _In_ PDEVICE_OBJECT  DeviceObject)
static

Definition at line 1711 of file Interface.c.

1712 {
1713  PFLTMGR_DEVICE_EXTENSION NewDeviceExtension;
1714  PDEVICE_OBJECT BaseDeviceObject;
1715  PDEVICE_OBJECT NewDeviceObject;
1717  PDEVICE_OBJECT StorageStackDeviceObject;
1719  ULONG NumDevices;
1720  ULONG i;
1721  NTSTATUS Status;
1722 
1723  PAGED_CODE();
1724 
1725  /* Get the base device */
1726  BaseDeviceObject = IoGetDeviceAttachmentBaseRef(DeviceObject);
1727 
1728  /* get the number of device object linked to the base file system */
1729  Status = IoEnumerateDeviceObjectList(BaseDeviceObject->DriverObject,
1730  NULL,
1731  0,
1732  &NumDevices);
1733  if (Status != STATUS_BUFFER_TOO_SMALL) return Status;
1734 
1735  /* Add a few more slots in case the size changed between calls and allocate some memory to hold the pointers */
1736  NumDevices += 4;
1738  (NumDevices * sizeof(PDEVICE_OBJECT)),
1741 
1742  /* Now get all the device objects that this base driver has created */
1743  Status = IoEnumerateDeviceObjectList(BaseDeviceObject->DriverObject,
1744  DeviceList,
1745  (NumDevices * sizeof(PDEVICE_OBJECT)),
1746  &NumDevices);
1747  if (!NT_SUCCESS(Status))
1748  {
1750  return Status;
1751  }
1752 
1753  /* Loop through all the devices looking for ones to attach to */
1754  for (i = 0; i < NumDevices; i++)
1755  {
1757  StorageStackDeviceObject = NULL;
1758  NewDeviceObject = NULL;
1759 
1760  /* Ignore the device we passed in, and devices of the wrong type */
1761  if ((DeviceList[i] == BaseDeviceObject) ||
1762  (DeviceList[i]->DeviceType != BaseDeviceObject->DeviceType))
1763  {
1764  goto CleanupAndNext;
1765  }
1766 
1767  /* Ignore this device if we're already attached to it */
1769  {
1770  goto CleanupAndNext;
1771  }
1772 
1773 
1774  /*
1775  * If the device has a name, it must be a control device.
1776  * This handles drivers with more then one control device (like FastFat)
1777  */
1779  if (NT_SUCCESS(Status) && DeviceName.Length > 0)
1780  {
1781  goto CleanupAndNext;
1782  }
1783 
1784  /*
1785  * Try to get the storage stack (disk) device object associated with
1786  * this file system device object. Ignore the device if we don't have one
1787  */
1789  &StorageStackDeviceObject);
1790  if (!NT_SUCCESS(Status))
1791  {
1792  goto CleanupAndNext;
1793  }
1794 
1795 
1796  /*
1797  * TODO: Don't attach to shadow copy volumes,
1798  * ros doesn't have any so it's not an issues yet
1799  */
1800 
1801  /*
1802  * We're far enough to be ready to attach, create a device
1803  * object which we'll use to do so
1804  */
1806  sizeof(FLTMGR_DEVICE_EXTENSION),
1807  NULL,
1809  0,
1810  FALSE,
1811  &NewDeviceObject);
1812  if (!NT_SUCCESS(Status))
1813  {
1814  goto CleanupAndNext;
1815  }
1816 
1817  /* Get the device extension for this new object and store our disk object there */
1818  NewDeviceExtension = NewDeviceObject->DeviceExtension;
1819  NewDeviceExtension->StorageStackDeviceObject = StorageStackDeviceObject;
1820 
1821  /* Lookup and store the device name for the storage stack */
1822  RtlInitEmptyUnicodeString(&NewDeviceExtension->DeviceName,
1823  NewDeviceExtension->DeviceNameBuffer,
1824  sizeof(NewDeviceExtension->DeviceNameBuffer));
1825  FltpGetObjectName(StorageStackDeviceObject,
1826  &NewDeviceExtension->DeviceName);
1827 
1828 
1829  /* Grab the attach lock before we attempt to attach */
1831 
1832  /* Check again that we aren't already attached. It may have changed since our last check */
1834  {
1835  FLT_ASSERT(NewDeviceObject->DriverObject == DriverData.DriverObject);
1836 
1837  /* Finally, attach to the volume */
1839  NewDeviceObject,
1840  &NewDeviceExtension->AttachedToDeviceObject);
1841  if (NT_SUCCESS(Status))
1842  {
1843  /* Clean the initializing flag so other filters can attach to our device object */
1844  ClearFlag(NewDeviceObject->Flags, DO_DEVICE_INITIALIZING);
1845  }
1846  }
1847  else
1848  {
1849  /* We're already attached. Just cleanup */
1851  }
1852 
1854 
1855 CleanupAndNext:
1856 
1857  if (!NT_SUCCESS(Status))
1858  {
1859  if (NewDeviceObject)
1860  {
1861  FltpCleanupDeviceObject(NewDeviceObject);
1862  IoDeleteDevice(NewDeviceObject);
1863  }
1864  }
1865 
1866  if (StorageStackDeviceObject)
1867  {
1868  /* A ref was added for us when we attached, so we can deref ours now */
1869  ObDereferenceObject(StorageStackDeviceObject);
1870  }
1871 
1872  /* Remove the ref which was added by IoEnumerateDeviceObjectList */
1874 
1875  /* Free the buffer that FltpGetBaseDeviceObjectName added */
1877 
1878  }
1879 
1880  /* Free the memory we allocated for the list */
1882 
1883  return STATUS_SUCCESS;
1884 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define STATUS_DEVICE_ALREADY_ATTACHED
Definition: ntstatus.h:278
static NTSTATUS FltpAttachDeviceObject(_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice, _Out_ PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: Interface.c:1630
#define FM_TAG_DEV_OBJ_PTRS
Definition: fltmgr.h:17
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
VOID FltpFreeUnicodeString(_In_ PUNICODE_STRING String)
Definition: Lib.c:24
DeviceType
Definition: mmdrv.h:41
FAST_MUTEX FilterAttachLock
Definition: fltmgr.h:37
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
PDEVICE_OBJECT StorageStackDeviceObject
Definition: fltmgr.h:47
WCHAR DeviceName[]
Definition: adapter.cpp:21
NTSTATUS NTAPI IoEnumerateDeviceObjectList(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT *DeviceObjectList, IN ULONG DeviceObjectListSize, OUT PULONG ActualNumberDeviceObjects)
Definition: device.c:1322
UNICODE_STRING DeviceName
Definition: fltmgr.h:51
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
#define PAGED_CODE()
Definition: video.h:57
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
PDEVICE_OBJECT NTAPI IoGetDeviceAttachmentBaseRef(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1419
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
DRIVER_DATA DriverData
Definition: Interface.c:396
NTSTATUS FltpGetBaseDeviceObjectName(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PUNICODE_STRING ObjectName)
Definition: Object.c:245
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
static VOID FltpCleanupDeviceObject(_In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1617
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS NTAPI IoGetDiskDeviceObject(IN PDEVICE_OBJECT FileSystemDeviceObject, OUT PDEVICE_OBJECT *DiskDeviceObject)
Definition: device.c:1453
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
DWORD DeviceType
Definition: utils.c:20
PDEVICE_LIST DeviceList
Definition: utils.c:27
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
PDEVICE_OBJECT AttachedToDeviceObject
Definition: fltmgr.h:44
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
return STATUS_SUCCESS
Definition: btrfs.c:2777
NTSTATUS FltpGetObjectName(_In_ PVOID Object, _Inout_ PUNICODE_STRING ObjectName)
Definition: Object.c:263
WCHAR DeviceNameBuffer[MAX_DEVNAME_LENGTH]
Definition: fltmgr.h:52
static BOOLEAN FltpIsAttachedToDevice(_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PDEVICE_OBJECT *AttachedDeviceObject)
Definition: Interface.c:1662
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by FltpAttachToFileSystemDevice().

◆ FltpFastIoCheckIfPossible()

BOOLEAN NTAPI FltpFastIoCheckIfPossible ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ BOOLEAN  Wait,
_In_ ULONG  LockKey,
_In_ BOOLEAN  CheckForReadOperation,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 592 of file Interface.c.

601 {
603  PDEVICE_OBJECT AttachedDeviceObject;
605 
606  PAGED_CODE();
607 
608  /* If it doesn't have a device extension, then it's not our device object */
610  {
611  /* Fail the call */
613  IoStatus->Information = 0;
614  return TRUE;
615  }
616 
618  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
619 
620  /* Get the device that we attached to */
621  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
622  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
623 
624  /* Make sure our FastIo table is valid */
626  {
627  /* Forward the call onto the device we attached to */
629  FileOffset,
630  Length,
631  Wait,
632  LockKey,
634  IoStatus,
635  AttachedDeviceObject);
636  }
637 
638  /* We failed to handle the request, send it down the slow path */
639  FLT_ASSERT(FALSE);
640  return FALSE;
641 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
Definition: fatprocs.h:2650
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1690
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoDetachDevice()

VOID NTAPI FltpFastIoDetachDevice ( _In_ PDEVICE_OBJECT  SourceDevice,
_In_ PDEVICE_OBJECT  TargetDevice 
)

Definition at line 1107 of file Interface.c.

1109 {
1110  PDETACH_DEVICE_WORK_ITEM DetachDeviceWorkItem;
1111 
1112  PAGED_CODE();
1113 
1114  /*
1115  * Detaching and deleting devices is a lot of work and takes too long
1116  * to be a worthwhile FastIo candidate, so we defer this call to speed
1117  * it up. There's no return value so we're okay to do this.
1118  */
1119 
1120  /* Allocate the work item and it's corresponding data */
1121  DetachDeviceWorkItem = ExAllocatePoolWithTag(NonPagedPool,
1122  sizeof(DETACH_DEVICE_WORK_ITEM),
1123  0x1234);
1124  if (DetachDeviceWorkItem)
1125  {
1126  /* Initialize the work item */
1127  ExInitializeWorkItem(&DetachDeviceWorkItem->WorkItem,
1129  DetachDeviceWorkItem);
1130 
1131  /* Queue the work item and return the call */
1132  ExQueueWorkItem(&DetachDeviceWorkItem->WorkItem,
1134  }
1135  else
1136  {
1137  /* We failed to defer, just cleanup here */
1141  }
1142 
1143 }
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:717
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:688
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
Definition: iofuncs.h:688
#define PAGED_CODE()
Definition: video.h:57
static VOID FltpCleanupDeviceObject(_In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1617
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
VOID NTAPI FltpFastIoDetachDeviceWorker(_In_ PVOID Parameter)
Definition: Interface.c:1088
WORK_QUEUE_ITEM WorkItem
Definition: Interface.c:401

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoDetachDeviceWorker()

VOID NTAPI FltpFastIoDetachDeviceWorker ( _In_ PVOID  Parameter)

Definition at line 1088 of file Interface.c.

1089 {
1090  PDETACH_DEVICE_WORK_ITEM DetachDeviceWorkItem = Parameter;
1091 
1092  /* Run any cleanup routines */
1093  FltpCleanupDeviceObject(DetachDeviceWorkItem->SourceDevice);
1094 
1095  /* Detach from the target device */
1096  IoDetachDevice(DetachDeviceWorkItem->TargetDevice);
1097 
1098  /* Delete the source */
1099  IoDeleteDevice(DetachDeviceWorkItem->SourceDevice);
1100 
1101  /* Free the pool we allocated in FltpFastIoDetachDevice */
1102  ExFreePoolWithTag(DetachDeviceWorkItem, 0x1234);
1103 }
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
_In_ PVOID Parameter
Definition: ldrtypes.h:240
static VOID FltpCleanupDeviceObject(_In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1617
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
PDEVICE_OBJECT SourceDevice
Definition: Interface.c:402
PDEVICE_OBJECT TargetDevice
Definition: Interface.c:403

Referenced by FltpFastIoDetachDevice().

◆ FltpFastIoDeviceControl()

BOOLEAN NTAPI FltpFastIoDeviceControl ( _In_ PFILE_OBJECT  FileObject,
_In_ BOOLEAN  Wait,
_In_opt_ PVOID  InputBuffer,
_In_ ULONG  InputBufferLength,
_Out_opt_ PVOID  OutputBuffer,
_In_ ULONG  OutputBufferLength,
_In_ ULONG  IoControlCode,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1036 of file Interface.c.

1045 {
1047  PDEVICE_OBJECT AttachedDeviceObject;
1049 
1050  PAGED_CODE();
1051 
1052  /* If it doesn't have a device extension, then it's not our device object */
1054  {
1055  /* Fail the request, send it down the slow path */
1056  return FALSE;
1057  }
1058 
1060  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1061 
1062  /* Get the device that we attached to */
1063  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1064  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1065 
1066  /* Make sure our FastIo table is valid */
1068  {
1069  /* Forward the call onto the device we attached to */
1071  Wait,
1072  InputBuffer,
1074  OutputBuffer,
1076  IoControlCode,
1077  IoStatus,
1078  AttachedDeviceObject);
1079  }
1080 
1081  /* We failed to handle the request, send it down the slow path */
1082  FLT_ASSERT(FALSE);
1083  return FALSE;
1084 }
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
#define PAGED_CODE()
Definition: video.h:57
CHAR InputBuffer[80]
Definition: conmgr.c:33
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
PFAST_IO_DEVICE_CONTROL FastIoDeviceControl
Definition: iotypes.h:1699
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoLock()

BOOLEAN NTAPI FltpFastIoLock ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ PLARGE_INTEGER  Length,
_In_ PEPROCESS  ProcessId,
_In_ ULONG  Key,
_In_ BOOLEAN  FailImmediately,
_In_ BOOLEAN  ExclusiveLock,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 841 of file Interface.c.

850 {
852  PDEVICE_OBJECT AttachedDeviceObject;
854 
855  PAGED_CODE();
856 
857  /* If it doesn't have a device extension, then it's not our device object */
859  {
860  /* Fail the call */
862  IoStatus->Information = 0;
863  return TRUE;
864  }
865 
867  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
868 
869  /* Get the device that we attached to */
870  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
871  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
872 
873  /* Make sure our FastIo table is valid */
875  {
876  /* Forward the call onto the device we attached to */
878  FileOffset,
879  Length,
880  ProcessId,
881  Key,
884  IoStatus,
885  AttachedDeviceObject);
886  }
887 
888  /* We failed to handle the request, send it down the slow path */
889  FLT_ASSERT(FALSE);
890  return FALSE;
891 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN FailImmediately
Definition: fatprocs.h:2697
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1695
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN BOOLEAN ExclusiveLock
Definition: fatprocs.h:2697
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoMdlRead()

BOOLEAN NTAPI FltpFastIoMdlRead ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ ULONG  LockKey,
_Out_ PMDL MdlChain,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1193 of file Interface.c.

1200 {
1202  PDEVICE_OBJECT AttachedDeviceObject;
1204 
1205  PAGED_CODE();
1206 
1207  /* If it doesn't have a device extension, then it's not our device object */
1209  {
1210  /* Fail the call */
1212  IoStatus->Information = 0;
1213  return TRUE;
1214  }
1215 
1217  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1218 
1219  /* Get the device that we attached to */
1220  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1221  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1222 
1223  /* Make sure our FastIo table is valid */
1225  {
1226  /* Forward the call onto the device we attached to */
1228  FileOffset,
1229  Length,
1230  LockKey,
1231  MdlChain,
1232  IoStatus,
1233  AttachedDeviceObject);
1234  }
1235 
1236  /* We failed to handle the request, send it down the slow path */
1237  FLT_ASSERT(FALSE);
1238  return FALSE;
1239 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
PFAST_IO_MDL_READ MdlRead
Definition: iotypes.h:1705
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoMdlReadComplete()

BOOLEAN NTAPI FltpFastIoMdlReadComplete ( _In_ PFILE_OBJECT  FileObject,
_In_ PMDL  MdlChain,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1243 of file Interface.c.

1247 {
1249  PDEVICE_OBJECT AttachedDeviceObject;
1251 
1252  PAGED_CODE();
1253 
1254  /* If it doesn't have a device extension, then it's not our device object */
1256  {
1257  /* Fail the request, send it down the slow path */
1258  return FALSE;
1259  }
1260 
1262  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1263 
1264  /* Get the device that we attached to */
1265  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1266  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1267 
1268  /* Make sure our FastIo table is valid */
1270  {
1271  /* Forward the call onto the device we attached to */
1273  MdlChain,
1274  AttachedDeviceObject);
1275  }
1276 
1277  /* We failed to handle the request, send it down the slow path */
1278  FLT_ASSERT(FALSE);
1279  return FALSE;
1280 }
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
PFAST_IO_MDL_READ_COMPLETE MdlReadComplete
Definition: iotypes.h:1706
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoMdlReadCompleteCompressed()

BOOLEAN NTAPI FltpFastIoMdlReadCompleteCompressed ( _In_ PFILE_OBJECT  FileObject,
_In_ PMDL  MdlChain,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1484 of file Interface.c.

1487 {
1489  PDEVICE_OBJECT AttachedDeviceObject;
1491 
1492  PAGED_CODE();
1493 
1494  /* If it doesn't have a device extension, then it's not our device object */
1496  {
1497  return FALSE;
1498  }
1499 
1501  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1502 
1503  /* Get the device that we attached to */
1504  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1505  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1506 
1507  /* Make sure our FastIo table is valid */
1509  {
1510  /* Forward the call onto the device we attached to */
1512  MdlChain,
1513  AttachedDeviceObject);
1514  }
1515 
1516  /* We failed to handle the request, send it down the slow path */
1517  FLT_ASSERT(FALSE);
1518  return FALSE;
1519 }
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
#define PAGED_CODE()
Definition: video.h:57
PFAST_IO_MDL_READ_COMPLETE_COMPRESSED MdlReadCompleteCompressed
Definition: iotypes.h:1711
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoMdlWriteComplete()

BOOLEAN NTAPI FltpFastIoMdlWriteComplete ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ PMDL  MdlChain,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1334 of file Interface.c.

1338 {
1340  PDEVICE_OBJECT AttachedDeviceObject;
1342 
1343  PAGED_CODE();
1344 
1345  /* If it doesn't have a device extension, then it's not our device object */
1347  {
1348  /* Fail the request, send it down the slow path */
1349  return FALSE;
1350  }
1351 
1353  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1354 
1355  /* Get the device that we attached to */
1356  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1357  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1358 
1359  /* Make sure our FastIo table is valid */
1361  {
1362  /* Forward the call onto the device we attached to */
1364  FileOffset,
1365  MdlChain,
1366  AttachedDeviceObject);
1367  }
1368 
1369  /* We failed to handle the request, send it down the slow path */
1370  FLT_ASSERT(FALSE);
1371  return FALSE;
1372 }
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete
Definition: iotypes.h:1708
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoMdlWriteCompleteCompressed()

BOOLEAN NTAPI FltpFastIoMdlWriteCompleteCompressed ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ PMDL  MdlChain,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1523 of file Interface.c.

1527 {
1529  PDEVICE_OBJECT AttachedDeviceObject;
1531 
1532  PAGED_CODE();
1533 
1534  /* If it doesn't have a device extension, then it's not our device object */
1536  {
1537  return FALSE;
1538  }
1539 
1541  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1542 
1543  /* Get the device that we attached to */
1544  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1545  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1546 
1547  /* Make sure our FastIo table is valid */
1549  {
1550  /* Forward the call onto the device we attached to */
1552  FileOffset,
1553  MdlChain,
1554  AttachedDeviceObject);
1555  }
1556 
1557  /* We failed to handle the request, send it down the slow path */
1558  FLT_ASSERT(FALSE);
1559  return FALSE;
1560 }
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED MdlWriteCompleteCompressed
Definition: iotypes.h:1712
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoPrepareMdlWrite()

BOOLEAN NTAPI FltpFastIoPrepareMdlWrite ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ ULONG  LockKey,
_Out_ PMDL MdlChain,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1284 of file Interface.c.

1291 {
1293  PDEVICE_OBJECT AttachedDeviceObject;
1295 
1296  PAGED_CODE();
1297 
1298  /* If it doesn't have a device extension, then it's not our device object */
1300  {
1301  /* Fail the call */
1303  IoStatus->Information = 0;
1304  return TRUE;
1305  }
1306 
1308  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1309 
1310  /* Get the device that we attached to */
1311  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1312  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1313 
1314  /* Make sure our FastIo table is valid */
1316  {
1317  /* Forward the call onto the device we attached to */
1319  FileOffset,
1320  Length,
1321  LockKey,
1322  MdlChain,
1323  IoStatus,
1324  AttachedDeviceObject);
1325  }
1326 
1327  /* We failed to handle the request, send it down the slow path */
1328  FLT_ASSERT(FALSE);
1329  return FALSE;
1330 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
PFAST_IO_PREPARE_MDL_WRITE PrepareMdlWrite
Definition: iotypes.h:1707
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoQueryBasicInfo()

BOOLEAN NTAPI FltpFastIoQueryBasicInfo ( _In_ PFILE_OBJECT  FileObject,
_In_ BOOLEAN  Wait,
_Out_ PFILE_BASIC_INFORMATION  Buffer,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 749 of file Interface.c.

754 {
756  PDEVICE_OBJECT AttachedDeviceObject;
758 
759  PAGED_CODE();
760 
761  /* If it doesn't have a device extension, then it's not our device object */
763  {
764  /* Fail the call */
766  IoStatus->Information = 0;
767  return TRUE;
768  }
769 
771  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
772 
773  /* Get the device that we attached to */
774  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
775  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
776 
777  /* Make sure our FastIo table is valid */
779  {
780  /* Forward the call onto the device we attached to */
782  Wait,
783  Buffer,
784  IoStatus,
785  AttachedDeviceObject);
786  }
787 
788  /* We failed to handle the request, send it down the slow path */
789  FLT_ASSERT(FALSE);
790  return FALSE;
791 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1693
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoQueryNetworkOpenInfo()

BOOLEAN NTAPI FltpFastIoQueryNetworkOpenInfo ( _In_ PFILE_OBJECT  FileObject,
_In_ BOOLEAN  Wait,
_Out_ PFILE_NETWORK_OPEN_INFORMATION  Buffer,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1147 of file Interface.c.

1152 {
1154  PDEVICE_OBJECT AttachedDeviceObject;
1156 
1157  PAGED_CODE();
1158 
1159  /* If it doesn't have a device extension, then it's not our device object */
1161  {
1162  /* Fail the call */
1164  IoStatus->Information = 0;
1165  return TRUE;
1166  }
1167 
1169  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1170 
1171  /* Get the device that we attached to */
1172  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1173  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1174 
1175  /* Make sure our FastIo table is valid */
1177  {
1178  /* Forward the call onto the device we attached to */
1180  Wait,
1181  Buffer,
1182  IoStatus,
1183  AttachedDeviceObject);
1184  }
1185 
1186  /* We failed to handle the request, send it down the slow path */
1187  FLT_ASSERT(FALSE);
1188  return FALSE;
1189 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1703
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoQueryOpen()

BOOLEAN NTAPI FltpFastIoQueryOpen ( _Inout_ PIRP  Irp,
_Out_ PFILE_NETWORK_OPEN_INFORMATION  NetworkInformation,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1564 of file Interface.c.

1567 {
1569  PDEVICE_OBJECT AttachedDeviceObject;
1571  BOOLEAN Success;
1572 
1573  PAGED_CODE();
1574 
1575  /* If it doesn't have a device extension, then it's not our device object */
1577  {
1578  return FALSE;
1579  }
1580 
1582  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1583 
1584  /* Get the device that we attached to */
1585  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1586  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1587 
1588  /* Make sure our FastIo table is valid */
1590  {
1592 
1593  /* Update the stack to contain the correct device for the next filter */
1594  StackPtr->DeviceObject = AttachedDeviceObject;
1595 
1596  /* Now forward the call */
1599  AttachedDeviceObject);
1600 
1601  /* Restore the DeviceObject as we found it */
1602  StackPtr->DeviceObject = DeviceObject;
1603  return Success;
1604  }
1605 
1606  /* We failed to handle the request, send it down the slow path */
1607  FLT_ASSERT(FALSE);
1608  return FALSE;
1609 }
_Out_ PFILE_NETWORK_OPEN_INFORMATION NetworkInformation
Definition: iotypes.h:1659
_In_ PIRP Irp
Definition: csq.h:116
#define PAGED_CODE()
Definition: video.h:57
PFAST_IO_QUERY_OPEN FastIoQueryOpen
Definition: iotypes.h:1713
PVOID DeviceExtension
Definition: env_spec_w32.h:418
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2866
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoQueryStandardInfo()

BOOLEAN NTAPI FltpFastIoQueryStandardInfo ( _In_ PFILE_OBJECT  FileObject,
_In_ BOOLEAN  Wait,
_Out_ PFILE_STANDARD_INFORMATION  Buffer,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 795 of file Interface.c.

800 {
802  PDEVICE_OBJECT AttachedDeviceObject;
804 
805  PAGED_CODE();
806 
807  /* If it doesn't have a device extension, then it's not our device object */
809  {
810  /* Fail the call */
812  IoStatus->Information = 0;
813  return TRUE;
814  }
815 
817  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
818 
819  /* Get the device that we attached to */
820  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
821  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
822 
823  /* Make sure our FastIo table is valid */
825  {
826  /* Forward the call onto the device we attached to */
828  Wait,
829  Buffer,
830  IoStatus,
831  AttachedDeviceObject);
832  }
833 
834  /* We failed to handle the request, send it down the slow path */
835  FLT_ASSERT(FALSE);
836  return FALSE;
837 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1694
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoRead()

BOOLEAN NTAPI FltpFastIoRead ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ BOOLEAN  Wait,
_In_ ULONG  LockKey,
_Out_ PVOID  Buffer,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 645 of file Interface.c.

653 {
655  PDEVICE_OBJECT AttachedDeviceObject;
657 
658  PAGED_CODE();
659 
660  /* If it doesn't have a device extension, then it's not our device object */
662  {
663  /* Fail the call */
665  IoStatus->Information = 0;
666  return TRUE;
667  }
668 
670  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
671 
672  /* Get the device that we attached to */
673  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
674  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
675 
676  /* Make sure our FastIo table is valid */
678  {
679  /* Forward the call onto the device we attached to */
681  FileOffset,
682  Length,
683  Wait,
684  LockKey,
685  Buffer,
686  IoStatus,
687  AttachedDeviceObject);
688  }
689 
690  /* We failed to handle the request, send it down the slow path */
691  FLT_ASSERT(FALSE);
692  return FALSE;
693 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1691
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoReadCompressed()

BOOLEAN NTAPI FltpFastIoReadCompressed ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ ULONG  LockKey,
_Out_ PVOID  Buffer,
_Out_ PMDL MdlChain,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_Out_ PCOMPRESSED_DATA_INFO  CompressedDataInfo,
_In_ ULONG  CompressedDataInfoLength,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1376 of file Interface.c.

1386 {
1388  PDEVICE_OBJECT AttachedDeviceObject;
1390 
1391  PAGED_CODE();
1392 
1393  /* If it doesn't have a device extension, then it's not our device object */
1395  {
1396  /* Fail the request, send it down the slow path */
1397  return FALSE;
1398  }
1399 
1401  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1402 
1403  /* Get the device that we attached to */
1404  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1405  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1406 
1407  /* Make sure our FastIo table is valid */
1409  {
1410  /* Forward the call onto the device we attached to */
1412  FileOffset,
1413  Length,
1414  LockKey,
1415  Buffer,
1416  MdlChain,
1417  IoStatus,
1420  AttachedDeviceObject);
1421  }
1422 
1423  /* We failed to handle the request, send it down the slow path */
1424  FLT_ASSERT(FALSE);
1425  return FALSE;
1426 }
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
PFAST_IO_READ_COMPRESSED FastIoReadCompressed
Definition: iotypes.h:1709
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_ PVOID _Out_ PMDL _Out_ PIO_STATUS_BLOCK _Out_ struct _COMPRESSED_DATA_INFO _In_ ULONG CompressedDataInfoLength
Definition: iotypes.h:1614
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_ PVOID _Out_ PMDL _Out_ PIO_STATUS_BLOCK _Out_ struct _COMPRESSED_DATA_INFO * CompressedDataInfo
Definition: iotypes.h:1614
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoUnlockAll()

BOOLEAN NTAPI FltpFastIoUnlockAll ( _In_ PFILE_OBJECT  FileObject,
_In_ PEPROCESS  ProcessId,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 945 of file Interface.c.

950 {
952  PDEVICE_OBJECT AttachedDeviceObject;
954 
955  PAGED_CODE();
956 
957  /* If it doesn't have a device extension, then it's not our device object */
959  {
960  /* Fail the call */
962  IoStatus->Information = 0;
963  return TRUE;
964  }
965 
967  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
968 
969  /* Get the device that we attached to */
970  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
971  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
972 
973  /* Make sure our FastIo table is valid */
975  {
976  /* Forward the call onto the device we attached to */
978  ProcessId,
979  IoStatus,
980  AttachedDeviceObject);
981  }
982 
983  /* We failed to handle the request, send it down the slow path */
984  FLT_ASSERT(FALSE);
985  return FALSE;
986 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1697
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoUnlockAllByKey()

BOOLEAN NTAPI FltpFastIoUnlockAllByKey ( _In_ PFILE_OBJECT  FileObject,
_In_ PVOID  ProcessId,
_In_ ULONG  Key,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 990 of file Interface.c.

995 {
997  PDEVICE_OBJECT AttachedDeviceObject;
999 
1000  PAGED_CODE();
1001 
1002  /* If it doesn't have a device extension, then it's not our device object */
1004  {
1005  /* Fail the call */
1007  IoStatus->Information = 0;
1008  return TRUE;
1009  }
1010 
1012  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1013 
1014  /* Get the device that we attached to */
1015  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1016  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1017 
1018  /* Make sure our FastIo table is valid */
1020  {
1021  /* Forward the call onto the device we attached to */
1023  ProcessId,
1024  Key,
1025  IoStatus,
1026  AttachedDeviceObject);
1027  }
1028 
1029  /* We failed to handle the request, send it down the slow path */
1030  FLT_ASSERT(FALSE);
1031  return FALSE;
1032 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1698
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoUnlockSingle()

BOOLEAN NTAPI FltpFastIoUnlockSingle ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ PLARGE_INTEGER  Length,
_In_ PEPROCESS  ProcessId,
_In_ ULONG  Key,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 895 of file Interface.c.

902 {
904  PDEVICE_OBJECT AttachedDeviceObject;
906 
907  PAGED_CODE();
908 
909  /* If it doesn't have a device extension, then it's not our device object */
911  {
912  /* Fail the call */
914  IoStatus->Information = 0;
915  return TRUE;
916  }
917 
919  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
920 
921  /* Get the device that we attached to */
922  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
923  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
924 
925  /* Make sure our FastIo table is valid */
927  {
928  /* Forward the call onto the device we attached to */
930  FileOffset,
931  Length,
932  ProcessId,
933  Key,
934  IoStatus,
935  AttachedDeviceObject);
936  }
937 
938  /* We failed to handle the request, send it down the slow path */
939  FLT_ASSERT(FALSE);
940  return FALSE;
941 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1696
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoWrite()

BOOLEAN NTAPI FltpFastIoWrite ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ BOOLEAN  Wait,
_In_ ULONG  LockKey,
_In_ PVOID  Buffer,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 697 of file Interface.c.

705 {
707  PDEVICE_OBJECT AttachedDeviceObject;
709 
710  PAGED_CODE();
711 
712  /* If it doesn't have a device extension, then it's not our device object */
714  {
715  /* Fail the call */
717  IoStatus->Information = 0;
718  return TRUE;
719  }
720 
722  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
723 
724  /* Get the device that we attached to */
725  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
726  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
727 
728  /* Make sure our FastIo table is valid */
730  {
731  /* Forward the call onto the device we attached to */
733  FileOffset,
734  Length,
735  Wait,
736  LockKey,
737  Buffer,
738  IoStatus,
739  AttachedDeviceObject);
740  }
741 
742  /* We failed to handle the request, send it down the slow path */
743  FLT_ASSERT(FALSE);
744  return FALSE;
745 }
#define TRUE
Definition: types.h:120
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1692
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFastIoWriteCompressed()

BOOLEAN NTAPI FltpFastIoWriteCompressed ( _In_ PFILE_OBJECT  FileObject,
_In_ PLARGE_INTEGER  FileOffset,
_In_ ULONG  Length,
_In_ ULONG  LockKey,
_In_ PVOID  Buffer,
_Out_ PMDL MdlChain,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_In_ PCOMPRESSED_DATA_INFO  CompressedDataInfo,
_In_ ULONG  CompressedDataInfoLength,
_In_ PDEVICE_OBJECT  DeviceObject 
)

Definition at line 1430 of file Interface.c.

1440 {
1442  PDEVICE_OBJECT AttachedDeviceObject;
1444 
1445  PAGED_CODE();
1446 
1447  /* If it doesn't have a device extension, then it's not our device object */
1449  {
1450  /* Fail the request, send it down the slow path */
1451  return FALSE;
1452  }
1453 
1455  FLT_ASSERT(DeviceExtension->AttachedToDeviceObject);
1456 
1457  /* Get the device that we attached to */
1458  AttachedDeviceObject = DeviceExtension->AttachedToDeviceObject;
1459  FastIoDispatch = AttachedDeviceObject->DriverObject->FastIoDispatch;
1460 
1461  /* Make sure our FastIo table is valid */
1463  {
1464  /* Forward the call onto the device we attached to */
1466  FileOffset,
1467  Length,
1468  LockKey,
1469  Buffer,
1470  MdlChain,
1471  IoStatus,
1474  AttachedDeviceObject);
1475  }
1476 
1477  /* We failed to handle the request, send it down the slow path */
1478  FLT_ASSERT(FALSE);
1479  return FALSE;
1480 }
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_ PVOID _Out_ PMDL _Out_ PIO_STATUS_BLOCK _Out_ struct _COMPRESSED_DATA_INFO _In_ ULONG CompressedDataInfoLength
Definition: iotypes.h:1614
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
PFAST_IO_WRITE_COMPRESSED FastIoWriteCompressed
Definition: iotypes.h:1710
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_ PVOID _Out_ PMDL _Out_ PIO_STATUS_BLOCK _Out_ struct _COMPRESSED_DATA_INFO * CompressedDataInfo
Definition: iotypes.h:1614
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFsControl()

NTSTATUS NTAPI FltpFsControl ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 527 of file Interface.c.

529 {
531 
532  PAGED_CODE();
533 
534  /* Check if this is a request for us */
536  {
537  /* We don't handle this request */
538  Irp->IoStatus.Information = 0;
539  Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
542  }
543 
545 
547  DeviceExtension->AttachedToDeviceObject);
548 
549  /* Just pass the IRP down the stack */
551  return IoCallDriver(DeviceExtension->AttachedToDeviceObject, Irp);
552 }
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
VOID FASTCALL IofCompleteRequest(IN PIRP Irp, IN CCHAR PriorityBoost)
Definition: irp.c:1308
PDEVICE_OBJECT DeviceObject
Definition: fltmgr.h:30
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpFsNotification()

VOID NTAPI FltpFsNotification ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ BOOLEAN  FsActive 
)

Definition at line 2037 of file Interface.c.

2039 {
2041  NTSTATUS Status;
2042 
2043  PAGED_CODE();
2044 
2045  /* Set an empty string */
2047 
2048  /* Get the name of the lowest device object on the stack */
2050  if (NT_SUCCESS(Status))
2051  {
2052  /* Check if it's attaching or detaching */
2053  if (FsActive)
2054  {
2055  /* Run the attach routine */
2057  }
2058  else
2059  {
2060  /* Run the detach routine */
2062  }
2063 
2064  /* Free the buffer which FltpGetBaseDeviceObjectName allocated */
2066  }
2067 }
VOID FltpFreeUnicodeString(_In_ PUNICODE_STRING String)
Definition: Lib.c:24
LONG NTSTATUS
Definition: precomp.h:26
static LONG_PTR FltpDetachFromFileSystemDevice(_In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1988
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS FltpGetBaseDeviceObjectName(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PUNICODE_STRING ObjectName)
Definition: Object.c:245
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ BOOLEAN FsActive
Definition: iotypes.h:7003
static NTSTATUS FltpAttachToFileSystemDevice(_In_ PDEVICE_OBJECT DeviceObject, _In_ PUNICODE_STRING DeviceName)
Definition: Interface.c:1888
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

◆ FltpIsAttachedToDevice()

static BOOLEAN FltpIsAttachedToDevice ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_opt_ PDEVICE_OBJECT AttachedDeviceObject 
)
static

Definition at line 1662 of file Interface.c.

1664 {
1665  PDEVICE_OBJECT CurrentDeviceObject;
1667 
1668  PAGED_CODE();
1669 
1670  /* Initialize the return pointer */
1671  if (AttachedDeviceObject) *AttachedDeviceObject = NULL;
1672 
1673  /* Start by getting the top level device in the chain */
1674  CurrentDeviceObject = IoGetAttachedDeviceReference(DeviceObject);
1675 
1676  /* Loop while there are attached devices */
1677  while (CurrentDeviceObject)
1678  {
1679  /* Check if this device driver matches ours */
1680  if (CurrentDeviceObject->DriverObject == DriverData.DriverObject)
1681  {
1682  FLT_ASSERT(CurrentDeviceObject->DeviceExtension != NULL);
1683 
1684  /* We're attached, return the device object if the caller asked for it */
1685  if (AttachedDeviceObject)
1686  {
1687  *AttachedDeviceObject = CurrentDeviceObject;
1688  }
1689  else
1690  {
1691  /* We aren't returning the reference, so decrement the count */
1692  ObDereferenceObject(CurrentDeviceObject);
1693  }
1694 
1695  return TRUE;
1696  }
1697 
1698  /* Get the next device in the chain */
1699  NextDeviceObject = IoGetLowerDeviceObject(CurrentDeviceObject);
1700 
1701  /* Decrement the count on the last device before we update the pointer */
1702  ObDereferenceObject(CurrentDeviceObject);
1703  CurrentDeviceObject = NextDeviceObject;
1704  }
1705 
1706  return FALSE;
1707 }
PDRIVER_OBJECT DriverObject
Definition: fltmgr.h:29
#define TRUE
Definition: types.h:120
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
#define PAGED_CODE()
Definition: video.h:57
DRIVER_DATA DriverData
Definition: Interface.c:396
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
PDEVICE_OBJECT NTAPI IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1507
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
Definition: device.c:1406
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT * NextDeviceObject
Definition: ndis.h:4640
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by FltpEnumerateFileSystemVolumes().

◆ FltpPostFsFilterOperation()

VOID NTAPI FltpPostFsFilterOperation ( _In_ PFS_FILTER_CALLBACK_DATA  Data,
_In_ NTSTATUS  OperationStatus,
_In_ PVOID  CompletionContext 
)

Definition at line 423 of file Interface.c.

426 {
430  __debugbreak();
431 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
_Unreferenced_parameter_ PVOID * CompletionContext
Definition: cdprocs.h:1130
_IRQL_requires_same_ _In_ PKE_PROCESSOR_CHANGE_NOTIFY_CONTEXT _Inout_ PNTSTATUS OperationStatus
Definition: ketypes.h:360

Referenced by SetupDispatchAndCallbacksTables().

◆ FltpPreFsFilterOperation()

NTSTATUS NTAPI FltpPreFsFilterOperation ( _In_ PFS_FILTER_CALLBACK_DATA  Data,
_Out_ PVOID CompletionContext 
)

Definition at line 412 of file Interface.c.

414 {
417  __debugbreak();
418  return STATUS_SUCCESS;
419 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
_Unreferenced_parameter_ PVOID * CompletionContext
Definition: cdprocs.h:1130
return STATUS_SUCCESS
Definition: btrfs.c:2777

Referenced by SetupDispatchAndCallbacksTables().

◆ SetupDispatchAndCallbacksTables()

static NTSTATUS SetupDispatchAndCallbacksTables ( _In_ PDRIVER_OBJECT  DriverObject)
static

Definition at line 2189 of file Interface.c.

2190 {
2193  ULONG i;
2194 
2195  /* Plug all the IRPs */
2196  for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
2197  {
2199  }
2200 
2201  /* Override the ones we're interested in */
2207 
2208  /* The FastIo dispatch table is stored in the pool along with a tag */
2211 
2212  /* Fill out the FastIo table */
2236 
2237  /* Store the FastIo table for internal and our access */
2240 
2241  /* Initialize the callback table */
2242  Callbacks.SizeOfFsFilterCallbacks = sizeof(FS_FILTER_CALLBACKS);
2243  Callbacks.PreAcquireForSectionSynchronization = FltpPreFsFilterOperation;
2244  Callbacks.PostAcquireForSectionSynchronization = FltpPostFsFilterOperation;
2245  Callbacks.PreReleaseForSectionSynchronization = FltpPreFsFilterOperation;
2246  Callbacks.PostReleaseForSectionSynchronization = FltpPostFsFilterOperation;
2247  Callbacks.PreAcquireForCcFlush = FltpPreFsFilterOperation;
2248  Callbacks.PostAcquireForCcFlush = FltpPostFsFilterOperation;
2249  Callbacks.PreReleaseForCcFlush = FltpPreFsFilterOperation;
2250  Callbacks.PostReleaseForCcFlush = FltpPostFsFilterOperation;
2251  Callbacks.PreAcquireForModifiedPageWriter = FltpPreFsFilterOperation;
2252  Callbacks.PostAcquireForModifiedPageWriter = FltpPostFsFilterOperation;
2253  Callbacks.PreReleaseForModifiedPageWriter = FltpPreFsFilterOperation;
2254  Callbacks.PostReleaseForModifiedPageWriter = FltpPostFsFilterOperation;
2255 
2256  /* Register our callbacks */
2258 }
BOOLEAN NTAPI FltpFastIoMdlReadCompleteCompressed(_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1484
#define FM_TAG_DISPATCH_TABLE
Definition: fltmgr.h:15
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1696
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define IRP_MJ_CREATE_MAILSLOT
BOOLEAN NTAPI FltpFastIoReadCompressed(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _Out_ PVOID Buffer, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _Out_ PCOMPRESSED_DATA_INFO CompressedDataInfo, _In_ ULONG CompressedDataInfoLength, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1376
#define IRP_MJ_MAXIMUM_FUNCTION
NTSTATUS NTAPI FltpCreate(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Interface.c:486
BOOLEAN NTAPI FltpFastIoMdlReadComplete(_In_ PFILE_OBJECT FileObject, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1243
PFAST_IO_MDL_READ MdlRead
Definition: iotypes.h:1705
PFAST_IO_PREPARE_MDL_WRITE PrepareMdlWrite
Definition: iotypes.h:1707
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1697
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1703
BOOLEAN NTAPI FltpFastIoMdlRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1193
PFAST_IO_READ_COMPRESSED FastIoReadCompressed
Definition: iotypes.h:1709
BOOLEAN NTAPI FltpFastIoRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _Out_ PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:645
PFAST_IO_MDL_READ_COMPLETE MdlReadComplete
Definition: iotypes.h:1706
PFAST_IO_MDL_READ_COMPLETE_COMPRESSED MdlReadCompleteCompressed
Definition: iotypes.h:1711
BOOLEAN NTAPI FltpFastIoWriteCompressed(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _In_ PVOID Buffer, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PCOMPRESSED_DATA_INFO CompressedDataInfo, _In_ ULONG CompressedDataInfoLength, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1430
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PFAST_IO_DETACH_DEVICE FastIoDetachDevice
Definition: iotypes.h:1702
DRIVER_DATA DriverData
Definition: Interface.c:396
NTSTATUS NTAPI FltpPreFsFilterOperation(_In_ PFS_FILTER_CALLBACK_DATA Data, _Out_ PVOID *CompletionContext)
Definition: Interface.c:412
PFAST_IO_QUERY_OPEN FastIoQueryOpen
Definition: iotypes.h:1713
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1693
struct _FAST_IO_DISPATCH FAST_IO_DISPATCH
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI FltpFsControl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Interface.c:527
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
BOOLEAN NTAPI FltpFastIoDeviceControl(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _In_opt_ PVOID InputBuffer, _In_ ULONG InputBufferLength, _Out_opt_ PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _In_ ULONG IoControlCode, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1036
BOOLEAN NTAPI FltpFastIoLock(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PLARGE_INTEGER Length, _In_ PEPROCESS ProcessId, _In_ ULONG Key, _In_ BOOLEAN FailImmediately, _In_ BOOLEAN ExclusiveLock, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:841
BOOLEAN NTAPI FltpFastIoQueryBasicInfo(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_BASIC_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:749
BOOLEAN NTAPI FltpFastIoQueryOpen(_Inout_ PIRP Irp, _Out_ PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1564
BOOLEAN NTAPI FltpFastIoCheckIfPossible(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _In_ BOOLEAN CheckForReadOperation, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:592
BOOLEAN NTAPI FltpFastIoMdlWriteComplete(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1334
BOOLEAN NTAPI FltpFastIoUnlockAll(_In_ PFILE_OBJECT FileObject, _In_ PEPROCESS ProcessId, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:945
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
VOID NTAPI FltpPostFsFilterOperation(_In_ PFS_FILTER_CALLBACK_DATA Data, _In_ NTSTATUS OperationStatus, _In_ PVOID CompletionContext)
Definition: Interface.c:423
BOOLEAN NTAPI FltpFastIoQueryNetworkOpenInfo(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_NETWORK_OPEN_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1147
#define IRP_MJ_FILE_SYSTEM_CONTROL
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1698
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
BOOLEAN NTAPI FltpFastIoMdlWriteCompleteCompressed(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PMDL MdlChain, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1523
NTSTATUS NTAPI FsRtlRegisterFileSystemFilterCallbacks(PDRIVER_OBJECT FilterDriverObject, PFS_FILTER_CALLBACKS Callbacks)
Definition: fastio.c:1947
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1695
PFAST_IO_DEVICE_CONTROL FastIoDeviceControl
Definition: iotypes.h:1699
BOOLEAN NTAPI FltpFastIoPrepareMdlWrite(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ ULONG LockKey, _Out_ PMDL *MdlChain, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:1284
struct _FS_FILTER_CALLBACKS FS_FILTER_CALLBACKS
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1691
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1692
PFAST_IO_WRITE_COMPRESSED FastIoWriteCompressed
Definition: iotypes.h:1710
NTSTATUS NTAPI FltpDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Interface.c:556
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1694
BOOLEAN NTAPI FltpFastIoUnlockAllByKey(_In_ PFILE_OBJECT FileObject, _In_ PVOID ProcessId, _In_ ULONG Key, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:990
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
struct _FAST_IO_DISPATCH * FastIoDispatch
Definition: iotypes.h:2176
PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete
Definition: iotypes.h:1708
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2180
VOID NTAPI FltpFastIoDetachDevice(_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice)
Definition: Interface.c:1107
unsigned int ULONG
Definition: retypes.h:1
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1690
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
BOOLEAN NTAPI FltpFastIoUnlockSingle(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ PLARGE_INTEGER Length, _In_ PEPROCESS ProcessId, _In_ ULONG Key, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:895
BOOLEAN NTAPI FltpFastIoQueryStandardInfo(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_STANDARD_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:795
NTSTATUS NTAPI FltpDispatch(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Interface.c:435
PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED MdlWriteCompleteCompressed
Definition: iotypes.h:1712
BOOLEAN NTAPI FltpFastIoWrite(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _In_ PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
Definition: Interface.c:697
#define IRP_MJ_CREATE_NAMED_PIPE
PFAST_IO_DISPATCH FastIoDispatch
Definition: fltmgr.h:35
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1689

Referenced by DriverEntry().

Variable Documentation

◆ CommsDeviceObject

PDEVICE_OBJECT CommsDeviceObject

Definition at line 22 of file Messaging.c.

Referenced by FltpCreate(), FltpDispatch(), and FltpSetupCommunicationObjects().

◆ DriverData

◆ DriverEntry

DRIVER_INITIALIZE DriverEntry

Definition at line 36 of file Interface.c.

◆ FilterList

LIST_ENTRY FilterList

Definition at line 24 of file Filter.c.

Referenced by DriverEntry().

◆ FilterListLock

ERESOURCE FilterListLock

Definition at line 25 of file Filter.c.

Referenced by DriverEntry().

◆ FltpFsNotification

VOID NTAPI FltpFsNotification

Definition at line 90 of file Interface.c.

Referenced by DriverEntry().