mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Add fsIsExFatSupported()
This commit is contained in:
parent
69a98dc0cb
commit
c328a74f71
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user