diff options
| author | 2018-08-02 14:57:24 -0400 | |
|---|---|---|
| committer | 2018-08-02 14:57:24 -0400 | |
| commit | e79e967151c6be6201fc8dd4743ee7675cfbefec (patch) | |
| tree | 4439c01c310c182a734654605beed906fc99aac7 /src | |
| parent | Implement RGB32F PixelFormat (#886) (used by Go Vacation) (diff) | |
| parent | service/ns: Add missing ns services (diff) | |
| download | yuzu-e79e967151c6be6201fc8dd4743ee7675cfbefec.tar.gz yuzu-e79e967151c6be6201fc8dd4743ee7675cfbefec.tar.xz yuzu-e79e967151c6be6201fc8dd4743ee7675cfbefec.zip | |
Merge pull request #891 from lioncash/ns
service/ns: Add missing ns services
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ns/ns.cpp | 447 |
1 files changed, 447 insertions, 0 deletions
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 89c703310..98017267c 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -2,12 +2,459 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/ipc_helpers.h" | ||
| 6 | #include "core/hle/kernel/hle_ipc.h" | ||
| 5 | #include "core/hle/service/ns/ns.h" | 7 | #include "core/hle/service/ns/ns.h" |
| 6 | #include "core/hle/service/ns/pl_u.h" | 8 | #include "core/hle/service/ns/pl_u.h" |
| 7 | 9 | ||
| 8 | namespace Service::NS { | 10 | namespace Service::NS { |
| 9 | 11 | ||
| 12 | class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> { | ||
| 13 | public: | ||
| 14 | explicit IAccountProxyInterface() : ServiceFramework{"IAccountProxyInterface"} { | ||
| 15 | // clang-format off | ||
| 16 | static const FunctionInfo functions[] = { | ||
| 17 | {0, nullptr, "CreateUserAccount"}, | ||
| 18 | }; | ||
| 19 | // clang-format on | ||
| 20 | |||
| 21 | RegisterHandlers(functions); | ||
| 22 | } | ||
| 23 | }; | ||
| 24 | |||
| 25 | class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> { | ||
| 26 | public: | ||
| 27 | explicit IApplicationManagerInterface() : ServiceFramework{"IApplicationManagerInterface"} { | ||
| 28 | // clang-format off | ||
| 29 | static const FunctionInfo functions[] = { | ||
| 30 | {0, nullptr, "ListApplicationRecord"}, | ||
| 31 | {1, nullptr, "GenerateApplicationRecordCount"}, | ||
| 32 | {2, nullptr, "GetApplicationRecordUpdateSystemEvent"}, | ||
| 33 | {3, nullptr, "GetApplicationViewDeprecated"}, | ||
| 34 | {4, nullptr, "DeleteApplicationEntity"}, | ||
| 35 | {5, nullptr, "DeleteApplicationCompletely"}, | ||
| 36 | {6, nullptr, "IsAnyApplicationEntityRedundant"}, | ||
| 37 | {7, nullptr, "DeleteRedundantApplicationEntity"}, | ||
| 38 | {8, nullptr, "IsApplicationEntityMovable"}, | ||
| 39 | {9, nullptr, "MoveApplicationEntity"}, | ||
| 40 | {11, nullptr, "CalculateApplicationOccupiedSize"}, | ||
| 41 | {16, nullptr, "PushApplicationRecord"}, | ||
| 42 | {17, nullptr, "ListApplicationRecordContentMeta"}, | ||
| 43 | {19, nullptr, "LaunchApplication"}, | ||
| 44 | {21, nullptr, "GetApplicationContentPath"}, | ||
| 45 | {22, nullptr, "TerminateApplication"}, | ||
| 46 | {23, nullptr, "ResolveApplicationContentPath"}, | ||
| 47 | {26, nullptr, "BeginInstallApplication"}, | ||
| 48 | {27, nullptr, "DeleteApplicationRecord"}, | ||
| 49 | {30, nullptr, "RequestApplicationUpdateInfo"}, | ||
| 50 | {32, nullptr, "CancelApplicationDownload"}, | ||
| 51 | {33, nullptr, "ResumeApplicationDownload"}, | ||
| 52 | {35, nullptr, "UpdateVersionList"}, | ||
| 53 | {36, nullptr, "PushLaunchVersion"}, | ||
| 54 | {37, nullptr, "ListRequiredVersion"}, | ||
| 55 | {38, nullptr, "CheckApplicationLaunchVersion"}, | ||
| 56 | {39, nullptr, "CheckApplicationLaunchRights"}, | ||
| 57 | {40, nullptr, "GetApplicationLogoData"}, | ||
| 58 | {41, nullptr, "CalculateApplicationDownloadRequiredSize"}, | ||
| 59 | {42, nullptr, "CleanupSdCard"}, | ||
| 60 | {43, nullptr, "CheckSdCardMountStatus"}, | ||
| 61 | {44, nullptr, "GetSdCardMountStatusChangedEvent"}, | ||
| 62 | {45, nullptr, "GetGameCardAttachmentEvent"}, | ||
| 63 | {46, nullptr, "GetGameCardAttachmentInfo"}, | ||
| 64 | {47, nullptr, "GetTotalSpaceSize"}, | ||
| 65 | {48, nullptr, "GetFreeSpaceSize"}, | ||
| 66 | {49, nullptr, "GetSdCardRemovedEvent"}, | ||
| 67 | {52, nullptr, "GetGameCardUpdateDetectionEvent"}, | ||
| 68 | {53, nullptr, "DisableApplicationAutoDelete"}, | ||
| 69 | {54, nullptr, "EnableApplicationAutoDelete"}, | ||
| 70 | {55, nullptr, "GetApplicationDesiredLanguage"}, | ||
| 71 | {56, nullptr, "SetApplicationTerminateResult"}, | ||
| 72 | {57, nullptr, "ClearApplicationTerminateResult"}, | ||
| 73 | {58, nullptr, "GetLastSdCardMountUnexpectedResult"}, | ||
| 74 | {59, nullptr, "ConvertApplicationLanguageToLanguageCode"}, | ||
| 75 | {60, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, | ||
| 76 | {61, nullptr, "GetBackgroundDownloadStressTaskInfo"}, | ||
| 77 | {62, nullptr, "GetGameCardStopper"}, | ||
| 78 | {63, nullptr, "IsSystemProgramInstalled"}, | ||
| 79 | {64, nullptr, "StartApplyDeltaTask"}, | ||
| 80 | {65, nullptr, "GetRequestServerStopper"}, | ||
| 81 | {66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, | ||
| 82 | {67, nullptr, "CancelApplicationApplyDelta"}, | ||
| 83 | {68, nullptr, "ResumeApplicationApplyDelta"}, | ||
| 84 | {69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"}, | ||
| 85 | {70, nullptr, "ResumeAll"}, | ||
| 86 | {71, nullptr, "GetStorageSize"}, | ||
| 87 | {80, nullptr, "RequestDownloadApplication"}, | ||
| 88 | {81, nullptr, "RequestDownloadAddOnContent"}, | ||
| 89 | {82, nullptr, "DownloadApplication"}, | ||
| 90 | {83, nullptr, "CheckApplicationResumeRights"}, | ||
| 91 | {84, nullptr, "GetDynamicCommitEvent"}, | ||
| 92 | {85, nullptr, "RequestUpdateApplication2"}, | ||
| 93 | {86, nullptr, "EnableApplicationCrashReport"}, | ||
| 94 | {87, nullptr, "IsApplicationCrashReportEnabled"}, | ||
| 95 | {90, nullptr, "BoostSystemMemoryResourceLimit"}, | ||
| 96 | {100, nullptr, "ResetToFactorySettings"}, | ||
| 97 | {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, | ||
| 98 | {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, | ||
| 99 | {200, nullptr, "CalculateUserSaveDataStatistics"}, | ||
| 100 | {201, nullptr, "DeleteUserSaveDataAll"}, | ||
| 101 | {210, nullptr, "DeleteUserSystemSaveData"}, | ||
| 102 | {220, nullptr, "UnregisterNetworkServiceAccount"}, | ||
| 103 | {300, nullptr, "GetApplicationShellEvent"}, | ||
| 104 | {301, nullptr, "PopApplicationShellEventInfo"}, | ||
| 105 | {302, nullptr, "LaunchLibraryApplet"}, | ||
| 106 | {303, nullptr, "TerminateLibraryApplet"}, | ||
| 107 | {304, nullptr, "LaunchSystemApplet"}, | ||
| 108 | {305, nullptr, "TerminateSystemApplet"}, | ||
| 109 | {306, nullptr, "LaunchOverlayApplet"}, | ||
| 110 | {307, nullptr, "TerminateOverlayApplet"}, | ||
| 111 | {400, nullptr, "GetApplicationControlData"}, | ||
| 112 | {401, nullptr, "InvalidateAllApplicationControlCache"}, | ||
| 113 | {402, nullptr, "RequestDownloadApplicationControlData"}, | ||
| 114 | {403, nullptr, "GetMaxApplicationControlCacheCount"}, | ||
| 115 | {404, nullptr, "InvalidateApplicationControlCache"}, | ||
| 116 | {405, nullptr, "ListApplicationControlCacheEntryInfo"}, | ||
| 117 | {502, nullptr, "RequestCheckGameCardRegistration"}, | ||
| 118 | {503, nullptr, "RequestGameCardRegistrationGoldPoint"}, | ||
| 119 | {504, nullptr, "RequestRegisterGameCard"}, | ||
| 120 | {505, nullptr, "GetGameCardMountFailureEvent"}, | ||
| 121 | {506, nullptr, "IsGameCardInserted"}, | ||
| 122 | {507, nullptr, "EnsureGameCardAccess"}, | ||
| 123 | {508, nullptr, "GetLastGameCardMountFailureResult"}, | ||
| 124 | {509, nullptr, "ListApplicationIdOnGameCard"}, | ||
| 125 | {600, nullptr, "CountApplicationContentMeta"}, | ||
| 126 | {601, nullptr, "ListApplicationContentMetaStatus"}, | ||
| 127 | {602, nullptr, "ListAvailableAddOnContent"}, | ||
| 128 | {603, nullptr, "GetOwnedApplicationContentMetaStatus"}, | ||
| 129 | {604, nullptr, "RegisterContentsExternalKey"}, | ||
| 130 | {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, | ||
| 131 | {606, nullptr, "GetContentMetaStorage"}, | ||
| 132 | {700, nullptr, "PushDownloadTaskList"}, | ||
| 133 | {701, nullptr, "ClearTaskStatusList"}, | ||
| 134 | {702, nullptr, "RequestDownloadTaskList"}, | ||
| 135 | {703, nullptr, "RequestEnsureDownloadTask"}, | ||
| 136 | {704, nullptr, "ListDownloadTaskStatus"}, | ||
| 137 | {705, nullptr, "RequestDownloadTaskListData"}, | ||
| 138 | {800, nullptr, "RequestVersionList"}, | ||
| 139 | {801, nullptr, "ListVersionList"}, | ||
| 140 | {802, nullptr, "RequestVersionListData"}, | ||
| 141 | {900, nullptr, "GetApplicationRecord"}, | ||
| 142 | {901, nullptr, "GetApplicationRecordProperty"}, | ||
| 143 | {902, nullptr, "EnableApplicationAutoUpdate"}, | ||
| 144 | {903, nullptr, "DisableApplicationAutoUpdate"}, | ||
| 145 | {904, nullptr, "TouchApplication"}, | ||
| 146 | {905, nullptr, "RequestApplicationUpdate"}, | ||
| 147 | {906, nullptr, "IsApplicationUpdateRequested"}, | ||
| 148 | {907, nullptr, "WithdrawApplicationUpdateRequest"}, | ||
| 149 | {908, nullptr, "ListApplicationRecordInstalledContentMeta"}, | ||
| 150 | {909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"}, | ||
| 151 | {1000, nullptr, "RequestVerifyApplicationDeprecated"}, | ||
| 152 | {1001, nullptr, "CorruptApplicationForDebug"}, | ||
| 153 | {1002, nullptr, "RequestVerifyAddOnContentsRights"}, | ||
| 154 | {1003, nullptr, "RequestVerifyApplication"}, | ||
| 155 | {1004, nullptr, "CorruptContentForDebug"}, | ||
| 156 | {1200, nullptr, "NeedsUpdateVulnerability"}, | ||
| 157 | {1300, nullptr, "IsAnyApplicationEntityInstalled"}, | ||
| 158 | {1301, nullptr, "DeleteApplicationContentEntities"}, | ||
| 159 | {1302, nullptr, "CleanupUnrecordedApplicationEntity"}, | ||
| 160 | {1303, nullptr, "CleanupAddOnContentsWithNoRights"}, | ||
| 161 | {1304, nullptr, "DeleteApplicationContentEntity"}, | ||
| 162 | {1305, nullptr, "TryDeleteRunningApplicationEntity"}, | ||
| 163 | {1306, nullptr, "TryDeleteRunningApplicationCompletely"}, | ||
| 164 | {1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, | ||
| 165 | {1400, nullptr, "PrepareShutdown"}, | ||
| 166 | {1500, nullptr, "FormatSdCard"}, | ||
| 167 | {1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, | ||
| 168 | {1502, nullptr, "GetLastSdCardFormatUnexpectedResult"}, | ||
| 169 | {1504, nullptr, "InsertSdCard"}, | ||
| 170 | {1505, nullptr, "RemoveSdCard"}, | ||
| 171 | {1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, | ||
| 172 | {1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, | ||
| 173 | {1700, nullptr, "ListApplicationDownloadingContentMeta"}, | ||
| 174 | {1701, nullptr, "GetApplicationView"}, | ||
| 175 | {1702, nullptr, "GetApplicationDownloadTaskStatus"}, | ||
| 176 | {1703, nullptr, "GetApplicationViewDownloadErrorContext"}, | ||
| 177 | {1800, nullptr, "IsNotificationSetupCompleted"}, | ||
| 178 | {1801, nullptr, "GetLastNotificationInfoCount"}, | ||
| 179 | {1802, nullptr, "ListLastNotificationInfo"}, | ||
| 180 | {1803, nullptr, "ListNotificationTask"}, | ||
| 181 | {1900, nullptr, "IsActiveAccount"}, | ||
| 182 | {1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, | ||
| 183 | {1902, nullptr, "GetApplicationTicketInfo"}, | ||
| 184 | {2000, nullptr, "GetSystemDeliveryInfo"}, | ||
| 185 | {2001, nullptr, "SelectLatestSystemDeliveryInfo"}, | ||
| 186 | {2002, nullptr, "VerifyDeliveryProtocolVersion"}, | ||
| 187 | {2003, nullptr, "GetApplicationDeliveryInfo"}, | ||
| 188 | {2004, nullptr, "HasAllContentsToDeliver"}, | ||
| 189 | {2005, nullptr, "CompareApplicationDeliveryInfo"}, | ||
| 190 | {2006, nullptr, "CanDeliverApplication"}, | ||
| 191 | {2007, nullptr, "ListContentMetaKeyToDeliverApplication"}, | ||
| 192 | {2008, nullptr, "NeedsSystemUpdateToDeliverApplication"}, | ||
| 193 | {2009, nullptr, "EstimateRequiredSize"}, | ||
| 194 | {2010, nullptr, "RequestReceiveApplication"}, | ||
| 195 | {2011, nullptr, "CommitReceiveApplication"}, | ||
| 196 | {2012, nullptr, "GetReceiveApplicationProgress"}, | ||
| 197 | {2013, nullptr, "RequestSendApplication"}, | ||
| 198 | {2014, nullptr, "GetSendApplicationProgress"}, | ||
| 199 | {2015, nullptr, "CompareSystemDeliveryInfo"}, | ||
| 200 | {2016, nullptr, "ListNotCommittedContentMeta"}, | ||
| 201 | {2017, nullptr, "CreateDownloadTask"}, | ||
| 202 | }; | ||
| 203 | // clang-format on | ||
| 204 | |||
| 205 | RegisterHandlers(functions); | ||
| 206 | } | ||
| 207 | }; | ||
| 208 | |||
| 209 | class IApplicationVersionInterface final : public ServiceFramework<IApplicationVersionInterface> { | ||
| 210 | public: | ||
| 211 | explicit IApplicationVersionInterface() : ServiceFramework{"IApplicationVersionInterface"} { | ||
| 212 | // clang-format off | ||
| 213 | static const FunctionInfo functions[] = { | ||
| 214 | {0, nullptr, "GetLaunchRequiredVersion"}, | ||
| 215 | {1, nullptr, "UpgradeLaunchRequiredVersion"}, | ||
| 216 | {35, nullptr, "UpdateVersionList"}, | ||
| 217 | {36, nullptr, "PushLaunchVersion"}, | ||
| 218 | {37, nullptr, "ListRequiredVersion"}, | ||
| 219 | {800, nullptr, "RequestVersionList"}, | ||
| 220 | {801, nullptr, "ListVersionList"}, | ||
| 221 | {802, nullptr, "RequestVersionListData"}, | ||
| 222 | {1000, nullptr, "PerformAutoUpdate"}, | ||
| 223 | }; | ||
| 224 | // clang-format on | ||
| 225 | |||
| 226 | RegisterHandlers(functions); | ||
| 227 | } | ||
| 228 | }; | ||
| 229 | |||
| 230 | class IContentManagerInterface final : public ServiceFramework<IContentManagerInterface> { | ||
| 231 | public: | ||
| 232 | explicit IContentManagerInterface() : ServiceFramework{"IContentManagerInterface"} { | ||
| 233 | // clang-format off | ||
| 234 | static const FunctionInfo functions[] = { | ||
| 235 | {11, nullptr, "CalculateApplicationOccupiedSize"}, | ||
| 236 | {43, nullptr, "CheckSdCardMountStatus"}, | ||
| 237 | {47, nullptr, "GetTotalSpaceSize"}, | ||
| 238 | {48, nullptr, "GetFreeSpaceSize"}, | ||
| 239 | {600, nullptr, "CountApplicationContentMeta"}, | ||
| 240 | {601, nullptr, "ListApplicationContentMetaStatus"}, | ||
| 241 | {605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, | ||
| 242 | {607, nullptr, "IsAnyApplicationRunning"}, | ||
| 243 | }; | ||
| 244 | // clang-format on | ||
| 245 | |||
| 246 | RegisterHandlers(functions); | ||
| 247 | } | ||
| 248 | }; | ||
| 249 | |||
| 250 | class IDocumentInterface final : public ServiceFramework<IDocumentInterface> { | ||
| 251 | public: | ||
| 252 | explicit IDocumentInterface() : ServiceFramework{"IDocumentInterface"} { | ||
| 253 | // clang-format off | ||
| 254 | static const FunctionInfo functions[] = { | ||
| 255 | {21, nullptr, "GetApplicationContentPath"}, | ||
| 256 | {23, nullptr, "ResolveApplicationContentPath"}, | ||
| 257 | }; | ||
| 258 | // clang-format on | ||
| 259 | |||
| 260 | RegisterHandlers(functions); | ||
| 261 | } | ||
| 262 | }; | ||
| 263 | |||
| 264 | class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> { | ||
| 265 | public: | ||
| 266 | explicit IDownloadTaskInterface() : ServiceFramework{"IDownloadTaskInterface"} { | ||
| 267 | // clang-format off | ||
| 268 | static const FunctionInfo functions[] = { | ||
| 269 | {701, nullptr, "ClearTaskStatusList"}, | ||
| 270 | {702, nullptr, "RequestDownloadTaskList"}, | ||
| 271 | {703, nullptr, "RequestEnsureDownloadTask"}, | ||
| 272 | {704, nullptr, "ListDownloadTaskStatus"}, | ||
| 273 | {705, nullptr, "RequestDownloadTaskListData"}, | ||
| 274 | {706, nullptr, "TryCommitCurrentApplicationDownloadTask"}, | ||
| 275 | {707, nullptr, "EnableAutoCommit"}, | ||
| 276 | {708, nullptr, "DisableAutoCommit"}, | ||
| 277 | {709, nullptr, "TriggerDynamicCommitEvent"}, | ||
| 278 | }; | ||
| 279 | // clang-format on | ||
| 280 | |||
| 281 | RegisterHandlers(functions); | ||
| 282 | } | ||
| 283 | }; | ||
| 284 | |||
| 285 | class IECommerceInterface final : public ServiceFramework<IECommerceInterface> { | ||
| 286 | public: | ||
| 287 | explicit IECommerceInterface() : ServiceFramework{"IECommerceInterface"} { | ||
| 288 | // clang-format off | ||
| 289 | static const FunctionInfo functions[] = { | ||
| 290 | {0, nullptr, "RequestLinkDevice"}, | ||
| 291 | }; | ||
| 292 | // clang-format on | ||
| 293 | |||
| 294 | RegisterHandlers(functions); | ||
| 295 | } | ||
| 296 | }; | ||
| 297 | |||
| 298 | class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> { | ||
| 299 | public: | ||
| 300 | explicit IFactoryResetInterface() : ServiceFramework{"IFactoryResetInterface"} { | ||
| 301 | // clang-format off | ||
| 302 | static const FunctionInfo functions[] = { | ||
| 303 | {100, nullptr, "ResetToFactorySettings"}, | ||
| 304 | {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, | ||
| 305 | {102, nullptr, "ResetToFactorySettingsForRefurbishment "}, | ||
| 306 | }; | ||
| 307 | // clang-format on | ||
| 308 | |||
| 309 | RegisterHandlers(functions); | ||
| 310 | } | ||
| 311 | }; | ||
| 312 | |||
| 313 | class NS final : public ServiceFramework<NS> { | ||
| 314 | public: | ||
| 315 | explicit NS(const char* name) : ServiceFramework{name} { | ||
| 316 | // clang-format off | ||
| 317 | static const FunctionInfo functions[] = { | ||
| 318 | {7992, &NS::PushInterface<IECommerceInterface>, "GetECommerceInterface"}, | ||
| 319 | {7993, &NS::PushInterface<IApplicationVersionInterface>, "GetApplicationVersionInterface"}, | ||
| 320 | {7994, &NS::PushInterface<IFactoryResetInterface>, "GetFactoryResetInterface"}, | ||
| 321 | {7995, &NS::PushInterface<IAccountProxyInterface>, "GetAccountProxyInterface"}, | ||
| 322 | {7996, &NS::PushInterface<IApplicationManagerInterface>, "GetApplicationManagerInterface"}, | ||
| 323 | {7997, &NS::PushInterface<IDownloadTaskInterface>, "GetDownloadTaskInterface"}, | ||
| 324 | {7998, &NS::PushInterface<IContentManagerInterface>, "GetContentManagementInterface"}, | ||
| 325 | {7999, &NS::PushInterface<IDocumentInterface>, "GetDocumentInterface"}, | ||
| 326 | }; | ||
| 327 | // clang-format on | ||
| 328 | |||
| 329 | RegisterHandlers(functions); | ||
| 330 | } | ||
| 331 | |||
| 332 | private: | ||
| 333 | template <typename T> | ||
| 334 | void PushInterface(Kernel::HLERequestContext& ctx) { | ||
| 335 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 336 | rb.Push(RESULT_SUCCESS); | ||
| 337 | rb.PushIpcInterface<T>(); | ||
| 338 | |||
| 339 | LOG_DEBUG(Service_NS, "called"); | ||
| 340 | } | ||
| 341 | }; | ||
| 342 | |||
| 343 | class NS_DEV final : public ServiceFramework<NS_DEV> { | ||
| 344 | public: | ||
| 345 | explicit NS_DEV() : ServiceFramework{"ns:dev"} { | ||
| 346 | // clang-format off | ||
| 347 | static const FunctionInfo functions[] = { | ||
| 348 | {0, nullptr, "LaunchProgram"}, | ||
| 349 | {1, nullptr, "TerminateProcess"}, | ||
| 350 | {2, nullptr, "TerminateProgram"}, | ||
| 351 | {3, nullptr, "GetShellEventHandle"}, | ||
| 352 | {4, nullptr, "GetShellEventInfo"}, | ||
| 353 | {5, nullptr, "TerminateApplication"}, | ||
| 354 | {6, nullptr, "PrepareLaunchProgramFromHost"}, | ||
| 355 | {7, nullptr, "LaunchApplication"}, | ||
| 356 | {8, nullptr, "LaunchApplicationWithStorageId"}, | ||
| 357 | }; | ||
| 358 | // clang-format on | ||
| 359 | |||
| 360 | RegisterHandlers(functions); | ||
| 361 | } | ||
| 362 | }; | ||
| 363 | |||
| 364 | class ISystemUpdateControl final : public ServiceFramework<ISystemUpdateControl> { | ||
| 365 | public: | ||
| 366 | explicit ISystemUpdateControl() : ServiceFramework{"ISystemUpdateControl"} { | ||
| 367 | // clang-format off | ||
| 368 | static const FunctionInfo functions[] = { | ||
| 369 | {0, nullptr, "HasDownloaded"}, | ||
| 370 | {1, nullptr, "RequestCheckLatestUpdate"}, | ||
| 371 | {2, nullptr, "RequestDownloadLatestUpdate"}, | ||
| 372 | {3, nullptr, "GetDownloadProgress"}, | ||
| 373 | {4, nullptr, "ApplyDownloadedUpdate"}, | ||
| 374 | {5, nullptr, "RequestPrepareCardUpdate"}, | ||
| 375 | {6, nullptr, "GetPrepareCardUpdateProgress"}, | ||
| 376 | {7, nullptr, "HasPreparedCardUpdate"}, | ||
| 377 | {8, nullptr, "ApplyCardUpdate"}, | ||
| 378 | {9, nullptr, "GetDownloadedEulaDataSize"}, | ||
| 379 | {10, nullptr, "GetDownloadedEulaData"}, | ||
| 380 | {11, nullptr, "SetupCardUpdate"}, | ||
| 381 | {12, nullptr, "GetPreparedCardUpdateEulaDataSize"}, | ||
| 382 | {13, nullptr, "GetPreparedCardUpdateEulaData"}, | ||
| 383 | {14, nullptr, "SetupCardUpdateViaSystemUpdater"}, | ||
| 384 | {15, nullptr, "HasReceived"}, | ||
| 385 | {16, nullptr, "RequestReceiveSystemUpdate"}, | ||
| 386 | {17, nullptr, "GetReceiveProgress"}, | ||
| 387 | {18, nullptr, "ApplyReceivedUpdate"}, | ||
| 388 | {19, nullptr, "GetReceivedEulaDataSize"}, | ||
| 389 | {20, nullptr, "GetReceivedEulaData"}, | ||
| 390 | {21, nullptr, "SetupToReceiveSystemUpdate"}, | ||
| 391 | }; | ||
| 392 | // clang-format on | ||
| 393 | |||
| 394 | RegisterHandlers(functions); | ||
| 395 | } | ||
| 396 | }; | ||
| 397 | |||
| 398 | class NS_SU final : public ServiceFramework<NS_SU> { | ||
| 399 | public: | ||
| 400 | explicit NS_SU() : ServiceFramework{"ns:su"} { | ||
| 401 | // clang-format off | ||
| 402 | static const FunctionInfo functions[] = { | ||
| 403 | {0, nullptr, "GetBackgroundNetworkUpdateState"}, | ||
| 404 | {1, &NS_SU::OpenSystemUpdateControl, "OpenSystemUpdateControl"}, | ||
| 405 | {2, nullptr, "NotifyExFatDriverRequired"}, | ||
| 406 | {3, nullptr, "ClearExFatDriverStatusForDebug"}, | ||
| 407 | {4, nullptr, "RequestBackgroundNetworkUpdate"}, | ||
| 408 | {5, nullptr, "NotifyBackgroundNetworkUpdate"}, | ||
| 409 | {6, nullptr, "NotifyExFatDriverDownloadedForDebug"}, | ||
| 410 | {9, nullptr, "GetSystemUpdateNotificationEventForContentDelivery"}, | ||
| 411 | {10, nullptr, "NotifySystemUpdateForContentDelivery"}, | ||
| 412 | {11, nullptr, "PrepareShutdown"}, | ||
| 413 | {16, nullptr, "DestroySystemUpdateTask"}, | ||
| 414 | {17, nullptr, "RequestSendSystemUpdate"}, | ||
| 415 | {18, nullptr, "GetSendSystemUpdateProgress"}, | ||
| 416 | }; | ||
| 417 | // clang-format on | ||
| 418 | |||
| 419 | RegisterHandlers(functions); | ||
| 420 | } | ||
| 421 | |||
| 422 | private: | ||
| 423 | void OpenSystemUpdateControl(Kernel::HLERequestContext& ctx) { | ||
| 424 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 425 | rb.Push(RESULT_SUCCESS); | ||
| 426 | rb.PushIpcInterface<ISystemUpdateControl>(); | ||
| 427 | |||
| 428 | LOG_DEBUG(Service_NS, "called"); | ||
| 429 | } | ||
| 430 | }; | ||
| 431 | |||
| 432 | class NS_VM final : public ServiceFramework<NS_VM> { | ||
| 433 | public: | ||
| 434 | explicit NS_VM() : ServiceFramework{"ns:vm"} { | ||
| 435 | // clang-format off | ||
| 436 | static const FunctionInfo functions[] = { | ||
| 437 | {1200, nullptr, "NeedsUpdateVulnerability"}, | ||
| 438 | {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, | ||
| 439 | {1202, nullptr, "GetSafeSystemVersion"}, | ||
| 440 | }; | ||
| 441 | // clang-format on | ||
| 442 | |||
| 443 | RegisterHandlers(functions); | ||
| 444 | } | ||
| 445 | }; | ||
| 446 | |||
| 10 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 447 | void InstallInterfaces(SM::ServiceManager& service_manager) { |
| 448 | std::make_shared<NS>("ns:am2")->InstallAsService(service_manager); | ||
| 449 | std::make_shared<NS>("ns:ec")->InstallAsService(service_manager); | ||
| 450 | std::make_shared<NS>("ns:rid")->InstallAsService(service_manager); | ||
| 451 | std::make_shared<NS>("ns:rt")->InstallAsService(service_manager); | ||
| 452 | std::make_shared<NS>("ns:web")->InstallAsService(service_manager); | ||
| 453 | |||
| 454 | std::make_shared<NS_DEV>()->InstallAsService(service_manager); | ||
| 455 | std::make_shared<NS_SU>()->InstallAsService(service_manager); | ||
| 456 | std::make_shared<NS_VM>()->InstallAsService(service_manager); | ||
| 457 | |||
| 11 | std::make_shared<PL_U>()->InstallAsService(service_manager); | 458 | std::make_shared<PL_U>()->InstallAsService(service_manager); |
| 12 | } | 459 | } |
| 13 | 460 | ||