From e7f5d3e7d4d9b767acb141d7eff4fb2a1e501d1f Mon Sep 17 00:00:00 2001 From: gibbed Date: Mon, 20 Jun 2016 17:13:31 -0500 Subject: [PATCH] Set length in overlapped completion to -1 when not success. --- src/xenia/kernel/kernel_state.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/kernel_state.cc b/src/xenia/kernel/kernel_state.cc index 07770d72d..c8314228b 100644 --- a/src/xenia/kernel/kernel_state.cc +++ b/src/xenia/kernel/kernel_state.cc @@ -608,7 +608,11 @@ void KernelState::CompleteOverlappedEx(uint32_t overlapped_ptr, X_RESULT result, void KernelState::CompleteOverlappedImmediate(uint32_t overlapped_ptr, X_RESULT result) { - CompleteOverlappedImmediateEx(overlapped_ptr, result, result, 0); + // TODO(gibbed): there are games that check 'length' of overlapped as + // an indication of success. WTF? + // Setting length to -1 when not success seems to be helping. + uint32_t length = !result ? 0 : 0xFFFFFFFF; + CompleteOverlappedImmediateEx(overlapped_ptr, result, result, length); } void KernelState::CompleteOverlappedImmediateEx(uint32_t overlapped_ptr,