implementation of OpenBisStorage

This commit is contained in:
IamSanjid
2022-04-24 21:13:20 +06:00
parent a215ce9ada
commit 9cd6052052
2 changed files with 25 additions and 0 deletions
@@ -846,6 +846,8 @@ void FSP_SRV::OpenBisFileSystem(Kernel::HLERequestContext& ctx) {
const auto partition_id = static_cast<FileSys::BisPartitionId>(rp.Pop<u32>());
LOG_DEBUG(Service_FS, "called with partition_id={}, input_buffer={}", partition_id, input);
auto partition = fsc.OpenBISPartition(partition_id);
if (partition.Failed()) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -877,6 +879,28 @@ void FSP_SRV::OpenBisFileSystem(Kernel::HLERequestContext& ctx) {
rb.PushIpcInterface<IFileSystem>(std::move(filesystem));
}
void FSP_SRV::OpenBisStorage(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto partition_id = static_cast<FileSys::BisPartitionId>(rp.Pop<u32>());
LOG_DEBUG(Service_FS, "called with partition_id={}", partition_id);
auto bis_storage = fsc.OpenBISPartitionStorage(partition_id);
if (bis_storage.Failed()) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(FileSys::ERROR_INVALID_ARGUMENT);
return;
}
auto storage = std::make_shared<IStorage>(system, std::move(bis_storage.Unwrap()));
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface(std::move(storage));
return;
}
void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_FS, "called");
@@ -39,6 +39,7 @@ private:
void SetCurrentProcess(Kernel::HLERequestContext& ctx);
void OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx);
void OpenBisFileSystem(Kernel::HLERequestContext& ctx);
void OpenBisStorage(Kernel::HLERequestContext& ctx);
void OpenSdCardFileSystem(Kernel::HLERequestContext& ctx);
void CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx);
void OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx);