From d178ea368ac9840ab9a95fca3ff74c39dda9ba96 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 12 Oct 2022 01:47:57 -0700 Subject: [PATCH] lr: new AOC commands use MapAlias for paths... --- .../lr_i_add_on_content_location_resolver.hpp | 20 +++++++++---------- .../include/stratosphere/lr/lr_types.hpp | 4 ++++ ..._add_on_content_location_resolver_impl.cpp | 6 +++--- ..._add_on_content_location_resolver_impl.hpp | 6 +++--- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/lr/lr_i_add_on_content_location_resolver.hpp b/libraries/libstratosphere/include/stratosphere/lr/lr_i_add_on_content_location_resolver.hpp index 893b27012..633a24b78 100644 --- a/libraries/libstratosphere/include/stratosphere/lr/lr_i_add_on_content_location_resolver.hpp +++ b/libraries/libstratosphere/include/stratosphere/lr/lr_i_add_on_content_location_resolver.hpp @@ -17,16 +17,16 @@ #pragma once #include -#define AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \ - AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveAddOnContentPath, (sf::Out out, ncm::DataId id), (out, id), hos::Version_2_0_0) \ - AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorageDeprecated, (ncm::DataId id, ncm::StorageId storage_id), (id, storage_id), hos::Version_2_0_0, hos::Version_8_1_1) \ - AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorage, (ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id), (id, application_id, storage_id), hos::Version_9_0_0) \ - AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterAllAddOnContentPath, (), (), hos::Version_2_0_0) \ - AMS_SF_METHOD_INFO(C, H, 3, Result, RefreshApplicationAddOnContent, (const sf::InArray &ids), (ids), hos::Version_9_0_0) \ - AMS_SF_METHOD_INFO(C, H, 4, Result, UnregisterApplicationAddOnContent, (ncm::ApplicationId id), (id), hos::Version_9_0_0) \ - AMS_SF_METHOD_INFO(C, H, 5, Result, GetRegisteredAddOnContentPaths, (sf::Out out, sf::Out out2, ncm::DataId id), (out, out2, id), hos::Version_15_0_0) \ - AMS_SF_METHOD_INFO(C, H, 6, Result, RegisterAddOnContentPath, (ncm::DataId id, ncm::ApplicationId application_id, const lr::Path &path), (id, application_id, path), hos::Version_15_0_0) \ - AMS_SF_METHOD_INFO(C, H, 7, Result, RegisterAddOnContentPaths, (ncm::DataId id, ncm::ApplicationId application_id, const lr::Path &path, const lr::Path &path2), (id, application_id, path, path2), hos::Version_15_0_0) +#define AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO(C, H) \ + AMS_SF_METHOD_INFO(C, H, 0, Result, ResolveAddOnContentPath, (sf::Out out, ncm::DataId id), (out, id), hos::Version_2_0_0) \ + AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorageDeprecated, (ncm::DataId id, ncm::StorageId storage_id), (id, storage_id), hos::Version_2_0_0, hos::Version_8_1_1) \ + AMS_SF_METHOD_INFO(C, H, 1, Result, RegisterAddOnContentStorage, (ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id), (id, application_id, storage_id), hos::Version_9_0_0) \ + AMS_SF_METHOD_INFO(C, H, 2, Result, UnregisterAllAddOnContentPath, (), (), hos::Version_2_0_0) \ + AMS_SF_METHOD_INFO(C, H, 3, Result, RefreshApplicationAddOnContent, (const sf::InArray &ids), (ids), hos::Version_9_0_0) \ + AMS_SF_METHOD_INFO(C, H, 4, Result, UnregisterApplicationAddOnContent, (ncm::ApplicationId id), (id), hos::Version_9_0_0) \ + AMS_SF_METHOD_INFO(C, H, 5, Result, GetRegisteredAddOnContentPaths, (sf::Out out, sf::Out out2, ncm::DataId id), (out, out2, id), hos::Version_15_0_0) \ + AMS_SF_METHOD_INFO(C, H, 6, Result, RegisterAddOnContentPath, (ncm::DataId id, ncm::ApplicationId application_id, const lr::PathByMapAlias &path), (id, application_id, path), hos::Version_15_0_0) \ + AMS_SF_METHOD_INFO(C, H, 7, Result, RegisterAddOnContentPaths, (ncm::DataId id, ncm::ApplicationId application_id, const lr::PathByMapAlias &path, const lr::PathByMapAlias &path2), (id, application_id, path, path2), hos::Version_15_0_0) AMS_SF_DEFINE_INTERFACE(ams::lr, IAddOnContentLocationResolver, AMS_LR_I_ADD_ON_CONTENT_LOCATION_RESOLVER_INTERFACE_INFO, 0x77617E39) diff --git a/libraries/libstratosphere/include/stratosphere/lr/lr_types.hpp b/libraries/libstratosphere/include/stratosphere/lr/lr_types.hpp index a708606ae..734c5fcb1 100644 --- a/libraries/libstratosphere/include/stratosphere/lr/lr_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/lr/lr_types.hpp @@ -58,4 +58,8 @@ namespace ams::lr { static_assert(util::is_pod::value && sizeof(Path) == fs::EntryNameLengthMax); + struct PathByMapAlias : public Path, ams::sf::PrefersMapAliasTransferMode{}; + static_assert(util::is_pod::value); + static_assert(sizeof(PathByMapAlias) == sizeof(Path)); + } diff --git a/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.cpp b/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.cpp index 1d1bb8425..1b89e4f70 100644 --- a/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.cpp +++ b/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.cpp @@ -156,16 +156,16 @@ namespace ams::lr { R_SUCCEED(); } - Result AddOnContentLocationResolverImpl::GetRegisteredAddOnContentPaths(sf::Out out, sf::Out out2, ncm::DataId id) { + Result AddOnContentLocationResolverImpl::GetRegisteredAddOnContentPaths(sf::Out out, sf::Out out2, ncm::DataId id) { RedirectionAttributes attr, attr2; R_RETURN(this->GetRegisteredAddOnContentPaths(out.GetPointer(), std::addressof(attr), out2.GetPointer(), std::addressof(attr2), id)); } - Result AddOnContentLocationResolverImpl::RegisterAddOnContentPath(ncm::DataId id, ncm::ApplicationId application_id, const lr::Path &path) { + Result AddOnContentLocationResolverImpl::RegisterAddOnContentPath(ncm::DataId id, ncm::ApplicationId application_id, const lr::PathByMapAlias &path) { R_RETURN(this->RegisterAddOnContentPaths(id, application_id, path, DefaultRedirectionAttributes, EmptyPath, DefaultRedirectionAttributes)); } - Result AddOnContentLocationResolverImpl::RegisterAddOnContentPaths(ncm::DataId id, ncm::ApplicationId application_id, const lr::Path &path, const lr::Path &path2) { + Result AddOnContentLocationResolverImpl::RegisterAddOnContentPaths(ncm::DataId id, ncm::ApplicationId application_id, const lr::PathByMapAlias &path, const lr::PathByMapAlias &path2) { R_RETURN(this->RegisterAddOnContentPaths(id, application_id, path, DefaultRedirectionAttributes, path2, DefaultRedirectionAttributes)); } diff --git a/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp b/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp index 14223178c..32e301035 100644 --- a/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp +++ b/libraries/libstratosphere/source/lr/lr_add_on_content_location_resolver_impl.hpp @@ -53,9 +53,9 @@ namespace ams::lr { Result UnregisterAllAddOnContentPath(); Result RefreshApplicationAddOnContent(const sf::InArray &ids); Result UnregisterApplicationAddOnContent(ncm::ApplicationId id); - Result GetRegisteredAddOnContentPaths(sf::Out out, sf::Out out2, ncm::DataId id); - Result RegisterAddOnContentPath(ncm::DataId id, ncm::ApplicationId application_id, const Path &path); - Result RegisterAddOnContentPaths(ncm::DataId id, ncm::ApplicationId application_id, const Path &path, const Path &path2); + Result GetRegisteredAddOnContentPaths(sf::Out out, sf::Out out2, ncm::DataId id); + Result RegisterAddOnContentPath(ncm::DataId id, ncm::ApplicationId application_id, const PathByMapAlias &path); + Result RegisterAddOnContentPaths(ncm::DataId id, ncm::ApplicationId application_id, const PathByMapAlias &path, const PathByMapAlias &path2); private: Result ResolveAddOnContentPath(Path *out, RedirectionAttributes *out_attr, ncm::DataId id); Result GetRegisteredAddOnContentPaths(Path *out, RedirectionAttributes *out_attr, Path *out2, RedirectionAttributes *out_attr2, ncm::DataId id);