Update LibHac to 0.18.0 (#4414)

* Update LibHac to 0.18.0

* Change instance of AsBytes(CreateReadOnlySpan(...)) to AsReadOnlyByteSpan(...)
This commit is contained in:
Steveice10 2023-03-01 18:42:27 -08:00 committed by GitHub
parent 9b5a0c3889
commit ecee34a50c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 161 additions and 159 deletions

View file

@ -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));
}
}
}
}

View file

@ -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);
}