From 56e27990e09c4d8b6cff96d22e7fab810bcfaf59 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 17 May 2015 17:17:56 -0700 Subject: [PATCH] Fixing name check. --- src/xenia/kernel/xboxkrnl_threading.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl_threading.cc b/src/xenia/kernel/xboxkrnl_threading.cc index a1c4f296e..c074e2e84 100644 --- a/src/xenia/kernel/xboxkrnl_threading.cc +++ b/src/xenia/kernel/xboxkrnl_threading.cc @@ -64,6 +64,9 @@ void AssertNoNameCollision(KernelState* state, uint32_t obj_attributes_ptr) { // with a success of NAME_EXISTS. // If the name exists and its type doesn't match, we do NAME_COLLISION. // Otherwise, we add like normal. + if (!obj_attributes_ptr) { + return; + } uint32_t name_str_ptr = xe::load_and_swap( state->memory()->TranslateVirtual(obj_attributes_ptr + 4)); if (name_str_ptr) { @@ -450,9 +453,7 @@ SHIM_CALL NtCreateEvent_shim(PPCContext* ppc_state, KernelState* state) { // TODO(benvanik): check for name collision. May return existing object if // type matches. - if (obj_attributes_ptr) { - AssertNoNameCollision(state, obj_attributes_ptr); - } + AssertNoNameCollision(state, obj_attributes_ptr); XEvent* ev = new XEvent(state); ev->Initialize(!event_type, !!initial_state);