From a77213dcdbe57f92b5573062dde88a5e905ad662 Mon Sep 17 00:00:00 2001 From: The-Little-Wolf <116989599+The-Little-Wolf@users.noreply.github.com> Date: Sat, 11 Jan 2025 20:20:45 -0800 Subject: [PATCH] [Xam/Xam_Profile] - Stub XamProfileCreate and more - Move XamProfileFindAccount - Leave notes for XamProfileOpen - Stub XamProfileCreate --- src/xenia/kernel/xam/xam_profile.cc | 46 ++++++++++++++++++++++++++++- src/xenia/kernel/xam/xam_user.cc | 29 ------------------ 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/src/xenia/kernel/xam/xam_profile.cc b/src/xenia/kernel/xam/xam_profile.cc index 7940b2e80..12afb909c 100644 --- a/src/xenia/kernel/xam/xam_profile.cc +++ b/src/xenia/kernel/xam/xam_profile.cc @@ -15,7 +15,40 @@ namespace xe { namespace kernel { namespace xam { -dword_result_t XamProfileOpen_entry(qword_t xuid, lpstring_t mount_path) { +dword_result_t XamProfileFindAccount_entry( + qword_t offline_xuid, pointer_t account_ptr, + lpdword_t device_id) { + if (!account_ptr) { + return X_ERROR_INVALID_PARAMETER; + } + + account_ptr.Zero(); + + const auto& account = + kernel_state()->xam_state()->profile_manager()->GetAccount(offline_xuid); + + if (!account) { + return X_ERROR_NO_SUCH_USER; + } + + std::memcpy(account_ptr, &account, sizeof(X_XAMACCOUNTINFO)); + + xe::string_util::copy_and_swap_truncating( + account_ptr->gamertag, account->gamertag, sizeof(account->gamertag)); + + if (device_id) { + *device_id = 1; + } + + return X_ERROR_SUCCESS; +} +DECLARE_XAM_EXPORT1(XamProfileFindAccount, kUserProfiles, kImplemented); + +dword_result_t XamProfileOpen_entry(qword_t xuid, lpstring_t mount_path, + dword_t flags, lpvoid_t content_data) { + /* Notes: + - If xuid is not local then returns X_ERROR_INVALID_PARAMETER + */ const bool result = kernel_state()->xam_state()->profile_manager()->MountProfile( xuid, mount_path.value()); @@ -24,6 +57,17 @@ dword_result_t XamProfileOpen_entry(qword_t xuid, lpstring_t mount_path) { } DECLARE_XAM_EXPORT1(XamProfileOpen, kNone, kImplemented); +dword_result_t XamProfileCreate_entry(dword_t flags, lpdword_t device_id, + qword_t xuid, + pointer_t account, + dword_t unk1, dword_t unk2, dword_t unk3, + dword_t unk4) { + // **unk4 + + return X_ERROR_SUCCESS; +} +DECLARE_XAM_EXPORT1(XamProfileCreate, kNone, kStub); + } // namespace xam } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index 7e6cc2202..7802dffa6 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -844,35 +844,6 @@ dword_result_t XamUserCreateStatsEnumerator_entry( } DECLARE_XAM_EXPORT1(XamUserCreateStatsEnumerator, kUserProfiles, kSketchy); -dword_result_t XamProfileFindAccount_entry( - qword_t offline_xuid, pointer_t account_ptr, - lpdword_t device_id) { - if (!account_ptr) { - return X_ERROR_INVALID_PARAMETER; - } - - account_ptr.Zero(); - - const auto& account = - kernel_state()->xam_state()->profile_manager()->GetAccount(offline_xuid); - - if (!account) { - return X_ERROR_NO_SUCH_USER; - } - - std::memcpy(account_ptr, &account, sizeof(X_XAMACCOUNTINFO)); - - xe::string_util::copy_and_swap_truncating( - account_ptr->gamertag, account->gamertag, sizeof(account->gamertag)); - - if (device_id) { - *device_id = 1; - } - - return X_ERROR_SUCCESS; -} -DECLARE_XAM_EXPORT1(XamProfileFindAccount, kUserProfiles, kImplemented); - } // namespace xam } // namespace kernel } // namespace xe