From 9cd605205285af48ff8ee7a45160189a596124dc Mon Sep 17 00:00:00 2001 From: IamSanjid Date: Sun, 24 Apr 2022 21:13:20 +0600 Subject: [PATCH] implementation of OpenBisStorage --- src/core/hle/service/filesystem/fsp_srv.cpp | 24 +++++++++++++++++++++ src/core/hle/service/filesystem/fsp_srv.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 006aa26ba1..139ffdb7b2 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -846,6 +846,8 @@ void FSP_SRV::OpenBisFileSystem(Kernel::HLERequestContext& ctx) { const auto partition_id = static_cast(rp.Pop()); + 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(std::move(filesystem)); } +void FSP_SRV::OpenBisStorage(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + + const auto partition_id = static_cast(rp.Pop()); + + 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(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"); diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h index 84ce1052fb..74384256e2 100644 --- a/src/core/hle/service/filesystem/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp_srv.h @@ -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);