[Kernel/Memory] MmQueryAddressProtect - Check for protect_bits equals 0

This commit is contained in:
Gliniak 2020-11-16 19:02:37 +01:00 committed by Rick Gibbed
parent 8749ca2260
commit aae292aab5
1 changed files with 5 additions and 0 deletions

View File

@ -401,6 +401,11 @@ DECLARE_XBOXKRNL_EXPORT2(MmQueryAddressProtect, kMemory, kImplemented,
void MmSetAddressProtect(lpvoid_t base_address, dword_t region_size, void MmSetAddressProtect(lpvoid_t base_address, dword_t region_size,
dword_t protect_bits) { dword_t protect_bits) {
if (!protect_bits) {
XELOGE("MmSetAddressProtect: Failed due to incorrect protect_bits");
return;
}
uint32_t protect = FromXdkProtectFlags(protect_bits); uint32_t protect = FromXdkProtectFlags(protect_bits);
auto heap = kernel_memory()->LookupHeap(base_address); auto heap = kernel_memory()->LookupHeap(base_address);
heap->Protect(base_address.guest_address(), region_size, protect); heap->Protect(base_address.guest_address(), region_size, protect);