profile: Migrate to the new UUID implementation

This commit is contained in:
Morph 2022-02-05 12:29:09 -05:00
parent d94dcaefa0
commit dfe11d72e3
14 changed files with 131 additions and 127 deletions

View file

@ -55,7 +55,7 @@ constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA;
struct LaunchParameterAccountPreselectedUser {
u32_le magic;
u32_le is_account_selected;
u128 current_user;
Common::NewUUID current_user;
INSERT_PADDING_BYTES(0x70);
};
static_assert(sizeof(LaunchParameterAccountPreselectedUser) == 0x88);
@ -1453,8 +1453,8 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
Account::ProfileManager profile_manager{};
const auto uuid = profile_manager.GetUser(static_cast<s32>(Settings::values.current_user));
ASSERT(uuid);
params.current_user = uuid->uuid;
ASSERT(uuid.has_value() && uuid->IsValid());
params.current_user = *uuid;
IPC::ResponseBuilder rb{ctx, 2, 0, 1};

View file

@ -54,19 +54,20 @@ void ProfileSelect::Execute() {
return;
}
frontend.SelectProfile([this](std::optional<Common::UUID> uuid) { SelectionComplete(uuid); });
frontend.SelectProfile(
[this](std::optional<Common::NewUUID> uuid) { SelectionComplete(uuid); });
}
void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) {
void ProfileSelect::SelectionComplete(std::optional<Common::NewUUID> uuid) {
UserSelectionOutput output{};
if (uuid.has_value() && uuid->IsValid()) {
output.result = 0;
output.uuid_selected = uuid->uuid;
output.uuid_selected = *uuid;
} else {
status = ERR_USER_CANCELLED_SELECTION;
output.result = ERR_USER_CANCELLED_SELECTION.raw;
output.uuid_selected = Common::INVALID_UUID;
output.uuid_selected = Common::InvalidUUID;
}
final_data = std::vector<u8>(sizeof(UserSelectionOutput));

View file

@ -7,7 +7,7 @@
#include <vector>
#include "common/common_funcs.h"
#include "common/uuid.h"
#include "common/new_uuid.h"
#include "core/hle/result.h"
#include "core/hle/service/am/applets/applets.h"
@ -27,7 +27,7 @@ static_assert(sizeof(UserSelectionConfig) == 0xA0, "UserSelectionConfig has inco
struct UserSelectionOutput {
u64 result;
u128 uuid_selected;
Common::NewUUID uuid_selected;
};
static_assert(sizeof(UserSelectionOutput) == 0x18, "UserSelectionOutput has incorrect size.");
@ -44,7 +44,7 @@ public:
void ExecuteInteractive() override;
void Execute() override;
void SelectionComplete(std::optional<Common::UUID> uuid);
void SelectionComplete(std::optional<Common::NewUUID> uuid);
private:
const Core::Frontend::ProfileSelectApplet& frontend;