Created
April 3, 2019 10:28
-
-
Save JustasMasiulis/1cfb6275d98572fec6457c063c8f01ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint64_t MiLockPageInline(_MMPFN *pfn) | |
{ | |
auto oldIrql = KeRaiseIrqlToDpcLevel(); | |
uint32_t spinCount = 0; | |
while(_interlockedbittestandset64(&pfn->u2.Lock, 63ui64)) // set pfn->u2.LockBit | |
{ | |
do | |
KeYieldProcessorEx(&spinCount); | |
while(pfn->u2.LockBit); | |
} | |
return oldIrql; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment