diff options
| -rw-r--r-- | src/core/hle/service/ncm/ncm.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index 5d31f638f..7f775900a 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp | |||
| @@ -11,8 +11,45 @@ | |||
| 11 | namespace Service::NCM { | 11 | namespace Service::NCM { |
| 12 | 12 | ||
| 13 | class LocationResolver final : public ServiceFramework<LocationResolver> { | 13 | class LocationResolver final : public ServiceFramework<LocationResolver> { |
| 14 | class ILocationResolver final : public ServiceFramework<ILocationResolver> { | ||
| 15 | public: | ||
| 16 | explicit ILocationResolver(FileSys::StorageId id) | ||
| 17 | : ServiceFramework{"ILocationResolver"}, storage(id) { | ||
| 18 | static const FunctionInfo functions[] = { | ||
| 19 | {0, nullptr, "ResolveProgramPath"}, | ||
| 20 | {1, nullptr, "RedirectProgramPath"}, | ||
| 21 | {2, nullptr, "ResolveApplicationControlPath"}, | ||
| 22 | {3, nullptr, "ResolveApplicationHtmlDocumentPath"}, | ||
| 23 | {4, nullptr, "ResolveDataPath"}, | ||
| 24 | {5, nullptr, "RedirectApplicationControlPath"}, | ||
| 25 | {6, nullptr, "RedirectApplicationHtmlDocumentPath"}, | ||
| 26 | {7, nullptr, "ResolveApplicationLegalInformationPath"}, | ||
| 27 | {8, nullptr, "RedirectApplicationLegalInformationPath"}, | ||
| 28 | {9, nullptr, "Refresh"}, | ||
| 29 | {10, nullptr, "RedirectProgramPath2"}, | ||
| 30 | {11, nullptr, "Refresh2"}, | ||
| 31 | {12, nullptr, "DeleteProgramPath"}, | ||
| 32 | {13, nullptr, "DeleteApplicationControlPath"}, | ||
| 33 | {14, nullptr, "DeleteApplicationHtmlDocumentPath"}, | ||
| 34 | {15, nullptr, "DeleteApplicationLegalInformationPath"}, | ||
| 35 | {16, nullptr, ""}, | ||
| 36 | {17, nullptr, ""}, | ||
| 37 | {18, nullptr, ""}, | ||
| 38 | {19, nullptr, ""}, | ||
| 39 | }; | ||
| 40 | |||
| 41 | RegisterHandlers(functions); | ||
| 42 | } | ||
| 43 | |||
| 44 | private: | ||
| 45 | FileSys::StorageId storage; | ||
| 46 | }; | ||
| 47 | |||
| 14 | public: | 48 | public: |
| 15 | explicit LocationResolver() : ServiceFramework{"lr"} { | 49 | explicit LocationResolver() : ServiceFramework{"lr"} { |
| 50 | class LR final : public ServiceFramework<LR> { | ||
| 51 | public: | ||
| 52 | explicit LR() : ServiceFramework{"lr"} { | ||
| 16 | // clang-format off | 53 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 54 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "OpenLocationResolver"}, | 55 | {0, nullptr, "OpenLocationResolver"}, |
| @@ -24,6 +61,19 @@ public: | |||
| 24 | 61 | ||
| 25 | RegisterHandlers(functions); | 62 | RegisterHandlers(functions); |
| 26 | } | 63 | } |
| 64 | |||
| 65 | private: | ||
| 66 | void OpenLocationResolver(Kernel::HLERequestContext& ctx) { | ||
| 67 | IPC::RequestParser rp{ctx}; | ||
| 68 | const auto id = rp.PopRaw<FileSys::StorageId>(); | ||
| 69 | |||
| 70 | LOG_DEBUG(Service_NCM, "called, id={:02X}", static_cast<u8>(id)); | ||
| 71 | |||
| 72 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 73 | rb.Push(RESULT_SUCCESS); | ||
| 74 | rb.PushIpcInterface(std::make_shared<ILocationResolver>(id)); | ||
| 75 | } | ||
| 76 | |||
| 27 | }; | 77 | }; |
| 28 | 78 | ||
| 29 | class NCM final : public ServiceFramework<NCM> { | 79 | class NCM final : public ServiceFramework<NCM> { |