Last active
April 4, 2019 12:26
-
-
Save JustasMasiulis/aed906ea3fcf6a864bb4afc49327b5b0 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
MI_PFN_CACHE_ATTRIBUTE MiProtectionToCacheAttribute(uint32_t protection) { | |
if(protection != 0x1F) // all flags combined | |
{ | |
if(protection >> 3 == 3) // MM_WRITECOMBINE | |
{ | |
if(protection & 7) // check if it has any actual access | |
return MiWriteCombined; | |
} | |
else if (protection >> 3 == 1) // MM_NOCACHE | |
return MiNonCached; | |
} | |
return MiCached; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment