Check kernel object types when looking up ids.

Some games misuse it, need to return an error.
This commit is contained in:
Unknown W. Brackets
2013-06-18 23:54:29 -07:00
parent 45775d4fc2
commit 933c8abb55
12 changed files with 25 additions and 9 deletions
+2 -1
View File
@@ -179,6 +179,7 @@ public:
nm.entry_addr);
}
static u32 GetMissingErrorCode() { return SCE_KERNEL_ERROR_UNKNOWN_MODULE; }
static int GetStaticIDType() { return PPSSPP_KERNEL_TMID_Module; }
int GetIDType() const { return PPSSPP_KERNEL_TMID_Module; }
virtual void DoState(PointerWrap &p)
@@ -1349,7 +1350,7 @@ u32 sceKernelGetModuleIdByAddress(u32 moduleAddr)
state.addr = moduleAddr;
state.result = SCE_KERNEL_ERROR_UNKNOWN_MODULE;
kernelObjects.Iterate(&__GetModuleIdByAddressIterator, &state, PPSSPP_KERNEL_TMID_Module);
kernelObjects.Iterate(&__GetModuleIdByAddressIterator, &state);
if (state.result == SCE_KERNEL_ERROR_UNKNOWN_MODULE)
ERROR_LOG(HLE, "sceKernelGetModuleIdByAddress(%08x): module not found", moduleAddr)
else