Validate attr for mutexes, semas, and events.

This commit is contained in:
Unknown W. Brackets committed 2012-12-14 12:05:15 -08:00
1 parent d2d82196b7
commit 2ea992f2c4
3 files changed
+63 -11

No files matched your search

+11 -1
View File
@@ -177,7 +177,15 @@ int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32
__KernelSemaInit();
if (!name)
{
WARN_LOG(HLE, "%08x=sceKernelCreateSema(): invalid name", SCE_KERNEL_ERROR_ERROR);
return SCE_KERNEL_ERROR_ERROR;
}
if (attr >= 0x200)
{
WARN_LOG(HLE, "%08x=sceKernelCreateSema(): invalid attr parameter: %08x", SCE_KERNEL_ERROR_ILLEGAL_ATTR, attr);
return SCE_KERNEL_ERROR_ILLEGAL_ATTR;
}
Semaphore *s = new Semaphore;
SceUID id = kernelObjects.Create(s);
@@ -194,7 +202,9 @@ int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32
DEBUG_LOG(HLE, "%i=sceKernelCreateSema(%s, %08x, %i, %i, %08x)", id, s->ns.name, s->ns.attr, s->ns.initCount, s->ns.maxCount, optionPtr);
if (optionPtr != 0)
WARN_LOG(HLE, "sceKernelCreateSema(%s) unsupported options parameter.", name);
WARN_LOG(HLE, "sceKernelCreateSema(%s) unsupported options parameter: %08x", name, optionPtr);
if (attr != 0 && attr != 0x100)
WARN_LOG(HLE, "sceKernelCreateSema(%s) unsupported attr parameter: %08x", name, attr);
return id;
}