diff options
| author | bunnei <bunneidev@gmail.com> | 2018-01-24 23:09:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-24 23:09:03 -0500 |
| commit | 748c0de539674dc8ca4a5a8aadd2a61b0eabe652 (patch) | |
| tree | ae56efe8654d3aa3a5e75ec04bd9dfdcc06023a9 /src/core/hle/service/filesystem/fsp_srv.cpp | |
| parent | 44eb8402322a47a52f0401f9ef7473bea719e2bf (diff) | |
| parent | de177f66926a5170c1ad0621085494d27de8e2d4 (diff) | |
Merge pull request #137 from bunnei/improve-ipc
Improve IPC, unify Domains and Sessions, and add validation
Diffstat (limited to 'src/core/hle/service/filesystem/fsp_srv.cpp')
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index ef1915e5a..71b82393e 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -40,12 +40,12 @@ private: // Error checking ASSERT_MSG(length == descriptor.Size(), "unexpected size difference"); if (length < 0) { - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidLength)); return; } if (offset < 0) { - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(ErrorModule::FS, ErrorDescription::InvalidOffset)); return; } @@ -54,7 +54,7 @@ private: std::vector<u8> output(length); ResultVal<size_t> res = backend->Read(offset, length, output.data()); if (res.Failed()) { - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(res.Code()); return; } @@ -62,7 +62,7 @@ private: // Write the data to memory Memory::WriteBlock(descriptor.Address(), output.data(), descriptor.Size()); - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } }; @@ -91,14 +91,14 @@ void FSP_SRV::TryLoadRomFS() { void FSP_SRV::Initalize(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_FS, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_FS, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 4}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push<u32>(5); } @@ -110,7 +110,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { if (!romfs) { // TODO (bunnei): Find the right error code to use here LOG_CRITICAL(Service_FS, "no file system interface available!"); - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultCode(-1)); return; } @@ -119,12 +119,12 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { auto storage = romfs->OpenFile({}, {}); if (storage.Failed()) { LOG_CRITICAL(Service_FS, "no storage interface available!"); - IPC::RequestBuilder rb{ctx, 2}; + IPC::ResponseBuilder rb{ctx, 2}; rb.Push(storage.Code()); return; } - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface<IStorage>(std::move(storage.Unwrap())); } |
