diff --git a/stratosphere/ams_mitm/source/bpc_mitm/bpc_ams_service.hpp b/stratosphere/ams_mitm/source/bpc_mitm/bpc_ams_service.hpp index f13a34647..21c9a864c 100644 --- a/stratosphere/ams_mitm/source/bpc_mitm/bpc_ams_service.hpp +++ b/stratosphere/ams_mitm/source/bpc_mitm/bpc_ams_service.hpp @@ -20,15 +20,14 @@ #include "../utils.hpp" -enum BpcAtmosphereCmd : u32 { - BpcAtmosphereCmd_RebootToFatalError = 65000, -}; - class BpcAtmosphereService : public IServiceObject { + enum class CommandId { + RebootToFatalError = 65000, + }; private: Result RebootToFatalError(InBuffer ctx); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(BpcAtmosphereService, RebootToFatalError), }; }; diff --git a/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp b/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp index a45f59e9d..d4d91e4e6 100644 --- a/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp @@ -20,12 +20,12 @@ #include "../utils.hpp" -enum BpcCmd : u32 { - BpcCmd_ShutdownSystem = 0, - BpcCmd_RebootSystem = 1, -}; - class BpcMitmService : public IMitmServiceObject { + private: + enum class CommandId { + ShutdownSystem = 0, + RebootSystem = 1, + }; public: BpcMitmService(std::shared_ptr s, u64 pid) : IMitmServiceObject(s, pid) { /* ... */ @@ -48,7 +48,7 @@ class BpcMitmService : public IMitmServiceObject { Result RebootSystem(); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(BpcMitmService, ShutdownSystem), + MAKE_SERVICE_COMMAND_META(BpcMitmService, RebootSystem), }; }; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_idirectory.hpp b/stratosphere/ams_mitm/source/fs_mitm/fs_idirectory.hpp index fa8ee1570..ff977b3fe 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_idirectory.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_idirectory.hpp @@ -18,11 +18,6 @@ #include #include -enum FsIDirectoryCmd : u32 { - FsIDirectoryCmd_Read = 0, - FsIDirectoryCmd_GetEntryCount = 1, -}; - class IDirectory { public: virtual ~IDirectory() {} @@ -56,6 +51,11 @@ class IDirectory { }; class IDirectoryInterface : public IServiceObject { + private: + enum class CommandId { + Read = 0, + GetEntryCount = 1, + }; private: std::unique_ptr base_dir; public: @@ -77,8 +77,8 @@ class IDirectoryInterface : public IServiceObject { public: DEFINE_SERVICE_DISPATCH_TABLE { /* 1.0.0- */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IDirectoryInterface, Read), + MAKE_SERVICE_COMMAND_META(IDirectoryInterface, GetEntryCount), }; }; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_ifile.hpp b/stratosphere/ams_mitm/source/fs_mitm/fs_ifile.hpp index d292e468f..303945e8e 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_ifile.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_ifile.hpp @@ -20,15 +20,6 @@ #include "fs_shim.h" -enum FsIFileCmd : u32 { - FsIFileCmd_Read = 0, - FsIFileCmd_Write = 1, - FsIFileCmd_Flush = 2, - FsIFileCmd_SetSize = 3, - FsIFileCmd_GetSize = 4, - FsIFileCmd_OperateRange = 5, -}; - class IFile { public: virtual ~IFile() {} @@ -106,6 +97,15 @@ class IFile { }; class IFileInterface : public IServiceObject { + private: + enum class CommandId { + Read = 0, + Write = 1, + Flush = 2, + SetSize = 3, + GetSize = 4, + OperateRange = 5, + }; private: std::unique_ptr base_file; public: @@ -139,14 +139,14 @@ class IFileInterface : public IServiceObject { public: DEFINE_SERVICE_DISPATCH_TABLE { /* 1.0.0- */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IFileInterface, Read), + MAKE_SERVICE_COMMAND_META(IFileInterface, Write), + MAKE_SERVICE_COMMAND_META(IFileInterface, Flush), + MAKE_SERVICE_COMMAND_META(IFileInterface, SetSize), + MAKE_SERVICE_COMMAND_META(IFileInterface, GetSize), /* 4.0.0- */ - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IFileInterface, OperateRange, FirmwareVersion_400), }; }; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_ifilesystem.hpp b/stratosphere/ams_mitm/source/fs_mitm/fs_ifilesystem.hpp index 0feef616d..9b7c05e23 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_ifilesystem.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_ifilesystem.hpp @@ -26,30 +26,6 @@ #include "fs_ifile.hpp" #include "fs_idirectory.hpp" -enum FsIFileSystemCmd : u32 { - /* 1.0.0+ */ - FsIFileSystemCmd_CreateFile = 0, - FsIFileSystemCmd_DeleteFile = 1, - FsIFileSystemCmd_CreateDirectory = 2, - FsIFileSystemCmd_DeleteDirectory = 3, - FsIFileSystemCmd_DeleteDirectoryRecursively = 4, - FsIFileSystemCmd_RenameFile = 5, - FsIFileSystemCmd_RenameDirectory = 6, - FsIFileSystemCmd_GetEntryType = 7, - FsIFileSystemCmd_OpenFile = 8, - FsIFileSystemCmd_OpenDirectory = 9, - FsIFileSystemCmd_Commit = 10, - FsIFileSystemCmd_GetFreeSpaceSize = 11, - FsIFileSystemCmd_GetTotalSpaceSize = 12, - - /* 3.0.0+ */ - FsIFileSystemCmd_CleanDirectoryRecursively = 13, - FsIFileSystemCmd_GetFileTimeStampRaw = 14, - - /* 4.0.0+ */ - FsIFileSystemCmd_QueryEntry = 15, -}; - class IFile; class IDirectory; @@ -197,6 +173,30 @@ class IFileSystem { }; class IFileSystemInterface : public IServiceObject { + private: + enum class CommandId { + /* 1.0.0+ */ + CreateFile = 0, + DeleteFile = 1, + CreateDirectory = 2, + DeleteDirectory = 3, + DeleteDirectoryRecursively = 4, + RenameFile = 5, + RenameDirectory = 6, + GetEntryType = 7, + OpenFile = 8, + OpenDirectory = 9, + Commit = 10, + GetFreeSpaceSize = 11, + GetTotalSpaceSize = 12, + + /* 3.0.0+ */ + CleanDirectoryRecursively = 13, + GetFileTimeStampRaw = 14, + + /* 4.0.0+ */ + QueryEntry = 15, + }; private: std::unique_ptr unique_fs; std::shared_ptr shared_fs; @@ -342,26 +342,26 @@ class IFileSystemInterface : public IServiceObject { public: DEFINE_SERVICE_DISPATCH_TABLE { /* 1.0.0- */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, CreateFile), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, DeleteFile), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, CreateDirectory), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, DeleteDirectory), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, DeleteDirectoryRecursively), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, RenameFile), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, RenameDirectory), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetEntryType), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, OpenFile), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, OpenDirectory), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, Commit), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetFreeSpaceSize), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetTotalSpaceSize), /* 3.0.0- */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, CleanDirectoryRecursively, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetFileTimeStampRaw, FirmwareVersion_300), /* 4.0.0- */ - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IFileSystemInterface, QueryEntry, FirmwareVersion_400), }; }; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_istorage.hpp b/stratosphere/ams_mitm/source/fs_mitm/fs_istorage.hpp index 02338bde7..5ea138326 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_istorage.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_istorage.hpp @@ -21,15 +21,6 @@ #include "../debug.hpp" -enum FsIStorageCmd : u32 { - FsIStorageCmd_Read = 0, - FsIStorageCmd_Write = 1, - FsIStorageCmd_Flush = 2, - FsIStorageCmd_SetSize = 3, - FsIStorageCmd_GetSize = 4, - FsIStorageCmd_OperateRange = 5, -}; - class IStorage { public: virtual ~IStorage(); @@ -47,6 +38,15 @@ class IStorage { }; class IStorageInterface : public IServiceObject { + private: + enum class CommandId { + Read = 0, + Write = 1, + Flush = 2, + SetSize = 3, + GetSize = 4, + OperateRange = 5, + }; private: IStorage *base_storage; public: @@ -81,14 +81,14 @@ class IStorageInterface : public IServiceObject { public: DEFINE_SERVICE_DISPATCH_TABLE { /* 1.0.0- */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IStorageInterface, Read), + MAKE_SERVICE_COMMAND_META(IStorageInterface, Write), + MAKE_SERVICE_COMMAND_META(IStorageInterface, Flush), + MAKE_SERVICE_COMMAND_META(IStorageInterface, SetSize), + MAKE_SERVICE_COMMAND_META(IStorageInterface, GetSize), /* 4.0.0- */ - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(IStorageInterface, OperateRange, FirmwareVersion_400), }; }; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp index e5d53458c..98d08a9d3 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp @@ -69,8 +69,8 @@ static void StorageCacheSetEntry(u64 title_id, std::shared_ptr(obj); - switch ((FspSrvCmd)ctx->cmd_id) { - case FspSrvCmd_SetCurrentProcess: + switch (static_cast(ctx->cmd_id)) { + case CommandId::SetCurrentProcess: if (R_SUCCEEDED(ctx->rc)) { this_ptr->has_initialized = true; this_ptr->process_id = ctx->request.Pid; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp index 54f8b6ff6..ed2ee56c6 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp @@ -21,24 +21,23 @@ #include "fs_ifilesystem.hpp" #include "../utils.hpp" -enum FspSrvCmd : u32 { - FspSrvCmd_OpenFileSystemDeprecated = 0, - - FspSrvCmd_SetCurrentProcess = 1, - - FspSrvCmd_OpenFileSystemWithPatch = 7, - FspSrvCmd_OpenFileSystemWithId = 8, - - FspSrvCmd_OpenSdCardFileSystem = 18, - - FspSrvCmd_OpenSaveDataFileSystem = 51, - - FspSrvCmd_OpenBisStorage = 12, - FspSrvCmd_OpenDataStorageByCurrentProcess = 200, - FspSrvCmd_OpenDataStorageByDataId = 202, -}; - class FsMitmService : public IMitmServiceObject { + private: + enum class CommandId { + OpenFileSystemDeprecated = 0, + + SetCurrentProcess = 1, + OpenFileSystemWithPatch = 7, + OpenFileSystemWithId = 8, + + OpenSdCardFileSystem = 18, + + OpenSaveDataFileSystem = 51, + + OpenBisStorage = 12, + OpenDataStorageByCurrentProcess = 200, + OpenDataStorageByDataId = 202, + }; private: static constexpr const char *AtmosphereHblWebContentDir = "/atmosphere/hbl_html"; private: @@ -84,13 +83,13 @@ class FsMitmService : public IMitmServiceObject { Result OpenDataStorageByDataId(Out> out, u64 data_id, u8 storage_id); public: DEFINE_SERVICE_DISPATCH_TABLE { - /* TODO MakeServiceCommandMeta(), */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + /* TODO MAKE_SERVICE_COMMAND_META(FsMitmService, OpenFileSystemDeprecated), */ + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenFileSystemWithPatch, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenFileSystemWithId, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenSdCardFileSystem), + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenSaveDataFileSystem), + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenBisStorage), + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenDataStorageByCurrentProcess), + MAKE_SERVICE_COMMAND_META(FsMitmService, OpenDataStorageByDataId), }; }; diff --git a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp index d83a084b4..5f74262b4 100644 --- a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp +++ b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp @@ -20,9 +20,13 @@ #include "../utils.hpp" -#include "nsmitm_service_common.hpp" - class NsAmMitmService : public IMitmServiceObject { + private: + enum class CommandId { + GetApplicationContentPath = 21, + ResolveApplicationContentPath = 23, + GetRunningApplicationProgramId = 92, + }; public: NsAmMitmService(std::shared_ptr s, u64 pid) : IMitmServiceObject(s, pid) { /* ... */ @@ -44,8 +48,8 @@ class NsAmMitmService : public IMitmServiceObject { Result GetRunningApplicationProgramId(Out out_tid, u64 app_id); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(NsAmMitmService, GetApplicationContentPath), + MAKE_SERVICE_COMMAND_META(NsAmMitmService, ResolveApplicationContentPath), + MAKE_SERVICE_COMMAND_META(NsAmMitmService, GetRunningApplicationProgramId, FirmwareVersion_600), }; }; diff --git a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_service_common.hpp b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_service_common.hpp deleted file mode 100644 index 5f550811a..000000000 --- a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_service_common.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2018-2019 Atmosphère-NX - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once -#include -#include - -#include "../utils.hpp" - -enum NsGetterCmd : u32 { - NsGetterCmd_GetDocumentInterface = 7999, -}; - -enum NsSrvCmd : u32 { - NsSrvCmd_GetApplicationContentPath = 21, - NsSrvCmd_ResolveApplicationContentPath = 23, - NsSrvCmd_GetRunningApplicationProgramId = 92, -}; diff --git a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp index 9b84d1ba2..2090afbe8 100644 --- a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp +++ b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp @@ -20,10 +20,15 @@ #include "../utils.hpp" -#include "nsmitm_service_common.hpp" #include "ns_shim.h" class NsDocumentService : public IServiceObject { + private: + enum class CommandId { + GetApplicationContentPath = 21, + ResolveApplicationContentPath = 23, + GetRunningApplicationProgramId = 92, + }; private: u64 title_id; std::unique_ptr srv; @@ -50,13 +55,17 @@ class NsDocumentService : public IServiceObject { Result GetRunningApplicationProgramId(Out out_tid, u64 app_id); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(NsDocumentService, GetApplicationContentPath), + MAKE_SERVICE_COMMAND_META(NsDocumentService, ResolveApplicationContentPath), + MAKE_SERVICE_COMMAND_META(NsDocumentService, GetRunningApplicationProgramId, FirmwareVersion_600), }; }; class NsWebMitmService : public IMitmServiceObject { + private: + enum class CommandId { + GetDocumentInterface = 7999, + }; public: NsWebMitmService(std::shared_ptr s, u64 pid) : IMitmServiceObject(s, pid) { /* ... */ @@ -76,6 +85,6 @@ class NsWebMitmService : public IMitmServiceObject { Result GetDocumentInterface(Out> out_intf); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(NsWebMitmService, GetDocumentInterface, FirmwareVersion_300), }; }; diff --git a/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp b/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp index 59a46b88e..2e28bc60c 100644 --- a/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp @@ -20,16 +20,16 @@ #include "../utils.hpp" -enum SetCmd : u32 { - SetCmd_GetLanguageCode = 0, - SetCmd_GetRegionCode = 4, - - /* Commands for which set:sys *must* act as a passthrough. */ - /* TODO: Solve the relevant IPC detection problem. */ - SetCmd_GetAvailableLanguageCodes = 1, -}; - class SetMitmService : public IMitmServiceObject { + private: + enum class CommandId { + GetLanguageCode = 0, + GetRegionCode = 4, + + /* Commands for which set:sys *must* act as a passthrough. */ + /* TODO: Solve the relevant IPC detection problem. */ + GetAvailableLanguageCodes = 1, + }; private: HosMutex lock; OverrideLocale locale; @@ -60,9 +60,9 @@ class SetMitmService : public IMitmServiceObject { Result GetAvailableLanguageCodes(OutPointerWithClientSize out_language_codes, Out out_count); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(SetMitmService, GetLanguageCode), + MAKE_SERVICE_COMMAND_META(SetMitmService, GetRegionCode), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(SetMitmService, GetAvailableLanguageCodes), }; }; diff --git a/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp b/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp index 7d3275b1c..63f6c4c96 100644 --- a/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp @@ -20,18 +20,18 @@ #include "setsys_shim.h" -enum SetSysCmd : u32 { - SetSysCmd_GetFirmwareVersion = 3, - SetSysCmd_GetFirmwareVersion2 = 4, - SetSysCmd_GetSettingsItemValueSize = 37, - SetSysCmd_GetSettingsItemValue = 38, - - /* Commands for which set:sys *must* act as a passthrough. */ - /* TODO: Solve the relevant IPC detection problem. */ - SetSysCmd_GetEdid = 41, -}; - class SetSysMitmService : public IMitmServiceObject { + private: + enum class CommandId { + GetFirmwareVersion = 3, + GetFirmwareVersion2 = 4, + GetSettingsItemValueSize = 37, + GetSettingsItemValue = 38, + + /* Commands for which set:sys *must* act as a passthrough. */ + /* TODO: Solve the relevant IPC detection problem. */ + GetEdid = 41, + }; public: SetSysMitmService(std::shared_ptr s, u64 pid) : IMitmServiceObject(s, pid) { /* ... */ @@ -55,11 +55,11 @@ class SetSysMitmService : public IMitmServiceObject { Result GetEdid(OutPointerWithServerSize out); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetFirmwareVersion), + MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetFirmwareVersion2), + MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetSettingsItemValueSize), + MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetSettingsItemValue), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetEdid), }; }; diff --git a/stratosphere/dmnt/source/dmnt_cheat_service.hpp b/stratosphere/dmnt/source/dmnt_cheat_service.hpp index eedfb27f0..b473d788e 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_service.hpp +++ b/stratosphere/dmnt/source/dmnt_cheat_service.hpp @@ -20,37 +20,37 @@ #include "dmnt_cheat_types.hpp" -enum DmntCheatCmd { - /* Meta */ - DmntCheat_Cmd_HasCheatProcess = 65000, - DmntCheat_Cmd_GetCheatProcessEvent = 65001, - DmntCheat_Cmd_GetCheatProcessMetadata = 65002, - DmntCheat_Cmd_ForceOpenCheatProcess = 65003, - - /* Interact with Memory */ - DmntCheat_Cmd_GetCheatProcessMappingCount = 65100, - DmntCheat_Cmd_GetCheatProcessMappings = 65101, - DmntCheat_Cmd_ReadCheatProcessMemory = 65102, - DmntCheat_Cmd_WriteCheatProcessMemory = 65103, - DmntCheat_Cmd_QueryCheatProcessMemory = 65104, - - /* Interact with Cheats */ - DmntCheat_Cmd_GetCheatCount = 65200, - DmntCheat_Cmd_GetCheats = 65201, - DmntCheat_Cmd_GetCheatById = 65202, - DmntCheat_Cmd_ToggleCheat = 65203, - DmntCheat_Cmd_AddCheat = 65204, - DmntCheat_Cmd_RemoveCheat = 65205, - - /* Interact with Frozen Addresses */ - DmntCheat_Cmd_GetFrozenAddressCount = 65300, - DmntCheat_Cmd_GetFrozenAddresses = 65301, - DmntCheat_Cmd_GetFrozenAddress = 65302, - DmntCheat_Cmd_EnableFrozenAddress = 65303, - DmntCheat_Cmd_DisableFrozenAddress = 65304, -}; - class DmntCheatService final : public IServiceObject { + private: + enum class CommandId { + /* Meta */ + HasCheatProcess = 65000, + GetCheatProcessEvent = 65001, + GetCheatProcessMetadata = 65002, + ForceOpenCheatProcess = 65003, + + /* Interact with Memory */ + GetCheatProcessMappingCount = 65100, + GetCheatProcessMappings = 65101, + ReadCheatProcessMemory = 65102, + WriteCheatProcessMemory = 65103, + QueryCheatProcessMemory = 65104, + + /* Interact with Cheats */ + GetCheatCount = 65200, + GetCheats = 65201, + GetCheatById = 65202, + ToggleCheat = 65203, + AddCheat = 65204, + RemoveCheat = 65205, + + /* Interact with Frozen Addresses */ + GetFrozenAddressCount = 65300, + GetFrozenAddresses = 65301, + GetFrozenAddress = 65302, + EnableFrozenAddress = 65303, + DisableFrozenAddress = 65304, + }; private: void HasCheatProcess(Out out); void GetCheatProcessEvent(Out out_event); @@ -78,28 +78,28 @@ class DmntCheatService final : public IServiceObject { public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DmntCheatService, HasCheatProcess), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessEvent), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessMetadata), + MAKE_SERVICE_COMMAND_META(DmntCheatService, ForceOpenCheatProcess), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessMappingCount), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessMappings), + MAKE_SERVICE_COMMAND_META(DmntCheatService, ReadCheatProcessMemory), + MAKE_SERVICE_COMMAND_META(DmntCheatService, WriteCheatProcessMemory), + MAKE_SERVICE_COMMAND_META(DmntCheatService, QueryCheatProcessMemory), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatCount), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheats), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatById), + MAKE_SERVICE_COMMAND_META(DmntCheatService, ToggleCheat), + MAKE_SERVICE_COMMAND_META(DmntCheatService, AddCheat), + MAKE_SERVICE_COMMAND_META(DmntCheatService, RemoveCheat), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetFrozenAddressCount), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetFrozenAddresses), + MAKE_SERVICE_COMMAND_META(DmntCheatService, GetFrozenAddress), + MAKE_SERVICE_COMMAND_META(DmntCheatService, EnableFrozenAddress), + MAKE_SERVICE_COMMAND_META(DmntCheatService, DisableFrozenAddress), }; }; diff --git a/stratosphere/dmnt/source/dmnt_service.hpp b/stratosphere/dmnt/source/dmnt_service.hpp index 378a37a2a..9974f23fd 100644 --- a/stratosphere/dmnt/source/dmnt_service.hpp +++ b/stratosphere/dmnt/source/dmnt_service.hpp @@ -18,62 +18,62 @@ #include #include -enum DmntCmd { - DebugMonitor_Cmd_BreakDebugProcess = 0, - DebugMonitor_Cmd_TerminateDebugProcess = 1, - DebugMonitor_Cmd_CloseHandle = 2, - DebugMonitor_Cmd_LoadImage = 3, - DebugMonitor_Cmd_GetProcessId = 4, - DebugMonitor_Cmd_GetProcessHandle = 5, - DebugMonitor_Cmd_WaitSynchronization = 6, - DebugMonitor_Cmd_GetDebugEvent = 7, - DebugMonitor_Cmd_GetProcessModuleInfo = 8, - DebugMonitor_Cmd_GetProcessList = 9, - DebugMonitor_Cmd_GetThreadList = 10, - DebugMonitor_Cmd_GetDebugThreadContext = 11, - DebugMonitor_Cmd_ContinueDebugEvent = 12, - DebugMonitor_Cmd_ReadDebugProcessMemory = 13, - DebugMonitor_Cmd_WriteDebugProcessMemory = 14, - DebugMonitor_Cmd_SetDebugThreadContext = 15, - DebugMonitor_Cmd_GetDebugThreadParam = 16, - DebugMonitor_Cmd_InitializeThreadInfo = 17, - DebugMonitor_Cmd_SetHardwareBreakPoint = 18, - DebugMonitor_Cmd_QueryDebugProcessMemory = 19, - DebugMonitor_Cmd_GetProcessMemoryDetails = 20, - DebugMonitor_Cmd_AttachByProgramId = 21, - DebugMonitor_Cmd_AttachOnLaunch = 22, - DebugMonitor_Cmd_GetDebugMonitorProcessId = 23, - DebugMonitor_Cmd_GetJitDebugProcessList = 25, - DebugMonitor_Cmd_CreateCoreDump = 26, - DebugMonitor_Cmd_GetAllDebugThreadInfo = 27, - DebugMonitor_Cmd_TargetIO_FileOpen = 29, - DebugMonitor_Cmd_TargetIO_FileClose = 30, - DebugMonitor_Cmd_TargetIO_FileRead = 31, - DebugMonitor_Cmd_TargetIO_FileWrite = 32, - DebugMonitor_Cmd_TargetIO_FileSetAttributes = 33, - DebugMonitor_Cmd_TargetIO_FileGetInformation = 34, - DebugMonitor_Cmd_TargetIO_FileSetTime = 35, - DebugMonitor_Cmd_TargetIO_FileSetSize = 36, - DebugMonitor_Cmd_TargetIO_FileDelete = 37, - DebugMonitor_Cmd_TargetIO_FileMove = 38, - DebugMonitor_Cmd_TargetIO_DirectoryCreate = 39, - DebugMonitor_Cmd_TargetIO_DirectoryDelete = 40, - DebugMonitor_Cmd_TargetIO_DirectoryRename = 41, - DebugMonitor_Cmd_TargetIO_DirectoryGetCount = 42, - DebugMonitor_Cmd_TargetIO_DirectoryOpen = 43, - DebugMonitor_Cmd_TargetIO_DirectoryGetNext = 44, - DebugMonitor_Cmd_TargetIO_DirectoryClose = 45, - DebugMonitor_Cmd_TargetIO_GetFreeSpace = 46, - DebugMonitor_Cmd_TargetIO_GetVolumeInformation = 47, - DebugMonitor_Cmd_InitiateCoreDump = 48, - DebugMonitor_Cmd_ContinueCoreDump = 49, - DebugMonitor_Cmd_AddTTYToCoreDump = 50, - DebugMonitor_Cmd_AddImageToCoreDump = 51, - DebugMonitor_Cmd_CloseCoreDump = 52, - DebugMonitor_Cmd_CancelAttach = 53, -}; - class DebugMonitorService final : public IServiceObject { + private: + enum class CommandId { + BreakDebugProcess = 0, + TerminateDebugProcess = 1, + CloseHandle = 2, + LoadImage = 3, + GetProcessId = 4, + GetProcessHandle = 5, + WaitSynchronization = 6, + GetDebugEvent = 7, + GetProcessModuleInfo = 8, + GetProcessList = 9, + GetThreadList = 10, + GetDebugThreadContext = 11, + ContinueDebugEvent = 12, + ReadDebugProcessMemory = 13, + WriteDebugProcessMemory = 14, + SetDebugThreadContext = 15, + GetDebugThreadParam = 16, + InitializeThreadInfo = 17, + SetHardwareBreakPoint = 18, + QueryDebugProcessMemory = 19, + GetProcessMemoryDetails = 20, + AttachByProgramId = 21, + AttachOnLaunch = 22, + GetDebugMonitorProcessId = 23, + GetJitDebugProcessList = 25, + CreateCoreDump = 26, + GetAllDebugThreadInfo = 27, + TargetIO_FileOpen = 29, + TargetIO_FileClose = 30, + TargetIO_FileRead = 31, + TargetIO_FileWrite = 32, + TargetIO_FileSetAttributes = 33, + TargetIO_FileGetInformation = 34, + TargetIO_FileSetTime = 35, + TargetIO_FileSetSize = 36, + TargetIO_FileDelete = 37, + TargetIO_FileMove = 38, + TargetIO_DirectoryCreate = 39, + TargetIO_DirectoryDelete = 40, + TargetIO_DirectoryRename = 41, + TargetIO_DirectoryGetCount = 42, + TargetIO_DirectoryOpen = 43, + TargetIO_DirectoryGetNext = 44, + TargetIO_DirectoryClose = 45, + TargetIO_GetFreeSpace = 46, + TargetIO_GetVolumeInformation = 47, + InitiateCoreDump = 48, + ContinueCoreDump = 49, + AddTTYToCoreDump = 50, + AddImageToCoreDump = 51, + CloseCoreDump = 52, + CancelAttach = 53, + }; private: Result BreakDebugProcess(Handle debug_hnd); Result TerminateDebugProcess(Handle debug_hnd); @@ -94,57 +94,57 @@ class DebugMonitorService final : public IServiceObject { Result TargetIO_FileMove(InBuffer path0, InBuffer path1); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - //MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), - // MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, BreakDebugProcess), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TerminateDebugProcess), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, CloseHandle), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, LoadImage), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessId), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessHandle), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, WaitSynchronization), + //MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugEvent), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessModuleInfo), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessList), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetThreadList), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugThreadContext), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, ContinueDebugEvent), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, ReadDebugProcessMemory), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, WriteDebugProcessMemory), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, SetDebugThreadContext), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugThreadParam), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, InitializeThreadInfo), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, SetHardwareBreakPoint), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, QueryDebugProcessMemory), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessMemoryDetails), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, AttachByProgramId), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, AttachOnLaunch), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugMonitorProcessId), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetJitDebugProcessList), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, CreateCoreDump), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetAllDebugThreadInfo), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileOpen), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileClose), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileRead), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileWrite), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileSetAttributes), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileGetInformation), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileSetTime), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileSetSize), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileDelete), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileMove), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryCreate), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryDelete), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryRename), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryGetCount), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryOpen), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryGetNext), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryClose), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_GetFreeSpace), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_GetVolumeInformation), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, InitiateCoreDump), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, ContinueCoreDump), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, AddTTYToCoreDump), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, AddImageToCoreDump), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, CloseCoreDump), + // MAKE_SERVICE_COMMAND_META(DebugMonitorService, CancelAttach), }; }; diff --git a/stratosphere/fatal/source/fatal_private.hpp b/stratosphere/fatal/source/fatal_private.hpp index 143e10c15..887623e9a 100644 --- a/stratosphere/fatal/source/fatal_private.hpp +++ b/stratosphere/fatal/source/fatal_private.hpp @@ -18,16 +18,16 @@ #include #include -enum PrivateCmd { - Private_Cmd_GetFatalEvent = 0, -}; - class PrivateService final : public IServiceObject { + private: + enum class CommandId { + GetFatalEvent = 0, + }; private: /* Actual commands. */ Result GetFatalEvent(Out out_h); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(PrivateService, GetFatalEvent), }; }; diff --git a/stratosphere/fatal/source/fatal_user.hpp b/stratosphere/fatal/source/fatal_user.hpp index 1ba64e24c..34b3846ef 100644 --- a/stratosphere/fatal/source/fatal_user.hpp +++ b/stratosphere/fatal/source/fatal_user.hpp @@ -20,13 +20,13 @@ #include "fatal_types.hpp" -enum UserCmd { - User_Cmd_ThrowFatal = 0, - User_Cmd_ThrowFatalWithPolicy = 1, - User_Cmd_ThrowFatalWithCpuContext = 2, -}; - class UserService final : public IServiceObject { + private: + enum class CommandId { + ThrowFatal = 0, + ThrowFatalWithPolicy = 1, + ThrowFatalWithCpuContext = 2, + }; private: /* Actual commands. */ Result ThrowFatal(u32 error, PidDescriptor pid_desc); @@ -34,8 +34,8 @@ class UserService final : public IServiceObject { Result ThrowFatalWithCpuContext(u32 error, PidDescriptor pid_desc, FatalType policy, InBuffer _ctx); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(UserService, ThrowFatal), + MAKE_SERVICE_COMMAND_META(UserService, ThrowFatalWithPolicy), + MAKE_SERVICE_COMMAND_META(UserService, ThrowFatalWithCpuContext), }; }; diff --git a/stratosphere/libstratosphere b/stratosphere/libstratosphere index 403f1c7a0..3f6df380c 160000 --- a/stratosphere/libstratosphere +++ b/stratosphere/libstratosphere @@ -1 +1 @@ -Subproject commit 403f1c7a014c47bf7e907da04df9f9b591b9f89f +Subproject commit 3f6df380c8becb4ba0a013cf0533364163a741d8 diff --git a/stratosphere/loader/source/ldr_loader_service.hpp b/stratosphere/loader/source/ldr_loader_service.hpp index 456a3dc57..5a14924ca 100644 --- a/stratosphere/loader/source/ldr_loader_service.hpp +++ b/stratosphere/loader/source/ldr_loader_service.hpp @@ -56,12 +56,12 @@ namespace sts::ldr { }; public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, CreateProcess), + MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, GetProgramInfo), + MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, PinTitle), + MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, UnpinTitle), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, AtmosphereHasLaunchedTitle), }; }; @@ -80,11 +80,11 @@ namespace sts::ldr { }; public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, SetTitleArguments), + MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, ClearArguments), + MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, GetProcessModuleInfo), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, AtmosphereHasLaunchedTitle), }; }; @@ -103,11 +103,11 @@ namespace sts::ldr { }; public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(ShellInterface, SetTitleArguments), + MAKE_SERVICE_COMMAND_META(ShellInterface, ClearArguments), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(ShellInterface, AtmosphereSetExternalContentSource), + MAKE_SERVICE_COMMAND_META(ShellInterface, AtmosphereClearExternalContentSource), }; }; diff --git a/stratosphere/pm/source/pm_boot_mode.hpp b/stratosphere/pm/source/pm_boot_mode.hpp index 96107e902..8a3fec6a4 100644 --- a/stratosphere/pm/source/pm_boot_mode.hpp +++ b/stratosphere/pm/source/pm_boot_mode.hpp @@ -18,12 +18,12 @@ #include #include -enum BootModeCmd { - BootMode_Cmd_GetBootMode = 0, - BootMode_Cmd_SetMaintenanceBoot = 1 -}; - class BootModeService final : public IServiceObject { + private: + enum class CommandId { + GetBootMode = 0, + SetMaintenanceBoot = 1, + }; private: /* Actual commands. */ void GetBootMode(Out out); @@ -32,7 +32,7 @@ class BootModeService final : public IServiceObject { static void SetMaintenanceBootForEmbeddedBoot2(); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(BootModeService, GetBootMode), + MAKE_SERVICE_COMMAND_META(BootModeService, SetMaintenanceBoot), }; }; diff --git a/stratosphere/pm/source/pm_debug_monitor.hpp b/stratosphere/pm/source/pm_debug_monitor.hpp index 26fd11880..3398ba832 100644 --- a/stratosphere/pm/source/pm_debug_monitor.hpp +++ b/stratosphere/pm/source/pm_debug_monitor.hpp @@ -20,30 +20,23 @@ #include "pm_registration.hpp" -enum DmntCmd { - Dmnt_Cmd_GetUnknownStub = 0, - Dmnt_Cmd_GetDebugProcessIds = 1, - Dmnt_Cmd_LaunchDebugProcess = 2, - Dmnt_Cmd_GetTitleProcessId = 3, - Dmnt_Cmd_EnableDebugForTitleId = 4, - Dmnt_Cmd_GetApplicationProcessId = 5, - Dmnt_Cmd_EnableDebugForApplication = 6, - - Dmnt_Cmd_5X_GetDebugProcessIds = 0, - Dmnt_Cmd_5X_LaunchDebugProcess = 1, - Dmnt_Cmd_5X_GetTitleProcessId = 2, - Dmnt_Cmd_5X_EnableDebugForTitleId = 3, - Dmnt_Cmd_5X_GetApplicationProcessId = 4, - Dmnt_Cmd_5X_EnableDebugForApplication = 5, - - Dmnt_Cmd_6X_DisableDebug = 6, - - Dmnt_Cmd_AtmosphereGetProcessInfo = 65000, - Dmnt_Cmd_AtmosphereGetCurrentLimitInfo = 65001, -}; - -class DebugMonitorService final : public IServiceObject { +/* Represents modern DebugMonitorService (5.0.0+) */ +class DebugMonitorService : public IServiceObject { private: + enum class CommandId { + GetDebugProcessIds = 0, + LaunchDebugProcess = 1, + GetTitleProcessId = 2, + EnableDebugForTitleId = 3, + GetApplicationProcessId = 4, + EnableDebugForApplication = 5, + + DisableDebug = 6, + + AtmosphereGetProcessInfo = 65000, + AtmosphereGetCurrentLimitInfo = 65001, + }; + protected: /* Actual commands. */ Result GetUnknownStub(Out count, OutBuffer out_buf, u64 in_unk); Result GetDebugProcessIds(Out count, OutBuffer out_pids); @@ -59,28 +52,51 @@ class DebugMonitorService final : public IServiceObject { Result AtmosphereGetCurrentLimitInfo(Out cur_val, Out lim_val, u32 category, u32 resource); public: DEFINE_SERVICE_DISPATCH_TABLE { - /* 1.0.0-4.1.0 */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - /* 5.0.0-* */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugProcessIds), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, LaunchDebugProcess), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetTitleProcessId), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, EnableDebugForTitleId), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetApplicationProcessId), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, EnableDebugForApplication), /* 6.0.0-* */ - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, DisableDebug, FirmwareVersion_600), /* Atmosphere extensions. */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, AtmosphereGetProcessInfo), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, AtmosphereGetCurrentLimitInfo), + }; +}; + +/* Represents deprecated DebugMonitorService (1.0.0-4.1.0). */ +class DebugMonitorServiceDeprecated : public DebugMonitorService { + private: + enum class CommandId { + GetUnknownStub = 0, + GetDebugProcessIds = 1, + LaunchDebugProcess = 2, + GetTitleProcessId = 3, + EnableDebugForTitleId = 4, + GetApplicationProcessId = 5, + EnableDebugForApplication = 6, + + AtmosphereGetProcessInfo = 65000, + AtmosphereGetCurrentLimitInfo = 65001, + }; + public: + DEFINE_SERVICE_DISPATCH_TABLE { + /* 1.0.0-4.1.0 */ + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetUnknownStub), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetDebugProcessIds), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, LaunchDebugProcess), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetTitleProcessId), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, EnableDebugForTitleId), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetApplicationProcessId), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, EnableDebugForApplication), + + /* Atmosphere extensions. */ + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, AtmosphereGetProcessInfo), + MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, AtmosphereGetCurrentLimitInfo), }; }; diff --git a/stratosphere/pm/source/pm_info.hpp b/stratosphere/pm/source/pm_info.hpp index 9420bc5b6..d45df54d6 100644 --- a/stratosphere/pm/source/pm_info.hpp +++ b/stratosphere/pm/source/pm_info.hpp @@ -18,14 +18,13 @@ #include #include -enum InformationCmd { - Information_Cmd_GetTitleId = 0, - - Information_Cmd_AtmosphereGetProcessId = 65000, - Information_Cmd_AtmosphereHasCreatedTitle = 65001, -}; - class InformationService final : public IServiceObject { + private: + enum class CommandId { + GetTitleId = 0, + AtmosphereGetProcessId = 65000, + AtmosphereHasLaunchedTitle = 65001, + }; private: /* Actual commands. */ Result GetTitleId(Out tid, u64 pid); @@ -35,8 +34,8 @@ class InformationService final : public IServiceObject { Result AtmosphereHasLaunchedTitle(Out out, u64 tid); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(InformationService, GetTitleId), + MAKE_SERVICE_COMMAND_META(InformationService, AtmosphereGetProcessId), + MAKE_SERVICE_COMMAND_META(InformationService, AtmosphereHasLaunchedTitle), }; }; diff --git a/stratosphere/pm/source/pm_main.cpp b/stratosphere/pm/source/pm_main.cpp index 8ef2b8770..c7115e610 100644 --- a/stratosphere/pm/source/pm_main.cpp +++ b/stratosphere/pm/source/pm_main.cpp @@ -142,8 +142,13 @@ int main(int argc, char **argv) static auto s_server_manager = WaitableManager(1); /* TODO: Create services. */ - s_server_manager.AddWaitable(new ServiceServer("pm:shell", 3)); - s_server_manager.AddWaitable(new ServiceServer("pm:dmnt", 3)); + if (GetRuntimeFirmwareVersion() <= FirmwareVersion_400) { + s_server_manager.AddWaitable(new ServiceServer("pm:shell", 3)); + s_server_manager.AddWaitable(new ServiceServer("pm:dmnt", 3)); + } else { + s_server_manager.AddWaitable(new ServiceServer("pm:shell", 3)); + s_server_manager.AddWaitable(new ServiceServer("pm:dmnt", 3)); + } s_server_manager.AddWaitable(new ServiceServer("pm:bm", 6)); s_server_manager.AddWaitable(new ServiceServer("pm:info", 19)); diff --git a/stratosphere/pm/source/pm_shell.hpp b/stratosphere/pm/source/pm_shell.hpp index a40801c10..f2bc7bc42 100644 --- a/stratosphere/pm/source/pm_shell.hpp +++ b/stratosphere/pm/source/pm_shell.hpp @@ -20,35 +20,22 @@ #include "pm_registration.hpp" -enum ShellCmd { - Shell_Cmd_LaunchProcess = 0, - Shell_Cmd_TerminateProcessId = 1, - Shell_Cmd_TerminateTitleId = 2, - Shell_Cmd_GetProcessWaitEvent = 3, - Shell_Cmd_GetProcessEventType = 4, - Shell_Cmd_FinalizeExitedProcess = 5, - Shell_Cmd_ClearProcessNotificationFlag = 6, - Shell_Cmd_NotifyBootFinished = 7, - Shell_Cmd_GetApplicationProcessId = 8, - Shell_Cmd_BoostSystemMemoryResourceLimit = 9 -}; - -enum ShellCmd_5X { - Shell_Cmd_5X_LaunchProcess = 0, - Shell_Cmd_5X_TerminateProcessId = 1, - Shell_Cmd_5X_TerminateTitleId = 2, - Shell_Cmd_5X_GetProcessWaitEvent = 3, - Shell_Cmd_5X_GetProcessEventType = 4, - Shell_Cmd_5X_NotifyBootFinished = 5, - Shell_Cmd_5X_GetApplicationProcessId = 6, - Shell_Cmd_5X_BoostSystemMemoryResourceLimit = 7, - - Shell_Cmd_BoostSystemThreadsResourceLimit = 8, - Shell_Cmd_GetBootFinishedEvent = 9, -}; - -class ShellService final : public IServiceObject { +/* Represents modern ShellService (5.0.0+) */ +class ShellService : public IServiceObject { private: + enum class CommandId { + LaunchProcess = 0, + TerminateProcessId = 1, + TerminateTitleId = 2, + GetProcessWaitEvent = 3, + GetProcessEventType = 4, + NotifyBootFinished = 5, + GetApplicationProcessId = 6, + BoostSystemMemoryResourceLimit = 7, + BoostSystemThreadsResourceLimit = 8, + GetBootFinishedEvent = 9, + }; + protected: /* Actual commands. */ Result LaunchProcess(Out pid, Registration::TidSid tid_sid, u32 launch_flags); Result TerminateProcessId(u64 pid); @@ -64,34 +51,53 @@ class ShellService final : public IServiceObject { void GetBootFinishedEvent(Out event); public: DEFINE_SERVICE_DISPATCH_TABLE { - /* 1.0.0-4.0.0 */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - - /* 4.0.0-4.0.0 */ - MakeServiceCommandMeta(), - /* 5.0.0-* */ - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(ShellService, LaunchProcess), + MAKE_SERVICE_COMMAND_META(ShellService, TerminateProcessId), + MAKE_SERVICE_COMMAND_META(ShellService, TerminateTitleId), + MAKE_SERVICE_COMMAND_META(ShellService, GetProcessWaitEvent), + MAKE_SERVICE_COMMAND_META(ShellService, GetProcessEventType), + MAKE_SERVICE_COMMAND_META(ShellService, NotifyBootFinished), + MAKE_SERVICE_COMMAND_META(ShellService, GetApplicationProcessId), + MAKE_SERVICE_COMMAND_META(ShellService, BoostSystemMemoryResourceLimit), /* 7.0.0-* */ - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(ShellService, BoostSystemThreadsResourceLimit, FirmwareVersion_700), /* 8.0.0-* */ - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(ShellService, GetBootFinishedEvent, FirmwareVersion_800), + }; +}; + +/* Represents deprecated ShellService (1.0.0-4.1.0). */ +class ShellServiceDeprecated : public ShellService { + private: + enum class CommandId { + LaunchProcess = 0, + TerminateProcessId = 1, + TerminateTitleId = 2, + GetProcessWaitEvent = 3, + GetProcessEventType = 4, + FinalizeExitedProcess = 5, + ClearProcessNotificationFlag = 6, + NotifyBootFinished = 7, + GetApplicationProcessId = 8, + BoostSystemMemoryResourceLimit = 9, + }; + public: + DEFINE_SERVICE_DISPATCH_TABLE { + /* 1.0.0- */ + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, LaunchProcess), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, TerminateProcessId), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, TerminateTitleId), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, GetProcessWaitEvent), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, GetProcessEventType), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, FinalizeExitedProcess), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, ClearProcessNotificationFlag), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, NotifyBootFinished), + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, GetApplicationProcessId), + + /* 4.0.0- */ + MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, BoostSystemMemoryResourceLimit, FirmwareVersion_400), }; }; diff --git a/stratosphere/ro/source/ro_debug_monitor.hpp b/stratosphere/ro/source/ro_debug_monitor.hpp index b675f83d9..18a889c69 100644 --- a/stratosphere/ro/source/ro_debug_monitor.hpp +++ b/stratosphere/ro/source/ro_debug_monitor.hpp @@ -30,7 +30,7 @@ namespace sts::ro { Result GetProcessModuleInfo(Out count, OutBuffer out_infos, u64 pid); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessModuleInfo), }; }; diff --git a/stratosphere/ro/source/ro_service.hpp b/stratosphere/ro/source/ro_service.hpp index 5e2914610..61e852a09 100644 --- a/stratosphere/ro/source/ro_service.hpp +++ b/stratosphere/ro/source/ro_service.hpp @@ -52,12 +52,12 @@ namespace sts::ro { Result LoadNrrEx(PidDescriptor pid_desc, u64 nrr_address, u64 nrr_size, CopiedHandle process_h); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(Service, LoadNro), + MAKE_SERVICE_COMMAND_META(Service, UnloadNro), + MAKE_SERVICE_COMMAND_META(Service, LoadNrr), + MAKE_SERVICE_COMMAND_META(Service, UnloadNrr), + MAKE_SERVICE_COMMAND_META(Service, Initialize), + MAKE_SERVICE_COMMAND_META(Service, LoadNrrEx, FirmwareVersion_700), }; }; diff --git a/stratosphere/sm/source/sm_dmnt_service.hpp b/stratosphere/sm/source/sm_dmnt_service.hpp index 25cce03dc..06bca507a 100644 --- a/stratosphere/sm/source/sm_dmnt_service.hpp +++ b/stratosphere/sm/source/sm_dmnt_service.hpp @@ -37,9 +37,9 @@ namespace sts::sm { virtual void AtmosphereGetRecordSize(Out record_size); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DmntService, AtmosphereGetRecord), + MAKE_SERVICE_COMMAND_META(DmntService, AtmosphereListRecords), + MAKE_SERVICE_COMMAND_META(DmntService, AtmosphereGetRecordSize), }; }; diff --git a/stratosphere/sm/source/sm_manager_service.hpp b/stratosphere/sm/source/sm_manager_service.hpp index 80e6650d0..bbe2b49ba 100644 --- a/stratosphere/sm/source/sm_manager_service.hpp +++ b/stratosphere/sm/source/sm_manager_service.hpp @@ -40,11 +40,11 @@ namespace sts::sm { virtual void AtmosphereHasMitm(Out out, ServiceName service); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(ManagerService, RegisterProcess), + MAKE_SERVICE_COMMAND_META(ManagerService, UnregisterProcess), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(ManagerService, AtmosphereEndInitDefers), + MAKE_SERVICE_COMMAND_META(ManagerService, AtmosphereHasMitm), }; }; diff --git a/stratosphere/sm/source/sm_user_service.hpp b/stratosphere/sm/source/sm_user_service.hpp index f548f553b..5572dd2c2 100644 --- a/stratosphere/sm/source/sm_user_service.hpp +++ b/stratosphere/sm/source/sm_user_service.hpp @@ -61,18 +61,18 @@ namespace sts::sm { virtual Result AtmosphereHasService(Out out, ServiceName service); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(UserService, Initialize), + MAKE_SERVICE_COMMAND_META(UserService, GetService), + MAKE_SERVICE_COMMAND_META(UserService, RegisterService), + MAKE_SERVICE_COMMAND_META(UserService, UnregisterService), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(UserService, AtmosphereInstallMitm), + MAKE_SERVICE_COMMAND_META(UserService, AtmosphereUninstallMitm), + MAKE_SERVICE_COMMAND_META(UserService, AtmosphereAssociatePidTidForMitm), + MAKE_SERVICE_COMMAND_META(UserService, AtmosphereAcknowledgeMitmSession), + MAKE_SERVICE_COMMAND_META(UserService, AtmosphereHasMitm), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(UserService, AtmosphereHasService), }; }; diff --git a/stratosphere/spl/source/spl_crypto_service.hpp b/stratosphere/spl/source/spl_crypto_service.hpp index c5ad23b1c..b118aae65 100644 --- a/stratosphere/spl/source/spl_crypto_service.hpp +++ b/stratosphere/spl/source/spl_crypto_service.hpp @@ -40,22 +40,22 @@ namespace sts::spl { virtual void GetAesKeyslotAvailableEvent(Out out_hnd); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(CryptoService, GetConfig), + MAKE_SERVICE_COMMAND_META(CryptoService, ExpMod), + MAKE_SERVICE_COMMAND_META(CryptoService, SetConfig), + MAKE_SERVICE_COMMAND_META(CryptoService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(CryptoService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(CryptoService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(CryptoService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(CryptoService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(CryptoService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(CryptoService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(CryptoService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(CryptoService, CryptAesCtr), + MAKE_SERVICE_COMMAND_META(CryptoService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(CryptoService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(CryptoService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(CryptoService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), }; }; diff --git a/stratosphere/spl/source/spl_deprecated_service.hpp b/stratosphere/spl/source/spl_deprecated_service.hpp index ee5e4695e..30fac8108 100644 --- a/stratosphere/spl/source/spl_deprecated_service.hpp +++ b/stratosphere/spl/source/spl_deprecated_service.hpp @@ -38,6 +38,7 @@ namespace sts::spl { GenerateSpecificAesKey = 12, DecryptRsaPrivateKey = 13, DecryptAesKey = 14, + CryptAesCtrDeprecated = 15, CryptAesCtr = 15, ComputeCmac = 16, ImportEsKey = 17, @@ -86,31 +87,31 @@ namespace sts::spl { virtual Result GetBootReason(Out out); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GetConfig), + MAKE_SERVICE_COMMAND_META(DeprecatedService, ExpMod), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(DeprecatedService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, SetConfig), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(DeprecatedService, ImportLotusKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, DecryptLotusMessage), + MAKE_SERVICE_COMMAND_META(DeprecatedService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateSpecificAesKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, DecryptRsaPrivateKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, CryptAesCtrDeprecated, FirmwareVersion_100, FirmwareVersion_100), + MAKE_SERVICE_COMMAND_META(DeprecatedService, CryptAesCtr, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(DeprecatedService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(DeprecatedService, ImportEsKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, UnwrapTitleKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, LoadTitleKey), + MAKE_SERVICE_COMMAND_META(DeprecatedService, UnwrapCommonTitleKey, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(DeprecatedService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(DeprecatedService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(DeprecatedService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(DeprecatedService, GetBootReason, FirmwareVersion_300), }; }; diff --git a/stratosphere/spl/source/spl_es_service.hpp b/stratosphere/spl/source/spl_es_service.hpp index 34564c373..774e14409 100644 --- a/stratosphere/spl/source/spl_es_service.hpp +++ b/stratosphere/spl/source/spl_es_service.hpp @@ -38,31 +38,31 @@ namespace sts::spl { virtual Result LoadElicenseKey(u32 keyslot, AccessKey access_key); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(EsService, GetConfig), + MAKE_SERVICE_COMMAND_META(EsService, ExpMod), + MAKE_SERVICE_COMMAND_META(EsService, SetConfig), + MAKE_SERVICE_COMMAND_META(EsService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(EsService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(EsService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(EsService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(EsService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(EsService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(EsService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(EsService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(EsService, CryptAesCtr), + MAKE_SERVICE_COMMAND_META(EsService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(EsService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(EsService, ImportEsKey), + MAKE_SERVICE_COMMAND_META(EsService, UnwrapTitleKey), + MAKE_SERVICE_COMMAND_META(EsService, UnwrapCommonTitleKey, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, ImportDrmKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(EsService, DrmExpMod, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(EsService, UnwrapElicenseKey, FirmwareVersion_600), + MAKE_SERVICE_COMMAND_META(EsService, LoadElicenseKey, FirmwareVersion_600), }; }; diff --git a/stratosphere/spl/source/spl_fs_service.hpp b/stratosphere/spl/source/spl_fs_service.hpp index 11ce4452b..69746c45e 100644 --- a/stratosphere/spl/source/spl_fs_service.hpp +++ b/stratosphere/spl/source/spl_fs_service.hpp @@ -36,27 +36,27 @@ namespace sts::spl { virtual Result GetPackage2Hash(OutPointerWithClientSize dst); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(FsService, GetConfig), + MAKE_SERVICE_COMMAND_META(FsService, ExpMod), + MAKE_SERVICE_COMMAND_META(FsService, SetConfig), + MAKE_SERVICE_COMMAND_META(FsService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(FsService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(FsService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(FsService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(FsService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(FsService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(FsService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(FsService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(FsService, CryptAesCtr), + MAKE_SERVICE_COMMAND_META(FsService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(FsService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(FsService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(FsService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(FsService, ImportLotusKey), + MAKE_SERVICE_COMMAND_META(FsService, DecryptLotusMessage), + MAKE_SERVICE_COMMAND_META(FsService, GenerateSpecificAesKey), + MAKE_SERVICE_COMMAND_META(FsService, LoadTitleKey), + MAKE_SERVICE_COMMAND_META(FsService, GetPackage2Hash, FirmwareVersion_500), }; }; diff --git a/stratosphere/spl/source/spl_general_service.hpp b/stratosphere/spl/source/spl_general_service.hpp index d6c2f0a3a..baad7d84f 100644 --- a/stratosphere/spl/source/spl_general_service.hpp +++ b/stratosphere/spl/source/spl_general_service.hpp @@ -80,13 +80,13 @@ namespace sts::spl { virtual Result GetBootReason(Out out); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(GeneralService, GetConfig), + MAKE_SERVICE_COMMAND_META(GeneralService, ExpMod), + MAKE_SERVICE_COMMAND_META(GeneralService, SetConfig), + MAKE_SERVICE_COMMAND_META(GeneralService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(GeneralService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(GeneralService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(GeneralService, GetBootReason, FirmwareVersion_300), }; }; diff --git a/stratosphere/spl/source/spl_manu_service.hpp b/stratosphere/spl/source/spl_manu_service.hpp index 3c1c6f9a8..2ae3f929c 100644 --- a/stratosphere/spl/source/spl_manu_service.hpp +++ b/stratosphere/spl/source/spl_manu_service.hpp @@ -33,25 +33,25 @@ namespace sts::spl { virtual Result ReEncryptRsaPrivateKey(OutPointerWithClientSize out, InPointer src, AccessKey access_key_dec, KeySource source_dec, AccessKey access_key_enc, KeySource source_enc, u32 option); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(ManuService, GetConfig), + MAKE_SERVICE_COMMAND_META(ManuService, ExpMod), + MAKE_SERVICE_COMMAND_META(ManuService, SetConfig), + MAKE_SERVICE_COMMAND_META(ManuService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(ManuService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(ManuService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(ManuService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(ManuService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(ManuService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(ManuService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(ManuService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(ManuService, CryptAesCtr), + MAKE_SERVICE_COMMAND_META(ManuService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(ManuService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(ManuService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(ManuService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(ManuService, ReEncryptRsaPrivateKey, FirmwareVersion_500), }; }; diff --git a/stratosphere/spl/source/spl_random_service.hpp b/stratosphere/spl/source/spl_random_service.hpp index e89e92bf5..3f8b7724c 100644 --- a/stratosphere/spl/source/spl_random_service.hpp +++ b/stratosphere/spl/source/spl_random_service.hpp @@ -34,7 +34,7 @@ namespace sts::spl { virtual Result GenerateRandomBytes(OutBuffer out); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMeta(), + MAKE_SERVICE_COMMAND_META(RandomService, GenerateRandomBytes), }; }; diff --git a/stratosphere/spl/source/spl_rsa_service.hpp b/stratosphere/spl/source/spl_rsa_service.hpp index 7b0933a5e..3e62d5288 100644 --- a/stratosphere/spl/source/spl_rsa_service.hpp +++ b/stratosphere/spl/source/spl_rsa_service.hpp @@ -33,24 +33,24 @@ namespace sts::spl { virtual Result DecryptRsaPrivateKey(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(RsaService, GetConfig), + MAKE_SERVICE_COMMAND_META(RsaService, ExpMod), + MAKE_SERVICE_COMMAND_META(RsaService, SetConfig), + MAKE_SERVICE_COMMAND_META(RsaService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(RsaService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(RsaService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(RsaService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(RsaService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(RsaService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(RsaService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(RsaService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(RsaService, CryptAesCtr), + MAKE_SERVICE_COMMAND_META(RsaService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(RsaService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(RsaService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(RsaService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_500), }; }; diff --git a/stratosphere/spl/source/spl_ssl_service.hpp b/stratosphere/spl/source/spl_ssl_service.hpp index 2a2fbf6b3..cb9e06126 100644 --- a/stratosphere/spl/source/spl_ssl_service.hpp +++ b/stratosphere/spl/source/spl_ssl_service.hpp @@ -33,26 +33,26 @@ namespace sts::spl { virtual Result SslExpMod(OutPointerWithClientSize out, InPointer base, InPointer mod); public: DEFINE_SERVICE_DISPATCH_TABLE { - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MAKE_SERVICE_COMMAND_META(SslService, GetConfig), + MAKE_SERVICE_COMMAND_META(SslService, ExpMod), + MAKE_SERVICE_COMMAND_META(SslService, SetConfig), + MAKE_SERVICE_COMMAND_META(SslService, GenerateRandomBytes), + MAKE_SERVICE_COMMAND_META(SslService, IsDevelopment), + MAKE_SERVICE_COMMAND_META(SslService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(SslService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(SslService, GenerateAesKek), + MAKE_SERVICE_COMMAND_META(SslService, LoadAesKey), + MAKE_SERVICE_COMMAND_META(SslService, GenerateAesKey), + MAKE_SERVICE_COMMAND_META(SslService, DecryptAesKey), + MAKE_SERVICE_COMMAND_META(SslService, CryptAesCtr), + MAKE_SERVICE_COMMAND_META(SslService, ComputeCmac), + MAKE_SERVICE_COMMAND_META(SslService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(SslService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(SslService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(SslService, ImportSslKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(SslService, SslExpMod, FirmwareVersion_500), }; };