- /*
- * Now we must raise to APC_LEVEL and mark the thread as owner
- * We don't actually implement a working set pushlock, so this is only
- * for internal consistency (and blocking APCs)
- */
- KeRaiseIrql(APC_LEVEL, &LockIrql);
- CurrentThread = PsGetCurrentThread();
- KeEnterGuardedRegion();
- ASSERT((CurrentThread->OwnsSystemWorkingSetExclusive == 0) &&
- (CurrentThread->OwnsSystemWorkingSetShared == 0));
- CurrentThread->OwnsSystemWorkingSetExclusive = 1;
+ /* Lock the system working set */
+ MiLockWorkingSet(CurrentThread, &MmSystemCacheWs);