summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am
diff options
context:
space:
mode:
authorMat M <mathew1800@gmail.com>2018-10-24 16:10:29 +0200
committerGitHub <noreply@github.com>2018-10-24 16:10:29 +0200
commit77e705a8fa0a70dac2eb81b95fedc5e98d7c274e (patch)
tree29bf11e757a34d608652b901f9c58ce4ad25aeaf /src/core/hle/service/am
parentMerge pull request #1551 from ogniK5377/improved-svcbreak (diff)
parentconfigure_system: Clear current username before overwriting (diff)
downloadyuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.tar
yuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.tar.gz
yuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.tar.bz2
yuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.tar.lz
yuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.tar.xz
yuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.tar.zst
yuzu-77e705a8fa0a70dac2eb81b95fedc5e98d7c274e.zip
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r--src/core/hle/service/am/am.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index ecf72ae24..4ed66d817 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -4,11 +4,13 @@
#include <array>
#include <cinttypes>
+#include <cstring>
#include <stack>
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/process.h"
+#include "core/hle/service/acc/profile_manager.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/applet_ae.h"
#include "core/hle/service/am/applet_oe.h"
@@ -26,6 +28,16 @@
namespace Service::AM {
+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
static const FunctionInfo functions[] = {
@@ -724,20 +736,23 @@ void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx
}
void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
- constexpr std::array<u8, 0x88> data{{
- 0xca, 0x97, 0x94, 0xc7, // Magic
- 1, 0, 0, 0, // IsAccountSelected (bool)
- 1, 0, 0, 0, // User Id (word 0)
- 0, 0, 0, 0, // User Id (word 1)
- 0, 0, 0, 0, // User Id (word 2)
- 0, 0, 0, 0 // User Id (word 3)
- }};
+ LaunchParameters params{};
- std::vector<u8> buffer(data.begin(), data.end());
+ params.magic = POP_LAUNCH_PARAMETER_MAGIC;
+ params.is_account_selected = 1;
+
+ Account::ProfileManager profile_manager{};
+ 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(), &params, buffer.size());
+
rb.PushIpcInterface<AM::IStorage>(buffer);
LOG_DEBUG(Service_AM, "called");