#define NDEBUG
#include <debug.h>
-#line 15 "ARMĀ³::DRVMGMT"
#define MODULE_INVOLVED_IN_ARM3
#include "../ARM3/miarm.h"
NTAPI
MmTrimAllSystemPageableMemory(IN ULONG PurgeTransitionList)
{
- UNIMPLEMENTED;
- return 0;
+ UNIMPLEMENTED;
+ return 0;
}
/*
ULONG i;
NTSTATUS Status = STATUS_SUCCESS;
PAGED_CODE();
-
+
//
// Make sure the driver verifier is initialized
//
if (!MiVerifierDriverAddedThunkListHead.Flink) return STATUS_NOT_SUPPORTED;
-
+
//
// Get the thunk pairs and count them
//
ThunkCount = ThunkBufferSize / sizeof(DRIVER_VERIFIER_THUNK_PAIRS);
if (!ThunkCount) return STATUS_INVALID_PARAMETER_1;
-
+
//
// Now allocate our own thunk table
//
sizeof(DRIVER_VERIFIER_THUNK_PAIRS),
'tVmM');
if (!DriverThunks) return STATUS_INSUFFICIENT_RESOURCES;
-
+
//
// Now copy the driver-fed part
//
RtlCopyMemory(ThunkTable,
ThunkBuffer,
ThunkCount * sizeof(DRIVER_VERIFIER_THUNK_PAIRS));
-
+
//
// Acquire the system load lock
//
KernelMode,
FALSE,
NULL);
-
+
//
// Get the loader entry
//
Status = STATUS_INVALID_PARAMETER_2;
goto Cleanup;
}
-
+
//
// Get driver base and end
//
ModuleBase = LdrEntry->DllBase;
ModuleEnd = (PVOID)((ULONG_PTR)LdrEntry->DllBase + LdrEntry->SizeOfImage);
-
+
//
// Don't allow hooking the kernel or HAL
//
Status = STATUS_INVALID_PARAMETER_2;
goto Cleanup;
}
-
+
//
// Loop all the thunks
//
goto Cleanup;
}
}
-
+
//
// Otherwise, add this entry
//
InsertTailList(&MiVerifierDriverAddedThunkListHead,
&DriverThunks->ListEntry);
DriverThunks = NULL;
-
+
Cleanup:
//
// Release the lock
//
KeReleaseMutant(&MmSystemLoadLock, 1, FALSE, FALSE);
KeLeaveCriticalRegion();
-
+
//
// Free the table if we failed and return status
//
- if (DriverThunks) ExFreePool(DriverThunks);
+ if (DriverThunks) ExFreePoolWithTag(DriverThunks, 'tVmM');
return Status;
}
MmIsDriverVerifying(IN PDRIVER_OBJECT DriverObject)
{
PLDR_DATA_TABLE_ENTRY LdrEntry;
-
+
//
// Get the loader entry
//
LdrEntry = (PLDR_DATA_TABLE_ENTRY)DriverObject->DriverSection;
if (!LdrEntry) return FALSE;
-
+
//
// Check if we're verifying or not
//
*VerifierFlags = MmVerifierData.Level;
return STATUS_SUCCESS;
}
-
+
//
// Otherwise, we're disabled
//