From f4fe3376bd77324e0f5679327925904b9a16ce9e Mon Sep 17 00:00:00 2001 From: yellows8 Date: Tue, 17 Sep 2019 13:19:29 -0400 Subject: [PATCH] Fixed the names for nsdevLaunchApplication, nsdevLaunchApplicationWithStorageId, nsdevGetRunningApplicationProcessId, and nsdevSetCurrentApplicationRightsEnvironmentCanBeActive. Updated the sysver checks for nsdevIsSystemMemoryResourceLimitBoosted since it was removed with [9.0.0+]. --- nx/include/switch/services/ns.h | 12 ++++++------ nx/source/services/ns.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/nx/include/switch/services/ns.h b/nx/include/switch/services/ns.h index 372f0299..cf80ccd9 100644 --- a/nx/include/switch/services/ns.h +++ b/nx/include/switch/services/ns.h @@ -90,12 +90,12 @@ void nsdevExit(void); Result nsdevLaunchProgram(u64* out_pid, const NsLaunchProperties* properties, u32 flags); Result nsdevTerminateProcess(u64 pid); Result nsdevTerminateProgram(u64 tid); -Result nsdevGetShellEvent(Event* out); // Autoclear for nsdevShellEvent is always true. +Result nsdevGetShellEvent(Event* out); ///< Autoclear for nsdevShellEvent is always true. Result nsdevGetShellEventInfo(NsShellEventInfo* out); Result nsdevTerminateApplication(void); Result nsdevPrepareLaunchProgramFromHost(NsLaunchProperties* out, const char* path, size_t path_len); -Result nsdevLaunchApplication(u64* out_pid, u64 app_title_id, u32 flags); -Result nsdevLaunchApplicationWithStorageId(u64* out_pid, u64 app_title_id, u32 flags, u8 app_storage_id, u8 patch_storage_id); -Result nsdevIsSystemMemoryResourceLimitBoosted(bool* out); -Result nsdevGetRunningApplicationProcessId(u64* out_pid); -Result nsdevSetCurrentApplicationRightsEnvironmentCanBeActive(bool can_be_active); +Result nsdevLaunchApplicationForDevelop(u64* out_pid, u64 app_title_id, u32 flags); +Result nsdevLaunchApplicationWithStorageIdForDevelop(u64* out_pid, u64 app_title_id, u32 flags, u8 app_storage_id, u8 patch_storage_id); +Result nsdevIsSystemMemoryResourceLimitBoosted(bool* out); ///< [6.0.0-8.1.0] +Result nsdevGetRunningApplicationProcessIdForDevelop(u64* out_pid); +Result nsdevSetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop(bool can_be_active); diff --git a/nx/source/services/ns.c b/nx/source/services/ns.c index 6fcbc492..ba46c740 100644 --- a/nx/source/services/ns.c +++ b/nx/source/services/ns.c @@ -642,7 +642,7 @@ Result nsdevPrepareLaunchProgramFromHost(NsLaunchProperties* out, const char* pa return rc; } -Result nsdevLaunchApplication(u64* out_pid, u64 app_title_id, u32 flags) { +Result nsdevLaunchApplicationForDevelop(u64* out_pid, u64 app_title_id, u32 flags) { IpcCommand c; ipcInitialize(&c); @@ -685,7 +685,7 @@ Result nsdevLaunchApplication(u64* out_pid, u64 app_title_id, u32 flags) { return rc; } -Result nsdevLaunchApplicationWithStorageId(u64* out_pid, u64 app_title_id, u32 flags, u8 app_storage_id, u8 patch_storage_id) { +Result nsdevLaunchApplicationWithStorageIdForDevelop(u64* out_pid, u64 app_title_id, u32 flags, u8 app_storage_id, u8 patch_storage_id) { IpcCommand c; ipcInitialize(&c); @@ -733,7 +733,7 @@ Result nsdevLaunchApplicationWithStorageId(u64* out_pid, u64 app_title_id, u32 f } Result nsdevIsSystemMemoryResourceLimitBoosted(bool* out) { - if (hosversionBefore(6,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + if (hosversionBefore(6,0,0) || hosversionAtLeast(9,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); IpcCommand c; ipcInitialize(&c); @@ -771,7 +771,7 @@ Result nsdevIsSystemMemoryResourceLimitBoosted(bool* out) { return rc; } -Result nsdevGetRunningApplicationProcessId(u64* out_pid) { +Result nsdevGetRunningApplicationProcessIdForDevelop(u64* out_pid) { if (hosversionBefore(6,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); IpcCommand c; @@ -810,7 +810,7 @@ Result nsdevGetRunningApplicationProcessId(u64* out_pid) { return rc; } -Result nsdevSetCurrentApplicationRightsEnvironmentCanBeActive(bool can_be_active) { +Result nsdevSetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop(bool can_be_active) { if (hosversionBefore(6,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); IpcCommand c;