1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-23 02:36:41 +00:00
nxdumptool/source/fs_ext.c
2019-12-11 04:56:58 -04:00

48 lines
1.2 KiB
C

#include <switch/kernel/ipc.h>
#include <switch/services/fs.h>
#include <stdlib.h>
#include <string.h>
#include "fs_ext.h"
// IFileSystemProxy
Result fsOpenGameCardStorage(FsStorage* out, const FsGameCardHandle* handle, u32 partition)
{
struct {
u32 handle;
u32 partition;
} in = { handle->value, partition };
return serviceDispatchIn(fsGetServiceSession(), 30, in,
.out_num_objects = 1,
.out_objects = &out->s
);
}
Result fsOpenGameCardDetectionEventNotifier(FsEventNotifier* out)
{
return serviceDispatch(fsGetServiceSession(), 501,
.out_num_objects = 1,
.out_objects = &out->s
);
}
// IDeviceOperator
Result fsDeviceOperatorUpdatePartitionInfo(FsDeviceOperator* d, const FsGameCardHandle* handle, u32* out_title_version, u64* out_title_id)
{
struct {
u32 handle;
} in = { handle->value };
struct {
u32 title_ver;
u64 title_id;
} out;
Result rc = serviceDispatchInOut(&d->s, 203, in, out);
if (R_SUCCEEDED(rc) && out_title_version) *out_title_version = out.title_ver;
if (R_SUCCEEDED(rc) && out_title_id) *out_title_id = out.title_id;
return rc;
}