aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2021-12-23 09:55:50 -0700
committerGitHub <noreply@github.com>2021-12-23 13:55:50 -0300
commitaa932a6df1764b7c600ae0ba4e0c7a0ba802f312 (patch)
tree24a390cf2330620aeeab1efbd42ae4099f61ca86 /Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs
parentcb43cc7e322014ce2bd0ee73b06d403be62fa8d5 (diff)
Update to LibHac v0.14.3 (#2925)
* Update to LibHac v0.14.3 * Fix loading NCAs that don't have a data partition
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs
index 3a94a2a7..fa5e05d6 100644
--- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs
@@ -1,4 +1,5 @@
using LibHac;
+using LibHac.Common;
using LibHac.Fs;
using LibHac.Sf;
using Ryujinx.Common;
@@ -7,11 +8,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
{
class IFile : DisposableIpcService
{
- private ReferenceCountedDisposable<LibHac.FsSrv.Sf.IFile> _baseFile;
+ private SharedRef<LibHac.FsSrv.Sf.IFile> _baseFile;
- public IFile(ReferenceCountedDisposable<LibHac.FsSrv.Sf.IFile> baseFile)
+ public IFile(ref SharedRef<LibHac.FsSrv.Sf.IFile> baseFile)
{
- _baseFile = baseFile;
+ _baseFile = SharedRef<LibHac.FsSrv.Sf.IFile>.CreateMove(ref baseFile);
}
[CommandHipc(0)]
@@ -28,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
byte[] data = new byte[context.Request.ReceiveBuff[0].Size];
- Result result = _baseFile.Target.Read(out long bytesRead, offset, new OutBuffer(data), size, readOption);
+ Result result = _baseFile.Get.Read(out long bytesRead, offset, new OutBuffer(data), size, readOption);
context.Memory.Write(position, data);
@@ -53,14 +54,14 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
context.Memory.Read(position, data);
- return (ResultCode)_baseFile.Target.Write(offset, new InBuffer(data), size, writeOption).Value;
+ return (ResultCode)_baseFile.Get.Write(offset, new InBuffer(data), size, writeOption).Value;
}
[CommandHipc(2)]
// Flush()
public ResultCode Flush(ServiceCtx context)
{
- return (ResultCode)_baseFile.Target.Flush().Value;
+ return (ResultCode)_baseFile.Get.Flush().Value;
}
[CommandHipc(3)]
@@ -69,14 +70,14 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
{
long size = context.RequestData.ReadInt64();
- return (ResultCode)_baseFile.Target.SetSize(size).Value;
+ return (ResultCode)_baseFile.Get.SetSize(size).Value;
}
[CommandHipc(4)]
// GetSize() -> u64 fileSize
public ResultCode GetSize(ServiceCtx context)
{
- Result result = _baseFile.Target.GetSize(out long size);
+ Result result = _baseFile.Get.GetSize(out long size);
context.ResponseData.Write(size);
@@ -87,7 +88,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
{
if (isDisposing)
{
- _baseFile?.Dispose();
+ _baseFile.Destroy();
}
}
}