fs: add IsSignedSystemPartitionOnSdCardValid

This commit is contained in:
Michael Scire 2020-03-07 02:11:49 -08:00
parent 1b1620f7bb
commit 19240034a3
2 changed files with 9 additions and 0 deletions

View File

@ -345,6 +345,8 @@ Result fsOpenDataStorageByDataId(FsStorage* out, u64 dataId, NcmStorageId storag
Result fsOpenDeviceOperator(FsDeviceOperator* out); Result fsOpenDeviceOperator(FsDeviceOperator* out);
Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out); Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out);
Result fsIsSignedSystemPartitionOnSdCardValid(bool *out);
/// Retrieves the rights id corresponding to the content path. Only available on [2.0.0+]. /// Retrieves the rights id corresponding to the content path. Only available on [2.0.0+].
Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id); Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id);

View File

@ -402,6 +402,13 @@ Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out) {
return _fsCmdGetSession(&g_fsSrv, &out->s, 500); return _fsCmdGetSession(&g_fsSrv, &out->s, 500);
} }
Result fsIsSignedSystemPartitionOnSdCardValid(bool *out) {
if (hosversionBefore(4,0,0) || hosversionAtLeast(8,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _fsCmdNoInOutBool(&g_fsSrv, out, 640);
}
Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id) { Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id) {
if (hosversionBefore(2,0,0)) if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);