From 0117c39968c1b761b0751a1415e64523a030f5f9 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sat, 14 Mar 2015 23:54:43 -0700 Subject: [PATCH] Proper XamEnumerate return when there are zero items. --- src/xenia/kernel/xam_info.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xam_info.cc b/src/xenia/kernel/xam_info.cc index dd7ba938d..742627283 100644 --- a/src/xenia/kernel/xam_info.cc +++ b/src/xenia/kernel/xam_info.cc @@ -165,14 +165,13 @@ SHIM_CALL XamEnumerate_shim(PPCContext* ppc_state, KernelState* state) { auto item_count = e->item_count(); e->WriteItems(SHIM_MEM_ADDR(buffer_ptr)); - X_RESULT result; + X_RESULT result = item_count ? X_ERROR_SUCCESS : X_ERROR_NO_MORE_FILES; if (item_count_ptr) { assert_zero(overlapped_ptr); SHIM_SET_MEM_32(item_count_ptr, item_count); - result = X_ERROR_SUCCESS; } else if (overlapped_ptr) { assert_zero(item_count_ptr); - state->CompleteOverlappedImmediate(overlapped_ptr, 0, item_count); + state->CompleteOverlappedImmediate(overlapped_ptr, result, item_count); result = X_ERROR_IO_PENDING; } else { assert_always();