2020-03-25 08:14:35 +00:00
|
|
|
|
using LibHac;
|
|
|
|
|
using Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Fs
|
|
|
|
|
{
|
2021-08-12 21:56:24 +00:00
|
|
|
|
class IMultiCommitManager : DisposableIpcService // 6.0.0+
|
2020-03-25 08:14:35 +00:00
|
|
|
|
{
|
2021-08-12 21:56:24 +00:00
|
|
|
|
private ReferenceCountedDisposable<LibHac.FsSrv.Sf.IMultiCommitManager> _baseCommitManager;
|
2020-03-25 08:14:35 +00:00
|
|
|
|
|
2021-08-12 21:56:24 +00:00
|
|
|
|
public IMultiCommitManager(ReferenceCountedDisposable<LibHac.FsSrv.Sf.IMultiCommitManager> baseCommitManager)
|
2020-03-25 08:14:35 +00:00
|
|
|
|
{
|
|
|
|
|
_baseCommitManager = baseCommitManager;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 22:01:24 +00:00
|
|
|
|
[CommandHipc(1)] // 6.0.0+
|
2020-03-25 08:14:35 +00:00
|
|
|
|
// Add(object<nn::fssrv::sf::IFileSystem>)
|
|
|
|
|
public ResultCode Add(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
IFileSystem fileSystem = GetObject<IFileSystem>(context, 0);
|
|
|
|
|
|
2021-08-12 21:56:24 +00:00
|
|
|
|
Result result = _baseCommitManager.Target.Add(fileSystem.GetBaseFileSystem());
|
2020-03-25 08:14:35 +00:00
|
|
|
|
|
|
|
|
|
return (ResultCode)result.Value;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 22:01:24 +00:00
|
|
|
|
[CommandHipc(2)] // 6.0.0+
|
2020-03-25 08:14:35 +00:00
|
|
|
|
// Commit()
|
|
|
|
|
public ResultCode Commit(ServiceCtx context)
|
|
|
|
|
{
|
2021-08-12 21:56:24 +00:00
|
|
|
|
Result result = _baseCommitManager.Target.Commit();
|
2020-03-25 08:14:35 +00:00
|
|
|
|
|
|
|
|
|
return (ResultCode)result.Value;
|
|
|
|
|
}
|
2021-08-12 21:56:24 +00:00
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
|
|
|
{
|
|
|
|
|
if (isDisposing)
|
|
|
|
|
{
|
|
|
|
|
_baseCommitManager?.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-25 08:14:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|