Add fsIsExFatSupported()

This commit is contained in:
plutooo 2018-12-09 17:06:47 +01:00
parent 69a98dc0cb
commit c328a74f71
2 changed files with 45 additions and 0 deletions

View File

@ -166,6 +166,8 @@ Service* fsGetServiceSession(void);
Result fsOpenBisStorage(FsStorage* out, u32 PartitionId);
Result fsOpenBisFileSystem(FsFileSystem* out, u32 PartitionId, const char* string);
Result fsIsExFatSupported(bool* out);
/// Do not call this directly, see fs_dev.h.
Result fsMountSdcard(FsFileSystem* out);

View File

@ -425,6 +425,49 @@ Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out) {
return rc;
}
Result fsIsExFatSupported(bool* out)
{
if (!kernelAbove200()) {
*out = false;
return 0;
}
IpcCommand c;
ipcInitialize(&c);
struct {
u64 magic;
u64 cmd_id;
} *raw;
raw = serviceIpcPrepareHeader(&g_fsSrv, &c, sizeof(*raw));
raw->magic = SFCI_MAGIC;
raw->cmd_id = 27;
Result rc = serviceIpcDispatch(&g_fsSrv);
if (R_SUCCEEDED(rc)) {
IpcParsedCommand r;
struct {
u64 magic;
u64 result;
u8 exfat;
} *resp;
serviceIpcParse(&g_fsSrv, &r, sizeof(*resp));
resp = r.Raw;
rc = resp->result;
if (R_SUCCEEDED(rc)) {
*out = resp->exfat;
}
}
return rc;
}
// Wrapper(s) for fsMountSaveData.
Result fsMount_SaveData(FsFileSystem* out, u64 titleID, u128 userID) {
FsSave save;