sys: FspFileNodeFlushAndPurgeCache

This commit is contained in:
Bill Zissimopoulos
2016-03-17 10:13:52 -07:00
parent df85107c42
commit b734e6968d
6 changed files with 157 additions and 22 deletions

View File

@ -7,10 +7,12 @@
#include <sys/driver.h>
DRIVER_INITIALIZE DriverEntry;
static VOID FspDriverMultiVersionInitialize(VOID);
DRIVER_UNLOAD FspUnload;
#ifdef ALLOC_PRAGMA
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(INIT, FspDriverMultiVersionInitialize)
#pragma alloc_text(PAGE, FspUnload)
#endif
@ -19,6 +21,8 @@ NTSTATUS DriverEntry(
{
FSP_ENTER();
FspDriverMultiVersionInitialize();
FspDriverObject = DriverObject;
/* create the file system control device objects */
@ -143,6 +147,18 @@ NTSTATUS DriverEntry(
&DriverObject->DriverName, RegistryPath);
}
static VOID FspDriverMultiVersionInitialize(VOID)
{
UNICODE_STRING Name;
if (RtlIsNtDdiVersionAvailable(NTDDI_WIN7))
{
RtlInitUnicodeString(&Name, L"CcCoherencyFlushAndPurgeCache");
FspMvCcCoherencyFlushAndPurgeCache =
(FSP_MV_CcCoherencyFlushAndPurgeCache *)(UINT_PTR)MmGetSystemRoutineAddress(&Name);
}
}
VOID FspUnload(
PDRIVER_OBJECT DriverObject)
{
@ -164,3 +180,5 @@ PDEVICE_OBJECT FspFsctlDiskDeviceObject;
PDEVICE_OBJECT FspFsctlNetDeviceObject;
FAST_IO_DISPATCH FspFastIoDispatch;
CACHE_MANAGER_CALLBACKS FspCacheManagerCallbacks;
FSP_MV_CcCoherencyFlushAndPurgeCache *FspMvCcCoherencyFlushAndPurgeCache;