From f2f8bba081625a30ae5c80516a06f28719b788eb Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Thu, 30 May 2024 11:54:41 +0100 Subject: [PATCH] [XAM] XamUserGetName return Win32 code instead of HResult --- src/xenia/kernel/xam/xam_user.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index 41e84fbe33..8b3f0724a7 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -111,7 +111,7 @@ DECLARE_XAM_EXPORT1(XamUserGetSigninInfo, kUserProfiles, kImplemented); dword_result_t XamUserGetName_entry(dword_t user_index, lpstring_t buffer, dword_t buffer_len) { if (user_index >= 4) { - return X_E_INVALIDARG; + return X_ERROR_INVALID_PARAMETER; } if (kernel_state()->IsUserSignedIn(user_index)) { @@ -120,9 +120,10 @@ dword_result_t XamUserGetName_entry(dword_t user_index, lpstring_t buffer, xe::string_util::copy_truncating( buffer, user_name, std::min(buffer_len.value(), uint32_t(16))); } else { - return X_E_NO_SUCH_USER; + *buffer = 0; + return X_ERROR_NO_SUCH_USER; } - return X_E_SUCCESS; + return X_ERROR_SUCCESS; } DECLARE_XAM_EXPORT1(XamUserGetName, kUserProfiles, kImplemented);