diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy')
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs | 18 | ||||
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs | 8 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs index 2afa3480..ba924db8 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs @@ -30,9 +30,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy ImportTitleKeysFromNsp(nsp.Get, context.Device.System.KeySet); - using SharedRef<LibHac.FsSrv.Sf.IFileSystem> adapter = FileSystemInterfaceAdapter.CreateShared(ref nsp.Ref(), true); + using SharedRef<LibHac.FsSrv.Sf.IFileSystem> adapter = FileSystemInterfaceAdapter.CreateShared(ref nsp.Ref, true); - openedFileSystem = new IFileSystem(ref adapter.Ref()); + openedFileSystem = new IFileSystem(ref adapter.Ref); } catch (HorizonResultException ex) { @@ -58,9 +58,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy LibHac.Fs.Fsa.IFileSystem fileSystem = nca.OpenFileSystem(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); using var sharedFs = new SharedRef<LibHac.Fs.Fsa.IFileSystem>(fileSystem); - using SharedRef<LibHac.FsSrv.Sf.IFileSystem> adapter = FileSystemInterfaceAdapter.CreateShared(ref sharedFs.Ref(), true); + using SharedRef<LibHac.FsSrv.Sf.IFileSystem> adapter = FileSystemInterfaceAdapter.CreateShared(ref sharedFs.Ref, true); - openedFileSystem = new IFileSystem(ref adapter.Ref()); + openedFileSystem = new IFileSystem(ref adapter.Ref); } catch (HorizonResultException ex) { @@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var ncaFile = new UniqueRef<LibHac.Fs.Fsa.IFile>(); - Result result = nsp.OpenFile(ref ncaFile.Ref(), filename.ToU8Span(), OpenMode.Read); + Result result = nsp.OpenFile(ref ncaFile.Ref, filename.ToU8Span(), OpenMode.Read); if (result.IsFailure()) { return (ResultCode)result.Value; @@ -121,13 +121,17 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { using var ticketFile = new UniqueRef<LibHac.Fs.Fsa.IFile>(); - Result result = nsp.OpenFile(ref ticketFile.Ref(), ticketEntry.FullPath.ToU8Span(), OpenMode.Read); + Result result = nsp.OpenFile(ref ticketFile.Ref, ticketEntry.FullPath.ToU8Span(), OpenMode.Read); if (result.IsSuccess()) { Ticket ticket = new Ticket(ticketFile.Get.AsStream()); + var titleKey = ticket.GetTitleKey(keySet); - keySet.ExternalKeySet.Add(new RightsId(ticket.RightsId), new AccessKey(ticket.GetTitleKey(keySet))); + if (titleKey != null) + { + keySet.ExternalKeySet.Add(new RightsId(ticket.RightsId), new AccessKey(titleKey)); + } } } } diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs index d68ef395..623f1371 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs @@ -111,11 +111,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy ref readonly Path name = ref FileSystemProxyHelper.GetSfPath(context); using var file = new SharedRef<LibHac.FsSrv.Sf.IFile>(); - Result result = _fileSystem.Get.OpenFile(ref file.Ref(), in name, mode); + Result result = _fileSystem.Get.OpenFile(ref file.Ref, in name, mode); if (result.IsSuccess()) { - IFile fileInterface = new IFile(ref file.Ref()); + IFile fileInterface = new IFile(ref file.Ref); MakeObject(context, fileInterface); } @@ -132,11 +132,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy ref readonly Path name = ref FileSystemProxyHelper.GetSfPath(context); using var dir = new SharedRef<LibHac.FsSrv.Sf.IDirectory>(); - Result result = _fileSystem.Get.OpenDirectory(ref dir.Ref(), name, mode); + Result result = _fileSystem.Get.OpenDirectory(ref dir.Ref, name, mode); if (result.IsSuccess()) { - IDirectory dirInterface = new IDirectory(ref dir.Ref()); + IDirectory dirInterface = new IDirectory(ref dir.Ref); MakeObject(context, dirInterface); } |