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

View file

@ -72,6 +72,7 @@ struct FPL : public KernelObject
const char *GetName() {return nf.name;}
const char *GetTypeName() {return "FPL";}
static u32 GetMissingErrorCode() { return SCE_KERNEL_ERROR_UNKNOWN_FPLID; }
static int GetStaticIDType() { return SCE_KERNEL_TMID_Fpl; }
int GetIDType() const { return SCE_KERNEL_TMID_Fpl; }
int findFreeBlock() {
@ -133,6 +134,7 @@ struct VPL : public KernelObject
const char *GetName() {return nv.name;}
const char *GetTypeName() {return "VPL";}
static u32 GetMissingErrorCode() { return SCE_KERNEL_ERROR_UNKNOWN_VPLID; }
static int GetStaticIDType() { return SCE_KERNEL_TMID_Vpl; }
int GetIDType() const { return SCE_KERNEL_TMID_Vpl; }
VPL() : alloc(8) {}
@ -424,6 +426,7 @@ public:
sprintf(ptr, "MemPart: %08x - %08x size: %08x", address, address + sz, sz);
}
static u32 GetMissingErrorCode() { return SCE_KERNEL_ERROR_UNKNOWN_UID; }
static int GetStaticIDType() { return PPSSPP_KERNEL_TMID_PMB; }
int GetIDType() const { return PPSSPP_KERNEL_TMID_PMB; }
PartitionMemoryBlock(BlockAllocator *_alloc, const char *_name, u32 size, MemblockType type, u32 alignment)
@ -1331,6 +1334,7 @@ struct TLS : public KernelObject
const char *GetName() {return ntls.name;}
const char *GetTypeName() {return "TLS";}
static u32 GetMissingErrorCode() { return PSP_ERROR_UNKNOWN_TLS_ID; }
static int GetStaticIDType() { return SCE_KERNEL_TMID_Tls; }
int GetIDType() const { return SCE_KERNEL_TMID_Tls; }
TLS() : next(0) {}