diff --git a/stratosphere/ncm/source/lr_contentlocationresolver.cpp b/stratosphere/ncm/source/lr_contentlocationresolver.cpp index 54e4432ff..95680e8bd 100644 --- a/stratosphere/ncm/source/lr_contentlocationresolver.cpp +++ b/stratosphere/ncm/source/lr_contentlocationresolver.cpp @@ -48,7 +48,7 @@ namespace sts::lr { return ResultSuccess; } - Result ContentLocationResolverInterface::RedirectProgramPath(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectProgramPath(InPointer path, ncm::TitleId tid) { this->program_redirector.SetRedirection(tid, *path.pointer); return ResultSuccess; } @@ -85,12 +85,12 @@ namespace sts::lr { return ResultSuccess; } - Result ContentLocationResolverInterface::RedirectApplicationControlPath(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectApplicationControlPath(InPointer path, ncm::TitleId tid) { this->app_control_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } - Result ContentLocationResolverInterface::RedirectApplicationHtmlDocumentPath(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectApplicationHtmlDocumentPath(InPointer path, ncm::TitleId tid) { this->html_docs_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } @@ -106,7 +106,7 @@ namespace sts::lr { return ResultLrLegalInformationNotFound; } - Result ContentLocationResolverInterface::RedirectApplicationLegalInformationPath(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectApplicationLegalInformationPath(InPointer path, ncm::TitleId tid) { this->legal_info_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } @@ -128,7 +128,7 @@ namespace sts::lr { return ResultSuccess; } - Result ContentLocationResolverInterface::RedirectApplicationProgramPath(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectApplicationProgramPath(InPointer path, ncm::TitleId tid) { this->program_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } @@ -180,12 +180,12 @@ namespace sts::lr { return ResultSuccess; } - Result ContentLocationResolverInterface::RedirectProgramPathForDebug(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectProgramPathForDebug(InPointer path, ncm::TitleId tid) { this->debug_program_redirector.SetRedirection(tid, *path.pointer); return ResultSuccess; } - Result ContentLocationResolverInterface::RedirectApplicationProgramPathForDebug(ncm::TitleId tid, InPointer path) { + Result ContentLocationResolverInterface::RedirectApplicationProgramPathForDebug(InPointer path, ncm::TitleId tid) { this->debug_program_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } diff --git a/stratosphere/ncm/source/lr_contentlocationresolver.hpp b/stratosphere/ncm/source/lr_contentlocationresolver.hpp index aa03d9ad4..ea3841053 100644 --- a/stratosphere/ncm/source/lr_contentlocationresolver.hpp +++ b/stratosphere/ncm/source/lr_contentlocationresolver.hpp @@ -26,6 +26,29 @@ namespace sts::lr { class ContentLocationResolverInterface : public ILocationResolver { + private: + enum class CommandId { + ResolveProgramPath = 0, + RedirectProgramPath = 1, + ResolveApplicationControlPath = 2, + ResolveApplicationHtmlDocumentPath = 3, + ResolveDataPath = 4, + RedirectApplicationControlPath = 5, + RedirectApplicationHtmlDocumentPath = 6, + ResolveApplicationLegalInformationPath = 7, + RedirectApplicationLegalInformationPath = 8, + Refresh = 9, + RedirectApplicationProgramPath = 10, + ClearApplicationRedirection = 11, + EraseProgramRedirection = 12, + EraseApplicationControlRedirection = 13, + EraseApplicationHtmlDocumentRedirection = 14, + EraseApplicationLegalInformationRedirection = 15, + ResolveProgramPathForDebug = 16, + RedirectProgramPathForDebug = 17, + RedirectApplicationProgramPathForDebug = 18, + EraseProgramRedirectionForDebug = 19, + }; private: ncm::StorageId storage_id; std::shared_ptr content_meta_database; @@ -37,24 +60,24 @@ namespace sts::lr { ~ContentLocationResolverInterface(); public: virtual Result ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectProgramPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectProgramPath(InPointer path, ncm::TitleId tid) override; virtual Result ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid) override; virtual Result ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) override; virtual Result ResolveDataPath(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectApplicationControlPath(ncm::TitleId tid, InPointer path) override; - virtual Result RedirectApplicationHtmlDocumentPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectApplicationControlPath(InPointer path, ncm::TitleId tid) override; + virtual Result RedirectApplicationHtmlDocumentPath(InPointer path, ncm::TitleId tid) override; virtual Result ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectApplicationLegalInformationPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectApplicationLegalInformationPath(InPointer path, ncm::TitleId tid) override; virtual Result Refresh() override; - virtual Result RedirectApplicationProgramPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectApplicationProgramPath(InPointer path, ncm::TitleId tid) override; virtual Result ClearApplicationRedirection() override; virtual Result EraseProgramRedirection(ncm::TitleId tid) override; virtual Result EraseApplicationControlRedirection(ncm::TitleId tid) override; virtual Result EraseApplicationHtmlDocumentRedirection(ncm::TitleId tid) override; virtual Result EraseApplicationLegalInformationRedirection(ncm::TitleId tid) override; virtual Result ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectProgramPathForDebug(ncm::TitleId tid, InPointer path) override; - virtual Result RedirectApplicationProgramPathForDebug(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectProgramPathForDebug(InPointer path, ncm::TitleId tid) override; + virtual Result RedirectApplicationProgramPathForDebug(InPointer path, ncm::TitleId tid) override; virtual Result EraseProgramRedirectionForDebug(ncm::TitleId tid) override; public: DEFINE_SERVICE_DISPATCH_TABLE { diff --git a/stratosphere/ncm/source/lr_ilocationresolver.cpp b/stratosphere/ncm/source/lr_ilocationresolver.cpp new file mode 100644 index 000000000..ef9bcf71f --- /dev/null +++ b/stratosphere/ncm/source/lr_ilocationresolver.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2019 Adubbz + * + * 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 . + */ + +#include "lr_ilocationresolver.hpp" + +namespace sts::lr { + + Result ILocationResolver::ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::RedirectProgramPath(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::ResolveDataPath(OutPointerWithServerSize out, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::RedirectApplicationControlPath(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::RedirectApplicationHtmlDocumentPath(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::RedirectApplicationLegalInformationPath(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::Refresh() { + std::abort(); + } + + Result ILocationResolver::RedirectApplicationProgramPath(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::ClearApplicationRedirection() { + std::abort(); + } + + Result ILocationResolver::EraseProgramRedirection(ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::EraseApplicationControlRedirection(ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::EraseApplicationHtmlDocumentRedirection(ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::EraseApplicationLegalInformationRedirection(ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::RedirectProgramPathForDebug(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::RedirectApplicationProgramPathForDebug(InPointer path, ncm::TitleId tid) { + std::abort(); + } + + Result ILocationResolver::EraseProgramRedirectionForDebug(ncm::TitleId tid) { + std::abort(); + } + +} \ No newline at end of file diff --git a/stratosphere/ncm/source/lr_ilocationresolver.hpp b/stratosphere/ncm/source/lr_ilocationresolver.hpp index affc57397..b7d6149d6 100644 --- a/stratosphere/ncm/source/lr_ilocationresolver.hpp +++ b/stratosphere/ncm/source/lr_ilocationresolver.hpp @@ -23,29 +23,6 @@ namespace sts::lr { class ILocationResolver : public IServiceObject { - protected: - enum class CommandId { - ResolveProgramPath = 0, - RedirectProgramPath = 1, - ResolveApplicationControlPath = 2, - ResolveApplicationHtmlDocumentPath = 3, - ResolveDataPath = 4, - RedirectApplicationControlPath = 5, - RedirectApplicationHtmlDocumentPath = 6, - ResolveApplicationLegalInformationPath = 7, - RedirectApplicationLegalInformationPath = 8, - Refresh = 9, - RedirectApplicationProgramPath = 10, - ClearApplicationRedirection = 11, - EraseProgramRedirection = 12, - EraseApplicationControlRedirection = 13, - EraseApplicationHtmlDocumentRedirection = 14, - EraseApplicationLegalInformationRedirection = 15, - ResolveProgramPathForDebug = 16, - RedirectProgramPathForDebug = 17, - RedirectApplicationProgramPathForDebug = 18, - EraseProgramRedirectionForDebug = 19, - }; protected: impl::LocationRedirector program_redirector; impl::LocationRedirector debug_program_redirector; @@ -53,26 +30,26 @@ namespace sts::lr { impl::LocationRedirector html_docs_redirector; impl::LocationRedirector legal_info_redirector; public: - virtual Result ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) = 0; - virtual Result RedirectProgramPath(ncm::TitleId tid, InPointer path) = 0; - virtual Result ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid) = 0; - virtual Result ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) = 0; - virtual Result ResolveDataPath(OutPointerWithServerSize out, ncm::TitleId tid) = 0; - virtual Result RedirectApplicationControlPath(ncm::TitleId tid, InPointer path) = 0; - virtual Result RedirectApplicationHtmlDocumentPath(ncm::TitleId tid, InPointer path) = 0; - virtual Result ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid) = 0; - virtual Result RedirectApplicationLegalInformationPath(ncm::TitleId tid, InPointer path) = 0; - virtual Result Refresh() = 0; - virtual Result RedirectApplicationProgramPath(ncm::TitleId tid, InPointer path) = 0; - virtual Result ClearApplicationRedirection() = 0; - virtual Result EraseProgramRedirection(ncm::TitleId tid) = 0; - virtual Result EraseApplicationControlRedirection(ncm::TitleId tid) = 0; - virtual Result EraseApplicationHtmlDocumentRedirection(ncm::TitleId tid) = 0; - virtual Result EraseApplicationLegalInformationRedirection(ncm::TitleId tid) = 0; - virtual Result ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid) = 0; - virtual Result RedirectProgramPathForDebug(ncm::TitleId tid, InPointer path) = 0; - virtual Result RedirectApplicationProgramPathForDebug(ncm::TitleId tid, InPointer path) = 0; - virtual Result EraseProgramRedirectionForDebug(ncm::TitleId tid) = 0; + virtual Result ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid); + virtual Result RedirectProgramPath(InPointer path, ncm::TitleId tid); + virtual Result ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid); + virtual Result ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid); + virtual Result ResolveDataPath(OutPointerWithServerSize out, ncm::TitleId tid); + virtual Result RedirectApplicationControlPath(InPointer path, ncm::TitleId tid); + virtual Result RedirectApplicationHtmlDocumentPath(InPointer path, ncm::TitleId tid); + virtual Result ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid); + virtual Result RedirectApplicationLegalInformationPath(InPointer path, ncm::TitleId tid); + virtual Result Refresh(); + virtual Result RedirectApplicationProgramPath(InPointer path, ncm::TitleId tid); + virtual Result ClearApplicationRedirection(); + virtual Result EraseProgramRedirection(ncm::TitleId tid); + virtual Result EraseApplicationControlRedirection(ncm::TitleId tid); + virtual Result EraseApplicationHtmlDocumentRedirection(ncm::TitleId tid); + virtual Result EraseApplicationLegalInformationRedirection(ncm::TitleId tid); + virtual Result ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid); + virtual Result RedirectProgramPathForDebug(InPointer path, ncm::TitleId tid); + virtual Result RedirectApplicationProgramPathForDebug(InPointer path, ncm::TitleId tid); + virtual Result EraseProgramRedirectionForDebug(ncm::TitleId tid); public: DEFINE_SERVICE_DISPATCH_TABLE {}; diff --git a/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp b/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp index 0c4f3242f..b140e69b1 100644 --- a/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp +++ b/stratosphere/ncm/source/lr_redirectonlylocationresolver.cpp @@ -38,7 +38,7 @@ namespace sts::lr { return ResultLrProgramNotFound; } - Result RedirectOnlyLocationResolverInterface::RedirectProgramPath(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectProgramPath(InPointer path, ncm::TitleId tid) { this->program_redirector.SetRedirection(tid, *path.pointer); return ResultSuccess; } @@ -69,12 +69,12 @@ namespace sts::lr { return ResultLrDataNotFound; } - Result RedirectOnlyLocationResolverInterface::RedirectApplicationControlPath(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectApplicationControlPath(InPointer path, ncm::TitleId tid) { this->app_control_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } - Result RedirectOnlyLocationResolverInterface::RedirectApplicationHtmlDocumentPath(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectApplicationHtmlDocumentPath(InPointer path, ncm::TitleId tid) { this->html_docs_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } @@ -90,7 +90,7 @@ namespace sts::lr { return ResultLrLegalInformationNotFound; } - Result RedirectOnlyLocationResolverInterface::RedirectApplicationLegalInformationPath(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectApplicationLegalInformationPath(InPointer path, ncm::TitleId tid) { this->legal_info_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } @@ -104,7 +104,7 @@ namespace sts::lr { return ResultSuccess; } - Result RedirectOnlyLocationResolverInterface::RedirectApplicationProgramPath(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectApplicationProgramPath(InPointer path, ncm::TitleId tid) { this->program_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } @@ -156,12 +156,12 @@ namespace sts::lr { return ResultSuccess; } - Result RedirectOnlyLocationResolverInterface::RedirectProgramPathForDebug(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectProgramPathForDebug(InPointer path, ncm::TitleId tid) { this->debug_program_redirector.SetRedirection(tid, *path.pointer); return ResultSuccess; } - Result RedirectOnlyLocationResolverInterface::RedirectApplicationProgramPathForDebug(ncm::TitleId tid, InPointer path) { + Result RedirectOnlyLocationResolverInterface::RedirectApplicationProgramPathForDebug(InPointer path, ncm::TitleId tid) { this->debug_program_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application); return ResultSuccess; } diff --git a/stratosphere/ncm/source/lr_redirectonlylocationresolver.hpp b/stratosphere/ncm/source/lr_redirectonlylocationresolver.hpp index a963a1de6..dbfdaac57 100644 --- a/stratosphere/ncm/source/lr_redirectonlylocationresolver.hpp +++ b/stratosphere/ncm/source/lr_redirectonlylocationresolver.hpp @@ -23,28 +23,51 @@ namespace sts::lr { class RedirectOnlyLocationResolverInterface : public ILocationResolver { + private: + enum class CommandId { + ResolveProgramPath = 0, + RedirectProgramPath = 1, + ResolveApplicationControlPath = 2, + ResolveApplicationHtmlDocumentPath = 3, + ResolveDataPath = 4, + RedirectApplicationControlPath = 5, + RedirectApplicationHtmlDocumentPath = 6, + ResolveApplicationLegalInformationPath = 7, + RedirectApplicationLegalInformationPath = 8, + Refresh = 9, + RedirectApplicationProgramPath = 10, + ClearApplicationRedirection = 11, + EraseProgramRedirection = 12, + EraseApplicationControlRedirection = 13, + EraseApplicationHtmlDocumentRedirection = 14, + EraseApplicationLegalInformationRedirection = 15, + ResolveProgramPathForDebug = 16, + RedirectProgramPathForDebug = 17, + RedirectApplicationProgramPathForDebug = 18, + EraseProgramRedirectionForDebug = 19, + }; public: ~RedirectOnlyLocationResolverInterface(); public: virtual Result ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectProgramPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectProgramPath(InPointer path, ncm::TitleId tid) override; virtual Result ResolveApplicationControlPath(OutPointerWithServerSize out, ncm::TitleId tid) override; virtual Result ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid) override; virtual Result ResolveDataPath(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectApplicationControlPath(ncm::TitleId tid, InPointer path) override; - virtual Result RedirectApplicationHtmlDocumentPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectApplicationControlPath(InPointer path, ncm::TitleId tid) override; + virtual Result RedirectApplicationHtmlDocumentPath(InPointer path, ncm::TitleId tid) override; virtual Result ResolveApplicationLegalInformationPath(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectApplicationLegalInformationPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectApplicationLegalInformationPath(InPointer path, ncm::TitleId tid) override; virtual Result Refresh() override; - virtual Result RedirectApplicationProgramPath(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectApplicationProgramPath(InPointer path, ncm::TitleId tid) override; virtual Result ClearApplicationRedirection() override; virtual Result EraseProgramRedirection(ncm::TitleId tid) override; virtual Result EraseApplicationControlRedirection(ncm::TitleId tid) override; virtual Result EraseApplicationHtmlDocumentRedirection(ncm::TitleId tid) override; virtual Result EraseApplicationLegalInformationRedirection(ncm::TitleId tid) override; virtual Result ResolveProgramPathForDebug(OutPointerWithServerSize out, ncm::TitleId tid) override; - virtual Result RedirectProgramPathForDebug(ncm::TitleId tid, InPointer path) override; - virtual Result RedirectApplicationProgramPathForDebug(ncm::TitleId tid, InPointer path) override; + virtual Result RedirectProgramPathForDebug(InPointer path, ncm::TitleId tid) override; + virtual Result RedirectApplicationProgramPathForDebug(InPointer path, ncm::TitleId tid) override; virtual Result EraseProgramRedirectionForDebug(ncm::TitleId tid) override; public: DEFINE_SERVICE_DISPATCH_TABLE { diff --git a/stratosphere/ncm/source/lr_registeredlocationresolver.cpp b/stratosphere/ncm/source/lr_registeredlocationresolver.cpp index 384945199..a21c41120 100644 --- a/stratosphere/ncm/source/lr_registeredlocationresolver.cpp +++ b/stratosphere/ncm/source/lr_registeredlocationresolver.cpp @@ -42,7 +42,7 @@ namespace sts::lr { return ResultSuccess; } - Result RegisteredLocationResolverInterface::RegisterProgramPath(ncm::TitleId tid, InPointer path) { + Result RegisteredLocationResolverInterface::RegisterProgramPath(InPointer path, ncm::TitleId tid) { Path tmp_path = *path.pointer; if (!this->registered_program_redirector.SetRedirection(tid, tmp_path)) { @@ -58,7 +58,7 @@ namespace sts::lr { return ResultSuccess; } - Result RegisteredLocationResolverInterface::RedirectProgramPath(ncm::TitleId tid, InPointer path) { + Result RegisteredLocationResolverInterface::RedirectProgramPath(InPointer path, ncm::TitleId tid) { Path tmp_path = *path.pointer; this->program_redirector.SetRedirection(tid, tmp_path); return ResultSuccess; @@ -77,7 +77,7 @@ namespace sts::lr { return ResultLrHtmlDocumentNotFound; } - Result RegisteredLocationResolverInterface::RegisterHtmlDocumentPath(ncm::TitleId tid, InPointer path) { + Result RegisteredLocationResolverInterface::RegisterHtmlDocumentPath(InPointer path, ncm::TitleId tid) { Path tmp_path = *path.pointer; if (!this->registered_html_docs_redirector.SetRedirection(tid, tmp_path)) { @@ -93,7 +93,7 @@ namespace sts::lr { return ResultSuccess; } - Result RegisteredLocationResolverInterface::RedirectHtmlDocumentPath(ncm::TitleId tid, InPointer path) { + Result RegisteredLocationResolverInterface::RedirectHtmlDocumentPath(InPointer path, ncm::TitleId tid) { Path tmp_path = *path.pointer; this->html_docs_redirector.SetRedirection(tid, tmp_path); return ResultSuccess; diff --git a/stratosphere/ncm/source/lr_registeredlocationresolver.hpp b/stratosphere/ncm/source/lr_registeredlocationresolver.hpp index 8ab09863a..3c40f9462 100644 --- a/stratosphere/ncm/source/lr_registeredlocationresolver.hpp +++ b/stratosphere/ncm/source/lr_registeredlocationresolver.hpp @@ -46,13 +46,13 @@ namespace sts::lr { ~RegisteredLocationResolverInterface(); Result ResolveProgramPath(OutPointerWithServerSize out, ncm::TitleId tid); - Result RegisterProgramPath(ncm::TitleId tid, InPointer path); + Result RegisterProgramPath(InPointer path, ncm::TitleId tid); Result UnregisterProgramPath(ncm::TitleId tid); - Result RedirectProgramPath(ncm::TitleId tid, InPointer path); + Result RedirectProgramPath(InPointer path, ncm::TitleId tid); Result ResolveHtmlDocumentPath(OutPointerWithServerSize out, ncm::TitleId tid); - Result RegisterHtmlDocumentPath(ncm::TitleId tid, InPointer path); + Result RegisterHtmlDocumentPath(InPointer path, ncm::TitleId tid); Result UnregisterHtmlDocumentPath(ncm::TitleId tid); - Result RedirectHtmlDocumentPath(ncm::TitleId tid, InPointer path); + Result RedirectHtmlDocumentPath(InPointer path, ncm::TitleId tid); Result Refresh(); public: DEFINE_SERVICE_DISPATCH_TABLE { diff --git a/stratosphere/ncm/source/ncm_contentmetadatabase.hpp b/stratosphere/ncm/source/ncm_contentmetadatabase.hpp index faca1e8f3..64c3a8492 100644 --- a/stratosphere/ncm/source/ncm_contentmetadatabase.hpp +++ b/stratosphere/ncm/source/ncm_contentmetadatabase.hpp @@ -23,6 +23,30 @@ namespace sts::ncm { class ContentMetaDatabaseInterface : public IContentMetaDatabase { + private: + enum class CommandId { + Set = 0, + Get = 1, + Remove = 2, + GetContentIdByType = 3, + ListContentInfo = 4, + List = 5, + GetLatestContentMetaKey = 6, + ListApplication = 7, + Has = 8, + HasAll = 9, + GetSize = 10, + GetRequiredSystemVersion = 11, + GetPatchId = 12, + DisableForcibly = 13, + LookupOrphanContent = 14, + Commit = 15, + HasContent = 16, + ListContentMetaInfo = 17, + GetAttributes = 18, + GetRequiredApplicationVersion = 19, + GetContentIdByTypeAndIdOffset = 20, + }; public: ContentMetaDatabaseInterface(sts::kvdb::MemoryKeyValueStore* kvs, const char* mount_name) : IContentMetaDatabase(kvs, mount_name) { } @@ -84,6 +108,30 @@ namespace sts::ncm { }; class OnMemoryContentMetaDatabaseInterface : public ContentMetaDatabaseInterface { + private: + enum class CommandId { + Set = 0, + Get = 1, + Remove = 2, + GetContentIdByType = 3, + ListContentInfo = 4, + List = 5, + GetLatestContentMetaKey = 6, + ListApplication = 7, + Has = 8, + HasAll = 9, + GetSize = 10, + GetRequiredSystemVersion = 11, + GetPatchId = 12, + DisableForcibly = 13, + LookupOrphanContent = 14, + Commit = 15, + HasContent = 16, + ListContentMetaInfo = 17, + GetAttributes = 18, + GetRequiredApplicationVersion = 19, + GetContentIdByTypeAndIdOffset = 20, + }; public: OnMemoryContentMetaDatabaseInterface(sts::kvdb::MemoryKeyValueStore* kvs) : ContentMetaDatabaseInterface(kvs) { } diff --git a/stratosphere/ncm/source/ncm_contentstorage.hpp b/stratosphere/ncm/source/ncm_contentstorage.hpp index df124f9bd..d69b115f7 100644 --- a/stratosphere/ncm/source/ncm_contentstorage.hpp +++ b/stratosphere/ncm/source/ncm_contentstorage.hpp @@ -25,6 +25,37 @@ namespace sts::ncm { class ContentStorageInterface : public IContentStorage { + private: + enum class CommandId { + GeneratePlaceHolderId = 0, + CreatePlaceHolder = 1, + DeletePlaceHolder = 2, + HasPlaceHolder = 3, + WritePlaceHolder = 4, + Register = 5, + Delete = 6, + Has = 7, + GetPath = 8, + GetPlaceHolderPath = 9, + CleanupAllPlaceHolder = 10, + ListPlaceHolder = 11, + GetContentCount = 12, + ListContentId = 13, + GetSizeFromContentId = 14, + DisableForcibly = 15, + RevertToPlaceHolder = 16, + SetPlaceHolderSize = 17, + ReadContentIdFile = 18, + GetRightsIdFromPlaceHolderId = 19, + GetRightsIdFromContentId = 20, + WriteContentForDebug = 21, + GetFreeSpaceSize = 22, + GetTotalSpaceSize = 23, + FlushPlaceHolder = 24, + GetSizeFromPlaceHolderId = 25, + RepairInvalidFileAttribute = 26, + GetRightsIdFromPlaceHolderIdWithCache = 27, + }; protected: impl::PlaceHolderAccessor placeholder_accessor; ContentId cached_content_id; diff --git a/stratosphere/ncm/source/ncm_icontentmetadatabase.cpp b/stratosphere/ncm/source/ncm_icontentmetadatabase.cpp new file mode 100644 index 000000000..7512ccc15 --- /dev/null +++ b/stratosphere/ncm/source/ncm_icontentmetadatabase.cpp @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2019 Adubbz + * + * 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 . + */ + +#include "ncm_icontentmetadatabase.hpp" + +namespace sts::ncm { + + Result IContentMetaDatabase::Set(ContentMetaKey key, InBuffer value) { + std::abort(); + } + + Result IContentMetaDatabase::Get(Out out_size, ContentMetaKey key, OutBuffer out_value) { + std::abort(); + } + + Result IContentMetaDatabase::Remove(ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::GetContentIdByType(Out out_content_id, ContentMetaKey key, ContentType type) { + std::abort(); + } + + Result IContentMetaDatabase::ListContentInfo(Out out_entries_written, OutBuffer out_info, ContentMetaKey key, u32 start_index) { + std::abort(); + } + + Result IContentMetaDatabase::List(Out out_entries_total, Out out_entries_written, OutBuffer out_info, ContentMetaType type, TitleId application_title_id, TitleId title_id_min, TitleId title_id_max, ContentInstallType install_type) { + std::abort(); + } + + Result IContentMetaDatabase::GetLatestContentMetaKey(Out out_key, TitleId title_id) { + std::abort(); + } + + Result IContentMetaDatabase::ListApplication(Out out_entries_total, Out out_entries_written, OutBuffer out_keys, ContentMetaType type) { + std::abort(); + } + + Result IContentMetaDatabase::Has(Out out, ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::HasAll(Out out, InBuffer keys) { + std::abort(); + } + + Result IContentMetaDatabase::GetSize(Out out_size, ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::GetRequiredSystemVersion(Out out_version, ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::GetPatchId(Out out_patch_id, ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::DisableForcibly() { + std::abort(); + } + + Result IContentMetaDatabase::LookupOrphanContent(OutBuffer out_orphaned, InBuffer content_ids) { + std::abort(); + } + + Result IContentMetaDatabase::Commit() { + std::abort(); + } + + Result IContentMetaDatabase::HasContent(Out out, ContentMetaKey key, ContentId content_id) { + std::abort(); + } + + Result IContentMetaDatabase::ListContentMetaInfo(Out out_entries_written, OutBuffer out_meta_info, ContentMetaKey key, u32 start_index) { + std::abort(); + } + + Result IContentMetaDatabase::GetAttributes(Out out_attributes, ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::GetRequiredApplicationVersion(Out out_version, ContentMetaKey key) { + std::abort(); + } + + Result IContentMetaDatabase::GetContentIdByTypeAndIdOffset(Out out_content_id, ContentMetaKey key, ContentType type, u8 id_offset) { + std::abort(); + } + + Result IContentMetaDatabase::GetLatestProgram(ContentId* out_content_id, TitleId title_id) { + std::abort(); + } + + Result IContentMetaDatabase::GetLatestData(ContentId* out_content_id, TitleId title_id) { + std::abort(); + } + +} \ No newline at end of file diff --git a/stratosphere/ncm/source/ncm_icontentmetadatabase.hpp b/stratosphere/ncm/source/ncm_icontentmetadatabase.hpp index c094f38f2..2fec2aa92 100644 --- a/stratosphere/ncm/source/ncm_icontentmetadatabase.hpp +++ b/stratosphere/ncm/source/ncm_icontentmetadatabase.hpp @@ -24,30 +24,6 @@ namespace sts::ncm { class IContentMetaDatabase : public IServiceObject { - protected: - enum class CommandId { - Set = 0, - Get = 1, - Remove = 2, - GetContentIdByType = 3, - ListContentInfo = 4, - List = 5, - GetLatestContentMetaKey = 6, - ListApplication = 7, - Has = 8, - HasAll = 9, - GetSize = 10, - GetRequiredSystemVersion = 11, - GetPatchId = 12, - DisableForcibly = 13, - LookupOrphanContent = 14, - Commit = 15, - HasContent = 16, - ListContentMetaInfo = 17, - GetAttributes = 18, - GetRequiredApplicationVersion = 19, - GetContentIdByTypeAndIdOffset = 20, - }; protected: sts::kvdb::MemoryKeyValueStore* kvs; char mount_name[16]; @@ -65,31 +41,31 @@ namespace sts::ncm { } public: /* Actual commands. */ - virtual Result Set(ContentMetaKey key, InBuffer value) = 0; - virtual Result Get(Out out_size, ContentMetaKey key, OutBuffer out_value) = 0; - virtual Result Remove(ContentMetaKey key) = 0; - virtual Result GetContentIdByType(Out out_content_id, ContentMetaKey key, ContentType type) = 0; - virtual Result ListContentInfo(Out out_entries_written, OutBuffer out_info, ContentMetaKey key, u32 start_index) = 0; - virtual Result List(Out out_entries_total, Out out_entries_written, OutBuffer out_info, ContentMetaType meta_type, TitleId application_title_id, TitleId title_id_min, TitleId title_id_max, ContentInstallType install_type) = 0; - virtual Result GetLatestContentMetaKey(Out out_key, TitleId tid) = 0; - virtual Result ListApplication(Out out_entries_total, Out out_entries_written, OutBuffer out_keys, ContentMetaType meta_type) = 0; - virtual Result Has(Out out, ContentMetaKey key) = 0; - virtual Result HasAll(Out out, InBuffer keys) = 0; - virtual Result GetSize(Out out_size, ContentMetaKey key) = 0; - virtual Result GetRequiredSystemVersion(Out out_version, ContentMetaKey key) = 0; - virtual Result GetPatchId(Out out_patch_id, ContentMetaKey key) = 0; - virtual Result DisableForcibly() = 0; - virtual Result LookupOrphanContent(OutBuffer out_orphaned, InBuffer content_ids) = 0; - virtual Result Commit() = 0; - virtual Result HasContent(Out out, ContentMetaKey key, ContentId content_id) = 0; - virtual Result ListContentMetaInfo(Out out_entries_written, OutBuffer out_meta_info, ContentMetaKey key, u32 start_index) = 0; - virtual Result GetAttributes(Out out_attributes, ContentMetaKey key) = 0; - virtual Result GetRequiredApplicationVersion(Out out_version, ContentMetaKey key) = 0; - virtual Result GetContentIdByTypeAndIdOffset(Out out_content_id, ContentMetaKey key, ContentType type, u8 id_offset) = 0; + virtual Result Set(ContentMetaKey key, InBuffer value); + virtual Result Get(Out out_size, ContentMetaKey key, OutBuffer out_value); + virtual Result Remove(ContentMetaKey key); + virtual Result GetContentIdByType(Out out_content_id, ContentMetaKey key, ContentType type); + virtual Result ListContentInfo(Out out_entries_written, OutBuffer out_info, ContentMetaKey key, u32 start_index); + virtual Result List(Out out_entries_total, Out out_entries_written, OutBuffer out_info, ContentMetaType meta_type, TitleId application_title_id, TitleId title_id_min, TitleId title_id_max, ContentInstallType install_type); + virtual Result GetLatestContentMetaKey(Out out_key, TitleId tid); + virtual Result ListApplication(Out out_entries_total, Out out_entries_written, OutBuffer out_keys, ContentMetaType meta_type); + virtual Result Has(Out out, ContentMetaKey key); + virtual Result HasAll(Out out, InBuffer keys); + virtual Result GetSize(Out out_size, ContentMetaKey key); + virtual Result GetRequiredSystemVersion(Out out_version, ContentMetaKey key); + virtual Result GetPatchId(Out out_patch_id, ContentMetaKey key); + virtual Result DisableForcibly(); + virtual Result LookupOrphanContent(OutBuffer out_orphaned, InBuffer content_ids); + virtual Result Commit(); + virtual Result HasContent(Out out, ContentMetaKey key, ContentId content_id); + virtual Result ListContentMetaInfo(Out out_entries_written, OutBuffer out_meta_info, ContentMetaKey key, u32 start_index); + virtual Result GetAttributes(Out out_attributes, ContentMetaKey key); + virtual Result GetRequiredApplicationVersion(Out out_version, ContentMetaKey key); + virtual Result GetContentIdByTypeAndIdOffset(Out out_content_id, ContentMetaKey key, ContentType type, u8 id_offset); /* APIs. */ - virtual Result GetLatestProgram(ContentId* out_content_id, TitleId title_id) = 0; - virtual Result GetLatestData(ContentId* out_content_id, TitleId title_id) = 0; + virtual Result GetLatestProgram(ContentId* out_content_id, TitleId title_id); + virtual Result GetLatestData(ContentId* out_content_id, TitleId title_id); public: DEFINE_SERVICE_DISPATCH_TABLE {}; }; diff --git a/stratosphere/ncm/source/ncm_icontentstorage.cpp b/stratosphere/ncm/source/ncm_icontentstorage.cpp new file mode 100644 index 000000000..26db32fc5 --- /dev/null +++ b/stratosphere/ncm/source/ncm_icontentstorage.cpp @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2019 Adubbz + * + * 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 . + */ + +#include "ncm_icontentstorage.hpp" + +namespace sts::ncm { + + Result IContentStorage::GeneratePlaceHolderId(Out out) { + std::abort(); + } + + Result IContentStorage::CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, u64 size) { + std::abort(); + } + + Result IContentStorage::DeletePlaceHolder(PlaceHolderId placeholder_id) { + std::abort(); + } + + Result IContentStorage::HasPlaceHolder(Out out, PlaceHolderId placeholder_id) { + std::abort(); + } + + Result IContentStorage::WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, InBuffer data) { + std::abort(); + } + + Result IContentStorage::Register(PlaceHolderId placeholder_id, ContentId content_id) { + std::abort(); + } + + Result IContentStorage::Delete(ContentId content_id) { + std::abort(); + } + + Result IContentStorage::Has(Out out, ContentId content_id) { + std::abort(); + } + + Result IContentStorage::GetPath(OutPointerWithServerSize out, ContentId content_id) { + std::abort(); + } + + Result IContentStorage::GetPlaceHolderPath(OutPointerWithServerSize out, PlaceHolderId placeholder_id) { + std::abort(); + } + + Result IContentStorage::CleanupAllPlaceHolder() { + std::abort(); + } + + Result IContentStorage::ListPlaceHolder(Out out_count, OutBuffer out_buf) { + std::abort(); + } + + Result IContentStorage::GetContentCount(Out out_count) { + std::abort(); + } + + Result IContentStorage::ListContentId(Out out_count, OutBuffer out_buf, u32 start_offset) { + std::abort(); + } + + Result IContentStorage::GetSizeFromContentId(Out out_size, ContentId content_id) { + std::abort(); + } + + Result IContentStorage::DisableForcibly() { + std::abort(); + } + + Result IContentStorage::RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) { + std::abort(); + } + + Result IContentStorage::SetPlaceHolderSize(PlaceHolderId placeholder_id, u64 size) { + std::abort(); + } + + Result IContentStorage::ReadContentIdFile(OutBuffer buf, ContentId content_id, u64 offset) { + std::abort(); + } + + Result IContentStorage::GetRightsIdFromPlaceHolderId(Out out_rights_id, Out out_key_generation, PlaceHolderId placeholder_id) { + std::abort(); + } + + Result IContentStorage::GetRightsIdFromContentId(Out out_rights_id, Out out_key_generation, ContentId content_id) { + std::abort(); + } + + Result IContentStorage::WriteContentForDebug(ContentId content_id, u64 offset, InBuffer data) { + std::abort(); + } + + Result IContentStorage::GetFreeSpaceSize(Out out_size) { + std::abort(); + } + + Result IContentStorage::GetTotalSpaceSize(Out out_size) { + std::abort(); + } + + Result IContentStorage::FlushPlaceHolder() { + std::abort(); + } + + Result IContentStorage::GetSizeFromPlaceHolderId(Out out_size, PlaceHolderId placeholder_id) { + std::abort(); + } + + Result IContentStorage::RepairInvalidFileAttribute() { + std::abort(); + } + + Result IContentStorage::GetRightsIdFromPlaceHolderIdWithCache(Out out_rights_id, Out out_key_generation, PlaceHolderId placeholder_id, ContentId cache_content_id) { + std::abort(); + } + +} \ No newline at end of file diff --git a/stratosphere/ncm/source/ncm_icontentstorage.hpp b/stratosphere/ncm/source/ncm_icontentstorage.hpp index a583c937c..7ac4b6c78 100644 --- a/stratosphere/ncm/source/ncm_icontentstorage.hpp +++ b/stratosphere/ncm/source/ncm_icontentstorage.hpp @@ -24,70 +24,39 @@ namespace sts::ncm { class IContentStorage : public IServiceObject { - protected: - enum class CommandId { - GeneratePlaceHolderId = 0, - CreatePlaceHolder = 1, - DeletePlaceHolder = 2, - HasPlaceHolder = 3, - WritePlaceHolder = 4, - Register = 5, - Delete = 6, - Has = 7, - GetPath = 8, - GetPlaceHolderPath = 9, - CleanupAllPlaceHolder = 10, - ListPlaceHolder = 11, - GetContentCount = 12, - ListContentId = 13, - GetSizeFromContentId = 14, - DisableForcibly = 15, - RevertToPlaceHolder = 16, - SetPlaceHolderSize = 17, - ReadContentIdFile = 18, - GetRightsIdFromPlaceHolderId = 19, - GetRightsIdFromContentId = 20, - WriteContentForDebug = 21, - GetFreeSpaceSize = 22, - GetTotalSpaceSize = 23, - FlushPlaceHolder = 24, - GetSizeFromPlaceHolderId = 25, - RepairInvalidFileAttribute = 26, - GetRightsIdFromPlaceHolderIdWithCache = 27, - }; protected: char root_path[FS_MAX_PATH-1]; MakeContentPathFunc make_content_path_func; bool disabled; public: - virtual Result GeneratePlaceHolderId(Out out) = 0; - virtual Result CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, u64 size) = 0; - virtual Result DeletePlaceHolder(PlaceHolderId placeholder_id) = 0; - virtual Result HasPlaceHolder(Out out, PlaceHolderId placeholder_id) = 0; - virtual Result WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, InBuffer data) = 0; - virtual Result Register(PlaceHolderId placeholder_id, ContentId content_id) = 0; - virtual Result Delete(ContentId content_id) = 0; - virtual Result Has(Out out, ContentId content_id) = 0; - virtual Result GetPath(OutPointerWithServerSize out, ContentId content_id) = 0; - virtual Result GetPlaceHolderPath(OutPointerWithServerSize out, PlaceHolderId placeholder_id) = 0; - virtual Result CleanupAllPlaceHolder() = 0; - virtual Result ListPlaceHolder(Out out_count, OutBuffer out_buf) = 0; - virtual Result GetContentCount(Out out_count) = 0; - virtual Result ListContentId(Out out_count, OutBuffer out_buf, u32 start_offset) = 0; - virtual Result GetSizeFromContentId(Out out_size, ContentId content_id) = 0; - virtual Result DisableForcibly() = 0; - virtual Result RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) = 0; - virtual Result SetPlaceHolderSize(PlaceHolderId placeholder_id, u64 size) = 0; - virtual Result ReadContentIdFile(OutBuffer buf, ContentId content_id, u64 offset) = 0; - virtual Result GetRightsIdFromPlaceHolderId(Out out_rights_id, Out out_key_generation, PlaceHolderId placeholder_id) = 0; - virtual Result GetRightsIdFromContentId(Out out_rights_id, Out out_key_generation, ContentId content_id) = 0; - virtual Result WriteContentForDebug(ContentId content_id, u64 offset, InBuffer data) = 0; - virtual Result GetFreeSpaceSize(Out out_size) = 0; - virtual Result GetTotalSpaceSize(Out out_size) = 0; - virtual Result FlushPlaceHolder() = 0; - virtual Result GetSizeFromPlaceHolderId(Out out, PlaceHolderId placeholder_id) = 0; - virtual Result RepairInvalidFileAttribute() = 0; - virtual Result GetRightsIdFromPlaceHolderIdWithCache(Out out_rights_id, Out out_key_generation, PlaceHolderId placeholder_id, ContentId cache_content_id) = 0; + virtual Result GeneratePlaceHolderId(Out out); + virtual Result CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, u64 size); + virtual Result DeletePlaceHolder(PlaceHolderId placeholder_id); + virtual Result HasPlaceHolder(Out out, PlaceHolderId placeholder_id); + virtual Result WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, InBuffer data); + virtual Result Register(PlaceHolderId placeholder_id, ContentId content_id); + virtual Result Delete(ContentId content_id); + virtual Result Has(Out out, ContentId content_id); + virtual Result GetPath(OutPointerWithServerSize out, ContentId content_id); + virtual Result GetPlaceHolderPath(OutPointerWithServerSize out, PlaceHolderId placeholder_id); + virtual Result CleanupAllPlaceHolder(); + virtual Result ListPlaceHolder(Out out_count, OutBuffer out_buf); + virtual Result GetContentCount(Out out_count); + virtual Result ListContentId(Out out_count, OutBuffer out_buf, u32 start_offset); + virtual Result GetSizeFromContentId(Out out_size, ContentId content_id); + virtual Result DisableForcibly(); + virtual Result RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id); + virtual Result SetPlaceHolderSize(PlaceHolderId placeholder_id, u64 size); + virtual Result ReadContentIdFile(OutBuffer buf, ContentId content_id, u64 offset); + virtual Result GetRightsIdFromPlaceHolderId(Out out_rights_id, Out out_key_generation, PlaceHolderId placeholder_id); + virtual Result GetRightsIdFromContentId(Out out_rights_id, Out out_key_generation, ContentId content_id); + virtual Result WriteContentForDebug(ContentId content_id, u64 offset, InBuffer data); + virtual Result GetFreeSpaceSize(Out out_size); + virtual Result GetTotalSpaceSize(Out out_size); + virtual Result FlushPlaceHolder(); + virtual Result GetSizeFromPlaceHolderId(Out out, PlaceHolderId placeholder_id); + virtual Result RepairInvalidFileAttribute(); + virtual Result GetRightsIdFromPlaceHolderIdWithCache(Out out_rights_id, Out out_key_generation, PlaceHolderId placeholder_id, ContentId cache_content_id); public: DEFINE_SERVICE_DISPATCH_TABLE {}; }; diff --git a/stratosphere/ncm/source/ncm_readonlycontentstorage.hpp b/stratosphere/ncm/source/ncm_readonlycontentstorage.hpp index 135690230..169d814b8 100644 --- a/stratosphere/ncm/source/ncm_readonlycontentstorage.hpp +++ b/stratosphere/ncm/source/ncm_readonlycontentstorage.hpp @@ -23,6 +23,37 @@ namespace sts::ncm { class ReadOnlyContentStorageInterface : public IContentStorage { + private: + enum class CommandId { + GeneratePlaceHolderId = 0, + CreatePlaceHolder = 1, + DeletePlaceHolder = 2, + HasPlaceHolder = 3, + WritePlaceHolder = 4, + Register = 5, + Delete = 6, + Has = 7, + GetPath = 8, + GetPlaceHolderPath = 9, + CleanupAllPlaceHolder = 10, + ListPlaceHolder = 11, + GetContentCount = 12, + ListContentId = 13, + GetSizeFromContentId = 14, + DisableForcibly = 15, + RevertToPlaceHolder = 16, + SetPlaceHolderSize = 17, + ReadContentIdFile = 18, + GetRightsIdFromPlaceHolderId = 19, + GetRightsIdFromContentId = 20, + WriteContentForDebug = 21, + GetFreeSpaceSize = 22, + GetTotalSpaceSize = 23, + FlushPlaceHolder = 24, + GetSizeFromPlaceHolderId = 25, + RepairInvalidFileAttribute = 26, + GetRightsIdFromPlaceHolderIdWithCache = 27, + }; public: Result Initialize(const char* root_path, MakeContentPathFunc content_path_func); public: