Merge remote-tracking branch 'GliniakRepo/physicalProtectPageCombinations' into canary_pr

This commit is contained in:
Gliniak 2022-05-19 10:17:58 +02:00
commit 320cbc43c8
1 changed files with 8 additions and 2 deletions

View File

@ -425,8 +425,14 @@ DECLARE_XBOXKRNL_EXPORT2(MmQueryAddressProtect, kMemory, kImplemented,
void MmSetAddressProtect_entry(lpvoid_t base_address, dword_t region_size, void MmSetAddressProtect_entry(lpvoid_t base_address, dword_t region_size,
dword_t protect_bits) { dword_t protect_bits) {
if (!protect_bits) { constexpr uint32_t required_protect_bits =
XELOGE("MmSetAddressProtect: Failed due to incorrect protect_bits"); X_PAGE_NOACCESS | X_PAGE_READONLY | X_PAGE_READWRITE |
X_PAGE_EXECUTE_READ | X_PAGE_EXECUTE_READWRITE;
if (xe::bit_count(protect_bits & required_protect_bits) != 1) {
// Many titles use invalid combination with zero valid bits set.
// We're skipping assertion for these cases to prevent unnecessary spam.
assert_false(xe::bit_count(protect_bits & required_protect_bits) > 1);
return; return;
} }