[XAM] ProfileManager: Renamed GetProfiles to GetAccounts

This is to prevent confusion between signed-in accounts (aka. Profiles) and all entries (Accounts)

Also added GetAccount to get specific instead of all of them when not needed
This commit is contained in:
Gliniak
2024-11-26 20:28:01 +01:00
parent b17faf84f2
commit 2b49fc2ddc
7 changed files with 33 additions and 23 deletions

View File

@@ -787,26 +787,26 @@ dword_result_t XamUserCreateStatsEnumerator_entry(
}
DECLARE_XAM_EXPORT1(XamUserCreateStatsEnumerator, kUserProfiles, kSketchy);
dword_result_t XamProfileFindAccount_entry(qword_t offline_xuid,
pointer_t<X_XAMACCOUNTINFO> account,
lpdword_t device_id) {
if (!account) {
dword_result_t XamProfileFindAccount_entry(
qword_t offline_xuid, pointer_t<X_XAMACCOUNTINFO> account_ptr,
lpdword_t device_id) {
if (!account_ptr) {
return X_ERROR_INVALID_PARAMETER;
}
account.Zero();
account_ptr.Zero();
const auto& profiles =
kernel_state()->xam_state()->profile_manager()->GetProfiles();
const auto& account =
kernel_state()->xam_state()->profile_manager()->GetAccount(offline_xuid);
if (!profiles->count(offline_xuid)) {
if (!account) {
return X_ERROR_NO_SUCH_USER;
}
memcpy(account, &profiles->at(offline_xuid), sizeof(X_XAMACCOUNTINFO));
std::memcpy(account_ptr, &account, sizeof(X_XAMACCOUNTINFO));
xe::string_util::copy_and_swap_truncating(
account->gamertag, account->gamertag, sizeof(account->gamertag));
account_ptr->gamertag, account->gamertag, sizeof(account->gamertag));
if (device_id) {
*device_id = 1;