From 61b2e15666333e9c4d1cd9c01a264ad1828c6f42 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:32:36 +0000 Subject: [PATCH] [XAM] Fix error code for XamUserGetIndexFromXUID --- src/xenia/kernel/xam/xam_user.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index d1b8b6923..5a4bdd70b 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -71,15 +71,18 @@ dword_result_t XamUserGetIndexFromXUID_entry(qword_t xuid, dword_t flags, return X_E_INVALIDARG; } - auto profile_manager = kernel_state()->xam_state()->profile_manager(); - const uint8_t user_index = - profile_manager->GetUserIndexAssignedToProfile(xuid); + const uint8_t user_index = kernel_state() + ->xam_state() + ->profile_manager() + ->GetUserIndexAssignedToProfile(xuid); + if (user_index == XUserIndexAny) { return X_E_NO_SUCH_USER; } *index = user_index; - return X_E_SUCCESS; + + return X_ERROR_SUCCESS; } DECLARE_XAM_EXPORT1(XamUserGetIndexFromXUID, kUserProfiles, kImplemented);