mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 19:02:14 +02:00
Fix fsOpenFileSystem
This commit is contained in:
parent
8e19bb5b0d
commit
f9e59d12be
@ -179,8 +179,8 @@ typedef enum
|
|||||||
} FsFileSystemType;
|
} FsFileSystemType;
|
||||||
|
|
||||||
/// Mount requested filesystem type from content file
|
/// Mount requested filesystem type from content file
|
||||||
Result fsOpenFileSystem(FsFileSystem* out, u64 titleId, FsFileSystemType fsType); /// only on 1.0.0, only works with registered content
|
Result fsOpenFileSystem(FsFileSystem* out, FsFileSystemType fsType, const char* contentPath); /// only on 1.0.0
|
||||||
Result fsOpenFileSystemWithId(FsFileSystem* out, u64 titleId, FsFileSystemType fsType, const char* contentPath); /// 2.0.0+, contentPath must be resolved manually
|
Result fsOpenFileSystemWithId(FsFileSystem* out, u64 titleId, FsFileSystemType fsType, const char* contentPath); /// 2.0.0+
|
||||||
|
|
||||||
// IFileSystem
|
// IFileSystem
|
||||||
Result fsFsCreateFile(FsFileSystem* fs, const char* path, size_t size, int flags);
|
Result fsFsCreateFile(FsFileSystem* fs, const char* path, size_t size, int flags);
|
||||||
|
@ -432,15 +432,18 @@ Result fsMount_SystemSaveData(FsFileSystem* out, u64 saveID) {
|
|||||||
return fsMountSystemSaveData(out, FsSaveDataSpaceId_NandSystem, &save);
|
return fsMountSystemSaveData(out, FsSaveDataSpaceId_NandSystem, &save);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result fsOpenFileSystem(FsFileSystem* out, u64 titleId, FsFileSystemType fsType) {
|
Result fsOpenFileSystem(FsFileSystem* out, FsFileSystemType fsType, const char* contentPath) {
|
||||||
|
char sendStr[FS_MAX_PATH] = {0};
|
||||||
|
strncpy(sendStr, contentPath, sizeof(sendStr)-1);
|
||||||
|
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
ipcAddSendStatic(&c, sendStr, sizeof(sendStr), 0);
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u64 magic;
|
u64 magic;
|
||||||
u64 cmd_id;
|
u64 cmd_id;
|
||||||
u32 fsType;
|
u32 fsType;
|
||||||
u64 titleId;
|
|
||||||
} *raw;
|
} *raw;
|
||||||
|
|
||||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
@ -448,7 +451,6 @@ Result fsOpenFileSystem(FsFileSystem* out, u64 titleId, FsFileSystemType fsType)
|
|||||||
raw->magic = SFCI_MAGIC;
|
raw->magic = SFCI_MAGIC;
|
||||||
raw->cmd_id = 0;
|
raw->cmd_id = 0;
|
||||||
raw->fsType = fsType;
|
raw->fsType = fsType;
|
||||||
raw->titleId = titleId;
|
|
||||||
|
|
||||||
Result rc = serviceIpcDispatch(&g_fsSrv);
|
Result rc = serviceIpcDispatch(&g_fsSrv);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user