MiZeroAllPageFiles
NTSTATUS __stdcall MiZeroAllPageFiles(){
_ETHREAD *CurrentThread;
__int64 v1;
unsigned int v2;
unsigned int v3;
__int64 v4;
VOID **v5;
_WORK_QUEUE_ITEM *Pool;
VOID *Object[64];
_KWAIT_BLOCK WaitBlockArray;
memset(Object, 0i64, 0x80u);
VfZeroAllPagesRunning = 1;
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
--CurrentThread->Tcb.SpecialApcDisable;
ExAcquirePushLockExclusiveEx((_EX_PUSH_LOCK *)&stru_140C50B28 + 117, 0i64);
v1 = *(&stru_140C50B28 + 7);
v2 = *(&stru_140C50B28 + 1708);
if( (_InterlockedExchangeAdd64((_QWORD *)&stru_140C50B28 + 117, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
ExfTryToWakePushLock((_EX_PUSH_LOCK *)&stru_140C50B28 + 117);
KeAbPostRelease((char *)&stru_140C50B28 + 936);
KiLeaveGuardedRegionUnsafe((__int64)CurrentThread);
if( v1 && v2 )
{
KeWaitForSingleObject((UINT64)&stru_140C50B28 + 656, 26, 0, 0, 0i64);
v3 = v2;
do
{
v4 = v3 - 1;
v5 = &Object[3 * v4 + 16];
KeInitializeEvent((INT64)v5, 0, 0);
Object[v4] = v5;
if( (Irp.Vp.PagingFile[v4]->_bf_cc & 0x40) != 0
|| (Pool = (_WORK_QUEUE_ITEM *)MiAllocatePool(64i64, 0x30ui64, 0x775A6D4Dui64)) == 0i64 )
{
KeSetEvent((PRKEVENT)&Object[3 * v4 + 16], 0, 0);
}
else
{
Pool[1].List.Flink = (_LIST_ENTRY *)Irp.Vp.PagingFile[v4];
Pool[1].List.Blink = (_LIST_ENTRY *)v5;
if( v3 == 1 )
{
KeSetEvent((PRKEVENT)&Object[3 * v4 + 16], 0, 0);
MiZeroPageFile(Pool);
}
else
{
Pool->List.Flink = 0i64;
Pool->WorkerRoutine = (void(__fastcall *)(void *))MiZeroPageFile;
Pool->Parameter = Pool;
ExQueueWorkItem(Pool, CriticalWorkQueue);
}
}
--v3;
}
while( (_DWORD)v4 );
if( v2 > 1 )
KeWaitForMultipleObjects(v2, Object, WaitAll, Executive, 0, 0, 0i64, &WaitBlockArray);
}
VfZeroAllPagesRunning = 0;
return 1;
}Referenced by:
MiShutdownSystem