From f676333ef095f477b59f8cba8d90e5678afd157b Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 21 Oct 2013 21:58:45 -0700 Subject: [PATCH] Stub MmQueryAddressProtect - unimplemented. --- .../modules/xboxkrnl/xboxkrnl_memory.cc | 21 +++++++++++++++++++ .../kernel/modules/xboxkrnl/xboxkrnl_memory.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc index dccb3610f..c95e4f59b 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.cc @@ -305,6 +305,26 @@ SHIM_CALL MmFreePhysicalMemory_shim( } +uint32_t xeMmQueryAddressProtect(uint32_t base_address) { + XELOGW("MmQueryAddressProtect faked!"); + return 0; +} + + +SHIM_CALL MmQueryAddressProtect_shim( + xe_ppc_state_t* ppc_state, KernelState* state) { + uint32_t base_address = SHIM_GET_ARG_32(0); + + XELOGD( + "MmQueryAddressProtect(%.8X)", + base_address); + + uint32_t result = xeMmQueryAddressProtect(base_address); + + SHIM_SET_RETURN(result); +} + + // http://msdn.microsoft.com/en-us/library/windows/hardware/ff554547(v=vs.85).aspx uint32_t xeMmGetPhysicalAddress(uint32_t base_address) { // PHYSICAL_ADDRESS MmGetPhysicalAddress( @@ -354,5 +374,6 @@ void xe::kernel::xboxkrnl::RegisterMemoryExports( //SHIM_SET_MAPPING("xboxkrnl.exe", MmAllocatePhysicalMemory, state); SHIM_SET_MAPPING("xboxkrnl.exe", MmAllocatePhysicalMemoryEx, state); SHIM_SET_MAPPING("xboxkrnl.exe", MmFreePhysicalMemory, state); + //SHIM_SET_MAPPING("xboxkrnl.exe", MmQueryAddressProtect, state); SHIM_SET_MAPPING("xboxkrnl.exe", MmGetPhysicalAddress, state); } diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h index c6f349615..a00bf6240 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h @@ -33,6 +33,7 @@ uint32_t xeMmAllocatePhysicalMemoryEx( uint32_t type, uint32_t region_size, uint32_t protect_bits, uint32_t min_addr_range, uint32_t max_addr_range, uint32_t alignment); void xeMmFreePhysicalMemory(uint32_t type, uint32_t base_address); +uint32_t xeMmQueryAddressProtect(uint32_t base_address); uint32_t xeMmGetPhysicalAddress(uint32_t base_address);