Use IPC:MakeHeader instead of hardcoded raw values for IPC command tables. (#6453)

* Use IPC:MakeHeader instead of hardcoded values for IPC command tables.

* Use u32 instead of unsigned int in MakeHeader function

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>

* Fix clang format

---------

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
This commit is contained in:
PabloMK7 2023-04-28 07:31:03 +02:00 committed by GitHub
parent 9bd8c9290b
commit 63bc0b59bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 1983 additions and 1896 deletions

View file

@ -11,14 +11,16 @@ namespace Service::NIM {
NIM_AOC::NIM_AOC() : ServiceFramework("nim:aoc", 2) {
const FunctionInfo functions[] = {
{0x00030042, nullptr, "SetApplicationId"},
{0x00040042, nullptr, "SetTin"},
{0x000902D0, nullptr, "ListContentSetsEx"},
{0x00180000, nullptr, "GetBalance"},
{0x001D0000, nullptr, "GetCustomerSupportCode"},
{0x00210000, nullptr, "Initialize"},
{0x00240282, nullptr, "CalculateContentsRequiredSize"},
{0x00250000, nullptr, "RefreshServerTime"},
// clang-format off
{IPC::MakeHeader(0x0003, 1, 2), nullptr, "SetApplicationId"},
{IPC::MakeHeader(0x0004, 1, 2), nullptr, "SetTin"},
{IPC::MakeHeader(0x0009, 11, 16), nullptr, "ListContentSetsEx"},
{IPC::MakeHeader(0x0018, 0, 0), nullptr, "GetBalance"},
{IPC::MakeHeader(0x001D, 0, 0), nullptr, "GetCustomerSupportCode"},
{IPC::MakeHeader(0x0021, 0, 0), nullptr, "Initialize"},
{IPC::MakeHeader(0x0024, 10, 2), nullptr, "CalculateContentsRequiredSize"},
{IPC::MakeHeader(0x0025, 0, 0), nullptr, "RefreshServerTime"},
// clang-format on
};
RegisterHandlers(functions);
}

View file

@ -11,11 +11,13 @@ namespace Service::NIM {
NIM_S::NIM_S() : ServiceFramework("nim:s", 1) {
const FunctionInfo functions[] = {
{0x000A0000, nullptr, "CheckSysupdateAvailableSOAP"},
{0x0016020A, nullptr, "ListTitles"},
{0x00290000, nullptr, "AccountCheckBalanceSOAP"},
{0x002D0042, nullptr, "DownloadTickets"},
{0x00420240, nullptr, "StartDownload"},
// clang-format off
{IPC::MakeHeader(0x000A, 0, 0), nullptr, "CheckSysupdateAvailableSOAP"},
{IPC::MakeHeader(0x0016, 8, 10), nullptr, "ListTitles"},
{IPC::MakeHeader(0x0029, 0, 0), nullptr, "AccountCheckBalanceSOAP"},
{IPC::MakeHeader(0x002D, 1, 2), nullptr, "DownloadTickets"},
{IPC::MakeHeader(0x0042, 9, 0), nullptr, "StartDownload"},
// clang-format on
};
RegisterHandlers(functions);
}

View file

@ -125,54 +125,54 @@ static_assert(sizeof(AutoDbgDat) == 0x108, "AutoDbgDat structure size is wrong")
NIM_U::NIM_U(Core::System& system) : ServiceFramework("nim:u", 2) {
const FunctionInfo functions[] = {
{0x00010000, &NIM_U::StartNetworkUpdate, "StartNetworkUpdate"},
{0x00020000, &NIM_U::GetProgress, "GetProgress"},
{0x00030000, &NIM_U::Cancel, "Cancel"},
{0x00040000, &NIM_U::CommitSystemTitles, "CommitSystemTitles"},
{0x00050000, &NIM_U::GetBackgroundEventForMenu, "GetBackgroundEventForMenu"},
{0x00060000, &NIM_U::GetBackgroundEventForNews, "GetBackgroundEventForNews"},
{0x00070000, &NIM_U::FormatSaveData, "FormatSaveData"},
{0x00080000, &NIM_U::GetCustomerSupportCode, "GetCustomerSupportCode"},
{0x00090000, &NIM_U::IsCommittableAllSystemTitles, "IsCommittableAllSystemTitles"},
{0x000A0000, &NIM_U::GetBackgroundProgress, "GetBackgroundProgress"},
{0x000B0000, &NIM_U::GetSavedHash, "GetSavedHash"},
{0x000C0082, &NIM_U::UnregisterTask, "UnregisterTask"},
{0x000D0080, &NIM_U::IsRegistered, "IsRegistered"},
{0x000E0080, &NIM_U::FindTaskInfo, "FindTaskInfo"},
{0x000F0042, &NIM_U::GetTaskInfos, "GetTaskInfos"},
{0x00100000, &NIM_U::DeleteUnmanagedContexts, "DeleteUnmanagedContexts"},
{0x00110000, &NIM_U::UpdateAutoTitleDownloadTasksAsync,
"UpdateAutoTitleDownloadTasksAsync"},
{0x00120000, &NIM_U::StartPendingAutoTitleDownloadTasksAsync,
"StartPendingAutoTitleDownloadTasksAsync"},
{0x00130000, &NIM_U::GetAsyncResult, "GetAsyncResult"},
{0x00140000, &NIM_U::CancelAsyncCall, "CancelAsyncCall"},
{0x00150000, &NIM_U::IsPendingAutoTitleDownloadTasks, "IsPendingAutoTitleDownloadTasks"},
{0x00160000, &NIM_U::GetNumAutoTitleDownloadTasks, "GetNumAutoTitleDownloadTasks"},
{0x00170042, &NIM_U::GetAutoTitleDownloadTaskInfos, "GetAutoTitleDownloadTaskInfos"},
{0x00180080, &NIM_U::CancelAutoTitleDownloadTask, "CancelAutoTitleDownloadTask"},
{0x00190002, &NIM_U::SetAutoDbgDat, "SetAutoDbgDat"},
{0x001A0002, &NIM_U::GetAutoDbgDat, "GetAutoDbgDat"},
{0x001B0042, &NIM_U::SetDbgTasks, "SetDbgTasks"},
{0x001C0042, &NIM_U::GetDbgTasks, "GetDbgTasks"},
{0x001D0000, &NIM_U::DeleteDbgData, "DeleteDbgData"},
{0x001E0042, &NIM_U::SetTslXml, "SetTslXml"},
{0x001F0000, &NIM_U::GetTslXmlSize, "GetTslXmlSize"},
{0x00200042, &NIM_U::GetTslXml, "GetTslXml"},
{0x00210000, &NIM_U::DeleteTslXml, "DeleteTslXml"},
{0x00220042, &NIM_U::SetDtlXml, "SetDtlXml"},
{0x00230000, &NIM_U::GetDtlXmlSize, "GetDtlXmlSize"},
{0x00240042, &NIM_U::GetDtlXml, "GetDtlXml"},
{0x00250000, &NIM_U::UpdateAccountStatus, "UpdateAccountStatus"},
{0x00260180, &NIM_U::StartTitleDownload, "StartTitleDownload"},
{0x00270000, &NIM_U::StopTitleDownload, "StopTitleDownload"},
{0x00280000, &NIM_U::GetTitleDownloadProgress, "GetTitleDownloadProgress"},
{0x00290246, &NIM_U::RegisterTask, "RegisterTask"},
{0x002A0000, &NIM_U::IsSystemUpdateAvailable, "IsSystemUpdateAvailable"},
{0x002B0000, &NIM_U::Unknown2B, "Unknown2B"},
{0x002C0000, &NIM_U::UpdateTickets, "UpdateTickets"},
{0x002D00C0, &NIM_U::DownloadTitleSeedAsync, "DownloadTitleSeedAsync"},
{0x002E0000, &NIM_U::DownloadMissingTitleSeedsAsync, "DownloadMissingTitleSeedsAsync"},
// clang-format off
{IPC::MakeHeader(0x0001, 0, 0), &NIM_U::StartNetworkUpdate, "StartNetworkUpdate"},
{IPC::MakeHeader(0x0002, 0, 0), &NIM_U::GetProgress, "GetProgress"},
{IPC::MakeHeader(0x0003, 0, 0), &NIM_U::Cancel, "Cancel"},
{IPC::MakeHeader(0x0004, 0, 0), &NIM_U::CommitSystemTitles, "CommitSystemTitles"},
{IPC::MakeHeader(0x0005, 0, 0), &NIM_U::GetBackgroundEventForMenu, "GetBackgroundEventForMenu"},
{IPC::MakeHeader(0x0006, 0, 0), &NIM_U::GetBackgroundEventForNews, "GetBackgroundEventForNews"},
{IPC::MakeHeader(0x0007, 0, 0), &NIM_U::FormatSaveData, "FormatSaveData"},
{IPC::MakeHeader(0x0008, 0, 0), &NIM_U::GetCustomerSupportCode, "GetCustomerSupportCode"},
{IPC::MakeHeader(0x0009, 0, 0), &NIM_U::IsCommittableAllSystemTitles, "IsCommittableAllSystemTitles"},
{IPC::MakeHeader(0x000A, 0, 0), &NIM_U::GetBackgroundProgress, "GetBackgroundProgress"},
{IPC::MakeHeader(0x000B, 0, 0), &NIM_U::GetSavedHash, "GetSavedHash"},
{IPC::MakeHeader(0x000C, 2, 2), &NIM_U::UnregisterTask, "UnregisterTask"},
{IPC::MakeHeader(0x000D, 2, 0), &NIM_U::IsRegistered, "IsRegistered"},
{IPC::MakeHeader(0x000E, 2, 0), &NIM_U::FindTaskInfo, "FindTaskInfo"},
{IPC::MakeHeader(0x000F, 1, 2), &NIM_U::GetTaskInfos, "GetTaskInfos"},
{IPC::MakeHeader(0x0010, 0, 0), &NIM_U::DeleteUnmanagedContexts, "DeleteUnmanagedContexts"},
{IPC::MakeHeader(0x0011, 0, 0), &NIM_U::UpdateAutoTitleDownloadTasksAsync, "UpdateAutoTitleDownloadTasksAsync"},
{IPC::MakeHeader(0x0012, 0, 0), &NIM_U::StartPendingAutoTitleDownloadTasksAsync, "StartPendingAutoTitleDownloadTasksAsync"},
{IPC::MakeHeader(0x0013, 0, 0), &NIM_U::GetAsyncResult, "GetAsyncResult"},
{IPC::MakeHeader(0x0014, 0, 0), &NIM_U::CancelAsyncCall, "CancelAsyncCall"},
{IPC::MakeHeader(0x0015, 0, 0), &NIM_U::IsPendingAutoTitleDownloadTasks, "IsPendingAutoTitleDownloadTasks"},
{IPC::MakeHeader(0x0016, 0, 0), &NIM_U::GetNumAutoTitleDownloadTasks, "GetNumAutoTitleDownloadTasks"},
{IPC::MakeHeader(0x0017, 1, 2), &NIM_U::GetAutoTitleDownloadTaskInfos, "GetAutoTitleDownloadTaskInfos"},
{IPC::MakeHeader(0x0018, 2, 0), &NIM_U::CancelAutoTitleDownloadTask, "CancelAutoTitleDownloadTask"},
{IPC::MakeHeader(0x0019, 0, 2), &NIM_U::SetAutoDbgDat, "SetAutoDbgDat"},
{IPC::MakeHeader(0x001A, 0, 2), &NIM_U::GetAutoDbgDat, "GetAutoDbgDat"},
{IPC::MakeHeader(0x001B, 1, 2), &NIM_U::SetDbgTasks, "SetDbgTasks"},
{IPC::MakeHeader(0x001C, 1, 2), &NIM_U::GetDbgTasks, "GetDbgTasks"},
{IPC::MakeHeader(0x001D, 0, 0), &NIM_U::DeleteDbgData, "DeleteDbgData"},
{IPC::MakeHeader(0x001E, 1, 2), &NIM_U::SetTslXml, "SetTslXml"},
{IPC::MakeHeader(0x001F, 0, 0), &NIM_U::GetTslXmlSize, "GetTslXmlSize"},
{IPC::MakeHeader(0x0020, 1, 2), &NIM_U::GetTslXml, "GetTslXml"},
{IPC::MakeHeader(0x0021, 0, 0), &NIM_U::DeleteTslXml, "DeleteTslXml"},
{IPC::MakeHeader(0x0022, 1, 2), &NIM_U::SetDtlXml, "SetDtlXml"},
{IPC::MakeHeader(0x0023, 0, 0), &NIM_U::GetDtlXmlSize, "GetDtlXmlSize"},
{IPC::MakeHeader(0x0024, 1, 2), &NIM_U::GetDtlXml, "GetDtlXml"},
{IPC::MakeHeader(0x0025, 0, 0), &NIM_U::UpdateAccountStatus, "UpdateAccountStatus"},
{IPC::MakeHeader(0x0026, 6, 0), &NIM_U::StartTitleDownload, "StartTitleDownload"},
{IPC::MakeHeader(0x0027, 0, 0), &NIM_U::StopTitleDownload, "StopTitleDownload"},
{IPC::MakeHeader(0x0028, 0, 0), &NIM_U::GetTitleDownloadProgress, "GetTitleDownloadProgress"},
{IPC::MakeHeader(0x0029, 9, 6), &NIM_U::RegisterTask, "RegisterTask"},
{IPC::MakeHeader(0x002A, 0, 0), &NIM_U::IsSystemUpdateAvailable, "IsSystemUpdateAvailable"},
{IPC::MakeHeader(0x002B, 0, 0), &NIM_U::Unknown2B, "Unknown2B"},
{IPC::MakeHeader(0x002C, 0, 0), &NIM_U::UpdateTickets, "UpdateTickets"},
{IPC::MakeHeader(0x002D, 3, 0), &NIM_U::DownloadTitleSeedAsync, "DownloadTitleSeedAsync"},
{IPC::MakeHeader(0x002E, 0, 0), &NIM_U::DownloadMissingTitleSeedsAsync, "DownloadMissingTitleSeedsAsync"},
// clang-format on
};
RegisterHandlers(functions);
nim_system_update_event_for_menu =