This commit is contained in:
Radosław Gliński 2025-08-24 23:45:31 +00:00 committed by GitHub
commit 3d346b8eae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -425,8 +425,15 @@ DECLARE_XBOXKRNL_EXPORT2(MmQueryAddressProtect, kMemory, kImplemented,
void MmSetAddressProtect_entry(lpvoid_t base_address, dword_t region_size,
dword_t protect_bits) {
if (!protect_bits) {
XELOGE("MmSetAddressProtect: Failed due to incorrect protect_bits");
constexpr uint32_t required_protect_bits =
X_PAGE_NOACCESS | X_PAGE_READONLY | X_PAGE_READWRITE | X_PAGE_EXECUTE |
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.
// Affected titles: 594B07D1 (used on boot), 544307D1 (used in menu)
assert_false(xe::bit_count(protect_bits & required_protect_bits) > 1);
return;
}