[XAM] Fixed invalid xuid being returned when only online XUID is requested
- Fixes stats loading of GoW3 savefile (and maybe checkpoints) Co-authored-by: Adrian <78108584+AdrianCassar@users.noreply.github.com>
This commit is contained in:
@@ -133,6 +133,9 @@ struct X_XAMACCOUNTINFO {
|
|||||||
};
|
};
|
||||||
static_assert_size(X_XAMACCOUNTINFO, 0x17C);
|
static_assert_size(X_XAMACCOUNTINFO, 0x17C);
|
||||||
|
|
||||||
|
#define X_USER_GET_SIGNIN_INFO_ONLINE_XUID_ONLY 0x00000001
|
||||||
|
#define X_USER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY 0x00000002
|
||||||
|
|
||||||
#define MAX_FIRSTNAME_SIZE 64
|
#define MAX_FIRSTNAME_SIZE 64
|
||||||
#define MAX_LASTNAME_SIZE 64
|
#define MAX_LASTNAME_SIZE 64
|
||||||
#define MAX_EMAIL_SIZE 129
|
#define MAX_EMAIL_SIZE 129
|
||||||
|
|||||||
@@ -119,21 +119,27 @@ X_HRESULT_result_t XamUserGetSigninInfo_entry(
|
|||||||
return X_E_INVALIDARG;
|
return X_E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::memset(info, 0, sizeof(X_USER_SIGNIN_INFO));
|
info.Zero();
|
||||||
|
|
||||||
if (user_index >= XUserMaxUserCount) {
|
if (user_index >= XUserMaxUserCount) {
|
||||||
return X_E_NO_SUCH_USER;
|
return X_E_NO_SUCH_USER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kernel_state()->xam_state()->IsUserSignedIn(user_index)) {
|
if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) {
|
||||||
const auto& user_profile =
|
|
||||||
kernel_state()->xam_state()->GetUserProfile(user_index);
|
|
||||||
info->xuid = user_profile->xuid();
|
|
||||||
info->signin_state = user_profile->signin_state();
|
|
||||||
xe::string_util::copy_truncating(info->name, user_profile->name(),
|
|
||||||
xe::countof(info->name));
|
|
||||||
} else {
|
|
||||||
return X_E_NO_SUCH_USER;
|
return X_E_NO_SUCH_USER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& user_profile =
|
||||||
|
kernel_state()->xam_state()->GetUserProfile(user_index);
|
||||||
|
|
||||||
|
xe::string_util::copy_truncating(info->name, user_profile->name(),
|
||||||
|
xe::countof(info->name));
|
||||||
|
|
||||||
|
if (!flags || flags & X_USER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY) {
|
||||||
|
info->xuid = user_profile->xuid();
|
||||||
|
}
|
||||||
|
|
||||||
|
info->signin_state = user_profile->signin_state();
|
||||||
return X_E_SUCCESS;
|
return X_E_SUCCESS;
|
||||||
}
|
}
|
||||||
DECLARE_XAM_EXPORT1(XamUserGetSigninInfo, kUserProfiles, kImplemented);
|
DECLARE_XAM_EXPORT1(XamUserGetSigninInfo, kUserProfiles, kImplemented);
|
||||||
|
|||||||
Reference in New Issue
Block a user