mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-09 04:21:38 +12:00
[FS] Add app data folder, add path safety checks
This commit is contained in:
parent
c16bf5c8aa
commit
b1f2be98fa
6 changed files with 77 additions and 12 deletions
|
@ -18,7 +18,8 @@ namespace FSCommands {
|
|||
namespace Result {
|
||||
enum : u32 {
|
||||
Success = 0,
|
||||
Failure = 0xFFFFFFFF
|
||||
FileNotFound = 0xC8804464, // TODO: Verify this
|
||||
Failure = 0xFFFFFFFF,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -166,9 +167,9 @@ void FSService::openFile(u32 messagePointer) {
|
|||
|
||||
std::optional<Handle> handle = openFileHandle(archive, filePath);
|
||||
if (!handle.has_value()) {
|
||||
Helpers::panic("OpenFile: Failed to open file with given path");
|
||||
}
|
||||
else {
|
||||
printf("OpenFile failed\n");
|
||||
mem.write32(messagePointer + 4, Result::FileNotFound);
|
||||
} else {
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
mem.write32(messagePointer + 8, 0x10); // "Move handle descriptor"
|
||||
mem.write32(messagePointer + 12, handle.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue