From c3b0b63471ee5309ea5040ad98f21919022ac9c7 Mon Sep 17 00:00:00 2001 From: SciresM Date: Sat, 7 Mar 2020 03:40:02 -0800 Subject: [PATCH] fs: add IsSignedSystemPartitionOnSdCardValid (#381) --- nx/include/switch/services/fs.h | 2 ++ nx/source/services/fs.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/nx/include/switch/services/fs.h b/nx/include/switch/services/fs.h index 0da76c50..d570ce84 100644 --- a/nx/include/switch/services/fs.h +++ b/nx/include/switch/services/fs.h @@ -345,6 +345,8 @@ Result fsOpenDataStorageByDataId(FsStorage* out, u64 dataId, NcmStorageId storag Result fsOpenDeviceOperator(FsDeviceOperator* out); Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out); +Result fsIsSignedSystemPartitionOnSdCardValid(bool *out); + /// Retrieves the rights id corresponding to the content path. Only available on [2.0.0+]. Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id); diff --git a/nx/source/services/fs.c b/nx/source/services/fs.c index ba5bda71..ebeef80f 100644 --- a/nx/source/services/fs.c +++ b/nx/source/services/fs.c @@ -402,6 +402,13 @@ Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out) { return _fsCmdGetSession(&g_fsSrv, &out->s, 500); } +Result fsIsSignedSystemPartitionOnSdCardValid(bool *out) { + if (!hosversionBetween(4, 8)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _fsCmdNoInOutBool(&g_fsSrv, out, 640); +} + Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id) { if (hosversionBefore(2,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);