/* GLOBALS *******************************************************************/
-static PFN_TYPE CcZeroPage = 0;
+static PFN_NUMBER CcZeroPage = 0;
#define MAX_ZERO_LENGTH (256 * 1024)
#define MAX_RW_LENGTH (256 * 1024)
/* FUNCTIONS *****************************************************************/
+VOID
+NTAPI
+MiZeroPhysicalPage(
+ IN PFN_NUMBER PageFrameIndex
+);
+
VOID
NTAPI
CcInitCacheZeroPage(VOID)
{
NTSTATUS Status;
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &CcZeroPage);
+ MI_SET_USAGE(MI_USAGE_CACHE);
+ //MI_SET_PROCESS2(PsGetCurrentProcess()->ImageFileName);
+ Status = MmRequestPageMemoryConsumer(MC_SYSTEM, TRUE, &CcZeroPage);
if (!NT_SUCCESS(Status))
{
DbgPrint("Can't allocate CcZeroPage.\n");
KeBugCheck(CACHE_MANAGER);
}
- Status = MiZeroPage(CcZeroPage);
- if (!NT_SUCCESS(Status))
- {
- DbgPrint("Can't zero out CcZeroPage.\n");
- KeBugCheck(CACHE_MANAGER);
- }
+ MiZeroPhysicalPage(CcZeroPage);
}
NTSTATUS
PCACHE_SEGMENT current2;
ULONG current_size;
ULONG i;
- PPFN_TYPE MdlPages;
+ PPFN_NUMBER MdlPages;
/*
* Count the maximum number of bytes we could read starting
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
current2 = current;
current_size = 0;
- MdlPages = (PPFN_TYPE)(Mdl + 1);
+ MdlPages = (PPFN_NUMBER)(Mdl + 1);
while (current2 != NULL && !current2->Valid && current_size < MAX_RW_LENGTH)
{
PVOID address = current2->BaseAddress;
Mdl->MdlFlags |= (MDL_PAGES_LOCKED | MDL_IO_PAGE_READ);
for (i = 0; i < ((Mdl->Size - sizeof(MDL)) / sizeof(ULONG)); i++)
{
- ((PPFN_TYPE)(Mdl + 1))[i] = CcZeroPage;
+ ((PPFN_NUMBER)(Mdl + 1))[i] = CcZeroPage;
}
KeInitializeEvent(&Event, NotificationEvent, FALSE);
Status = IoSynchronousPageWrite(FileObject, Mdl, &WriteOffset, &Event, &Iosb);