diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/olsc/olsc.cpp | 158 |
1 files changed, 152 insertions, 6 deletions
diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 14ba67b4c..889f27c31 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp | |||
| @@ -8,15 +8,16 @@ | |||
| 8 | 8 | ||
| 9 | namespace Service::OLSC { | 9 | namespace Service::OLSC { |
| 10 | 10 | ||
| 11 | class OLSC final : public ServiceFramework<OLSC> { | 11 | class IOlscServiceForApplication final : public ServiceFramework<IOlscServiceForApplication> { |
| 12 | public: | 12 | public: |
| 13 | explicit OLSC(Core::System& system_) : ServiceFramework{system_, "olsc:u"} { | 13 | explicit IOlscServiceForApplication(Core::System& system_) |
| 14 | : ServiceFramework{system_, "olsc:u"} { | ||
| 14 | // clang-format off | 15 | // clang-format off |
| 15 | static const FunctionInfo functions[] = { | 16 | static const FunctionInfo functions[] = { |
| 16 | {0, &OLSC::Initialize, "Initialize"}, | 17 | {0, &IOlscServiceForApplication::Initialize, "Initialize"}, |
| 17 | {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, | 18 | {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, |
| 18 | {13, &OLSC::GetSaveDataBackupSetting, "GetSaveDataBackupSetting"}, | 19 | {13, &IOlscServiceForApplication::GetSaveDataBackupSetting, "GetSaveDataBackupSetting"}, |
| 19 | {14, &OLSC::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"}, | 20 | {14, &IOlscServiceForApplication::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"}, |
| 20 | {15, nullptr, "SetCustomData"}, | 21 | {15, nullptr, "SetCustomData"}, |
| 21 | {16, nullptr, "DeleteSaveDataBackupSetting"}, | 22 | {16, nullptr, "DeleteSaveDataBackupSetting"}, |
| 22 | {18, nullptr, "GetSaveDataBackupInfoCache"}, | 23 | {18, nullptr, "GetSaveDataBackupInfoCache"}, |
| @@ -72,10 +73,155 @@ private: | |||
| 72 | bool initialized{}; | 73 | bool initialized{}; |
| 73 | }; | 74 | }; |
| 74 | 75 | ||
| 76 | class INativeHandleHolder final : public ServiceFramework<INativeHandleHolder> { | ||
| 77 | public: | ||
| 78 | explicit INativeHandleHolder(Core::System& system_) | ||
| 79 | : ServiceFramework{system_, "INativeHandleHolder"} { | ||
| 80 | // clang-format off | ||
| 81 | static const FunctionInfo functions[] = { | ||
| 82 | {0, nullptr, "GetNativeHandle"}, | ||
| 83 | }; | ||
| 84 | // clang-format on | ||
| 85 | |||
| 86 | RegisterHandlers(functions); | ||
| 87 | } | ||
| 88 | }; | ||
| 89 | |||
| 90 | class ITransferTaskListController final : public ServiceFramework<ITransferTaskListController> { | ||
| 91 | public: | ||
| 92 | explicit ITransferTaskListController(Core::System& system_) | ||
| 93 | : ServiceFramework{system_, "ITransferTaskListController"} { | ||
| 94 | // clang-format off | ||
| 95 | static const FunctionInfo functions[] = { | ||
| 96 | {0, nullptr, "Unknown0"}, | ||
| 97 | {1, nullptr, "Unknown1"}, | ||
| 98 | {2, nullptr, "Unknown2"}, | ||
| 99 | {3, nullptr, "Unknown3"}, | ||
| 100 | {4, nullptr, "Unknown4"}, | ||
| 101 | {5, &ITransferTaskListController::GetNativeHandleHolder , "GetNativeHandleHolder"}, | ||
| 102 | {6, nullptr, "Unknown6"}, | ||
| 103 | {7, nullptr, "Unknown7"}, | ||
| 104 | {8, nullptr, "GetRemoteStorageController"}, | ||
| 105 | {9, &ITransferTaskListController::GetNativeHandleHolder, "GetNativeHandleHolder2"}, | ||
| 106 | {10, nullptr, "Unknown10"}, | ||
| 107 | {11, nullptr, "Unknown11"}, | ||
| 108 | {12, nullptr, "Unknown12"}, | ||
| 109 | {13, nullptr, "Unknown13"}, | ||
| 110 | {14, nullptr, "Unknown14"}, | ||
| 111 | {15, nullptr, "Unknown15"}, | ||
| 112 | {16, nullptr, "Unknown16"}, | ||
| 113 | {17, nullptr, "Unknown17"}, | ||
| 114 | {18, nullptr, "Unknown18"}, | ||
| 115 | {19, nullptr, "Unknown19"}, | ||
| 116 | {20, nullptr, "Unknown20"}, | ||
| 117 | {21, nullptr, "Unknown21"}, | ||
| 118 | {22, nullptr, "Unknown22"}, | ||
| 119 | {23, nullptr, "Unknown23"}, | ||
| 120 | {24, nullptr, "Unknown24"}, | ||
| 121 | {25, nullptr, "Unknown25"}, | ||
| 122 | }; | ||
| 123 | // clang-format on | ||
| 124 | |||
| 125 | RegisterHandlers(functions); | ||
| 126 | } | ||
| 127 | |||
| 128 | private: | ||
| 129 | void GetNativeHandleHolder(HLERequestContext& ctx) { | ||
| 130 | LOG_INFO(Service_OLSC, "called"); | ||
| 131 | |||
| 132 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 133 | rb.Push(ResultSuccess); | ||
| 134 | rb.PushIpcInterface<INativeHandleHolder>(system); | ||
| 135 | } | ||
| 136 | }; | ||
| 137 | |||
| 138 | class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> { | ||
| 139 | public: | ||
| 140 | explicit IOlscServiceForSystemService(Core::System& system_) | ||
| 141 | : ServiceFramework{system_, "olsc:s"} { | ||
| 142 | // clang-format off | ||
| 143 | static const FunctionInfo functions[] = { | ||
| 144 | {0, &IOlscServiceForSystemService::OpenTransferTaskListController, "OpenTransferTaskListController"}, | ||
| 145 | {1, nullptr, "OpenRemoteStorageController"}, | ||
| 146 | {2, nullptr, "OpenDaemonController"}, | ||
| 147 | {10, nullptr, "Unknown10"}, | ||
| 148 | {11, nullptr, "Unknown11"}, | ||
| 149 | {12, nullptr, "Unknown12"}, | ||
| 150 | {13, nullptr, "Unknown13"}, | ||
| 151 | {100, nullptr, "ListLastTransferTaskErrorInfo"}, | ||
| 152 | {101, nullptr, "GetLastErrorInfoCount"}, | ||
| 153 | {102, nullptr, "RemoveLastErrorInfoOld"}, | ||
| 154 | {103, nullptr, "GetLastErrorInfo"}, | ||
| 155 | {104, nullptr, "GetLastErrorEventHolder"}, | ||
| 156 | {105, nullptr, "GetLastTransferTaskErrorInfo"}, | ||
| 157 | {200, nullptr, "GetDataTransferPolicyInfo"}, | ||
| 158 | {201, nullptr, "RemoveDataTransferPolicyInfo"}, | ||
| 159 | {202, nullptr, "UpdateDataTransferPolicyOld"}, | ||
| 160 | {203, nullptr, "UpdateDataTransferPolicy"}, | ||
| 161 | {204, nullptr, "CleanupDataTransferPolicyInfo"}, | ||
| 162 | {205, nullptr, "RequestDataTransferPolicy"}, | ||
| 163 | {300, nullptr, "GetAutoTransferSeriesInfo"}, | ||
| 164 | {301, nullptr, "UpdateAutoTransferSeriesInfo"}, | ||
| 165 | {400, nullptr, "CleanupSaveDataArchiveInfoType1"}, | ||
| 166 | {900, nullptr, "CleanupTransferTask"}, | ||
| 167 | {902, nullptr, "CleanupSeriesInfoType0"}, | ||
| 168 | {903, nullptr, "CleanupSaveDataArchiveInfoType0"}, | ||
| 169 | {904, nullptr, "CleanupApplicationAutoTransferSetting"}, | ||
| 170 | {905, nullptr, "CleanupErrorHistory"}, | ||
| 171 | {906, nullptr, "SetLastError"}, | ||
| 172 | {907, nullptr, "AddSaveDataArchiveInfoType0"}, | ||
| 173 | {908, nullptr, "RemoveSeriesInfoType0"}, | ||
| 174 | {909, nullptr, "GetSeriesInfoType0"}, | ||
| 175 | {910, nullptr, "RemoveLastErrorInfo"}, | ||
| 176 | {911, nullptr, "CleanupSeriesInfoType1"}, | ||
| 177 | {912, nullptr, "RemoveSeriesInfoType1"}, | ||
| 178 | {913, nullptr, "GetSeriesInfoType1"}, | ||
| 179 | {1000, nullptr, "UpdateIssueOld"}, | ||
| 180 | {1010, nullptr, "Unknown1010"}, | ||
| 181 | {1011, nullptr, "ListIssueInfoOld"}, | ||
| 182 | {1012, nullptr, "GetIssueOld"}, | ||
| 183 | {1013, nullptr, "GetIssue2Old"}, | ||
| 184 | {1014, nullptr, "GetIssue3Old"}, | ||
| 185 | {1020, nullptr, "RepairIssueOld"}, | ||
| 186 | {1021, nullptr, "RepairIssueWithUserIdOld"}, | ||
| 187 | {1022, nullptr, "RepairIssue2Old"}, | ||
| 188 | {1023, nullptr, "RepairIssue3Old"}, | ||
| 189 | {1024, nullptr, "Unknown1024"}, | ||
| 190 | {1100, nullptr, "UpdateIssue"}, | ||
| 191 | {1110, nullptr, "Unknown1110"}, | ||
| 192 | {1111, nullptr, "ListIssueInfo"}, | ||
| 193 | {1112, nullptr, "GetIssue"}, | ||
| 194 | {1113, nullptr, "GetIssue2"}, | ||
| 195 | {1114, nullptr, "GetIssue3"}, | ||
| 196 | {1120, nullptr, "RepairIssue"}, | ||
| 197 | {1121, nullptr, "RepairIssueWithUserId"}, | ||
| 198 | {1122, nullptr, "RepairIssue2"}, | ||
| 199 | {1123, nullptr, "RepairIssue3"}, | ||
| 200 | {1124, nullptr, "Unknown1124"}, | ||
| 201 | }; | ||
| 202 | // clang-format on | ||
| 203 | |||
| 204 | RegisterHandlers(functions); | ||
| 205 | } | ||
| 206 | |||
| 207 | private: | ||
| 208 | void OpenTransferTaskListController(HLERequestContext& ctx) { | ||
| 209 | LOG_INFO(Service_OLSC, "called"); | ||
| 210 | |||
| 211 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 212 | rb.Push(ResultSuccess); | ||
| 213 | rb.PushIpcInterface<ITransferTaskListController>(system); | ||
| 214 | } | ||
| 215 | }; | ||
| 216 | |||
| 75 | void LoopProcess(Core::System& system) { | 217 | void LoopProcess(Core::System& system) { |
| 76 | auto server_manager = std::make_unique<ServerManager>(system); | 218 | auto server_manager = std::make_unique<ServerManager>(system); |
| 77 | 219 | ||
| 78 | server_manager->RegisterNamedService("olsc:u", std::make_shared<OLSC>(system)); | 220 | server_manager->RegisterNamedService("olsc:u", |
| 221 | std::make_shared<IOlscServiceForApplication>(system)); | ||
| 222 | server_manager->RegisterNamedService("olsc:s", | ||
| 223 | std::make_shared<IOlscServiceForSystemService>(system)); | ||
| 224 | |||
| 79 | ServerManager::RunServer(std::move(server_manager)); | 225 | ServerManager::RunServer(std::move(server_manager)); |
| 80 | } | 226 | } |
| 81 | 227 | ||