This commit is contained in:
ITotalJustice 2025-09-19 22:02:07 +01:00 committed by GitHub
commit e9abc81c3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View File

@ -261,6 +261,11 @@ typedef enum {
FsGameCardPartition_Logo = 3, ///< [4.0.0+] FsGameCardPartition_Logo = 3, ///< [4.0.0+]
} FsGameCardPartition; } FsGameCardPartition;
typedef enum {
FsGameCardPartitionRaw_Normal = 0,
FsGameCardPartitionRaw_Secure = 1,
} FsGameCardPartitionRaw;
typedef struct { typedef struct {
u32 value; u32 value;
} FsGameCardHandle; } FsGameCardHandle;
@ -540,8 +545,11 @@ Result fsOpenDataStorageByProgramId(FsStorage *out, u64 program_id); /// <[3.0.0
Result fsOpenDataStorageByDataId(FsStorage* out, u64 dataId, NcmStorageId storageId); Result fsOpenDataStorageByDataId(FsStorage* out, u64 dataId, NcmStorageId storageId);
Result fsOpenPatchDataStorageByCurrentProcess(FsStorage* out); Result fsOpenPatchDataStorageByCurrentProcess(FsStorage* out);
Result fsOpenGameCardPartition(FsStorage* out, const FsGameCardHandle* handle, FsGameCardPartitionRaw partition);
Result fsOpenDeviceOperator(FsDeviceOperator* out); Result fsOpenDeviceOperator(FsDeviceOperator* out);
Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out); Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out);
Result fsOpenGameCardDetectionEventNotifier(FsEventNotifier* out);
Result fsIsSignedSystemPartitionOnSdCardValid(bool *out); Result fsIsSignedSystemPartitionOnSdCardValid(bool *out);

View File

@ -538,6 +538,18 @@ Result fsOpenPatchDataStorageByCurrentProcess(FsStorage* out) {
return _fsCmdGetSession(&g_fsSrv, &out->s, 203); return _fsCmdGetSession(&g_fsSrv, &out->s, 203);
} }
Result fsOpenGameCardPartition(FsStorage* out, const FsGameCardHandle* handle, FsGameCardPartitionRaw partition) {
const struct {
FsGameCardHandle handle;
u32 partition;
} in = { *handle, (u32)partition };
return serviceDispatchIn(&g_fsSrv, 30, in,
.out_num_objects = 1,
.out_objects = &out->s
);
}
Result fsOpenDeviceOperator(FsDeviceOperator* out) { Result fsOpenDeviceOperator(FsDeviceOperator* out) {
return _fsCmdGetSession(&g_fsSrv, &out->s, 400); return _fsCmdGetSession(&g_fsSrv, &out->s, 400);
} }
@ -546,6 +558,10 @@ Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out) {
return _fsCmdGetSession(&g_fsSrv, &out->s, 500); return _fsCmdGetSession(&g_fsSrv, &out->s, 500);
} }
Result fsOpenGameCardDetectionEventNotifier(FsEventNotifier* out) {
return _fsCmdGetSession(&g_fsSrv, &out->s, 501);
}
Result fsIsSignedSystemPartitionOnSdCardValid(bool *out) { Result fsIsSignedSystemPartitionOnSdCardValid(bool *out) {
if (!hosversionBetween(4, 8)) if (!hosversionBetween(4, 8))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);