Fix XamEnumerate returns.

This commit is contained in:
Ben Vanik 2015-02-02 22:31:58 -08:00
parent 4f92df8918
commit 969ef8f688
1 changed files with 5 additions and 1 deletions

View File

@ -118,19 +118,23 @@ SHIM_CALL XamEnumerate_shim(PPCContext* ppc_state, KernelState* state) {
} }
// 0 items. // 0 items.
X_RESULT result;
if (item_count_ptr) { if (item_count_ptr) {
assert_zero(overlapped_ptr); assert_zero(overlapped_ptr);
SHIM_SET_MEM_32(item_count_ptr, 0); SHIM_SET_MEM_32(item_count_ptr, 0);
result = X_ERROR_SUCCESS;
} else if (overlapped_ptr) { } else if (overlapped_ptr) {
assert_zero(item_count_ptr); assert_zero(item_count_ptr);
state->CompleteOverlappedImmediate(overlapped_ptr, 0, 0); state->CompleteOverlappedImmediate(overlapped_ptr, 0, 0);
result = X_ERROR_IO_PENDING;
} else { } else {
assert_always(); assert_always();
result = X_ERROR_INVALID_PARAMETER;
} }
e->Release(); e->Release();
SHIM_SET_RETURN_64(0); SHIM_SET_RETURN_64(result);
} }
} // namespace kernel } // namespace kernel