1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-11 22:56:39 +00:00
Ryujinx/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs
Alex Barney aa932a6df1
Update to LibHac v0.14.3 (#2925)
* Update to LibHac v0.14.3

* Fix loading NCAs that don't have a data partition
2021-12-23 13:55:50 -03:00

44 lines
1.3 KiB
C#

using LibHac;
using LibHac.Common;
using Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy;
namespace Ryujinx.HLE.HOS.Services.Fs
{
class IMultiCommitManager : DisposableIpcService // 6.0.0+
{
private SharedRef<LibHac.FsSrv.Sf.IMultiCommitManager> _baseCommitManager;
public IMultiCommitManager(ref SharedRef<LibHac.FsSrv.Sf.IMultiCommitManager> baseCommitManager)
{
_baseCommitManager = SharedRef<LibHac.FsSrv.Sf.IMultiCommitManager>.CreateMove(ref baseCommitManager);
}
[CommandHipc(1)] // 6.0.0+
// Add(object<nn::fssrv::sf::IFileSystem>)
public ResultCode Add(ServiceCtx context)
{
using SharedRef<LibHac.FsSrv.Sf.IFileSystem> fileSystem = GetObject<IFileSystem>(context, 0).GetBaseFileSystem();
Result result = _baseCommitManager.Get.Add(ref fileSystem.Ref());
return (ResultCode)result.Value;
}
[CommandHipc(2)] // 6.0.0+
// Commit()
public ResultCode Commit(ServiceCtx context)
{
Result result = _baseCommitManager.Get.Commit();
return (ResultCode)result.Value;
}
protected override void Dispose(bool isDisposing)
{
if (isDisposing)
{
_baseCommitManager.Destroy();
}
}
}
}