[XAM] Correct error code in XamUserGetGamerTag

This commit is contained in:
Adrian 2024-11-19 00:32:47 +00:00 committed by Radosław Gliński
parent a7a981105a
commit 1333b4dc98
1 changed files with 5 additions and 5 deletions

View File

@ -141,18 +141,18 @@ DECLARE_XAM_EXPORT1(XamUserGetName, kUserProfiles, kImplemented);
dword_result_t XamUserGetGamerTag_entry(dword_t user_index,
lpu16string_t buffer,
dword_t buffer_len) {
if (user_index >= XUserMaxUserCount) {
return X_E_INVALIDARG;
}
if (!buffer || buffer_len < 16) {
return X_E_INVALIDARG;
}
if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) {
if (user_index >= XUserMaxUserCount) {
return X_E_INVALIDARG;
}
if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) {
return X_ERROR_NO_SUCH_USER;
}
const auto& user_profile =
kernel_state()->xam_state()->GetUserProfile(user_index);
auto user_name = xe::to_utf16(user_profile->name());