diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-10-13 19:02:33 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-10-24 01:31:28 +0200 |
commit | 45f2a2fe29373f261144c097d169dad8b65fe012 (patch) | |
tree | 610b04ce839b40eaab1fe297c625b34eaf76e9cd /src/core/hle/service/am | |
parent | configure_system: Clear selection after user delete (diff) | |
download | yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.tar yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.tar.gz yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.tar.bz2 yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.tar.lz yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.tar.xz yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.tar.zst yuzu-45f2a2fe29373f261144c097d169dad8b65fe012.zip |
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r-- | src/core/hle/service/am/am.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 9dfcec59b..4ed66d817 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -28,7 +28,15 @@ namespace Service::AM { -constexpr std::size_t POP_LAUNCH_PARAMETER_BUFFER_SIZE = 0x88; +constexpr u32 POP_LAUNCH_PARAMETER_MAGIC = 0xC79497CA; + +struct LaunchParameters { + u32_le magic; + u32_le is_account_selected; + u128 current_user; + INSERT_PADDING_BYTES(0x70); +}; +static_assert(sizeof(LaunchParameters) == 0x88); IWindowController::IWindowController() : ServiceFramework("IWindowController") { // clang-format off @@ -728,22 +736,23 @@ void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx } void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { - constexpr std::array<u8, 0x8> header_data{ - 0xca, 0x97, 0x94, 0xc7, // Magic - 1, 0, 0, 0, // IsAccountSelected (bool) - }; + LaunchParameters params{}; - std::vector<u8> buffer(POP_LAUNCH_PARAMETER_BUFFER_SIZE); - - std::memcpy(buffer.data(), header_data.data(), header_data.size()); + params.magic = POP_LAUNCH_PARAMETER_MAGIC; + params.is_account_selected = 1; Account::ProfileManager profile_manager{}; - const auto uuid = profile_manager.GetAllUsers()[Settings::values.current_user].uuid; - std::memcpy(buffer.data() + header_data.size(), uuid.data(), sizeof(u128)); + const auto uuid = profile_manager.GetUser(Settings::values.current_user); + ASSERT(uuid != boost::none); + params.current_user = uuid->uuid; IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); + + std::vector<u8> buffer(sizeof(LaunchParameters)); + std::memcpy(buffer.data(), ¶ms, buffer.size()); + rb.PushIpcInterface<AM::IStorage>(buffer); LOG_DEBUG(Service_AM, "called"); |