Merge pull request #210 from DrChat/name_check_fixes

Fix some crashes from checking for object name collisions
This commit is contained in:
Ben Vanik 2015-05-16 14:59:04 -07:00
commit 83d52beaf2
1 changed files with 9 additions and 3 deletions

View File

@ -596,7 +596,9 @@ SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_state, KernelState* state) {
// TODO(benvanik): check for name collision. May return existing object if
// type matches.
AssertNoNameCollision(state, obj_attributes_ptr);
if (obj_attributes_ptr) {
AssertNoNameCollision(state, obj_attributes_ptr);
}
XSemaphore* sem = new XSemaphore(state);
sem->Initialize(count, limit);
@ -690,7 +692,9 @@ SHIM_CALL NtCreateMutant_shim(PPCContext* ppc_state, KernelState* state) {
// TODO(benvanik): check for name collision. May return existing object if
// type matches.
AssertNoNameCollision(state, obj_attributes_ptr);
if (obj_attributes_ptr) {
AssertNoNameCollision(state, obj_attributes_ptr);
}
XMutant* mutant = new XMutant(state);
mutant->Initialize(initial_owner ? true : false);
@ -747,7 +751,9 @@ SHIM_CALL NtCreateTimer_shim(PPCContext* ppc_state, KernelState* state) {
// TODO(benvanik): check for name collision. May return existing object if
// type matches.
AssertNoNameCollision(state, obj_attributes_ptr);
if (obj_attributes_ptr) {
AssertNoNameCollision(state, obj_attributes_ptr);
}
XTimer* timer = new XTimer(state);
timer->Initialize(timer_type);