|
|
@ -337,13 +337,14 @@ public:
|
|
|
|
const auto file_buffer = ctx.ReadBuffer();
|
|
|
|
const auto file_buffer = ctx.ReadBuffer();
|
|
|
|
const std::string name = Common::StringFromBuffer(file_buffer);
|
|
|
|
const std::string name = Common::StringFromBuffer(file_buffer);
|
|
|
|
|
|
|
|
|
|
|
|
const u64 mode = rp.Pop<u64>();
|
|
|
|
const u64 file_mode = rp.Pop<u64>();
|
|
|
|
const u32 size = rp.Pop<u32>();
|
|
|
|
const u32 file_size = rp.Pop<u32>();
|
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_FS, "called. file={}, mode=0x{:X}, size=0x{:08X}", name, mode, size);
|
|
|
|
LOG_DEBUG(Service_FS, "called. file={}, mode=0x{:X}, size=0x{:08X}", name, file_mode,
|
|
|
|
|
|
|
|
file_size);
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
rb.Push(backend.CreateFile(name, size));
|
|
|
|
rb.Push(backend.CreateFile(name, file_size));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeleteFile(Kernel::HLERequestContext& ctx) {
|
|
|
|
void DeleteFile(Kernel::HLERequestContext& ctx) {
|
|
|
@ -935,8 +936,8 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(
|
|
|
|
void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
|
|
|
|
void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
|
|
|
|
LOG_DEBUG(Service_FS, "called");
|
|
|
|
LOG_DEBUG(Service_FS, "called");
|
|
|
|
|
|
|
|
|
|
|
|
auto romfs = fsc.OpenRomFSCurrentProcess();
|
|
|
|
auto current_romfs = fsc.OpenRomFSCurrentProcess();
|
|
|
|
if (romfs.Failed()) {
|
|
|
|
if (current_romfs.Failed()) {
|
|
|
|
// TODO (bunnei): Find the right error code to use here
|
|
|
|
// TODO (bunnei): Find the right error code to use here
|
|
|
|
LOG_CRITICAL(Service_FS, "no file system interface available!");
|
|
|
|
LOG_CRITICAL(Service_FS, "no file system interface available!");
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
@ -944,7 +945,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto storage = std::make_shared<IStorage>(system, std::move(romfs.Unwrap()));
|
|
|
|
auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap()));
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
@ -1010,10 +1011,10 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_FS, "called, program_index={}", program_index);
|
|
|
|
LOG_DEBUG(Service_FS, "called, program_index={}", program_index);
|
|
|
|
|
|
|
|
|
|
|
|
auto romfs = fsc.OpenPatchedRomFSWithProgramIndex(
|
|
|
|
auto patched_romfs = fsc.OpenPatchedRomFSWithProgramIndex(
|
|
|
|
system.CurrentProcess()->GetTitleID(), program_index, FileSys::ContentRecordType::Program);
|
|
|
|
system.CurrentProcess()->GetTitleID(), program_index, FileSys::ContentRecordType::Program);
|
|
|
|
|
|
|
|
|
|
|
|
if (romfs.Failed()) {
|
|
|
|
if (patched_romfs.Failed()) {
|
|
|
|
// TODO: Find the right error code to use here
|
|
|
|
// TODO: Find the right error code to use here
|
|
|
|
LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index);
|
|
|
|
LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index);
|
|
|
|
|
|
|
|
|
|
|
@ -1022,7 +1023,7 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto storage = std::make_shared<IStorage>(system, std::move(romfs.Unwrap()));
|
|
|
|
auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap()));
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|