mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-23 04:41:12 +00:00
fs: add (stubbed) OperateRangeWithBuffer implementation
This commit is contained in:
parent
461e2ced6f
commit
03a98635d8
3 changed files with 15 additions and 7 deletions
|
@ -56,6 +56,7 @@ namespace ams::fssrv::impl {
|
||||||
Result SetSize(s64 size);
|
Result SetSize(s64 size);
|
||||||
Result GetSize(ams::sf::Out<s64> out);
|
Result GetSize(ams::sf::Out<s64> out);
|
||||||
Result OperateRange(ams::sf::Out<fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size);
|
Result OperateRange(ams::sf::Out<fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size);
|
||||||
|
Result OperateRangeWithBuffer(const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 op_id, s64 offset, s64 size);
|
||||||
};
|
};
|
||||||
static_assert(fssrv::sf::IsIFile<FileInterfaceAdapter>);
|
static_assert(fssrv::sf::IsIFile<FileInterfaceAdapter>);
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, (), ()) \
|
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, (), ()) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size), (size)) \
|
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size), (size)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out), (out)) \
|
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out), (out)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), (out, op_id, offset, size), hos::Version_4_0_0)
|
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), (out, op_id, offset, size), hos::Version_4_0_0) \
|
||||||
|
AMS_SF_METHOD_INFO(C, H, 6, Result, OperateRangeWithBuffer, (const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 op_id, s64 offset, s64 size), (out_buf, in_buf, op_id, offset, size), hos::Version_12_0_0)
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFile, AMS_FSSRV_I_FILE_INTERFACE_INFO)
|
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFile, AMS_FSSRV_I_FILE_INTERFACE_INFO)
|
||||||
|
|
|
@ -89,6 +89,12 @@ namespace ams::fssrv::impl {
|
||||||
return ResultSuccess();
|
return ResultSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result FileInterfaceAdapter::OperateRangeWithBuffer(const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 op_id, s64 offset, s64 size) {
|
||||||
|
/* TODO: Nintendo supports calling info OperateRange using the provided buffers, when op_id is 4/5/6 or a class member is set. */
|
||||||
|
/* We should (in the future), determine what uses this, and mimic Nintendo's behavior to the extent that we can. */
|
||||||
|
return fs::ResultPermissionDenied();
|
||||||
|
}
|
||||||
|
|
||||||
DirectoryInterfaceAdapter::DirectoryInterfaceAdapter(std::unique_ptr<fs::fsa::IDirectory> &&dir, FileSystemInterfaceAdapter *parent, util::unique_lock<fssystem::SemaphoreAdapter> &&sema)
|
DirectoryInterfaceAdapter::DirectoryInterfaceAdapter(std::unique_ptr<fs::fsa::IDirectory> &&dir, FileSystemInterfaceAdapter *parent, util::unique_lock<fssystem::SemaphoreAdapter> &&sema)
|
||||||
: parent_filesystem(parent, true), base_dir(std::move(dir)), open_count_semaphore(std::move(sema))
|
: parent_filesystem(parent, true), base_dir(std::move(dir)), open_count_semaphore(std::move(sema))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue