From 4db78f0a9d485a50bcbf256db95eb27bdbd1f2cc Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Thu, 27 Jul 2023 23:20:14 +0200 Subject: [PATCH] Fix ipc request headers --- src/core/hle/service/frd/frd.cpp | 62 ++++++++++++++--------------- src/core/hle/service/fs/fs_user.cpp | 16 ++++---- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index 22b385ee99..ad282457f0 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -51,7 +51,7 @@ Module::Interface::Interface(std::shared_ptr frd, const char* name, u32 Module::Interface::~Interface() = default; void Module::Interface::HasLoggedIn(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x1, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); @@ -59,7 +59,7 @@ void Module::Interface::HasLoggedIn(Kernel::HLERequestContext& ctx) { } void Module::Interface::IsOnline(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x2, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); // This is actually different than HasLoggedIn, @@ -71,7 +71,7 @@ void Module::Interface::IsOnline(Kernel::HLERequestContext& ctx) { } void Module::Interface::Login(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x3, 0, 2); + IPC::RequestParser rp(ctx); auto event = rp.PopObject(); frd->has_logged_in = true; @@ -82,7 +82,7 @@ void Module::Interface::Login(Kernel::HLERequestContext& ctx) { } void Module::Interface::Logout(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x4, 0, 0); + IPC::RequestParser rp(ctx); frd->has_logged_in = false; @@ -91,14 +91,14 @@ void Module::Interface::Logout(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetMyFriendKey(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x5, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(5, 0); rb.Push(RESULT_SUCCESS); rb.PushRaw(frd->my_account_data.my_key); } void Module::Interface::GetMyPreference(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x6, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(4, 0); rb.Push(RESULT_SUCCESS); rb.Push(frd->my_account_data.my_pref_public_mode); @@ -107,7 +107,7 @@ void Module::Interface::GetMyPreference(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetMyProfile(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x7, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(3, 0); rb.Push(RESULT_SUCCESS); rb.PushRaw(frd->my_account_data.my_profile); @@ -125,21 +125,21 @@ void Module::Interface::GetMyPresence(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetMyScreenName(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x9, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(7, 0); rb.Push(RESULT_SUCCESS); rb.PushRaw>(frd->my_account_data.my_screen_name); } void Module::Interface::GetMyMii(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0xA, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(25, 0); rb.Push(RESULT_SUCCESS); rb.PushRaw(frd->my_account_data.my_mii_data); } void Module::Interface::GetMyLocalAccountId(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0xB, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(1); // Assume using account ID 1 @@ -148,7 +148,7 @@ void Module::Interface::GetMyLocalAccountId(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetMyPlayingGame(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0xC, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(5, 0); TitleData title_data{}; @@ -159,14 +159,14 @@ void Module::Interface::GetMyPlayingGame(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetMyFavoriteGame(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0xD, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(5, 0); rb.Push(RESULT_SUCCESS); rb.PushRaw(frd->my_account_data.my_fav_game); } void Module::Interface::GetMyNcPrincipalId(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0xE, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); rb.Push(0); // Stubbed @@ -175,14 +175,14 @@ void Module::Interface::GetMyNcPrincipalId(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetMyComment(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0xF, 0, 0); + IPC::RequestParser rp(ctx); IPC::RequestBuilder rb = rp.MakeBuilder(10, 0); rb.Push(RESULT_SUCCESS); rb.PushRaw>(frd->my_account_data.my_comment); } void Module::Interface::GetMyPassword(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x10, 1, 0); + IPC::RequestParser rp(ctx); u32 pass_len = rp.Pop(); std::vector pass_buf(pass_len); @@ -220,7 +220,7 @@ void Module::Interface::GetFriendKeyList(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetFriendPresence(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x12, 1, 2); + IPC::RequestParser rp(ctx); const u32 count = rp.Pop(); const std::vector frd_keys = rp.PopStaticBuffer(); ASSERT(frd_keys.size() == count * sizeof(FriendKey)); @@ -235,7 +235,7 @@ void Module::Interface::GetFriendPresence(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetFriendScreenName(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x12, 5, 2); + IPC::RequestParser rp(ctx); const u32 name_count = rp.Pop(); const u32 font_count = rp.Pop(); const u32 count = rp.Pop(); @@ -267,7 +267,7 @@ void Module::Interface::GetFriendScreenName(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetFriendMii(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x14, 1, 4); + IPC::RequestParser rp(ctx); const u32 count = rp.Pop(); const std::vector frd_keys = rp.PopStaticBuffer(); ASSERT(frd_keys.size() == count * sizeof(FriendKey)); @@ -319,7 +319,7 @@ void Module::Interface::GetFriendProfile(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetFriendRelationship(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x16, 1, 2); + IPC::RequestParser rp(ctx); const u32 count = rp.Pop(); const std::vector frd_keys = rp.PopStaticBuffer(); ASSERT(frd_keys.size() == count * sizeof(FriendKey)); @@ -380,7 +380,7 @@ void Module::Interface::GetFriendAttributeFlags(Kernel::HLERequestContext& ctx) } void Module::Interface::GetFriendPlayingGame(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x18, 1, 4); + IPC::RequestParser rp(ctx); const u32 count = rp.Pop(); const std::vector frd_keys = rp.PopStaticBuffer(); ASSERT(frd_keys.size() == count * sizeof(FriendKey)); @@ -400,7 +400,7 @@ void Module::Interface::GetFriendPlayingGame(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetFriendFavoriteGame(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x19, 1, 2); + IPC::RequestParser rp(ctx); const u32 count = rp.Pop(); const std::vector frd_keys = rp.PopStaticBuffer(); ASSERT(frd_keys.size() == count * sizeof(FriendKey)); @@ -423,7 +423,7 @@ void Module::Interface::GetFriendFavoriteGame(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetFriendInfo(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x1A, 3, 4); + IPC::RequestParser rp(ctx); const u32 count = rp.Pop(); rp.Pop(); // replace_unknown_characters rp.Pop(); // replace_bad_words @@ -453,7 +453,7 @@ void Module::Interface::GetFriendInfo(Kernel::HLERequestContext& ctx) { } void Module::Interface::IsIncludedInFriendList(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x1B, 2, 0); + IPC::RequestParser rp(ctx); u64_le friendCode = rp.Pop(); bool is_included = false; @@ -501,7 +501,7 @@ void Module::Interface::UnscrambleLocalFriendCode(Kernel::HLERequestContext& ctx } void Module::Interface::UpdateGameModeDescription(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x1D, 0, 2); + IPC::RequestParser rp(ctx); const std::vector new_game_mode_description = rp.PopStaticBuffer(); u32 copy_size = std::min(static_cast(new_game_mode_description.size()), @@ -513,7 +513,7 @@ void Module::Interface::UpdateGameModeDescription(Kernel::HLERequestContext& ctx } void Module::Interface::UpdateGameMode(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x1E, 11, 2); + IPC::RequestParser rp(ctx); auto game_mode = rp.PopRaw(); const std::vector new_game_mode_description = rp.PopStaticBuffer(); @@ -527,7 +527,7 @@ void Module::Interface::UpdateGameMode(Kernel::HLERequestContext& ctx) { } void Module::Interface::AttachToEventNotification(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x20, 0, 2); + IPC::RequestParser rp(ctx); frd->notif_event = rp.PopObject(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -535,7 +535,7 @@ void Module::Interface::AttachToEventNotification(Kernel::HLERequestContext& ctx } void Module::Interface::SetNotificationMask(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x21, 1, 0); + IPC::RequestParser rp(ctx); frd->notif_event_mask = rp.Pop(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -543,7 +543,7 @@ void Module::Interface::SetNotificationMask(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetEventNotification(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x22, 1, 0); + IPC::RequestParser rp(ctx); u32 count = rp.Pop(); // LOG_WARNING(Service_FRD, "(STUBBED) called"); @@ -556,7 +556,7 @@ void Module::Interface::GetEventNotification(Kernel::HLERequestContext& ctx) { } void Module::Interface::GetLastResponseResult(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x23, 0, 0); + IPC::RequestParser rp(ctx); LOG_WARNING(Service_FRD, "(STUBBED) called"); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -564,7 +564,7 @@ void Module::Interface::GetLastResponseResult(Kernel::HLERequestContext& ctx) { } void Module::Interface::RequestGameAuthentication(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x28, 9, 4); + IPC::RequestParser rp(ctx); u32 gameID = rp.Pop(); struct ScreenNameIPC { @@ -691,7 +691,7 @@ void Module::Interface::RequestGameAuthentication(Kernel::HLERequestContext& ctx } void Module::Interface::GetGameAuthenticationData(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x29, 0, 0); + IPC::RequestParser rp(ctx); std::vector out_auth_data(sizeof(GameAuthenticationData)); memcpy(out_auth_data.data(), &frd->last_game_auth_data, sizeof(GameAuthenticationData)); diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 0765ac9c85..12925a0deb 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -671,7 +671,7 @@ void FS_USER::GetFormatInfo(Kernel::HLERequestContext& ctx) { } void FS_USER::GetProductInfo(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x82E, 1, 0); + IPC::RequestParser rp(ctx); u32 process_id = rp.Pop(); @@ -845,7 +845,7 @@ void FS_USER::ObsoletedGetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { } void FS_USER::SetThisSaveDataSecureValue(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x86E, 3, 0); + IPC::RequestParser rp(ctx); u32 secure_value_slot = rp.Pop(); u64 value = rp.Pop(); @@ -861,7 +861,7 @@ void FS_USER::SetThisSaveDataSecureValue(Kernel::HLERequestContext& ctx) { } void FS_USER::GetThisSaveDataSecureValue(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x86F, 1, 0); + IPC::RequestParser rp(ctx); u32 secure_value_slot = rp.Pop(); @@ -882,7 +882,7 @@ void FS_USER::GetThisSaveDataSecureValue(Kernel::HLERequestContext& ctx) { } void FS_USER::SetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x875, 6, 0); + IPC::RequestParser rp(ctx); auto archive_handle = rp.PopRaw(); u32 secure_value_slot = rp.Pop(); u64 value = rp.Pop(); @@ -901,7 +901,7 @@ void FS_USER::SetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { } void FS_USER::GetSaveDataSecureValue(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp(ctx, 0x876, 3, 0); + IPC::RequestParser rp(ctx); auto archive_handle = rp.PopRaw(); u32 secure_value_slot = rp.Pop(); @@ -1049,7 +1049,7 @@ FS_USER::FS_USER(Core::System& system) {0x082B, nullptr, "CardNorDirectRead_4xIO"}, {0x082C, nullptr, "CardNorDirectCpuWriteWithoutVerify"}, {0x082D, nullptr, "CardNorDirectSectorEraseWithoutVerify"}, - {0x082E, nullptr, "GetProductInfo"}, + {0x082E, &FS_USER::GetProductInfo, "GetProductInfo"}, {0x082F, &FS_USER::GetProgramLaunchInfo, "GetProgramLaunchInfo"}, {0x0830, &FS_USER::ObsoletedCreateExtSaveData, "Obsoleted_3_0_CreateExtSaveData"}, {0x0831, nullptr, "CreateSharedExtSaveData"}, @@ -1104,8 +1104,8 @@ FS_USER::FS_USER(Core::System& system) {0x0862, &FS_USER::SetPriority, "SetPriority"}, {0x0863, &FS_USER::GetPriority, "GetPriority"}, {0x0864, nullptr, "GetNandInfo"}, - {0x0865, &FS_USER::SetSaveDataSecureValue, "SetSaveDataSecureValue"}, - {0x0866, &FS_USER::GetSaveDataSecureValue, "GetSaveDataSecureValue"}, + {0x0865, &FS_USER::ObsoletedSetSaveDataSecureValue, "SetSaveDataSecureValue"}, + {0x0866, &FS_USER::ObsoletedGetSaveDataSecureValue, "GetSaveDataSecureValue"}, {0x0867, nullptr, "ControlSecureSave"}, {0x0868, nullptr, "GetMediaType"}, {0x0869, nullptr, "GetNandEraseCount"},