Return a proper error for fake TMIDs.

This commit is contained in:
Unknown W. Brackets 2014-08-06 07:52:23 -07:00
parent 6852e32d6b
commit 909ac62669

View file

@ -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;