Browse Source
Merge pull request #13048 from liamwhite/new-shell
Merge pull request #13048 from liamwhite/new-shell
ns: rewrite for new IPCpull/15/merge
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
46 changed files with 2029 additions and 1183 deletions
-
43src/core/CMakeLists.txt
-
2src/core/file_sys/system_archive/shared_font.cpp
-
2src/core/hle/service/am/frontend/applet_web_browser.cpp
-
11src/core/hle/service/am/service/application_functions.cpp
-
11src/core/hle/service/am/service/library_applet_self_accessor.cpp
-
21src/core/hle/service/ns/account_proxy_interface.cpp
-
16src/core/hle/service/ns/account_proxy_interface.h
-
519src/core/hle/service/ns/application_manager_interface.cpp
-
62src/core/hle/service/ns/application_manager_interface.h
-
33src/core/hle/service/ns/application_version_interface.cpp
-
16src/core/hle/service/ns/application_version_interface.h
-
72src/core/hle/service/ns/content_management_interface.cpp
-
25src/core/hle/service/ns/content_management_interface.h
-
38src/core/hle/service/ns/develop_interface.cpp
-
16src/core/hle/service/ns/develop_interface.h
-
38src/core/hle/service/ns/document_interface.cpp
-
22src/core/hle/service/ns/document_interface.h
-
39src/core/hle/service/ns/download_task_interface.cpp
-
20src/core/hle/service/ns/download_task_interface.h
-
62src/core/hle/service/ns/dynamic_rights_interface.cpp
-
22src/core/hle/service/ns/dynamic_rights_interface.h
-
27src/core/hle/service/ns/ecommerce_interface.cpp
-
16src/core/hle/service/ns/ecommerce_interface.h
-
27src/core/hle/service/ns/factory_reset_interface.cpp
-
16src/core/hle/service/ns/factory_reset_interface.h
-
903src/core/hle/service/ns/ns.cpp
-
133src/core/hle/service/ns/ns.h
-
0src/core/hle/service/ns/ns_results.h
-
111src/core/hle/service/ns/ns_types.h
-
67src/core/hle/service/ns/pdm_qry.cpp
-
130src/core/hle/service/ns/platform_service_manager.cpp
-
33src/core/hle/service/ns/platform_service_manager.h
-
57src/core/hle/service/ns/query_service.cpp
-
12src/core/hle/service/ns/query_service.h
-
122src/core/hle/service/ns/read_only_application_control_data_interface.cpp
-
30src/core/hle/service/ns/read_only_application_control_data_interface.h
-
38src/core/hle/service/ns/read_only_application_record_interface.cpp
-
22src/core/hle/service/ns/read_only_application_record_interface.h
-
120src/core/hle/service/ns/service_getter_interface.cpp
-
47src/core/hle/service/ns/service_getter_interface.h
-
44src/core/hle/service/ns/system_update_control.cpp
-
16src/core/hle/service/ns/system_update_control.h
-
61src/core/hle/service/ns/system_update_interface.cpp
-
38src/core/hle/service/ns/system_update_interface.h
-
31src/core/hle/service/ns/vulnerability_manager_interface.cpp
-
21src/core/hle/service/ns/vulnerability_manager_interface.h
@ -0,0 +1,21 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/ns/account_proxy_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IAccountProxyInterface::IAccountProxyInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IAccountProxyInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "CreateUserAccount"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IAccountProxyInterface::~IAccountProxyInterface() = default; |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,16 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> { |
|||
public: |
|||
explicit IAccountProxyInterface(Core::System& system_); |
|||
~IAccountProxyInterface() override; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,519 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/file_sys/nca_metadata.h"
|
|||
#include "core/file_sys/registered_cache.h"
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/filesystem/filesystem.h"
|
|||
#include "core/hle/service/ns/application_manager_interface.h"
|
|||
#include "core/hle/service/ns/content_management_interface.h"
|
|||
#include "core/hle/service/ns/read_only_application_control_data_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IApplicationManagerInterface"}, |
|||
service_context{system, "IApplicationManagerInterface"}, |
|||
record_update_system_event{service_context}, sd_card_mount_status_event{service_context}, |
|||
gamecard_update_detection_event{service_context}, |
|||
gamecard_mount_status_event{service_context}, gamecard_mount_failure_event{service_context} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, D<&IApplicationManagerInterface::ListApplicationRecord>, "ListApplicationRecord"}, |
|||
{1, nullptr, "GenerateApplicationRecordCount"}, |
|||
{2, D<&IApplicationManagerInterface::GetApplicationRecordUpdateSystemEvent>, "GetApplicationRecordUpdateSystemEvent"}, |
|||
{3, nullptr, "GetApplicationViewDeprecated"}, |
|||
{4, nullptr, "DeleteApplicationEntity"}, |
|||
{5, nullptr, "DeleteApplicationCompletely"}, |
|||
{6, nullptr, "IsAnyApplicationEntityRedundant"}, |
|||
{7, nullptr, "DeleteRedundantApplicationEntity"}, |
|||
{8, nullptr, "IsApplicationEntityMovable"}, |
|||
{9, nullptr, "MoveApplicationEntity"}, |
|||
{11, nullptr, "CalculateApplicationOccupiedSize"}, |
|||
{16, nullptr, "PushApplicationRecord"}, |
|||
{17, nullptr, "ListApplicationRecordContentMeta"}, |
|||
{19, nullptr, "LaunchApplicationOld"}, |
|||
{21, nullptr, "GetApplicationContentPath"}, |
|||
{22, nullptr, "TerminateApplication"}, |
|||
{23, nullptr, "ResolveApplicationContentPath"}, |
|||
{26, nullptr, "BeginInstallApplication"}, |
|||
{27, nullptr, "DeleteApplicationRecord"}, |
|||
{30, nullptr, "RequestApplicationUpdateInfo"}, |
|||
{31, nullptr, "Unknown31"}, |
|||
{32, nullptr, "CancelApplicationDownload"}, |
|||
{33, nullptr, "ResumeApplicationDownload"}, |
|||
{35, nullptr, "UpdateVersionList"}, |
|||
{36, nullptr, "PushLaunchVersion"}, |
|||
{37, nullptr, "ListRequiredVersion"}, |
|||
{38, D<&IApplicationManagerInterface::CheckApplicationLaunchVersion>, "CheckApplicationLaunchVersion"}, |
|||
{39, nullptr, "CheckApplicationLaunchRights"}, |
|||
{40, nullptr, "GetApplicationLogoData"}, |
|||
{41, nullptr, "CalculateApplicationDownloadRequiredSize"}, |
|||
{42, nullptr, "CleanupSdCard"}, |
|||
{43, D<&IApplicationManagerInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, |
|||
{44, D<&IApplicationManagerInterface::GetSdCardMountStatusChangedEvent>, "GetSdCardMountStatusChangedEvent"}, |
|||
{45, nullptr, "GetGameCardAttachmentEvent"}, |
|||
{46, nullptr, "GetGameCardAttachmentInfo"}, |
|||
{47, nullptr, "GetTotalSpaceSize"}, |
|||
{48, D<&IApplicationManagerInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, |
|||
{49, nullptr, "GetSdCardRemovedEvent"}, |
|||
{52, D<&IApplicationManagerInterface::GetGameCardUpdateDetectionEvent>, "GetGameCardUpdateDetectionEvent"}, |
|||
{53, nullptr, "DisableApplicationAutoDelete"}, |
|||
{54, nullptr, "EnableApplicationAutoDelete"}, |
|||
{55, D<&IApplicationManagerInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, |
|||
{56, nullptr, "SetApplicationTerminateResult"}, |
|||
{57, nullptr, "ClearApplicationTerminateResult"}, |
|||
{58, nullptr, "GetLastSdCardMountUnexpectedResult"}, |
|||
{59, D<&IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, |
|||
{60, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, |
|||
{61, nullptr, "GetBackgroundDownloadStressTaskInfo"}, |
|||
{62, nullptr, "GetGameCardStopper"}, |
|||
{63, nullptr, "IsSystemProgramInstalled"}, |
|||
{64, nullptr, "StartApplyDeltaTask"}, |
|||
{65, nullptr, "GetRequestServerStopper"}, |
|||
{66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"}, |
|||
{67, nullptr, "CancelApplicationApplyDelta"}, |
|||
{68, nullptr, "ResumeApplicationApplyDelta"}, |
|||
{69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"}, |
|||
{70, D<&IApplicationManagerInterface::ResumeAll>, "ResumeAll"}, |
|||
{71, D<&IApplicationManagerInterface::GetStorageSize>, "GetStorageSize"}, |
|||
{80, nullptr, "RequestDownloadApplication"}, |
|||
{81, nullptr, "RequestDownloadAddOnContent"}, |
|||
{82, nullptr, "DownloadApplication"}, |
|||
{83, nullptr, "CheckApplicationResumeRights"}, |
|||
{84, nullptr, "GetDynamicCommitEvent"}, |
|||
{85, nullptr, "RequestUpdateApplication2"}, |
|||
{86, nullptr, "EnableApplicationCrashReport"}, |
|||
{87, nullptr, "IsApplicationCrashReportEnabled"}, |
|||
{90, nullptr, "BoostSystemMemoryResourceLimit"}, |
|||
{91, nullptr, "DeprecatedLaunchApplication"}, |
|||
{92, nullptr, "GetRunningApplicationProgramId"}, |
|||
{93, nullptr, "GetMainApplicationProgramIndex"}, |
|||
{94, nullptr, "LaunchApplication"}, |
|||
{95, nullptr, "GetApplicationLaunchInfo"}, |
|||
{96, nullptr, "AcquireApplicationLaunchInfo"}, |
|||
{97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"}, |
|||
{98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, |
|||
{99, nullptr, "LaunchDevMenu"}, |
|||
{100, nullptr, "ResetToFactorySettings"}, |
|||
{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, |
|||
{102, nullptr, "ResetToFactorySettingsForRefurbishment"}, |
|||
{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, |
|||
{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, |
|||
{105, nullptr, "RequestResetToFactorySettingsSecurely"}, |
|||
{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, |
|||
{200, nullptr, "CalculateUserSaveDataStatistics"}, |
|||
{201, nullptr, "DeleteUserSaveDataAll"}, |
|||
{210, nullptr, "DeleteUserSystemSaveData"}, |
|||
{211, nullptr, "DeleteSaveData"}, |
|||
{220, nullptr, "UnregisterNetworkServiceAccount"}, |
|||
{221, nullptr, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"}, |
|||
{300, nullptr, "GetApplicationShellEvent"}, |
|||
{301, nullptr, "PopApplicationShellEventInfo"}, |
|||
{302, nullptr, "LaunchLibraryApplet"}, |
|||
{303, nullptr, "TerminateLibraryApplet"}, |
|||
{304, nullptr, "LaunchSystemApplet"}, |
|||
{305, nullptr, "TerminateSystemApplet"}, |
|||
{306, nullptr, "LaunchOverlayApplet"}, |
|||
{307, nullptr, "TerminateOverlayApplet"}, |
|||
{400, D<&IApplicationManagerInterface::GetApplicationControlData>, "GetApplicationControlData"}, |
|||
{401, nullptr, "InvalidateAllApplicationControlCache"}, |
|||
{402, nullptr, "RequestDownloadApplicationControlData"}, |
|||
{403, nullptr, "GetMaxApplicationControlCacheCount"}, |
|||
{404, nullptr, "InvalidateApplicationControlCache"}, |
|||
{405, nullptr, "ListApplicationControlCacheEntryInfo"}, |
|||
{406, nullptr, "GetApplicationControlProperty"}, |
|||
{407, nullptr, "ListApplicationTitle"}, |
|||
{408, nullptr, "ListApplicationIcon"}, |
|||
{502, nullptr, "RequestCheckGameCardRegistration"}, |
|||
{503, nullptr, "RequestGameCardRegistrationGoldPoint"}, |
|||
{504, nullptr, "RequestRegisterGameCard"}, |
|||
{505, D<&IApplicationManagerInterface::GetGameCardMountFailureEvent>, "GetGameCardMountFailureEvent"}, |
|||
{506, nullptr, "IsGameCardInserted"}, |
|||
{507, nullptr, "EnsureGameCardAccess"}, |
|||
{508, nullptr, "GetLastGameCardMountFailureResult"}, |
|||
{509, nullptr, "ListApplicationIdOnGameCard"}, |
|||
{510, nullptr, "GetGameCardPlatformRegion"}, |
|||
{600, nullptr, "CountApplicationContentMeta"}, |
|||
{601, nullptr, "ListApplicationContentMetaStatus"}, |
|||
{602, nullptr, "ListAvailableAddOnContent"}, |
|||
{603, nullptr, "GetOwnedApplicationContentMetaStatus"}, |
|||
{604, nullptr, "RegisterContentsExternalKey"}, |
|||
{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, |
|||
{606, nullptr, "GetContentMetaStorage"}, |
|||
{607, nullptr, "ListAvailableAddOnContent"}, |
|||
{609, nullptr, "ListAvailabilityAssuredAddOnContent"}, |
|||
{610, nullptr, "GetInstalledContentMetaStorage"}, |
|||
{611, nullptr, "PrepareAddOnContent"}, |
|||
{700, nullptr, "PushDownloadTaskList"}, |
|||
{701, nullptr, "ClearTaskStatusList"}, |
|||
{702, nullptr, "RequestDownloadTaskList"}, |
|||
{703, nullptr, "RequestEnsureDownloadTask"}, |
|||
{704, nullptr, "ListDownloadTaskStatus"}, |
|||
{705, nullptr, "RequestDownloadTaskListData"}, |
|||
{800, nullptr, "RequestVersionList"}, |
|||
{801, nullptr, "ListVersionList"}, |
|||
{802, nullptr, "RequestVersionListData"}, |
|||
{900, nullptr, "GetApplicationRecord"}, |
|||
{901, nullptr, "GetApplicationRecordProperty"}, |
|||
{902, nullptr, "EnableApplicationAutoUpdate"}, |
|||
{903, nullptr, "DisableApplicationAutoUpdate"}, |
|||
{904, nullptr, "TouchApplication"}, |
|||
{905, nullptr, "RequestApplicationUpdate"}, |
|||
{906, D<&IApplicationManagerInterface::IsApplicationUpdateRequested>, "IsApplicationUpdateRequested"}, |
|||
{907, nullptr, "WithdrawApplicationUpdateRequest"}, |
|||
{908, nullptr, "ListApplicationRecordInstalledContentMeta"}, |
|||
{909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"}, |
|||
{910, nullptr, "HasApplicationRecord"}, |
|||
{911, nullptr, "SetPreInstalledApplication"}, |
|||
{912, nullptr, "ClearPreInstalledApplicationFlag"}, |
|||
{913, nullptr, "ListAllApplicationRecord"}, |
|||
{914, nullptr, "HideApplicationRecord"}, |
|||
{915, nullptr, "ShowApplicationRecord"}, |
|||
{916, nullptr, "IsApplicationAutoDeleteDisabled"}, |
|||
{1000, nullptr, "RequestVerifyApplicationDeprecated"}, |
|||
{1001, nullptr, "CorruptApplicationForDebug"}, |
|||
{1002, nullptr, "RequestVerifyAddOnContentsRights"}, |
|||
{1003, nullptr, "RequestVerifyApplication"}, |
|||
{1004, nullptr, "CorruptContentForDebug"}, |
|||
{1200, nullptr, "NeedsUpdateVulnerability"}, |
|||
{1300, D<&IApplicationManagerInterface::IsAnyApplicationEntityInstalled>, "IsAnyApplicationEntityInstalled"}, |
|||
{1301, nullptr, "DeleteApplicationContentEntities"}, |
|||
{1302, nullptr, "CleanupUnrecordedApplicationEntity"}, |
|||
{1303, nullptr, "CleanupAddOnContentsWithNoRights"}, |
|||
{1304, nullptr, "DeleteApplicationContentEntity"}, |
|||
{1305, nullptr, "TryDeleteRunningApplicationEntity"}, |
|||
{1306, nullptr, "TryDeleteRunningApplicationCompletely"}, |
|||
{1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, |
|||
{1308, nullptr, "DeleteApplicationCompletelyForDebug"}, |
|||
{1309, nullptr, "CleanupUnavailableAddOnContents"}, |
|||
{1310, nullptr, "RequestMoveApplicationEntity"}, |
|||
{1311, nullptr, "EstimateSizeToMove"}, |
|||
{1312, nullptr, "HasMovableEntity"}, |
|||
{1313, nullptr, "CleanupOrphanContents"}, |
|||
{1314, nullptr, "CheckPreconditionSatisfiedToMove"}, |
|||
{1400, nullptr, "PrepareShutdown"}, |
|||
{1500, nullptr, "FormatSdCard"}, |
|||
{1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, |
|||
{1502, nullptr, "GetLastSdCardFormatUnexpectedResult"}, |
|||
{1504, nullptr, "InsertSdCard"}, |
|||
{1505, nullptr, "RemoveSdCard"}, |
|||
{1506, nullptr, "GetSdCardStartupStatus"}, |
|||
{1600, nullptr, "GetSystemSeedForPseudoDeviceId"}, |
|||
{1601, nullptr, "ResetSystemSeedForPseudoDeviceId"}, |
|||
{1700, nullptr, "ListApplicationDownloadingContentMeta"}, |
|||
{1701, D<&IApplicationManagerInterface::GetApplicationView>, "GetApplicationView"}, |
|||
{1702, nullptr, "GetApplicationDownloadTaskStatus"}, |
|||
{1703, nullptr, "GetApplicationViewDownloadErrorContext"}, |
|||
{1704, D<&IApplicationManagerInterface::GetApplicationViewWithPromotionInfo>, "GetApplicationViewWithPromotionInfo"}, |
|||
{1705, nullptr, "IsPatchAutoDeletableApplication"}, |
|||
{1800, nullptr, "IsNotificationSetupCompleted"}, |
|||
{1801, nullptr, "GetLastNotificationInfoCount"}, |
|||
{1802, nullptr, "ListLastNotificationInfo"}, |
|||
{1803, nullptr, "ListNotificationTask"}, |
|||
{1900, nullptr, "IsActiveAccount"}, |
|||
{1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, |
|||
{1902, nullptr, "GetApplicationTicketInfo"}, |
|||
{1903, nullptr, "RequestDownloadApplicationPrepurchasedRightsForAccount"}, |
|||
{2000, nullptr, "GetSystemDeliveryInfo"}, |
|||
{2001, nullptr, "SelectLatestSystemDeliveryInfo"}, |
|||
{2002, nullptr, "VerifyDeliveryProtocolVersion"}, |
|||
{2003, nullptr, "GetApplicationDeliveryInfo"}, |
|||
{2004, nullptr, "HasAllContentsToDeliver"}, |
|||
{2005, nullptr, "CompareApplicationDeliveryInfo"}, |
|||
{2006, nullptr, "CanDeliverApplication"}, |
|||
{2007, nullptr, "ListContentMetaKeyToDeliverApplication"}, |
|||
{2008, nullptr, "NeedsSystemUpdateToDeliverApplication"}, |
|||
{2009, nullptr, "EstimateRequiredSize"}, |
|||
{2010, nullptr, "RequestReceiveApplication"}, |
|||
{2011, nullptr, "CommitReceiveApplication"}, |
|||
{2012, nullptr, "GetReceiveApplicationProgress"}, |
|||
{2013, nullptr, "RequestSendApplication"}, |
|||
{2014, nullptr, "GetSendApplicationProgress"}, |
|||
{2015, nullptr, "CompareSystemDeliveryInfo"}, |
|||
{2016, nullptr, "ListNotCommittedContentMeta"}, |
|||
{2017, nullptr, "CreateDownloadTask"}, |
|||
{2018, nullptr, "GetApplicationDeliveryInfoHash"}, |
|||
{2050, D<&IApplicationManagerInterface::GetApplicationRightsOnClient>, "GetApplicationRightsOnClient"}, |
|||
{2051, nullptr, "InvalidateRightsIdCache"}, |
|||
{2100, D<&IApplicationManagerInterface::GetApplicationTerminateResult>, "GetApplicationTerminateResult"}, |
|||
{2101, nullptr, "GetRawApplicationTerminateResult"}, |
|||
{2150, nullptr, "CreateRightsEnvironment"}, |
|||
{2151, nullptr, "DestroyRightsEnvironment"}, |
|||
{2152, nullptr, "ActivateRightsEnvironment"}, |
|||
{2153, nullptr, "DeactivateRightsEnvironment"}, |
|||
{2154, nullptr, "ForceActivateRightsContextForExit"}, |
|||
{2155, nullptr, "UpdateRightsEnvironmentStatus"}, |
|||
{2156, nullptr, "CreateRightsEnvironmentForMicroApplication"}, |
|||
{2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, |
|||
{2161, nullptr, "SetUsersToRightsEnvironment"}, |
|||
{2170, nullptr, "GetRightsEnvironmentStatus"}, |
|||
{2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, |
|||
{2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, |
|||
{2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, |
|||
{2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, |
|||
{2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, |
|||
{2199, nullptr, "GetRightsEnvironmentCountForDebug"}, |
|||
{2200, nullptr, "GetGameCardApplicationCopyIdentifier"}, |
|||
{2201, nullptr, "GetInstalledApplicationCopyIdentifier"}, |
|||
{2250, nullptr, "RequestReportActiveELicence"}, |
|||
{2300, nullptr, "ListEventLog"}, |
|||
{2350, nullptr, "PerformAutoUpdateByApplicationId"}, |
|||
{2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, |
|||
{2352, nullptr, "RequestResolveNoDownloadRightsError"}, |
|||
{2353, nullptr, "GetApplicationDownloadTaskInfo"}, |
|||
{2354, nullptr, "PrioritizeApplicationBackgroundTask"}, |
|||
{2355, nullptr, "PreferStorageEfficientUpdate"}, |
|||
{2356, nullptr, "RequestStorageEfficientUpdatePreferable"}, |
|||
{2357, nullptr, "EnableMultiCoreDownload"}, |
|||
{2358, nullptr, "DisableMultiCoreDownload"}, |
|||
{2359, nullptr, "IsMultiCoreDownloadEnabled"}, |
|||
{2400, nullptr, "GetPromotionInfo"}, |
|||
{2401, nullptr, "CountPromotionInfo"}, |
|||
{2402, nullptr, "ListPromotionInfo"}, |
|||
{2403, nullptr, "ImportPromotionJsonForDebug"}, |
|||
{2404, nullptr, "ClearPromotionInfoForDebug"}, |
|||
{2500, nullptr, "ConfirmAvailableTime"}, |
|||
{2510, nullptr, "CreateApplicationResource"}, |
|||
{2511, nullptr, "GetApplicationResource"}, |
|||
{2513, nullptr, "LaunchMicroApplication"}, |
|||
{2514, nullptr, "ClearTaskOfAsyncTaskManager"}, |
|||
{2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"}, |
|||
{2516, nullptr, "EnsureApplicationCertificate"}, |
|||
{2517, nullptr, "CreateApplicationInstance"}, |
|||
{2518, nullptr, "UpdateQualificationForDebug"}, |
|||
{2519, nullptr, "IsQualificationTransitionSupported"}, |
|||
{2520, nullptr, "IsQualificationTransitionSupportedByProcessId"}, |
|||
{2521, nullptr, "GetRightsUserChangedEvent"}, |
|||
{2522, nullptr, "IsRomRedirectionAvailable"}, |
|||
{2800, nullptr, "GetApplicationIdOfPreomia"}, |
|||
{3000, nullptr, "RegisterDeviceLockKey"}, |
|||
{3001, nullptr, "UnregisterDeviceLockKey"}, |
|||
{3002, nullptr, "VerifyDeviceLockKey"}, |
|||
{3003, nullptr, "HideApplicationIcon"}, |
|||
{3004, nullptr, "ShowApplicationIcon"}, |
|||
{3005, nullptr, "HideApplicationTitle"}, |
|||
{3006, nullptr, "ShowApplicationTitle"}, |
|||
{3007, nullptr, "EnableGameCard"}, |
|||
{3008, nullptr, "DisableGameCard"}, |
|||
{3009, nullptr, "EnableLocalContentShare"}, |
|||
{3010, nullptr, "DisableLocalContentShare"}, |
|||
{3011, nullptr, "IsApplicationIconHidden"}, |
|||
{3012, nullptr, "IsApplicationTitleHidden"}, |
|||
{3013, nullptr, "IsGameCardEnabled"}, |
|||
{3014, nullptr, "IsLocalContentShareEnabled"}, |
|||
{3050, nullptr, "ListAssignELicenseTaskResult"}, |
|||
{9999, nullptr, "GetApplicationCertificate"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IApplicationManagerInterface::~IApplicationManagerInterface() = default; |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationControlData( |
|||
OutBuffer<BufferAttr_HipcMapAlias> out_buffer, Out<u32> out_actual_size, |
|||
ApplicationControlSource application_control_source, u64 application_id) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
R_RETURN(IReadOnlyApplicationControlDataInterface(system).GetApplicationControlData( |
|||
out_buffer, out_actual_size, application_control_source, application_id)); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationDesiredLanguage( |
|||
Out<ApplicationLanguage> out_desired_language, u32 supported_languages) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
R_RETURN(IReadOnlyApplicationControlDataInterface(system).GetApplicationDesiredLanguage( |
|||
out_desired_language, supported_languages)); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode( |
|||
Out<u64> out_language_code, ApplicationLanguage application_language) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
R_RETURN( |
|||
IReadOnlyApplicationControlDataInterface(system).ConvertApplicationLanguageToLanguageCode( |
|||
out_language_code, application_language)); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::ListApplicationRecord( |
|||
OutArray<ApplicationRecord, BufferAttr_HipcMapAlias> out_records, Out<s32> out_count, |
|||
s32 offset) { |
|||
const auto limit = out_records.size(); |
|||
|
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
const auto& cache = system.GetContentProviderUnion(); |
|||
const auto installed_games = cache.ListEntriesFilterOrigin( |
|||
std::nullopt, FileSys::TitleType::Application, FileSys::ContentRecordType::Program); |
|||
|
|||
size_t i = 0; |
|||
u8 ii = 24; |
|||
|
|||
for (const auto& [slot, game] : installed_games) { |
|||
if (i >= limit) { |
|||
break; |
|||
} |
|||
if (game.title_id == 0 || game.title_id < 0x0100000000001FFFull) { |
|||
continue; |
|||
} |
|||
if (offset > 0) { |
|||
offset--; |
|||
continue; |
|||
} |
|||
|
|||
ApplicationRecord record{}; |
|||
record.application_id = game.title_id; |
|||
record.type = ApplicationRecordType::Installed; |
|||
record.unknown = 0; // 2 = needs update
|
|||
record.unknown2 = ii++; |
|||
|
|||
out_records[i++] = record; |
|||
} |
|||
|
|||
*out_count = static_cast<s32>(i); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationRecordUpdateSystemEvent( |
|||
OutCopyHandle<Kernel::KReadableEvent> out_event) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
|
|||
record_update_system_event.Signal(); |
|||
*out_event = record_update_system_event.GetHandle(); |
|||
|
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetGameCardMountFailureEvent( |
|||
OutCopyHandle<Kernel::KReadableEvent> out_event) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_event = gamecard_mount_failure_event.GetHandle(); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::IsAnyApplicationEntityInstalled( |
|||
Out<bool> out_is_any_application_entity_installed) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_is_any_application_entity_installed = true; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationView( |
|||
OutArray<ApplicationView, BufferAttr_HipcMapAlias> out_application_views, |
|||
InArray<u64, BufferAttr_HipcMapAlias> application_ids) { |
|||
const auto size = std::min(out_application_views.size(), application_ids.size()); |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, size={}", application_ids.size()); |
|||
|
|||
for (size_t i = 0; i < size; i++) { |
|||
ApplicationView view{}; |
|||
view.application_id = application_ids[i]; |
|||
view.unk = 0x70000; |
|||
view.flags = 0x401f17; |
|||
|
|||
out_application_views[i] = view; |
|||
} |
|||
|
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationViewWithPromotionInfo( |
|||
OutArray<ApplicationViewWithPromotionInfo, BufferAttr_HipcMapAlias> out_application_views, |
|||
InArray<u64, BufferAttr_HipcMapAlias> application_ids) { |
|||
const auto size = std::min(out_application_views.size(), application_ids.size()); |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, size={}", application_ids.size()); |
|||
|
|||
for (size_t i = 0; i < size; i++) { |
|||
ApplicationViewWithPromotionInfo view{}; |
|||
view.view.application_id = application_ids[i]; |
|||
view.view.unk = 0x70000; |
|||
view.view.flags = 0x401f17; |
|||
view.promotion = {}; |
|||
|
|||
out_application_views[i] = view; |
|||
} |
|||
|
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationRightsOnClient( |
|||
OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, |
|||
Common::UUID account_id, u32 flags, u64 application_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, flags={}, application_id={:016X}, account_id={}", |
|||
flags, application_id, account_id.FormattedString()); |
|||
|
|||
if (!out_rights.empty()) { |
|||
ApplicationRightsOnClient rights{}; |
|||
rights.application_id = application_id; |
|||
rights.uid = account_id; |
|||
rights.flags = 0; |
|||
rights.flags2 = 0; |
|||
|
|||
out_rights[0] = rights; |
|||
*out_count = 1; |
|||
} else { |
|||
*out_count = 0; |
|||
} |
|||
|
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::CheckSdCardMountStatus() { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
R_RETURN(IContentManagementInterface(system).CheckSdCardMountStatus()); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetSdCardMountStatusChangedEvent( |
|||
OutCopyHandle<Kernel::KReadableEvent> out_event) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_event = sd_card_mount_status_event.GetHandle(); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetFreeSpaceSize(Out<s64> out_free_space_size, |
|||
FileSys::StorageId storage_id) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
R_RETURN(IContentManagementInterface(system).GetFreeSpaceSize(out_free_space_size, storage_id)); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetGameCardUpdateDetectionEvent( |
|||
OutCopyHandle<Kernel::KReadableEvent> out_event) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_event = gamecard_update_detection_event.GetHandle(); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::ResumeAll() { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetStorageSize(Out<s64> out_total_space_size, |
|||
Out<s64> out_free_space_size, |
|||
FileSys::StorageId storage_id) { |
|||
LOG_INFO(Service_NS, "called, storage_id={}", storage_id); |
|||
*out_total_space_size = system.GetFileSystemController().GetTotalSpaceSize(storage_id); |
|||
*out_free_space_size = system.GetFileSystemController().GetFreeSpaceSize(storage_id); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::IsApplicationUpdateRequested(Out<bool> out_update_required, |
|||
Out<u32> out_update_version, |
|||
u64 application_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called. application_id={:016X}", application_id); |
|||
*out_update_required = false; |
|||
*out_update_version = 0; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::CheckApplicationLaunchVersion(u64 application_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called. application_id={:016X}", application_id); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IApplicationManagerInterface::GetApplicationTerminateResult(Out<Result> out_result, |
|||
u64 application_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called. application_id={:016X}", application_id); |
|||
*out_result = ResultSuccess; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,62 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/ns/language.h" |
|||
#include "core/hle/service/ns/ns_types.h" |
|||
#include "core/hle/service/os/event.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IApplicationManagerInterface final : public ServiceFramework<IApplicationManagerInterface> { |
|||
public: |
|||
explicit IApplicationManagerInterface(Core::System& system_); |
|||
~IApplicationManagerInterface() override; |
|||
|
|||
Result GetApplicationControlData(OutBuffer<BufferAttr_HipcMapAlias> out_buffer, |
|||
Out<u32> out_actual_size, |
|||
ApplicationControlSource application_control_source, |
|||
u64 application_id); |
|||
Result GetApplicationDesiredLanguage(Out<ApplicationLanguage> out_desired_language, |
|||
u32 supported_languages); |
|||
Result ConvertApplicationLanguageToLanguageCode(Out<u64> out_language_code, |
|||
ApplicationLanguage application_language); |
|||
Result ListApplicationRecord(OutArray<ApplicationRecord, BufferAttr_HipcMapAlias> out_records, |
|||
Out<s32> out_count, s32 offset); |
|||
Result GetApplicationRecordUpdateSystemEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); |
|||
Result GetGameCardMountFailureEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); |
|||
Result IsAnyApplicationEntityInstalled(Out<bool> out_is_any_application_entity_installed); |
|||
Result GetApplicationView( |
|||
OutArray<ApplicationView, BufferAttr_HipcMapAlias> out_application_views, |
|||
InArray<u64, BufferAttr_HipcMapAlias> application_ids); |
|||
Result GetApplicationViewWithPromotionInfo( |
|||
OutArray<ApplicationViewWithPromotionInfo, BufferAttr_HipcMapAlias> out_application_views, |
|||
InArray<u64, BufferAttr_HipcMapAlias> application_ids); |
|||
Result GetApplicationRightsOnClient( |
|||
OutArray<ApplicationRightsOnClient, BufferAttr_HipcMapAlias> out_rights, Out<u32> out_count, |
|||
Common::UUID account_id, u32 flags, u64 application_id); |
|||
Result CheckSdCardMountStatus(); |
|||
Result GetSdCardMountStatusChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); |
|||
Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); |
|||
Result GetGameCardUpdateDetectionEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); |
|||
Result ResumeAll(); |
|||
Result GetStorageSize(Out<s64> out_total_space_size, Out<s64> out_free_space_size, |
|||
FileSys::StorageId storage_id); |
|||
Result IsApplicationUpdateRequested(Out<bool> out_update_required, Out<u32> out_update_version, |
|||
u64 application_id); |
|||
Result CheckApplicationLaunchVersion(u64 application_id); |
|||
Result GetApplicationTerminateResult(Out<Result> out_result, u64 application_id); |
|||
|
|||
private: |
|||
KernelHelpers::ServiceContext service_context; |
|||
Event record_update_system_event; |
|||
Event sd_card_mount_status_event; |
|||
Event gamecard_update_detection_event; |
|||
Event gamecard_mount_status_event; |
|||
Event gamecard_mount_failure_event; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,33 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/ns/application_version_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IApplicationVersionInterface::IApplicationVersionInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IApplicationVersionInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "GetLaunchRequiredVersion"}, |
|||
{1, nullptr, "UpgradeLaunchRequiredVersion"}, |
|||
{35, nullptr, "UpdateVersionList"}, |
|||
{36, nullptr, "PushLaunchVersion"}, |
|||
{37, nullptr, "ListRequiredVersion"}, |
|||
{800, nullptr, "RequestVersionList"}, |
|||
{801, nullptr, "ListVersionList"}, |
|||
{802, nullptr, "RequestVersionListData"}, |
|||
{900, nullptr, "ImportAutoUpdatePolicyJsonForDebug"}, |
|||
{901, nullptr, "ListDefaultAutoUpdatePolicy"}, |
|||
{902, nullptr, "ListAutoUpdatePolicyForSpecificApplication"}, |
|||
{1000, nullptr, "PerformAutoUpdate"}, |
|||
{1001, nullptr, "ListAutoUpdateSchedule"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IApplicationVersionInterface::~IApplicationVersionInterface() = default; |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,16 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IApplicationVersionInterface final : public ServiceFramework<IApplicationVersionInterface> { |
|||
public: |
|||
explicit IApplicationVersionInterface(Core::System& system_); |
|||
~IApplicationVersionInterface() override; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,72 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "common/common_funcs.h"
|
|||
#include "core/core.h"
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/filesystem/filesystem.h"
|
|||
#include "core/hle/service/ns/content_management_interface.h"
|
|||
#include "core/hle/service/ns/ns_types.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IContentManagementInterface::IContentManagementInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IContentManagementInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{11, D<&IContentManagementInterface::CalculateApplicationOccupiedSize>, "CalculateApplicationOccupiedSize"}, |
|||
{43, D<&IContentManagementInterface::CheckSdCardMountStatus>, "CheckSdCardMountStatus"}, |
|||
{47, D<&IContentManagementInterface::GetTotalSpaceSize>, "GetTotalSpaceSize"}, |
|||
{48, D<&IContentManagementInterface::GetFreeSpaceSize>, "GetFreeSpaceSize"}, |
|||
{600, nullptr, "CountApplicationContentMeta"}, |
|||
{601, nullptr, "ListApplicationContentMetaStatus"}, |
|||
{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"}, |
|||
{607, nullptr, "IsAnyApplicationRunning"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IContentManagementInterface::~IContentManagementInterface() = default; |
|||
|
|||
Result IContentManagementInterface::CalculateApplicationOccupiedSize( |
|||
Out<ApplicationOccupiedSize> out_size, u64 application_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, application_id={:016X}", application_id); |
|||
|
|||
using namespace Common::Literals; |
|||
|
|||
constexpr ApplicationOccupiedSizeEntity stub_entity{ |
|||
.storage_id = FileSys::StorageId::SdCard, |
|||
.app_size = 8_GiB, |
|||
.patch_size = 2_GiB, |
|||
.aoc_size = 12_MiB, |
|||
}; |
|||
|
|||
for (auto& entity : out_size->entities) { |
|||
entity = stub_entity; |
|||
} |
|||
|
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IContentManagementInterface::CheckSdCardMountStatus() { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IContentManagementInterface::GetTotalSpaceSize(Out<s64> out_total_space_size, |
|||
FileSys::StorageId storage_id) { |
|||
LOG_INFO(Service_NS, "(STUBBED) called, storage_id={}", storage_id); |
|||
*out_total_space_size = system.GetFileSystemController().GetTotalSpaceSize(storage_id); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IContentManagementInterface::GetFreeSpaceSize(Out<s64> out_free_space_size, |
|||
FileSys::StorageId storage_id) { |
|||
LOG_INFO(Service_NS, "(STUBBED) called, storage_id={}", storage_id); |
|||
*out_free_space_size = system.GetFileSystemController().GetFreeSpaceSize(storage_id); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,25 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/ns/ns_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IContentManagementInterface final : public ServiceFramework<IContentManagementInterface> { |
|||
public: |
|||
explicit IContentManagementInterface(Core::System& system_); |
|||
~IContentManagementInterface() override; |
|||
|
|||
public: |
|||
Result CalculateApplicationOccupiedSize(Out<ApplicationOccupiedSize> out_size, |
|||
u64 application_id); |
|||
Result CheckSdCardMountStatus(); |
|||
Result GetTotalSpaceSize(Out<s64> out_total_space_size, FileSys::StorageId storage_id); |
|||
Result GetFreeSpaceSize(Out<s64> out_free_space_size, FileSys::StorageId storage_id); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,38 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/ns/develop_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IDevelopInterface::IDevelopInterface(Core::System& system_) : ServiceFramework{system_, "ns:dev"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "LaunchProgram"}, |
|||
{1, nullptr, "TerminateProcess"}, |
|||
{2, nullptr, "TerminateProgram"}, |
|||
{4, nullptr, "GetShellEvent"}, |
|||
{5, nullptr, "GetShellEventInfo"}, |
|||
{6, nullptr, "TerminateApplication"}, |
|||
{7, nullptr, "PrepareLaunchProgramFromHost"}, |
|||
{8, nullptr, "LaunchApplicationFromHost"}, |
|||
{9, nullptr, "LaunchApplicationWithStorageIdForDevelop"}, |
|||
{10, nullptr, "IsSystemMemoryResourceLimitBoosted"}, |
|||
{11, nullptr, "GetRunningApplicationProcessIdForDevelop"}, |
|||
{12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop"}, |
|||
{13, nullptr, "CreateApplicationResourceForDevelop"}, |
|||
{14, nullptr, "IsPreomiaForDevelop"}, |
|||
{15, nullptr, "GetApplicationProgramIdFromHost"}, |
|||
{16, nullptr, "RefreshCachedDebugValues"}, |
|||
{17, nullptr, "PrepareLaunchApplicationFromHost"}, |
|||
{18, nullptr, "GetLaunchEvent"}, |
|||
{19, nullptr, "GetLaunchResult"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IDevelopInterface::~IDevelopInterface() = default; |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,16 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IDevelopInterface final : public ServiceFramework<IDevelopInterface> { |
|||
public: |
|||
explicit IDevelopInterface(Core::System& system_); |
|||
~IDevelopInterface() override; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,38 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/core.h"
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/document_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IDocumentInterface::IDocumentInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IDocumentInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{21, nullptr, "GetApplicationContentPath"}, |
|||
{23, D<&IDocumentInterface::ResolveApplicationContentPath>, "ResolveApplicationContentPath"}, |
|||
{92, D<&IDocumentInterface::GetRunningApplicationProgramId>, "GetRunningApplicationProgramId"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IDocumentInterface::~IDocumentInterface() = default; |
|||
|
|||
Result IDocumentInterface::ResolveApplicationContentPath(ContentPath content_path) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, file_system_proxy_type={}, program_id={:016X}", |
|||
content_path.file_system_proxy_type, content_path.program_id); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IDocumentInterface::GetRunningApplicationProgramId(Out<u64> out_program_id, |
|||
u64 caller_program_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, caller_program_id={:016X}", caller_program_id); |
|||
*out_program_id = system.GetApplicationProcessProgramID(); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,22 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/ns/ns_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IDocumentInterface final : public ServiceFramework<IDocumentInterface> { |
|||
public: |
|||
explicit IDocumentInterface(Core::System& system_); |
|||
~IDocumentInterface() override; |
|||
|
|||
private: |
|||
Result ResolveApplicationContentPath(ContentPath content_path); |
|||
Result GetRunningApplicationProgramId(Out<u64> out_program_id, u64 caller_program_id); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,39 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/download_task_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IDownloadTaskInterface::IDownloadTaskInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IDownloadTaskInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{701, nullptr, "ClearTaskStatusList"}, |
|||
{702, nullptr, "RequestDownloadTaskList"}, |
|||
{703, nullptr, "RequestEnsureDownloadTask"}, |
|||
{704, nullptr, "ListDownloadTaskStatus"}, |
|||
{705, nullptr, "RequestDownloadTaskListData"}, |
|||
{706, nullptr, "TryCommitCurrentApplicationDownloadTask"}, |
|||
{707, D<&IDownloadTaskInterface::EnableAutoCommit>, "EnableAutoCommit"}, |
|||
{708, D<&IDownloadTaskInterface::DisableAutoCommit>, "DisableAutoCommit"}, |
|||
{709, nullptr, "TriggerDynamicCommitEvent"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IDownloadTaskInterface::~IDownloadTaskInterface() = default; |
|||
|
|||
Result IDownloadTaskInterface::EnableAutoCommit() { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
R_SUCCEED(); |
|||
} |
|||
Result IDownloadTaskInterface::DisableAutoCommit() { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,20 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IDownloadTaskInterface final : public ServiceFramework<IDownloadTaskInterface> { |
|||
public: |
|||
explicit IDownloadTaskInterface(Core::System& system_); |
|||
~IDownloadTaskInterface() override; |
|||
|
|||
private: |
|||
Result EnableAutoCommit(); |
|||
Result DisableAutoCommit(); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,62 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/dynamic_rights_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IDynamicRightsInterface::IDynamicRightsInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "DynamicRightsInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "RequestApplicationRightsOnServer"}, |
|||
{1, nullptr, "RequestAssignRights"}, |
|||
{4, nullptr, "DeprecatedRequestAssignRightsToResume"}, |
|||
{5, D<&IDynamicRightsInterface::VerifyActivatedRightsOwners>, "VerifyActivatedRightsOwners"}, |
|||
{6, nullptr, "DeprecatedGetApplicationRightsStatus"}, |
|||
{7, nullptr, "RequestPrefetchForDynamicRights"}, |
|||
{8, nullptr, "GetDynamicRightsState"}, |
|||
{9, nullptr, "RequestApplicationRightsOnServerToResume"}, |
|||
{10, nullptr, "RequestAssignRightsToResume"}, |
|||
{11, nullptr, "GetActivatedRightsUsers"}, |
|||
{12, nullptr, "GetApplicationRightsStatus"}, |
|||
{13, D<&IDynamicRightsInterface::GetRunningApplicationStatus>, "GetRunningApplicationStatus"}, |
|||
{14, nullptr, "SelectApplicationLicense"}, |
|||
{15, nullptr, "RequestContentsAuthorizationToken"}, |
|||
{16, nullptr, "QualifyUser"}, |
|||
{17, nullptr, "QualifyUserWithProcessId"}, |
|||
{18, D<&IDynamicRightsInterface::NotifyApplicationRightsCheckStart>, "NotifyApplicationRightsCheckStart"}, |
|||
{19, nullptr, "UpdateUserList"}, |
|||
{20, nullptr, "IsRightsLostUser"}, |
|||
{21, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, |
|||
{22, nullptr, "GetLimitedApplicationLicense"}, |
|||
{23, nullptr, "GetLimitedApplicationLicenseUpgradableEvent"}, |
|||
{24, nullptr, "NotifyLimitedApplicationLicenseUpgradableEventForDebug"}, |
|||
{25, nullptr, "RequestProceedDynamicRightsState"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IDynamicRightsInterface::~IDynamicRightsInterface() = default; |
|||
|
|||
Result IDynamicRightsInterface::NotifyApplicationRightsCheckStart() { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IDynamicRightsInterface::GetRunningApplicationStatus(Out<u32> out_status, |
|||
u64 rights_handle) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, rights_handle={:#x}", rights_handle); |
|||
*out_status = 0; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IDynamicRightsInterface::VerifyActivatedRightsOwners(u64 rights_handle) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, rights_handle={:#x}", rights_handle); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,22 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IDynamicRightsInterface final : public ServiceFramework<IDynamicRightsInterface> { |
|||
public: |
|||
explicit IDynamicRightsInterface(Core::System& system_); |
|||
~IDynamicRightsInterface() override; |
|||
|
|||
private: |
|||
Result NotifyApplicationRightsCheckStart(); |
|||
Result GetRunningApplicationStatus(Out<u32> out_status, u64 rights_handle); |
|||
Result VerifyActivatedRightsOwners(u64 rights_handle); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,27 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/ns/ecommerce_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IECommerceInterface::IECommerceInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IECommerceInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "RequestLinkDevice"}, |
|||
{1, nullptr, "RequestCleanupAllPreInstalledApplications"}, |
|||
{2, nullptr, "RequestCleanupPreInstalledApplication"}, |
|||
{3, nullptr, "RequestSyncRights"}, |
|||
{4, nullptr, "RequestUnlinkDevice"}, |
|||
{5, nullptr, "RequestRevokeAllELicense"}, |
|||
{6, nullptr, "RequestSyncRightsBasedOnAssignedELicenses"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IECommerceInterface::~IECommerceInterface() = default; |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,16 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IECommerceInterface final : public ServiceFramework<IECommerceInterface> { |
|||
public: |
|||
explicit IECommerceInterface(Core::System& system_); |
|||
~IECommerceInterface() override; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,27 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/ns/factory_reset_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IFactoryResetInterface::IFactoryResetInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IFactoryResetInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{100, nullptr, "ResetToFactorySettings"}, |
|||
{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, |
|||
{102, nullptr, "ResetToFactorySettingsForRefurbishment"}, |
|||
{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, |
|||
{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, |
|||
{105, nullptr, "RequestResetToFactorySettingsSecurely"}, |
|||
{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IFactoryResetInterface::~IFactoryResetInterface() = default; |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,16 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IFactoryResetInterface final : public ServiceFramework<IFactoryResetInterface> { |
|||
public: |
|||
explicit IFactoryResetInterface(Core::System& system_); |
|||
~IFactoryResetInterface() override; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,111 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "common/common_funcs.h" |
|||
#include "common/uuid.h" |
|||
#include "core/file_sys/romfs_factory.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
enum class ApplicationRecordType : u8 { |
|||
Installing = 2, |
|||
Installed = 3, |
|||
GameCardNotInserted = 5, |
|||
Archived = 11, |
|||
GameCard = 16, |
|||
}; |
|||
|
|||
enum class ApplicationControlSource : u8 { |
|||
CacheOnly = 0, |
|||
Storage = 1, |
|||
StorageOnly = 2, |
|||
}; |
|||
|
|||
enum class BackgroundNetworkUpdateState : u8 { |
|||
None, |
|||
InProgress, |
|||
Ready, |
|||
}; |
|||
|
|||
struct ApplicationRecord { |
|||
u64 application_id; |
|||
ApplicationRecordType type; |
|||
u8 unknown; |
|||
INSERT_PADDING_BYTES_NOINIT(0x6); |
|||
u8 unknown2; |
|||
INSERT_PADDING_BYTES_NOINIT(0x7); |
|||
}; |
|||
static_assert(sizeof(ApplicationRecord) == 0x18, "ApplicationRecord has incorrect size."); |
|||
|
|||
/// ApplicationView |
|||
struct ApplicationView { |
|||
u64 application_id; ///< ApplicationId. |
|||
u32 unk; ///< Unknown. |
|||
u32 flags; ///< Flags. |
|||
std::array<u8, 0x10> unk_x10; ///< Unknown. |
|||
u32 unk_x20; ///< Unknown. |
|||
u16 unk_x24; ///< Unknown. |
|||
std::array<u8, 0x2> unk_x26; ///< Unknown. |
|||
std::array<u8, 0x8> unk_x28; ///< Unknown. |
|||
std::array<u8, 0x10> unk_x30; ///< Unknown. |
|||
u32 unk_x40; ///< Unknown. |
|||
u8 unk_x44; ///< Unknown. |
|||
std::array<u8, 0xb> unk_x45; ///< Unknown. |
|||
}; |
|||
static_assert(sizeof(ApplicationView) == 0x50, "ApplicationView has incorrect size."); |
|||
|
|||
struct ApplicationRightsOnClient { |
|||
u64 application_id; |
|||
Common::UUID uid; |
|||
u8 flags; |
|||
u8 flags2; |
|||
INSERT_PADDING_BYTES_NOINIT(0x6); |
|||
}; |
|||
static_assert(sizeof(ApplicationRightsOnClient) == 0x20, |
|||
"ApplicationRightsOnClient has incorrect size."); |
|||
|
|||
/// NsPromotionInfo |
|||
struct PromotionInfo { |
|||
u64 start_timestamp; ///< POSIX timestamp for the promotion start. |
|||
u64 end_timestamp; ///< POSIX timestamp for the promotion end. |
|||
s64 remaining_time; ///< Remaining time until the promotion ends, in nanoseconds |
|||
///< ({end_timestamp - current_time} converted to nanoseconds). |
|||
INSERT_PADDING_BYTES_NOINIT(0x4); |
|||
u8 flags; ///< Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: |
|||
///< remaining_time is set. |
|||
INSERT_PADDING_BYTES_NOINIT(0x3); |
|||
}; |
|||
static_assert(sizeof(PromotionInfo) == 0x20, "PromotionInfo has incorrect size."); |
|||
|
|||
/// NsApplicationViewWithPromotionInfo |
|||
struct ApplicationViewWithPromotionInfo { |
|||
ApplicationView view; ///< \ref NsApplicationView |
|||
PromotionInfo promotion; ///< \ref NsPromotionInfo |
|||
}; |
|||
static_assert(sizeof(ApplicationViewWithPromotionInfo) == 0x70, |
|||
"ApplicationViewWithPromotionInfo has incorrect size."); |
|||
|
|||
struct ApplicationOccupiedSizeEntity { |
|||
FileSys::StorageId storage_id; |
|||
u64 app_size; |
|||
u64 patch_size; |
|||
u64 aoc_size; |
|||
}; |
|||
static_assert(sizeof(ApplicationOccupiedSizeEntity) == 0x20, |
|||
"ApplicationOccupiedSizeEntity has incorrect size."); |
|||
|
|||
struct ApplicationOccupiedSize { |
|||
std::array<ApplicationOccupiedSizeEntity, 4> entities; |
|||
}; |
|||
static_assert(sizeof(ApplicationOccupiedSize) == 0x80, |
|||
"ApplicationOccupiedSize has incorrect size."); |
|||
|
|||
struct ContentPath { |
|||
u8 file_system_proxy_type; |
|||
u64 program_id; |
|||
}; |
|||
static_assert(sizeof(ContentPath) == 0x10, "ContentPath has incorrect size."); |
|||
|
|||
} // namespace Service::NS |
|||
@ -1,67 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include <memory>
|
|||
|
|||
#include "common/logging/log.h"
|
|||
#include "common/uuid.h"
|
|||
#include "core/hle/service/ipc_helpers.h"
|
|||
#include "core/hle/service/ns/pdm_qry.h"
|
|||
#include "core/hle/service/service.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
PDM_QRY::PDM_QRY(Core::System& system_) : ServiceFramework{system_, "pdm:qry"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "QueryAppletEvent"}, |
|||
{1, nullptr, "QueryPlayStatistics"}, |
|||
{2, nullptr, "QueryPlayStatisticsByUserAccountId"}, |
|||
{3, nullptr, "QueryPlayStatisticsByNetworkServiceAccountId"}, |
|||
{4, nullptr, "QueryPlayStatisticsByApplicationId"}, |
|||
{5, &PDM_QRY::QueryPlayStatisticsByApplicationIdAndUserAccountId, "QueryPlayStatisticsByApplicationIdAndUserAccountId"}, |
|||
{6, nullptr, "QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId"}, |
|||
{7, nullptr, "QueryLastPlayTimeV0"}, |
|||
{8, nullptr, "QueryPlayEvent"}, |
|||
{9, nullptr, "GetAvailablePlayEventRange"}, |
|||
{10, nullptr, "QueryAccountEvent"}, |
|||
{11, nullptr, "QueryAccountPlayEvent"}, |
|||
{12, nullptr, "GetAvailableAccountPlayEventRange"}, |
|||
{13, nullptr, "QueryApplicationPlayStatisticsForSystemV0"}, |
|||
{14, nullptr, "QueryRecentlyPlayedApplication"}, |
|||
{15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"}, |
|||
{16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"}, |
|||
{17, nullptr, "QueryLastPlayTime"}, |
|||
{18, nullptr, "QueryApplicationPlayStatisticsForSystem"}, |
|||
{19, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
PDM_QRY::~PDM_QRY() = default; |
|||
|
|||
void PDM_QRY::QueryPlayStatisticsByApplicationIdAndUserAccountId(HLERequestContext& ctx) { |
|||
IPC::RequestParser rp{ctx}; |
|||
const auto unknown = rp.Pop<bool>(); |
|||
rp.Pop<u8>(); // Padding
|
|||
const auto application_id = rp.Pop<u64>(); |
|||
const auto user_account_uid = rp.PopRaw<Common::UUID>(); |
|||
|
|||
// TODO(German77): Read statistics of the game
|
|||
PlayStatistics statistics{ |
|||
.application_id = application_id, |
|||
.total_launches = 1, |
|||
}; |
|||
|
|||
LOG_WARNING(Service_NS, |
|||
"(STUBBED) called. unknown={}. application_id=0x{:016X}, user_account_uid=0x{}", |
|||
unknown, application_id, user_account_uid.RawString()); |
|||
|
|||
IPC::ResponseBuilder rb{ctx, 12}; |
|||
rb.Push(ResultSuccess); |
|||
rb.PushRaw(statistics); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,57 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "common/logging/log.h"
|
|||
#include "common/uuid.h"
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/query_service.h"
|
|||
#include "core/hle/service/service.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_, "pdm:qry"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "QueryAppletEvent"}, |
|||
{1, nullptr, "QueryPlayStatistics"}, |
|||
{2, nullptr, "QueryPlayStatisticsByUserAccountId"}, |
|||
{3, nullptr, "QueryPlayStatisticsByNetworkServiceAccountId"}, |
|||
{4, nullptr, "QueryPlayStatisticsByApplicationId"}, |
|||
{5, D<&IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId>, "QueryPlayStatisticsByApplicationIdAndUserAccountId"}, |
|||
{6, nullptr, "QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId"}, |
|||
{7, nullptr, "QueryLastPlayTimeV0"}, |
|||
{8, nullptr, "QueryPlayEvent"}, |
|||
{9, nullptr, "GetAvailablePlayEventRange"}, |
|||
{10, nullptr, "QueryAccountEvent"}, |
|||
{11, nullptr, "QueryAccountPlayEvent"}, |
|||
{12, nullptr, "GetAvailableAccountPlayEventRange"}, |
|||
{13, nullptr, "QueryApplicationPlayStatisticsForSystemV0"}, |
|||
{14, nullptr, "QueryRecentlyPlayedApplication"}, |
|||
{15, nullptr, "GetRecentlyPlayedApplicationUpdateEvent"}, |
|||
{16, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystemV0"}, |
|||
{17, nullptr, "QueryLastPlayTime"}, |
|||
{18, nullptr, "QueryApplicationPlayStatisticsForSystem"}, |
|||
{19, nullptr, "QueryApplicationPlayStatisticsByUserAccountIdForSystem"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IQueryService::~IQueryService() = default; |
|||
|
|||
Result IQueryService::QueryPlayStatisticsByApplicationIdAndUserAccountId( |
|||
Out<PlayStatistics> out_play_statistics, bool unknown, Common::UUID account_id, |
|||
u64 application_id) { |
|||
// TODO(German77): Read statistics of the game
|
|||
*out_play_statistics = { |
|||
.application_id = application_id, |
|||
.total_launches = 1, |
|||
}; |
|||
|
|||
LOG_WARNING(Service_NS, "(STUBBED) called. unknown={}. application_id={:016X}, account_id={}", |
|||
unknown, application_id, account_id.FormattedString()); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,122 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "common/settings.h"
|
|||
#include "core/file_sys/control_metadata.h"
|
|||
#include "core/file_sys/patch_manager.h"
|
|||
#include "core/file_sys/vfs/vfs.h"
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/language.h"
|
|||
#include "core/hle/service/ns/ns_results.h"
|
|||
#include "core/hle/service/ns/read_only_application_control_data_interface.h"
|
|||
#include "core/hle/service/set/settings_server.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterface( |
|||
Core::System& system_) |
|||
: ServiceFramework{system_, "IReadOnlyApplicationControlDataInterface"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData>, "GetApplicationControlData"}, |
|||
{1, D<&IReadOnlyApplicationControlDataInterface::GetApplicationDesiredLanguage>, "GetApplicationDesiredLanguage"}, |
|||
{2, D<&IReadOnlyApplicationControlDataInterface::ConvertApplicationLanguageToLanguageCode>, "ConvertApplicationLanguageToLanguageCode"}, |
|||
{3, nullptr, "ConvertLanguageCodeToApplicationLanguage"}, |
|||
{4, nullptr, "SelectApplicationDesiredLanguage"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IReadOnlyApplicationControlDataInterface::~IReadOnlyApplicationControlDataInterface() = default; |
|||
|
|||
Result IReadOnlyApplicationControlDataInterface::GetApplicationControlData( |
|||
OutBuffer<BufferAttr_HipcMapAlias> out_buffer, Out<u32> out_actual_size, |
|||
ApplicationControlSource application_control_source, u64 application_id) { |
|||
LOG_INFO(Service_NS, "called with control_source={}, application_id={:016X}", |
|||
application_control_source, application_id); |
|||
|
|||
const FileSys::PatchManager pm{application_id, system.GetFileSystemController(), |
|||
system.GetContentProvider()}; |
|||
const auto control = pm.GetControlMetadata(); |
|||
const auto size = out_buffer.size(); |
|||
|
|||
const auto icon_size = control.second ? control.second->GetSize() : 0; |
|||
const auto total_size = sizeof(FileSys::RawNACP) + icon_size; |
|||
|
|||
if (size < total_size) { |
|||
LOG_ERROR(Service_NS, "output buffer is too small! (actual={:016X}, expected_min=0x4000)", |
|||
size); |
|||
R_THROW(ResultUnknown); |
|||
} |
|||
|
|||
if (control.first != nullptr) { |
|||
const auto bytes = control.first->GetRawBytes(); |
|||
std::memcpy(out_buffer.data(), bytes.data(), bytes.size()); |
|||
} else { |
|||
LOG_WARNING(Service_NS, "missing NACP data for application_id={:016X}, defaulting to zero", |
|||
application_id); |
|||
std::memset(out_buffer.data(), 0, sizeof(FileSys::RawNACP)); |
|||
} |
|||
|
|||
if (control.second != nullptr) { |
|||
control.second->Read(out_buffer.data() + sizeof(FileSys::RawNACP), icon_size); |
|||
} else { |
|||
LOG_WARNING(Service_NS, "missing icon data for application_id={:016X}", application_id); |
|||
} |
|||
|
|||
*out_actual_size = static_cast<u32>(total_size); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IReadOnlyApplicationControlDataInterface::GetApplicationDesiredLanguage( |
|||
Out<ApplicationLanguage> out_desired_language, u32 supported_languages) { |
|||
LOG_INFO(Service_NS, "called with supported_languages={:08X}", supported_languages); |
|||
|
|||
// Get language code from settings
|
|||
const auto language_code = |
|||
Set::GetLanguageCodeFromIndex(static_cast<s32>(Settings::values.language_index.GetValue())); |
|||
|
|||
// Convert to application language, get priority list
|
|||
const auto application_language = ConvertToApplicationLanguage(language_code); |
|||
if (application_language == std::nullopt) { |
|||
LOG_ERROR(Service_NS, "Could not convert application language! language_code={}", |
|||
language_code); |
|||
R_THROW(Service::NS::ResultApplicationLanguageNotFound); |
|||
} |
|||
const auto priority_list = GetApplicationLanguagePriorityList(*application_language); |
|||
if (!priority_list) { |
|||
LOG_ERROR(Service_NS, |
|||
"Could not find application language priorities! application_language={}", |
|||
*application_language); |
|||
R_THROW(Service::NS::ResultApplicationLanguageNotFound); |
|||
} |
|||
|
|||
// Try to find a valid language.
|
|||
for (const auto lang : *priority_list) { |
|||
const auto supported_flag = GetSupportedLanguageFlag(lang); |
|||
if (supported_languages == 0 || (supported_languages & supported_flag) == supported_flag) { |
|||
*out_desired_language = lang; |
|||
R_SUCCEED(); |
|||
} |
|||
} |
|||
|
|||
LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}", |
|||
supported_languages); |
|||
R_THROW(Service::NS::ResultApplicationLanguageNotFound); |
|||
} |
|||
|
|||
Result IReadOnlyApplicationControlDataInterface::ConvertApplicationLanguageToLanguageCode( |
|||
Out<u64> out_language_code, ApplicationLanguage application_language) { |
|||
const auto language_code = ConvertToLanguageCode(application_language); |
|||
if (language_code == std::nullopt) { |
|||
LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language); |
|||
R_THROW(Service::NS::ResultApplicationLanguageNotFound); |
|||
} |
|||
|
|||
*out_language_code = static_cast<u64>(*language_code); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,30 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/ns/language.h" |
|||
#include "core/hle/service/ns/ns_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IReadOnlyApplicationControlDataInterface final |
|||
: public ServiceFramework<IReadOnlyApplicationControlDataInterface> { |
|||
public: |
|||
explicit IReadOnlyApplicationControlDataInterface(Core::System& system_); |
|||
~IReadOnlyApplicationControlDataInterface() override; |
|||
|
|||
public: |
|||
Result GetApplicationControlData(OutBuffer<BufferAttr_HipcMapAlias> out_buffer, |
|||
Out<u32> out_actual_size, |
|||
ApplicationControlSource application_control_source, |
|||
u64 application_id); |
|||
Result GetApplicationDesiredLanguage(Out<ApplicationLanguage> out_desired_language, |
|||
u32 supported_languages); |
|||
Result ConvertApplicationLanguageToLanguageCode(Out<u64> out_language_code, |
|||
ApplicationLanguage application_language); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,38 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/read_only_application_record_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IReadOnlyApplicationRecordInterface::IReadOnlyApplicationRecordInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "IReadOnlyApplicationRecordInterface"} { |
|||
static const FunctionInfo functions[] = { |
|||
{0, D<&IReadOnlyApplicationRecordInterface::HasApplicationRecord>, "HasApplicationRecord"}, |
|||
{1, nullptr, "NotifyApplicationFailure"}, |
|||
{2, D<&IReadOnlyApplicationRecordInterface::IsDataCorruptedResult>, |
|||
"IsDataCorruptedResult"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IReadOnlyApplicationRecordInterface::~IReadOnlyApplicationRecordInterface() = default; |
|||
|
|||
Result IReadOnlyApplicationRecordInterface::HasApplicationRecord( |
|||
Out<bool> out_has_application_record, u64 program_id) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, program_id={:016X}", program_id); |
|||
*out_has_application_record = true; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IReadOnlyApplicationRecordInterface::IsDataCorruptedResult( |
|||
Out<bool> out_is_data_corrupted_result, Result result) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called, result={:#x}", result.GetInnerValue()); |
|||
*out_is_data_corrupted_result = false; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,22 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IReadOnlyApplicationRecordInterface final |
|||
: public ServiceFramework<IReadOnlyApplicationRecordInterface> { |
|||
public: |
|||
explicit IReadOnlyApplicationRecordInterface(Core::System& system_); |
|||
~IReadOnlyApplicationRecordInterface() override; |
|||
|
|||
private: |
|||
Result HasApplicationRecord(Out<bool> out_has_application_record, u64 program_id); |
|||
Result IsDataCorruptedResult(Out<bool> out_is_data_corrupted_result, Result result); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,120 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/account_proxy_interface.h"
|
|||
#include "core/hle/service/ns/application_manager_interface.h"
|
|||
#include "core/hle/service/ns/application_version_interface.h"
|
|||
#include "core/hle/service/ns/content_management_interface.h"
|
|||
#include "core/hle/service/ns/document_interface.h"
|
|||
#include "core/hle/service/ns/download_task_interface.h"
|
|||
#include "core/hle/service/ns/dynamic_rights_interface.h"
|
|||
#include "core/hle/service/ns/ecommerce_interface.h"
|
|||
#include "core/hle/service/ns/factory_reset_interface.h"
|
|||
#include "core/hle/service/ns/read_only_application_control_data_interface.h"
|
|||
#include "core/hle/service/ns/read_only_application_record_interface.h"
|
|||
#include "core/hle/service/ns/service_getter_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IServiceGetterInterface::IServiceGetterInterface(Core::System& system_, const char* name) |
|||
: ServiceFramework{system_, name} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{7988, D<&IServiceGetterInterface::GetDynamicRightsInterface>, "GetDynamicRightsInterface"}, |
|||
{7989, D<&IServiceGetterInterface::GetReadOnlyApplicationControlDataInterface>, "GetReadOnlyApplicationControlDataInterface"}, |
|||
{7991, D<&IServiceGetterInterface::GetReadOnlyApplicationRecordInterface>, "GetReadOnlyApplicationRecordInterface"}, |
|||
{7992, D<&IServiceGetterInterface::GetECommerceInterface>, "GetECommerceInterface"}, |
|||
{7993, D<&IServiceGetterInterface::GetApplicationVersionInterface>, "GetApplicationVersionInterface"}, |
|||
{7994, D<&IServiceGetterInterface::GetFactoryResetInterface>, "GetFactoryResetInterface"}, |
|||
{7995, D<&IServiceGetterInterface::GetAccountProxyInterface>, "GetAccountProxyInterface"}, |
|||
{7996, D<&IServiceGetterInterface::GetApplicationManagerInterface>, "GetApplicationManagerInterface"}, |
|||
{7997, D<&IServiceGetterInterface::GetDownloadTaskInterface>, "GetDownloadTaskInterface"}, |
|||
{7998, D<&IServiceGetterInterface::GetContentManagementInterface>, "GetContentManagementInterface"}, |
|||
{7999, D<&IServiceGetterInterface::GetDocumentInterface>, "GetDocumentInterface"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IServiceGetterInterface::~IServiceGetterInterface() = default; |
|||
|
|||
Result IServiceGetterInterface::GetDynamicRightsInterface( |
|||
Out<SharedPointer<IDynamicRightsInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IDynamicRightsInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetReadOnlyApplicationControlDataInterface( |
|||
Out<SharedPointer<IReadOnlyApplicationControlDataInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IReadOnlyApplicationControlDataInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetReadOnlyApplicationRecordInterface( |
|||
Out<SharedPointer<IReadOnlyApplicationRecordInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IReadOnlyApplicationRecordInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetECommerceInterface( |
|||
Out<SharedPointer<IECommerceInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IECommerceInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetApplicationVersionInterface( |
|||
Out<SharedPointer<IApplicationVersionInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IApplicationVersionInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetFactoryResetInterface( |
|||
Out<SharedPointer<IFactoryResetInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IFactoryResetInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetAccountProxyInterface( |
|||
Out<SharedPointer<IAccountProxyInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IAccountProxyInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetApplicationManagerInterface( |
|||
Out<SharedPointer<IApplicationManagerInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IApplicationManagerInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetDownloadTaskInterface( |
|||
Out<SharedPointer<IDownloadTaskInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IDownloadTaskInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetContentManagementInterface( |
|||
Out<SharedPointer<IContentManagementInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IContentManagementInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result IServiceGetterInterface::GetDocumentInterface( |
|||
Out<SharedPointer<IDocumentInterface>> out_interface) { |
|||
LOG_DEBUG(Service_NS, "called"); |
|||
*out_interface = std::make_shared<IDocumentInterface>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,47 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IDynamicRightsInterface; |
|||
class IReadOnlyApplicationControlDataInterface; |
|||
class IReadOnlyApplicationRecordInterface; |
|||
class IECommerceInterface; |
|||
class IApplicationVersionInterface; |
|||
class IFactoryResetInterface; |
|||
class IAccountProxyInterface; |
|||
class IApplicationManagerInterface; |
|||
class IDownloadTaskInterface; |
|||
class IContentManagementInterface; |
|||
class IDocumentInterface; |
|||
|
|||
class IServiceGetterInterface : public ServiceFramework<IServiceGetterInterface> { |
|||
public: |
|||
explicit IServiceGetterInterface(Core::System& system_, const char* name); |
|||
~IServiceGetterInterface() override; |
|||
|
|||
public: |
|||
Result GetDynamicRightsInterface(Out<SharedPointer<IDynamicRightsInterface>> out_interface); |
|||
Result GetReadOnlyApplicationControlDataInterface( |
|||
Out<SharedPointer<IReadOnlyApplicationControlDataInterface>> out_interface); |
|||
Result GetReadOnlyApplicationRecordInterface( |
|||
Out<SharedPointer<IReadOnlyApplicationRecordInterface>> out_interface); |
|||
Result GetECommerceInterface(Out<SharedPointer<IECommerceInterface>> out_interface); |
|||
Result GetApplicationVersionInterface( |
|||
Out<SharedPointer<IApplicationVersionInterface>> out_interface); |
|||
Result GetFactoryResetInterface(Out<SharedPointer<IFactoryResetInterface>> out_interface); |
|||
Result GetAccountProxyInterface(Out<SharedPointer<IAccountProxyInterface>> out_interface); |
|||
Result GetApplicationManagerInterface( |
|||
Out<SharedPointer<IApplicationManagerInterface>> out_interface); |
|||
Result GetDownloadTaskInterface(Out<SharedPointer<IDownloadTaskInterface>> out_interface); |
|||
Result GetContentManagementInterface( |
|||
Out<SharedPointer<IContentManagementInterface>> out_interface); |
|||
Result GetDocumentInterface(Out<SharedPointer<IDocumentInterface>> out_interface); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,44 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/system_update_control.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
ISystemUpdateControl::ISystemUpdateControl(Core::System& system_) |
|||
: ServiceFramework{system_, "ISystemUpdateControl"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, nullptr, "HasDownloaded"}, |
|||
{1, nullptr, "RequestCheckLatestUpdate"}, |
|||
{2, nullptr, "RequestDownloadLatestUpdate"}, |
|||
{3, nullptr, "GetDownloadProgress"}, |
|||
{4, nullptr, "ApplyDownloadedUpdate"}, |
|||
{5, nullptr, "RequestPrepareCardUpdate"}, |
|||
{6, nullptr, "GetPrepareCardUpdateProgress"}, |
|||
{7, nullptr, "HasPreparedCardUpdate"}, |
|||
{8, nullptr, "ApplyCardUpdate"}, |
|||
{9, nullptr, "GetDownloadedEulaDataSize"}, |
|||
{10, nullptr, "GetDownloadedEulaData"}, |
|||
{11, nullptr, "SetupCardUpdate"}, |
|||
{12, nullptr, "GetPreparedCardUpdateEulaDataSize"}, |
|||
{13, nullptr, "GetPreparedCardUpdateEulaData"}, |
|||
{14, nullptr, "SetupCardUpdateViaSystemUpdater"}, |
|||
{15, nullptr, "HasReceived"}, |
|||
{16, nullptr, "RequestReceiveSystemUpdate"}, |
|||
{17, nullptr, "GetReceiveProgress"}, |
|||
{18, nullptr, "ApplyReceivedUpdate"}, |
|||
{19, nullptr, "GetReceivedEulaDataSize"}, |
|||
{20, nullptr, "GetReceivedEulaData"}, |
|||
{21, nullptr, "SetupToReceiveSystemUpdate"}, |
|||
{22, nullptr, "RequestCheckLatestUpdateIncludesRebootlessUpdate"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
ISystemUpdateControl::~ISystemUpdateControl() = default; |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,16 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class ISystemUpdateControl final : public ServiceFramework<ISystemUpdateControl> { |
|||
public: |
|||
explicit ISystemUpdateControl(Core::System& system_); |
|||
~ISystemUpdateControl() override; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,61 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/system_update_control.h"
|
|||
#include "core/hle/service/ns/system_update_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
ISystemUpdateInterface::ISystemUpdateInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "ns:su"}, service_context{system_, "ns:su"}, |
|||
update_notification_event{service_context} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{0, D<&ISystemUpdateInterface::GetBackgroundNetworkUpdateState>, "GetBackgroundNetworkUpdateState"}, |
|||
{1, D<&ISystemUpdateInterface::OpenSystemUpdateControl>, "OpenSystemUpdateControl"}, |
|||
{2, nullptr, "NotifyExFatDriverRequired"}, |
|||
{3, nullptr, "ClearExFatDriverStatusForDebug"}, |
|||
{4, nullptr, "RequestBackgroundNetworkUpdate"}, |
|||
{5, nullptr, "NotifyBackgroundNetworkUpdate"}, |
|||
{6, nullptr, "NotifyExFatDriverDownloadedForDebug"}, |
|||
{9, D<&ISystemUpdateInterface::GetSystemUpdateNotificationEventForContentDelivery>, "GetSystemUpdateNotificationEventForContentDelivery"}, |
|||
{10, nullptr, "NotifySystemUpdateForContentDelivery"}, |
|||
{11, nullptr, "PrepareShutdown"}, |
|||
{12, nullptr, "Unknown12"}, |
|||
{13, nullptr, "Unknown13"}, |
|||
{14, nullptr, "Unknown14"}, |
|||
{15, nullptr, "Unknown15"}, |
|||
{16, nullptr, "DestroySystemUpdateTask"}, |
|||
{17, nullptr, "RequestSendSystemUpdate"}, |
|||
{18, nullptr, "GetSendSystemUpdateProgress"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
ISystemUpdateInterface::~ISystemUpdateInterface() = default; |
|||
|
|||
Result ISystemUpdateInterface::GetBackgroundNetworkUpdateState( |
|||
Out<BackgroundNetworkUpdateState> out_background_network_update_state) { |
|||
LOG_WARNING(Service_AM, "(STUBBED) called"); |
|||
*out_background_network_update_state = BackgroundNetworkUpdateState::None; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result ISystemUpdateInterface::OpenSystemUpdateControl( |
|||
Out<SharedPointer<ISystemUpdateControl>> out_system_update_control) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_system_update_control = std::make_shared<ISystemUpdateControl>(system); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
Result ISystemUpdateInterface::GetSystemUpdateNotificationEventForContentDelivery( |
|||
OutCopyHandle<Kernel::KReadableEvent> out_event) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_event = update_notification_event.GetHandle(); |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,38 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/kernel_helpers.h" |
|||
#include "core/hle/service/ns/ns_types.h" |
|||
#include "core/hle/service/os/event.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Kernel { |
|||
class KReadableEvent; |
|||
} |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class ISystemUpdateControl; |
|||
|
|||
class ISystemUpdateInterface final : public ServiceFramework<ISystemUpdateInterface> { |
|||
public: |
|||
explicit ISystemUpdateInterface(Core::System& system_); |
|||
~ISystemUpdateInterface() override; |
|||
|
|||
private: |
|||
Result GetBackgroundNetworkUpdateState( |
|||
Out<BackgroundNetworkUpdateState> out_background_network_update_state); |
|||
Result OpenSystemUpdateControl( |
|||
Out<SharedPointer<ISystemUpdateControl>> out_system_update_control); |
|||
Result GetSystemUpdateNotificationEventForContentDelivery( |
|||
OutCopyHandle<Kernel::KReadableEvent> out_event); |
|||
|
|||
private: |
|||
KernelHelpers::ServiceContext service_context; |
|||
Event update_notification_event; |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
@ -0,0 +1,31 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
|||
|
|||
#include "core/hle/service/cmif_serialization.h"
|
|||
#include "core/hle/service/ns/vulnerability_manager_interface.h"
|
|||
|
|||
namespace Service::NS { |
|||
|
|||
IVulnerabilityManagerInterface::IVulnerabilityManagerInterface(Core::System& system_) |
|||
: ServiceFramework{system_, "ns:vm"} { |
|||
// clang-format off
|
|||
static const FunctionInfo functions[] = { |
|||
{1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, |
|||
{1201, nullptr, "UpdateSafeSystemVersionForDebug"}, |
|||
{1202, nullptr, "GetSafeSystemVersion"}, |
|||
}; |
|||
// clang-format on
|
|||
|
|||
RegisterHandlers(functions); |
|||
} |
|||
|
|||
IVulnerabilityManagerInterface::~IVulnerabilityManagerInterface() = default; |
|||
|
|||
Result IVulnerabilityManagerInterface::NeedsUpdateVulnerability( |
|||
Out<bool> out_needs_update_vulnerability) { |
|||
LOG_WARNING(Service_NS, "(STUBBED) called"); |
|||
*out_needs_update_vulnerability = false; |
|||
R_SUCCEED(); |
|||
} |
|||
|
|||
} // namespace Service::NS
|
|||
@ -0,0 +1,21 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
|||
// SPDX-License-Identifier: GPL-2.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "core/hle/service/cmif_types.h" |
|||
#include "core/hle/service/service.h" |
|||
|
|||
namespace Service::NS { |
|||
|
|||
class IVulnerabilityManagerInterface final |
|||
: public ServiceFramework<IVulnerabilityManagerInterface> { |
|||
public: |
|||
explicit IVulnerabilityManagerInterface(Core::System& system_); |
|||
~IVulnerabilityManagerInterface() override; |
|||
|
|||
private: |
|||
Result NeedsUpdateVulnerability(Out<bool> out_needs_update_vulnerability); |
|||
}; |
|||
|
|||
} // namespace Service::NS |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue