Minor cleanup
This commit is contained in:
parent
db33c315f2
commit
c087edf2ba
@ -163,19 +163,4 @@ Result FSLDR_OpenDirectory(Handle* out, FS_Archive archive, FS_Path path)
|
||||
if(out) *out = cmdbuf[3];
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result FSDIRLDR_Close(Handle handle)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x802,0,0); // 0x8020000
|
||||
|
||||
Result ret = 0;
|
||||
if(R_FAILED(ret = svcSendSyncRequest(handle))) return ret;
|
||||
|
||||
ret = cmdbuf[1];
|
||||
if(R_SUCCEEDED(ret)) ret = svcCloseHandle(handle);
|
||||
|
||||
return ret;
|
||||
}
|
@ -9,5 +9,4 @@ Result FSLDR_SetPriority(u32 priority);
|
||||
Result FSLDR_OpenFileDirectly(Handle* out, FS_ArchiveID archiveId, FS_Path archivePath, FS_Path filePath, u32 openFlags, u32 attributes);
|
||||
Result FSLDR_OpenArchive(FS_Archive* archive, FS_ArchiveID id, FS_Path path);
|
||||
Result FSLDR_CloseArchive(FS_Archive archive);
|
||||
Result FSLDR_OpenDirectory(Handle* out, FS_Archive archive, FS_Path path);
|
||||
Result FSDIRLDR_Close(Handle handle);
|
||||
Result FSLDR_OpenDirectory(Handle* out, FS_Archive archive, FS_Path path);
|
@ -52,7 +52,7 @@ static u32 dirCheck(FS_ArchiveID archiveId, const char *path)
|
||||
else
|
||||
{
|
||||
ret = R_SUCCEEDED(FSLDR_OpenDirectory(&handle, archive, dirPath)) ? 0 : 2;
|
||||
if(ret) FSDIRLDR_Close(handle);
|
||||
if(ret) FSDIR_Close(handle);
|
||||
FSLDR_CloseArchive(archive);
|
||||
}
|
||||
|
||||
@ -522,8 +522,6 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize)
|
||||
|
||||
if(!archiveId) return true;
|
||||
|
||||
static const char *archiveName = "lf:";
|
||||
|
||||
u32 fsMountArchive = 0xFFFFFFFF,
|
||||
fsRegisterArchive = 0xFFFFFFFF,
|
||||
fsTryOpenFile = 0xFFFFFFFF,
|
||||
@ -534,7 +532,8 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize)
|
||||
!findLayeredFsPayloadOffset(code, textSize, &payloadOffset)) return false;
|
||||
|
||||
static const char *updateRomFsMounts[] = { "patch:",
|
||||
"ext:" };
|
||||
"ext:" },
|
||||
patch = 'r';
|
||||
|
||||
//Change update RomFS mountpoints to start with "r"
|
||||
for(u32 i = 0, ret = 0; i < sizeof(updateRomFsMounts) / sizeof(char *) && !ret; i++)
|
||||
@ -542,8 +541,8 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize)
|
||||
ret = patchMemory(code, size,
|
||||
updateRomFsMounts[i],
|
||||
strnlen(updateRomFsMounts[i], 255), 0,
|
||||
"r",
|
||||
1, 0
|
||||
&patch,
|
||||
sizeof(patch), 0
|
||||
);
|
||||
}
|
||||
|
||||
@ -570,7 +569,7 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize)
|
||||
payload32[i] = MAKE_BRANCH(payloadOffset + i * 4, fsTryOpenFile + 4);
|
||||
break;
|
||||
case 0xdead0004:
|
||||
memcpy(payload32 + i, archiveName, 3);
|
||||
memcpy(payload32 + i, "lf:", 3);
|
||||
memcpy((u8 *)(payload32 + i) + 3, path, sizeof(path));
|
||||
break;
|
||||
case 0xdead0005:
|
||||
|
Reference in New Issue
Block a user