From a6954aced397ea1846379dbb48571a76637dadce Mon Sep 17 00:00:00 2001 From: Gliniak Date: Sun, 3 Jan 2021 18:21:08 +0100 Subject: [PATCH] [Kernel/XAM] XamContentCreateEx - Extended Error Support --- src/xenia/kernel/xam/xam_content.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/xam/xam_content.cc b/src/xenia/kernel/xam/xam_content.cc index 4de097fb7..2e3ebbc9f 100644 --- a/src/xenia/kernel/xam/xam_content.cc +++ b/src/xenia/kernel/xam/xam_content.cc @@ -202,8 +202,12 @@ dword_result_t XamContentCreateEx(dword_t user_index, lpstring_t root_name, } if (overlapped_ptr) { - kernel_state()->CompleteOverlappedImmediateEx(overlapped_ptr, result, 0, - disposition); + X_RESULT extended_error = X_HRESULT_FROM_WIN32(result); + if (int32_t(extended_error) < 0) { + result = X_ERROR_FUNCTION_FAILED; + } + kernel_state()->CompleteOverlappedImmediateEx(overlapped_ptr, result, + extended_error, disposition); return X_ERROR_IO_PENDING; } else { return result;