Add IMultiCommitManager

This commit is contained in:
Alex Barney 2020-03-22 01:04:52 -07:00
commit 8d243eeaa9
4 changed files with 54 additions and 1 deletions

View file

@ -15,6 +15,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
_fileSystem = provider;
}
public LibHac.Fs.IFileSystem GetBaseFileSystem()
{
return _fileSystem;
}
[Command(0)]
// CreateFile(u32 createOption, u64 size, buffer<bytes<0x301>, 0x19, 0x301> path)
public ResultCode CreateFile(ServiceCtx context)

View file

@ -513,5 +513,18 @@ namespace Ryujinx.HLE.HOS.Services.Fs
return ResultCode.Success;
}
[Command(1200)]
public ResultCode OpenMultiCommitManager(ServiceCtx context)
{
Result result = _baseFileSystemProxy.OpenMultiCommitManager(out LibHac.FsService.IMultiCommitManager commitManager);
if (result.IsSuccess())
{
MakeObject(context, new IMultiCommitManager(commitManager));
}
return (ResultCode)result.Value;
}
}
}

View file

@ -0,0 +1,35 @@
using LibHac;
using Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy;
namespace Ryujinx.HLE.HOS.Services.Fs
{
class IMultiCommitManager : IpcService
{
private LibHac.FsService.IMultiCommitManager _baseCommitManager;
public IMultiCommitManager(LibHac.FsService.IMultiCommitManager baseCommitManager)
{
_baseCommitManager = baseCommitManager;
}
[Command(1)]
// Add(object<nn::fssrv::sf::IFileSystem>)
public ResultCode Add(ServiceCtx context)
{
IFileSystem fileSystem = GetObject<IFileSystem>(context, 0);
Result result = _baseCommitManager.Add(fileSystem.GetBaseFileSystem());
return (ResultCode)result.Value;
}
[Command(2)]
// Commit()
public ResultCode Commit(ServiceCtx context)
{
Result result = _baseCommitManager.Commit();
return (ResultCode)result.Value;
}
}
}

View file

@ -52,7 +52,7 @@
<ItemGroup>
<PackageReference Include="Concentus" Version="1.1.7" />
<PackageReference Include="LibHac" Version="0.9.2--multi-commit.17" />
<PackageReference Include="LibHac" Version="0.9.2--multi-commit.18" />
<PackageReference Include="MsgPack.Cli" Version="1.0.1" />
<PackageReference Include="TimeZoneConverter.Posix" Version="2.1.0" />
</ItemGroup>