NTAPI
MmMpwThreadMain(PVOID Parameter)
{
- NTSTATUS Status;
- ULONG PagesWritten;
- LARGE_INTEGER Timeout;
-
- UNREFERENCED_PARAMETER(Parameter);
-
- Timeout.QuadPart = -50000000;
-
- for(;;)
- {
- Status = KeWaitForSingleObject(&MpwThreadEvent,
- 0,
- KernelMode,
- FALSE,
- &Timeout);
- if (!NT_SUCCESS(Status))
- {
- DbgPrint("MpwThread: Wait failed\n");
- KeBugCheck(MEMORY_MANAGEMENT);
- return;
- }
-
- PagesWritten = 0;
+ NTSTATUS Status;
+ ULONG PagesWritten;
+ LARGE_INTEGER Timeout;
+
+ UNREFERENCED_PARAMETER(Parameter);
+
+ Timeout.QuadPart = -50000000;
+
+ for(;;)
+ {
+ Status = KeWaitForSingleObject(&MpwThreadEvent,
+ 0,
+ KernelMode,
+ FALSE,
+ &Timeout);
+ if (!NT_SUCCESS(Status))
+ {
+ DbgPrint("MpwThread: Wait failed\n");
+ KeBugCheck(MEMORY_MANAGEMENT);
+ return;
+ }
+
+ PagesWritten = 0;
#ifndef NEWCC
- // XXX arty -- we flush when evicting pages or destorying cache
- // sections.
- CcRosFlushDirtyPages(128, &PagesWritten, FALSE);
+ // XXX arty -- we flush when evicting pages or destorying cache
+ // sections.
+ CcRosFlushDirtyPages(128, &PagesWritten, FALSE);
#endif
- }
+ }
}
NTSTATUS
INIT_FUNCTION
MmInitMpwThread(VOID)
{
- KPRIORITY Priority;
- NTSTATUS Status;
- CLIENT_ID MpwThreadId;
-
- KeInitializeEvent(&MpwThreadEvent, SynchronizationEvent, FALSE);
-
- Status = PsCreateSystemThread(&MpwThreadHandle,
- THREAD_ALL_ACCESS,
- NULL,
- NULL,
- &MpwThreadId,
- MmMpwThreadMain,
- NULL);
- if (!NT_SUCCESS(Status))
- {
- return(Status);
- }
-
- Priority = 27;
- NtSetInformationThread(MpwThreadHandle,
- ThreadPriority,
- &Priority,
- sizeof(Priority));
-
- return(STATUS_SUCCESS);
+ KPRIORITY Priority;
+ NTSTATUS Status;
+ CLIENT_ID MpwThreadId;
+
+ KeInitializeEvent(&MpwThreadEvent, SynchronizationEvent, FALSE);
+
+ Status = PsCreateSystemThread(&MpwThreadHandle,
+ THREAD_ALL_ACCESS,
+ NULL,
+ NULL,
+ &MpwThreadId,
+ MmMpwThreadMain,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ return(Status);
+ }
+
+ Priority = 27;
+ NtSetInformationThread(MpwThreadHandle,
+ ThreadPriority,
+ &Priority,
+ sizeof(Priority));
+
+ return(STATUS_SUCCESS);
}
NTSTATUS
// by the fault handler.
//
MmSharedUserDataPte = ExAllocatePoolWithTag(PagedPool,
- sizeof(MMPTE),
- ' mM');
+ sizeof(MMPTE),
+ ' mM');
if (!MmSharedUserDataPte) return FALSE;
//