mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-03 18:12:14 +02:00
add romfs wrapper for program mounting
This commit is contained in:
parent
e9f2ca9a99
commit
86577c2c72
@ -82,6 +82,14 @@ Result romfsMountFromStorage(FsStorage storage, u64 offset, const char *name);
|
|||||||
*/
|
*/
|
||||||
Result romfsMountFromCurrentProcess(const char *name);
|
Result romfsMountFromCurrentProcess(const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mounts RomFS of a running program.
|
||||||
|
* @note Permission needs to be set in the NPDM.
|
||||||
|
* @param program_id ProgramId to mount.
|
||||||
|
* @param name Device mount name.
|
||||||
|
*/
|
||||||
|
Result romfsMountProgram(u64 program_id, const char *name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Mounts RomFS from a file path in a mounted fsdev device.
|
* @brief Mounts RomFS from a file path in a mounted fsdev device.
|
||||||
* @param path File path.
|
* @param path File path.
|
||||||
|
@ -342,6 +342,16 @@ Result romfsMountFromCurrentProcess(const char *name) {
|
|||||||
return romfsMountFromStorage(storage, 0, name);
|
return romfsMountFromStorage(storage, 0, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result romfsMountProgram(u64 program_id, const char *name) {
|
||||||
|
FsStorage storage;
|
||||||
|
|
||||||
|
Result rc = fsOpenDataStorageByProgramId(&storage, program_id);
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
return romfsMountFromStorage(storage, 0, name);
|
||||||
|
}
|
||||||
|
|
||||||
Result romfsMountFromFsdev(const char *path, u64 offset, const char *name)
|
Result romfsMountFromFsdev(const char *path, u64 offset, const char *name)
|
||||||
{
|
{
|
||||||
FsFileSystem *tmpfs = NULL;
|
FsFileSystem *tmpfs = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user