From d73c22bf4d975379d0e379f4f03398f102e7836d Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 3 Jun 2018 14:19:24 -0400 Subject: am: Implement ILibraryAppletCreator::CreateStorage. --- src/core/hle/service/am/am.cpp | 54 ++++++++++++++++++++++++++---------------- src/core/hle/service/am/am.h | 1 + 2 files changed, 34 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 6b1d6bf97..9434512d8 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -391,27 +391,6 @@ private: Kernel::SharedPtr state_changed_event; }; -ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") { - static const FunctionInfo functions[] = { - {0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"}, - {1, nullptr, "TerminateAllLibraryApplets"}, - {2, nullptr, "AreAnyLibraryAppletsLeft"}, - {10, nullptr, "CreateStorage"}, - {11, nullptr, "CreateTransferMemoryStorage"}, - {12, nullptr, "CreateHandleStorage"}, - }; - RegisterHandlers(functions); -} - -void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) { - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - - rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface(); - - NGLOG_DEBUG(Service_AM, "called"); -} - class IStorageAccessor final : public ServiceFramework { public: explicit IStorageAccessor(std::vector buffer) @@ -479,6 +458,39 @@ private: } }; +ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") { + static const FunctionInfo functions[] = { + {0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"}, + {1, nullptr, "TerminateAllLibraryApplets"}, + {2, nullptr, "AreAnyLibraryAppletsLeft"}, + {10, &ILibraryAppletCreator::CreateStorage, "CreateStorage"}, + {11, nullptr, "CreateTransferMemoryStorage"}, + {12, nullptr, "CreateHandleStorage"}, + }; + RegisterHandlers(functions); +} + +void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface(); + + NGLOG_DEBUG(Service_AM, "called"); +} + +void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const u64 size{rp.Pop()}; + std::vector buffer(size); + + IPC::ResponseBuilder rb{rp.MakeBuilder(2, 0, 1)}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface(std::move(buffer)); + + NGLOG_DEBUG(Service_AM, "called, size={}", size); +} + IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationFunctions") { static const FunctionInfo functions[] = { {1, &IApplicationFunctions::PopLaunchParameter, "PopLaunchParameter"}, diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index ff8eb14d7..301a6c798 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -121,6 +121,7 @@ public: private: void CreateLibraryApplet(Kernel::HLERequestContext& ctx); + void CreateStorage(Kernel::HLERequestContext& ctx); }; class IApplicationFunctions final : public ServiceFramework { -- cgit v1.2.3