From 909ac626699c057a03978df11fbcdaafa09dbe8d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 6 Aug 2014 07:52:23 -0700 Subject: [PATCH] Return a proper error for fake TMIDs. --- Core/HLE/sceKernelThread.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 53bdf72a0b..a2fc29fe56 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1584,8 +1584,14 @@ int sceKernelGetThreadExitStatus(SceUID threadID) u32 sceKernelGetThreadmanIdType(u32 uid) { int type; if (kernelObjects.GetIDType(uid, &type)) { - DEBUG_LOG(SCEKERNEL, "%i=sceKernelGetThreadmanIdType(%i)", type, uid); - return type; + if (type < 0x1000) { + DEBUG_LOG(SCEKERNEL, "%i=sceKernelGetThreadmanIdType(%i)", type, uid); + return type; + } else { + // This means a partition memory block or module, etc. + ERROR_LOG(SCEKERNEL, "sceKernelGetThreadmanIdType(%i): invalid object type %i", uid, type); + return SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT; + } } else { ERROR_LOG(SCEKERNEL, "sceKernelGetThreadmanIdType(%i) - FAILED", uid); return SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT;