From 8a8ea4c8c00e8ba23349d9cdb0a6b681d09e6b0d Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Thu, 17 Oct 2019 01:17:44 -0500 Subject: Update to LibHac 0.6.0 (#792) * Update to LibHac 0.6.0 * Create an IFileSystemProxy object from LibHac * Rename rc -> result * Alignment and spacing * Result formatting * Spacing * Sort usings --- .../HOS/Services/Fs/FileSystemProxy/IStorage.cs | 24 +++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs') diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs index 107599a4..cc407039 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -31,16 +31,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy byte[] data = new byte[size]; - try - { - _baseStorage.Read(data, offset); - } - catch (HorizonResultException ex) - { - return (ResultCode)ex.ResultValue.Value; - } + Result result = _baseStorage.Read(offset, data); context.Memory.WriteBytes(buffDesc.Position, data); + + return (ResultCode)result.Value; } return ResultCode.Success; @@ -50,16 +45,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy // GetSize() -> u64 size public ResultCode GetSize(ServiceCtx context) { - try - { - context.ResponseData.Write(_baseStorage.GetSize()); - } - catch (HorizonResultException ex) - { - return (ResultCode)ex.ResultValue.Value; - } + Result result = _baseStorage.GetSize(out long size); - return ResultCode.Success; + context.ResponseData.Write(size); + + return (ResultCode)result.Value; } } } \ No newline at end of file -- cgit v1.2.3