diff options
| author | Mary <1760003+Thog@users.noreply.github.com> | 2021-07-13 16:48:54 +0200 |
|---|---|---|
| committer | Mary <1760003+Thog@users.noreply.github.com> | 2021-07-13 16:48:54 +0200 |
| commit | 208ba1dde2b9a4d31446ace2bba8f0d641d2e300 (patch) | |
| tree | c7478e7eb87061400bab37daf4f2f69cf387d9f2 /Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs | |
| parent | 997380d48cb3b74e2438cee7fc3b017d6b59b714 (diff) | |
Revert LibHac update
Users are facing save destruction on failing extra data update apparently
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs index 1b6c84c3..7774af23 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs @@ -1,16 +1,10 @@ using LibHac; using LibHac.Common; -using LibHac.Common.Keys; using LibHac.Fs; -using LibHac.FsSrv.Impl; -using LibHac.FsSrv.Sf; using LibHac.FsSystem; using LibHac.FsSystem.NcaUtils; using LibHac.Spl; -using System; using System.IO; -using System.Runtime.InteropServices; -using Path = System.IO.Path; namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { @@ -22,12 +16,12 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy try { - LocalStorage storage = new LocalStorage(pfsPath, FileAccess.Read, FileMode.Open); - ReferenceCountedDisposable<LibHac.Fs.Fsa.IFileSystem> nsp = new(new PartitionFileSystem(storage)); + LocalStorage storage = new LocalStorage(pfsPath, FileAccess.Read, FileMode.Open); + PartitionFileSystem nsp = new PartitionFileSystem(storage); - ImportTitleKeysFromNsp(nsp.Target, context.Device.System.KeySet); + ImportTitleKeysFromNsp(nsp, context.Device.System.KeySet); - openedFileSystem = new IFileSystem(FileSystemInterfaceAdapter.CreateShared(ref nsp)); + openedFileSystem = new IFileSystem(nsp); } catch (HorizonResultException ex) { @@ -51,9 +45,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy } LibHac.Fs.Fsa.IFileSystem fileSystem = nca.OpenFileSystem(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); - var sharedFs = new ReferenceCountedDisposable<LibHac.Fs.Fsa.IFileSystem>(fileSystem); - openedFileSystem = new IFileSystem(FileSystemInterfaceAdapter.CreateShared(ref sharedFs)); + openedFileSystem = new IFileSystem(fileSystem); } catch (HorizonResultException ex) { @@ -106,7 +99,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy return ResultCode.PathDoesNotExist; } - public static void ImportTitleKeysFromNsp(LibHac.Fs.Fsa.IFileSystem nsp, KeySet keySet) + public static void ImportTitleKeysFromNsp(LibHac.Fs.Fsa.IFileSystem nsp, Keyset keySet) { foreach (DirectoryEntryEx ticketEntry in nsp.EnumerateEntries("/", "*.tik")) { @@ -132,27 +125,5 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy return FsPath.FromSpan(out path, pathBytes); } - - public static ref readonly FspPath GetFspPath(ServiceCtx context, int index = 0) - { - ulong position = (ulong)context.Request.PtrBuff[index].Position; - ulong size = (ulong)context.Request.PtrBuff[index].Size; - - ReadOnlySpan<byte> buffer = context.Memory.GetSpan(position, (int)size); - ReadOnlySpan<FspPath> fspBuffer = MemoryMarshal.Cast<byte, FspPath>(buffer); - - return ref fspBuffer[0]; - } - - public static ref readonly LibHac.FsSrv.Sf.Path GetSfPath(ServiceCtx context, int index = 0) - { - ulong position = (ulong)context.Request.PtrBuff[index].Position; - ulong size = (ulong)context.Request.PtrBuff[index].Size; - - ReadOnlySpan<byte> buffer = context.Memory.GetSpan(position, (int)size); - ReadOnlySpan<LibHac.FsSrv.Sf.Path> pathBuffer = MemoryMarshal.Cast<byte, LibHac.FsSrv.Sf.Path>(buffer); - - return ref pathBuffer[0]; - } } } |
