diff options
author | Subv <subv2112@gmail.com> | 2018-03-20 05:02:30 +0100 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-03-20 05:02:30 +0100 |
commit | 0485ee499f9e00fb2ec1926876d6e50c9b22447b (patch) | |
tree | 3e0a48b1648366aa7b41ce3c48a628b0a6c067d7 /src | |
parent | FS: Added the IDirectory IPC interface and implemented its two functions. (diff) | |
download | yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.tar yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.tar.gz yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.tar.bz2 yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.tar.lz yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.tar.xz yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.tar.zst yuzu-0485ee499f9e00fb2ec1926876d6e50c9b22447b.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 5536991bc..6f539316e 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -210,6 +210,7 @@ public: {0, &IFileSystem::CreateFile, "CreateFile"}, {7, &IFileSystem::GetEntryType, "GetEntryType"}, {8, &IFileSystem::OpenFile, "OpenFile"}, + {9, &IFileSystem::OpenDirectory, "OpenDirectory"}, {10, &IFileSystem::Commit, "Commit"}, }; RegisterHandlers(functions); @@ -259,6 +260,33 @@ public: rb.PushIpcInterface<IFile>(std::move(file)); } + void OpenDirectory(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + + auto file_buffer = ctx.ReadBuffer(); + auto end = std::find(file_buffer.begin(), file_buffer.end(), '\0'); + + std::string name(file_buffer.begin(), end); + + // TODO(Subv): Implement this filter. + u32 filter_flags = rp.Pop<u32>(); + + LOG_DEBUG(Service_FS, "called directory %s filter %u", name.c_str(), filter_flags); + + auto result = backend->OpenDirectory(name); + if (result.Failed()) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(result.Code()); + return; + } + + auto directory = std::move(result.Unwrap()); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<IDirectory>(std::move(directory)); + } + void GetEntryType(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; |