From ecee34a50cd8e4266cb2ecc9910d8d33d612c84a Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:42:27 -0800 Subject: [PATCH] Update LibHac to 0.18.0 (#4414) * Update LibHac to 0.18.0 * Change instance of AsBytes(CreateReadOnlySpan(...)) to AsReadOnlyByteSpan(...) --- Directory.Packages.props | 2 +- Ryujinx.Ava/Common/ApplicationHelper.cs | 6 +- .../UI/Controls/NavigationDialogHost.axaml.cs | 2 +- .../UI/ViewModels/AvatarProfileViewModel.cs | 2 +- .../UI/ViewModels/MainWindowViewModel.cs | 3 +- .../UI/ViewModels/TitleUpdateViewModel.cs | 2 +- .../UserFirmwareAvatarSelectorViewModel.cs | 2 +- .../UI/Views/Main/MainMenuBarView.axaml.cs | 2 +- .../Views/User/UserSaveManagerView.axaml.cs | 2 +- .../DownloadableContentManagerWindow.axaml.cs | 4 +- Ryujinx.HLE/FileSystem/ContentManager.cs | 26 ++--- Ryujinx.HLE/FileSystem/LocationEntry.cs | 2 +- Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | 9 +- Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs | 2 +- Ryujinx.HLE/HOS/ApplicationLoader.cs | 28 ++--- Ryujinx.HLE/HOS/ModLoader.cs | 4 +- Ryujinx.HLE/HOS/ProgramLoader.cs | 8 +- .../Services/Account/Acc/AccountManager.cs | 2 +- .../ApplicationProxy/IApplicationFunctions.cs | 2 +- .../HOS/Services/Bcat/IServiceCreator.cs | 8 +- .../IDeliveryCacheStorageService.cs | 8 +- .../FileSystemProxy/FileSystemProxyHelper.cs | 18 +-- .../Fs/FileSystemProxy/IFileSystem.cs | 8 +- .../HOS/Services/Fs/IFileSystemProxy.cs | 108 +++++++++--------- .../HOS/Services/Fs/IMultiCommitManager.cs | 2 +- .../HOS/Services/Mii/Types/StoreData.cs | 6 +- .../ILocationResolver.cs | 4 +- .../Nifm/StaticService/Types/ProxySetting.cs | 4 +- .../HOS/Services/Sdb/Pl/SharedFontManager.cs | 2 +- .../Settings/ISystemSettingsServer.cs | 2 +- .../Services/Ssl/BuiltInCertificateManager.cs | 4 +- .../Time/TimeZone/TimeZoneContentManager.cs | 6 +- Ryujinx.Ui.Common/App/ApplicationLibrary.cs | 14 +-- Ryujinx/Ui/MainWindow.cs | 2 +- Ryujinx/Ui/Widgets/GameTableContextMenu.cs | 6 +- Ryujinx/Ui/Windows/AvatarWindow.cs | 2 +- Ryujinx/Ui/Windows/DlcWindow.cs | 4 +- Ryujinx/Ui/Windows/TitleUpdateWindow.cs | 2 +- 38 files changed, 161 insertions(+), 159 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 35c98e5a..b46b77e7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -19,7 +19,7 @@ - + diff --git a/Ryujinx.Ava/Common/ApplicationHelper.cs b/Ryujinx.Ava/Common/ApplicationHelper.cs index 0b8bd8da..276d1874 100644 --- a/Ryujinx.Ava/Common/ApplicationHelper.cs +++ b/Ryujinx.Ava/Common/ApplicationHelper.cs @@ -193,7 +193,7 @@ namespace Ryujinx.Ava.Common { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = new(_virtualFileSystem.KeySet, ncaFile.Get.AsStorage()); if (nca.Header.ContentType == NcaContentType.Program) @@ -249,8 +249,8 @@ namespace Ryujinx.Ava.Common using var uniqueSourceFs = new UniqueRef(ncaFileSystem); using var uniqueOutputFs = new UniqueRef(new LocalFileSystem(destination)); - fsClient.Register(source.ToU8Span(), ref uniqueSourceFs.Ref()); - fsClient.Register(output.ToU8Span(), ref uniqueOutputFs.Ref()); + fsClient.Register(source.ToU8Span(), ref uniqueSourceFs.Ref); + fsClient.Register(output.ToU8Span(), ref uniqueOutputFs.Ref); (Result? resultCode, bool canceled) = CopyDirectory(fsClient, $"{source}:/", $"{output}:/", cancellationToken.Token); diff --git a/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml.cs b/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml.cs index 6911a4d4..74188530 100644 --- a/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml.cs +++ b/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml.cs @@ -121,7 +121,7 @@ namespace Ryujinx.Ava.UI.Controls using var saveDataIterator = new UniqueRef(); - HorizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref(), SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); + HorizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); Span saveDataInfo = stackalloc SaveDataInfo[10]; diff --git a/Ryujinx.Ava/UI/ViewModels/AvatarProfileViewModel.cs b/Ryujinx.Ava/UI/ViewModels/AvatarProfileViewModel.cs index 1d090623..b2b31014 100644 --- a/Ryujinx.Ava/UI/ViewModels/AvatarProfileViewModel.cs +++ b/Ryujinx.Ava/UI/ViewModels/AvatarProfileViewModel.cs @@ -246,7 +246,7 @@ namespace Ryujinx.Ava.UI.ViewModels { using var file = new UniqueRef(); - romfs.OpenFile(ref file.Ref(), ("/" + item.FullPath).ToU8Span(), OpenMode.Read) + romfs.OpenFile(ref file.Ref, ("/" + item.FullPath).ToU8Span(), OpenMode.Read) .ThrowIfFailure(); using (MemoryStream stream = new()) diff --git a/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs b/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs index a4ccac2d..489dfe62 100644 --- a/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs +++ b/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs @@ -7,8 +7,7 @@ using DynamicData; using DynamicData.Binding; using LibHac.Common; using LibHac.Fs; -using LibHac.FsSystem; -using LibHac.Tools.Fs; +using LibHac.Tools.FsSystem.NcaUtils; using Ryujinx.Ava.Common; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Input; diff --git a/Ryujinx.Ava/UI/ViewModels/TitleUpdateViewModel.cs b/Ryujinx.Ava/UI/ViewModels/TitleUpdateViewModel.cs index f330006e..dd9e1b96 100644 --- a/Ryujinx.Ava/UI/ViewModels/TitleUpdateViewModel.cs +++ b/Ryujinx.Ava/UI/ViewModels/TitleUpdateViewModel.cs @@ -170,7 +170,7 @@ public class TitleUpdateViewModel : BaseModel using UniqueRef nacpFile = new(); - controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref(), "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); nacpFile.Get.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure(); TitleUpdates.Add(new TitleUpdateModel(controlData, path)); diff --git a/Ryujinx.Ava/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs b/Ryujinx.Ava/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs index 9d981128..558cad5a 100644 --- a/Ryujinx.Ava/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs +++ b/Ryujinx.Ava/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs @@ -126,7 +126,7 @@ namespace Ryujinx.Ava.UI.ViewModels { using var file = new UniqueRef(); - romfs.OpenFile(ref file.Ref(), ("/" + item.FullPath).ToU8Span(), OpenMode.Read).ThrowIfFailure(); + romfs.OpenFile(ref file.Ref, ("/" + item.FullPath).ToU8Span(), OpenMode.Read).ThrowIfFailure(); using (MemoryStream stream = new()) using (MemoryStream streamPng = new()) diff --git a/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs b/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs index 11ecd0fc..1c6f4265 100644 --- a/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs @@ -1,8 +1,8 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Interactivity; -using LibHac.FsSystem; using LibHac.Ncm; +using LibHac.Tools.FsSystem.NcaUtils; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; diff --git a/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs index 074ca30e..08fef27d 100644 --- a/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs +++ b/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs @@ -76,7 +76,7 @@ namespace Ryujinx.Ava.UI.Views.User using var saveDataIterator = new UniqueRef(); - _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref(), SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); + _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); Span saveDataInfo = stackalloc SaveDataInfo[10]; diff --git a/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml.cs b/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml.cs index 47216c48..2dab1d35 100644 --- a/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml.cs +++ b/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml.cs @@ -105,7 +105,7 @@ namespace Ryujinx.Ava.UI.Windows { using UniqueRef ncaFile = new(); - partitionFileSystem.OpenFile(ref ncaFile.Ref(), downloadableContentNca.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + partitionFileSystem.OpenFile(ref ncaFile.Ref, downloadableContentNca.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = TryOpenNca(ncaFile.Get.AsStorage(), downloadableContentContainer.ContainerPath); if (nca != null) @@ -158,7 +158,7 @@ namespace Ryujinx.Ava.UI.Windows { using var ncaFile = new UniqueRef(); - partitionFileSystem.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + partitionFileSystem.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = TryOpenNca(ncaFile.Get.AsStorage(), path); if (nca == null) diff --git a/Ryujinx.HLE/FileSystem/ContentManager.cs b/Ryujinx.HLE/FileSystem/ContentManager.cs index 9f0f3a4a..4e394008 100644 --- a/Ryujinx.HLE/FileSystem/ContentManager.cs +++ b/Ryujinx.HLE/FileSystem/ContentManager.cs @@ -209,7 +209,7 @@ namespace Ryujinx.HLE.FileSystem { using var ncaFile = new UniqueRef(); - fs.OpenFile(ref ncaFile.Ref(), ncaPath.FullPath.ToU8Span(), OpenMode.Read); + fs.OpenFile(ref ncaFile.Ref, ncaPath.FullPath.ToU8Span(), OpenMode.Read); var nca = new Nca(_virtualFileSystem.KeySet, ncaFile.Get.AsStorage()); if (nca.Header.ContentType != NcaContentType.Meta) { @@ -221,7 +221,7 @@ namespace Ryujinx.HLE.FileSystem using var pfs0 = nca.OpenFileSystem(0, integrityCheckLevel); using var cnmtFile = new UniqueRef(); - pfs0.OpenFile(ref cnmtFile.Ref(), pfs0.EnumerateEntries().Single().FullPath.ToU8Span(), OpenMode.Read); + pfs0.OpenFile(ref cnmtFile.Ref, pfs0.EnumerateEntries().Single().FullPath.ToU8Span(), OpenMode.Read); var cnmt = new Cnmt(cnmtFile.Get.AsStream()); if (cnmt.Type != ContentMetaType.AddOnContent || (cnmt.TitleId & 0xFFFFFFFFFFFFE000) != aocBaseId) @@ -276,11 +276,11 @@ namespace Ryujinx.HLE.FileSystem { case ".xci": pfs = new Xci(_virtualFileSystem.KeySet, file.AsStorage()).OpenPartition(XciPartitionType.Secure); - pfs.OpenFile(ref ncaFile.Ref(), aoc.NcaPath.ToU8Span(), OpenMode.Read); + pfs.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read); break; case ".nsp": pfs = new PartitionFileSystem(file.AsStorage()); - pfs.OpenFile(ref ncaFile.Ref(), aoc.NcaPath.ToU8Span(), OpenMode.Read); + pfs.OpenFile(ref ncaFile.Ref, aoc.NcaPath.ToU8Span(), OpenMode.Read); break; default: return false; // Print error? @@ -625,11 +625,11 @@ namespace Ryujinx.HLE.FileSystem if (filesystem.FileExists($"{path}/00")) { - filesystem.OpenFile(ref file.Ref(), $"{path}/00".ToU8Span(), mode); + filesystem.OpenFile(ref file.Ref, $"{path}/00".ToU8Span(), mode); } else { - filesystem.OpenFile(ref file.Ref(), path.ToU8Span(), mode); + filesystem.OpenFile(ref file.Ref, path.ToU8Span(), mode); } return file.Release(); @@ -751,7 +751,7 @@ namespace Ryujinx.HLE.FileSystem using var metaFile = new UniqueRef(); - if (fs.OpenFile(ref metaFile.Ref(), cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) + if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { var meta = new Cnmt(metaFile.Get.AsStream()); @@ -781,7 +781,7 @@ namespace Ryujinx.HLE.FileSystem using var systemVersionFile = new UniqueRef(); - if (romfs.OpenFile(ref systemVersionFile.Ref(), "/file".ToU8Span(), OpenMode.Read).IsSuccess()) + if (romfs.OpenFile(ref systemVersionFile.Ref, "/file".ToU8Span(), OpenMode.Read).IsSuccess()) { systemVersion = new SystemVersion(systemVersionFile.Get.AsStream()); } @@ -820,7 +820,7 @@ namespace Ryujinx.HLE.FileSystem using var metaFile = new UniqueRef(); - if (fs.OpenFile(ref metaFile.Ref(), cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) + if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { var meta = new Cnmt(metaFile.Get.AsStream()); @@ -891,7 +891,7 @@ namespace Ryujinx.HLE.FileSystem using var metaFile = new UniqueRef(); - if (fs.OpenFile(ref metaFile.Ref(), cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) + if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { var meta = new Cnmt(metaFile.Get.AsStream()); @@ -909,7 +909,7 @@ namespace Ryujinx.HLE.FileSystem using var systemVersionFile = new UniqueRef(); - if (romfs.OpenFile(ref systemVersionFile.Ref(), "/file".ToU8Span(), OpenMode.Read).IsSuccess()) + if (romfs.OpenFile(ref systemVersionFile.Ref, "/file".ToU8Span(), OpenMode.Read).IsSuccess()) { systemVersion = new SystemVersion(systemVersionFile.Get.AsStream()); } @@ -960,7 +960,7 @@ namespace Ryujinx.HLE.FileSystem using var metaFile = new UniqueRef(); - if (fs.OpenFile(ref metaFile.Ref(), cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) + if (fs.OpenFile(ref metaFile.Ref, cnmtPath.ToU8Span(), OpenMode.Read).IsSuccess()) { var meta = new Cnmt(metaFile.Get.AsStream()); @@ -1030,7 +1030,7 @@ namespace Ryujinx.HLE.FileSystem using var systemVersionFile = new UniqueRef(); - if (romfs.OpenFile(ref systemVersionFile.Ref(), "/file".ToU8Span(), OpenMode.Read).IsSuccess()) + if (romfs.OpenFile(ref systemVersionFile.Ref, "/file".ToU8Span(), OpenMode.Read).IsSuccess()) { return new SystemVersion(systemVersionFile.Get.AsStream()); } diff --git a/Ryujinx.HLE/FileSystem/LocationEntry.cs b/Ryujinx.HLE/FileSystem/LocationEntry.cs index 45cbc8cd..a60c2896 100644 --- a/Ryujinx.HLE/FileSystem/LocationEntry.cs +++ b/Ryujinx.HLE/FileSystem/LocationEntry.cs @@ -1,4 +1,4 @@ -using LibHac.FsSystem; +using LibHac.Tools.FsSystem.NcaUtils; namespace Ryujinx.HLE.FileSystem { diff --git a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index 0b91d3a2..3f94ce61 100644 --- a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -260,15 +260,16 @@ namespace Ryujinx.HLE.FileSystem { using var ticketFile = new UniqueRef(); - Result result = fs.OpenFile(ref ticketFile.Ref(), ticketEntry.FullPath.ToU8Span(), OpenMode.Read); + Result result = fs.OpenFile(ref ticketFile.Ref, ticketEntry.FullPath.ToU8Span(), OpenMode.Read); if (result.IsSuccess()) { Ticket ticket = new Ticket(ticketFile.Get.AsStream()); + var titleKey = ticket.GetTitleKey(KeySet); - if (ticket.TitleKeyType == TitleKeyType.Common) + if (titleKey != null) { - KeySet.ExternalKeySet.Add(new RightsId(ticket.RightsId), new AccessKey(ticket.GetTitleKey(KeySet))); + KeySet.ExternalKeySet.Add(new RightsId(ticket.RightsId), new AccessKey(titleKey)); } } } @@ -302,7 +303,7 @@ namespace Ryujinx.HLE.FileSystem using var iterator = new UniqueRef(); - Result rc = hos.Fs.OpenSaveDataIterator(ref iterator.Ref(), spaceId); + Result rc = hos.Fs.OpenSaveDataIterator(ref iterator.Ref, spaceId); if (rc.IsFailure()) return rc; while (true) diff --git a/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs b/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs index ba7efbd7..c5c6e8e9 100644 --- a/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs +++ b/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error { using var binaryFile = new UniqueRef(); - romfs.OpenFile(ref binaryFile.Ref(), filePath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + romfs.OpenFile(ref binaryFile.Ref, filePath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); StreamReader reader = new StreamReader(binaryFile.Get.AsStream(), Encoding.Unicode); return CleanText(reader.ReadToEnd()); diff --git a/Ryujinx.HLE/HOS/ApplicationLoader.cs b/Ryujinx.HLE/HOS/ApplicationLoader.cs index 67e0a9c7..82bd9b31 100644 --- a/Ryujinx.HLE/HOS/ApplicationLoader.cs +++ b/Ryujinx.HLE/HOS/ApplicationLoader.cs @@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = new Nca(fileSystem.KeySet, ncaFile.Release().AsStorage()); @@ -154,7 +154,7 @@ namespace Ryujinx.HLE.HOS { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = new Nca(fileSystem.KeySet, ncaFile.Release().AsStorage()); @@ -329,7 +329,7 @@ namespace Ryujinx.HLE.HOS using var npdmFile = new UniqueRef(); - Result result = codeFs.OpenFile(ref npdmFile.Ref(), "/main.npdm".ToU8Span(), OpenMode.Read); + Result result = codeFs.OpenFile(ref npdmFile.Ref, "/main.npdm".ToU8Span(), OpenMode.Read); MetaLoader metaData; @@ -356,7 +356,7 @@ namespace Ryujinx.HLE.HOS using var nsoFile = new UniqueRef(); - codeFs.OpenFile(ref nsoFile.Ref(), $"/{name}".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + codeFs.OpenFile(ref nsoFile.Ref, $"/{name}".ToU8Span(), OpenMode.Read).ThrowIfFailure(); nsos[i] = new NsoExecutable(nsoFile.Release().AsStorage(), name); } @@ -371,10 +371,10 @@ namespace Ryujinx.HLE.HOS ProgramInfo programInfo = new ProgramInfo(in npdm, displayVersion, usePtc, allowCodeMemoryForJit: false); ProgramLoader.LoadNsos(_device.System.KernelContext, metaData, programInfo, executables: programs); - string titleIdText = npdm.Aci.Value.ProgramId.Value.ToString("x16"); - bool titleIs64Bit = (npdm.Meta.Value.Flags & 1) != 0; + string titleIdText = npdm.Aci.ProgramId.Value.ToString("x16"); + bool titleIs64Bit = (npdm.Meta.Flags & 1) != 0; - string programName = Encoding.ASCII.GetString(npdm.Meta.Value.ProgramName).TrimEnd('\0'); + string programName = Encoding.ASCII.GetString(npdm.Meta.ProgramName).TrimEnd('\0'); Logger.Info?.Print(LogClass.Loader, $"Service Loaded: {programName} [{titleIdText}] [{(titleIs64Bit ? "64-bit" : "32-bit")}]"); } @@ -520,7 +520,7 @@ namespace Ryujinx.HLE.HOS { using var npdmFile = new UniqueRef(); - Result result = fs.OpenFile(ref npdmFile.Ref(), "/main.npdm".ToU8Span(), OpenMode.Read); + Result result = fs.OpenFile(ref npdmFile.Ref, "/main.npdm".ToU8Span(), OpenMode.Read); MetaLoader metaData; @@ -543,8 +543,8 @@ namespace Ryujinx.HLE.HOS metaData.GetNpdm(out var npdm).ThrowIfFailure(); - TitleId = npdm.Aci.Value.ProgramId.Value; - TitleIs64Bit = (npdm.Meta.Value.Flags & 1) != 0; + TitleId = npdm.Aci.ProgramId.Value; + TitleIs64Bit = (npdm.Meta.Flags & 1) != 0; _device.System.LibHacHorizonManager.ArpIReader.ApplicationId = new LibHac.ApplicationId(TitleId); return metaData; @@ -555,7 +555,7 @@ namespace Ryujinx.HLE.HOS using var controlFile = new UniqueRef(); IFileSystem controlFs = controlNca.OpenFileSystem(NcaSectionType.Data, device.System.FsIntegrityCheckLevel); - Result result = controlFs.OpenFile(ref controlFile.Ref(), "/control.nacp".ToU8Span(), OpenMode.Read); + Result result = controlFs.OpenFile(ref controlFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read); if (result.IsSuccess()) { @@ -603,7 +603,7 @@ namespace Ryujinx.HLE.HOS using var nsoFile = new UniqueRef(); - codeFs.OpenFile(ref nsoFile.Ref(), $"/{name}".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + codeFs.OpenFile(ref nsoFile.Ref, $"/{name}".ToU8Span(), OpenMode.Read).ThrowIfFailure(); nsos[i] = new NsoExecutable(nsoFile.Release().AsStorage(), name); } @@ -752,7 +752,7 @@ namespace Ryujinx.HLE.HOS _titleName = programInfo.Name; TitleId = programInfo.ProgramId; - TitleIs64Bit = (npdm.Meta.Value.Flags & 1) != 0; + TitleIs64Bit = (npdm.Meta.Flags & 1) != 0; _device.System.LibHacHorizonManager.ArpIReader.ApplicationId = new LibHac.ApplicationId(TitleId); // Explicitly null titleid to disable the shader cache. @@ -798,7 +798,7 @@ namespace Ryujinx.HLE.HOS { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = new Nca(fileSystem.KeySet, ncaFile.Release().AsStorage()); diff --git a/Ryujinx.HLE/HOS/ModLoader.cs b/Ryujinx.HLE/HOS/ModLoader.cs index b6c9973f..bf0f1f89 100644 --- a/Ryujinx.HLE/HOS/ModLoader.cs +++ b/Ryujinx.HLE/HOS/ModLoader.cs @@ -475,7 +475,7 @@ namespace Ryujinx.HLE.HOS { using var file = new UniqueRef(); - baseRom.OpenFile(ref file.Ref(), entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + baseRom.OpenFile(ref file.Ref, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); builder.AddFile(entry.FullPath, file.Release()); } @@ -494,7 +494,7 @@ namespace Ryujinx.HLE.HOS { using var file = new UniqueRef(); - fs.OpenFile(ref file.Ref(), entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + fs.OpenFile(ref file.Ref, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); if (fileSet.Add(entry.FullPath)) { builder.AddFile(entry.FullPath, file.Release()); diff --git a/Ryujinx.HLE/HOS/ProgramLoader.cs b/Ryujinx.HLE/HOS/ProgramLoader.cs index 1f6fd96d..158ab701 100644 --- a/Ryujinx.HLE/HOS/ProgramLoader.cs +++ b/Ryujinx.HLE/HOS/ProgramLoader.cs @@ -28,9 +28,9 @@ namespace Ryujinx.HLE.HOS public ProgramInfo(in Npdm npdm, string displayVersion, bool diskCacheEnabled, bool allowCodeMemoryForJit) { - ulong programId = npdm.Aci.Value.ProgramId.Value; + ulong programId = npdm.Aci.ProgramId.Value; - Name = StringUtils.Utf8ZToString(npdm.Meta.Value.ProgramName); + Name = StringUtils.Utf8ZToString(npdm.Meta.ProgramName); ProgramId = programId; TitleIdText = programId.ToString("x16"); DisplayVersion = displayVersion; @@ -193,7 +193,7 @@ namespace Ryujinx.HLE.HOS return ProgramLoadResult.Failed; } - ref readonly var meta = ref npdm.Meta.Value; + ref readonly var meta = ref npdm.Meta; ulong argsStart = 0; uint argsSize = 0; @@ -298,7 +298,7 @@ namespace Ryujinx.HLE.HOS KProcess process = new KProcess(context, programInfo.AllowCodeMemoryForJit); - MemoryRegion memoryRegion = (MemoryRegion)((npdm.Acid.Value.Flags >> 2) & 0xf); + MemoryRegion memoryRegion = (MemoryRegion)((npdm.Acid.Flags >> 2) & 0xf); if (memoryRegion > MemoryRegion.NvServices) { diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs index 41d5028f..f5364329 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountManager.cs @@ -183,7 +183,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc using var saveDataIterator = new UniqueRef(); - _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref(), SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); + _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); Span saveDataInfo = stackalloc SaveDataInfo[10]; diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs index 49331e21..f8f88a1c 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs @@ -1,9 +1,9 @@ using LibHac.Account; using LibHac.Common; using LibHac.Fs; -using LibHac.FsSystem; using LibHac.Ncm; using LibHac.Ns; +using LibHac.Tools.FsSystem.NcaUtils; using Ryujinx.Common; using Ryujinx.Common.Logging; using Ryujinx.HLE.Exceptions; diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs index d4528efa..b16ea4c1 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs @@ -54,11 +54,11 @@ namespace Ryujinx.HLE.HOS.Services.Bcat using var serv = new SharedRef(); - Result rc = _base.Get.CreateDeliveryCacheStorageService(ref serv.Ref(), pid); + Result rc = _base.Get.CreateDeliveryCacheStorageService(ref serv.Ref, pid); if (rc.IsSuccess()) { - MakeObject(context, new IDeliveryCacheStorageService(context, ref serv.Ref())); + MakeObject(context, new IDeliveryCacheStorageService(context, ref serv.Ref)); } return (ResultCode)rc.Value; @@ -72,11 +72,11 @@ namespace Ryujinx.HLE.HOS.Services.Bcat using var service = new SharedRef(); - Result rc = _base.Get.CreateDeliveryCacheStorageServiceWithApplicationId(ref service.Ref(), applicationId); + Result rc = _base.Get.CreateDeliveryCacheStorageServiceWithApplicationId(ref service.Ref, applicationId); if (rc.IsSuccess()) { - MakeObject(context, new IDeliveryCacheStorageService(context, ref service.Ref())); + MakeObject(context, new IDeliveryCacheStorageService(context, ref service.Ref)); } return (ResultCode)rc.Value; diff --git a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs index 71d7aed7..32dd75d8 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs @@ -20,11 +20,11 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator { using var service = new SharedRef(); - Result result = _base.Get.CreateFileService(ref service.Ref()); + Result result = _base.Get.CreateFileService(ref service.Ref); if (result.IsSuccess()) { - MakeObject(context, new IDeliveryCacheFileService(ref service.Ref())); + MakeObject(context, new IDeliveryCacheFileService(ref service.Ref)); } return (ResultCode)result.Value; @@ -36,11 +36,11 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator { using var service = new SharedRef(); - Result result = _base.Get.CreateDirectoryService(ref service.Ref()); + Result result = _base.Get.CreateDirectoryService(ref service.Ref); if (result.IsSuccess()) { - MakeObject(context, new IDeliveryCacheDirectoryService(ref service.Ref())); + MakeObject(context, new IDeliveryCacheDirectoryService(ref service.Ref)); } return (ResultCode)result.Value; 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 adapter = FileSystemInterfaceAdapter.CreateShared(ref nsp.Ref(), true); + using SharedRef 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(fileSystem); - using SharedRef adapter = FileSystemInterfaceAdapter.CreateShared(ref sharedFs.Ref(), true); + using SharedRef 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(); - 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(); - 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(); - 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(); - 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); } diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index a4bc6254..e43b1cad 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -109,10 +109,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs ref readonly var path = ref FileSystemProxyHelper.GetFspPath(context); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenBisFileSystem(ref fileSystem.Ref(), in path, bisPartitionId); + Result result = _baseFileSystemProxy.Get.OpenBisFileSystem(ref fileSystem.Ref, in path, bisPartitionId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -124,10 +124,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs BisPartitionId bisPartitionId = (BisPartitionId)context.RequestData.ReadInt32(); using var storage = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenBisStorage(ref storage.Ref(), bisPartitionId); + Result result = _baseFileSystemProxy.Get.OpenBisStorage(ref storage.Ref, bisPartitionId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IStorage(ref storage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref storage.Ref)); return ResultCode.Success; } @@ -145,10 +145,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSdCardFileSystem(ref fileSystem.Ref()); + Result result = _baseFileSystemProxy.Get.OpenSdCardFileSystem(ref fileSystem.Ref); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -247,10 +247,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs GameCardPartitionRaw partitionId = (GameCardPartitionRaw)context.RequestData.ReadInt32(); using var storage = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenGameCardStorage(ref storage.Ref(), handle, partitionId); + Result result = _baseFileSystemProxy.Get.OpenGameCardStorage(ref storage.Ref, handle, partitionId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IStorage(ref storage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref storage.Ref)); return ResultCode.Success; } @@ -263,10 +263,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs GameCardPartition partitionId = (GameCardPartition)context.RequestData.ReadInt32(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenGameCardFileSystem(ref fileSystem.Ref(), handle, partitionId); + Result result = _baseFileSystemProxy.Get.OpenGameCardFileSystem(ref fileSystem.Ref, handle, partitionId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -338,10 +338,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataAttribute attribute = context.RequestData.ReadStruct(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystem(ref fileSystem.Ref(), spaceId, in attribute); + Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystem(ref fileSystem.Ref, spaceId, in attribute); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -354,10 +354,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataAttribute attribute = context.RequestData.ReadStruct(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystemBySystemSaveDataId(ref fileSystem.Ref(), spaceId, in attribute); + Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystemBySystemSaveDataId(ref fileSystem.Ref, spaceId, in attribute); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -370,10 +370,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataAttribute attribute = context.RequestData.ReadStruct(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenReadOnlySaveDataFileSystem(ref fileSystem.Ref(), spaceId, in attribute); + Result result = _baseFileSystemProxy.Get.OpenReadOnlySaveDataFileSystem(ref fileSystem.Ref, spaceId, in attribute); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -432,10 +432,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using var infoReader = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReader(ref infoReader.Ref()); + Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReader(ref infoReader.Ref); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref())); + MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref)); return ResultCode.Success; } @@ -447,10 +447,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadByte(); using var infoReader = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderBySaveDataSpaceId(ref infoReader.Ref(), spaceId); + Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderBySaveDataSpaceId(ref infoReader.Ref, spaceId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref())); + MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref)); return ResultCode.Success; } @@ -461,10 +461,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using var infoReader = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderOnlyCacheStorage(ref infoReader.Ref()); + Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderOnlyCacheStorage(ref infoReader.Ref); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref())); + MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref)); return ResultCode.Success; } @@ -477,10 +477,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs ulong saveDataId = context.RequestData.ReadUInt64(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataInternalStorageFileSystem(ref fileSystem.Ref(), spaceId, saveDataId); + Result result = _baseFileSystemProxy.Get.OpenSaveDataInternalStorageFileSystem(ref fileSystem.Ref, spaceId, saveDataId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -537,10 +537,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataFilter filter = context.RequestData.ReadStruct(); using var infoReader = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderWithFilter(ref infoReader.Ref(), spaceId, in filter); + Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderWithFilter(ref infoReader.Ref, spaceId, in filter); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref())); + MakeObject(context, new ISaveDataInfoReader(ref infoReader.Ref)); return ResultCode.Success; } @@ -605,10 +605,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataAttribute attribute = context.RequestData.ReadStruct(); using var file = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenSaveDataMetaFile(ref file.Ref(), spaceId, in attribute, metaType); + Result result = _baseFileSystemProxy.Get.OpenSaveDataMetaFile(ref file.Ref, spaceId, in attribute, metaType); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new IFile(ref file.Ref())); + MakeObject(context, new IFile(ref file.Ref)); return ResultCode.Success; } @@ -637,10 +637,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs ImageDirectoryId directoryId = (ImageDirectoryId)context.RequestData.ReadInt32(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenImageDirectoryFileSystem(ref fileSystem.Ref(), directoryId); + Result result = _baseFileSystemProxy.Get.OpenImageDirectoryFileSystem(ref fileSystem.Ref, directoryId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -651,10 +651,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs BaseFileSystemId fileSystemId = (BaseFileSystemId)context.RequestData.ReadInt32(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenBaseFileSystem(ref fileSystem.Ref(), fileSystemId); + Result result = _baseFileSystemProxy.Get.OpenBaseFileSystem(ref fileSystem.Ref, fileSystemId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -665,10 +665,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs ContentStorageId contentStorageId = (ContentStorageId)context.RequestData.ReadInt32(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenContentStorageFileSystem(ref fileSystem.Ref(), contentStorageId); + Result result = _baseFileSystemProxy.Get.OpenContentStorageFileSystem(ref fileSystem.Ref, contentStorageId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -679,10 +679,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs CloudBackupWorkStorageId storageId = (CloudBackupWorkStorageId)context.RequestData.ReadInt32(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenCloudBackupWorkStorageFileSystem(ref fileSystem.Ref(), storageId); + Result result = _baseFileSystemProxy.Get.OpenCloudBackupWorkStorageFileSystem(ref fileSystem.Ref, storageId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -693,10 +693,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs CustomStorageId customStorageId = (CustomStorageId)context.RequestData.ReadInt32(); using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenCustomStorageFileSystem(ref fileSystem.Ref(), customStorageId); + Result result = _baseFileSystemProxy.Get.OpenCustomStorageFileSystem(ref fileSystem.Ref, customStorageId); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -707,9 +707,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs { var storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true); using var sharedStorage = new SharedRef(storage); - using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); - MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); return ResultCode.Success; } @@ -730,9 +730,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs var storage = context.Device.FileSystem.ModLoader.ApplyRomFsMods(titleId, aocStorage); using var sharedStorage = new SharedRef(storage); - using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); - MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); return ResultCode.Success; } @@ -765,9 +765,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs Nca nca = new Nca(context.Device.System.KeySet, ncaStorage); LibHac.Fs.IStorage romfsStorage = nca.OpenStorage(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); using var sharedStorage = new SharedRef(romfsStorage); - using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); - MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); } catch (HorizonResultException ex) { @@ -796,9 +796,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs { var storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true); using var sharedStorage = new SharedRef(storage); - using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); - MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); return ResultCode.Success; } @@ -816,9 +816,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs var storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true); using var sharedStorage = new SharedRef(storage); - using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef(new StorageInterfaceAdapter(ref sharedStorage.Ref)); - MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref())); + MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref)); return ResultCode.Success; } @@ -829,10 +829,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using var deviceOperator = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenDeviceOperator(ref deviceOperator.Ref()); + Result result = _baseFileSystemProxy.Get.OpenDeviceOperator(ref deviceOperator.Ref); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new IDeviceOperator(ref deviceOperator.Ref())); + MakeObject(context, new IDeviceOperator(ref deviceOperator.Ref)); return ResultCode.Success; } @@ -1195,10 +1195,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using var fileSystem = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenRegisteredUpdatePartition(ref fileSystem.Ref()); + Result result = _baseFileSystemProxy.Get.OpenRegisteredUpdatePartition(ref fileSystem.Ref); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref())); + MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); return ResultCode.Success; } @@ -1290,10 +1290,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using var commitManager = new SharedRef(); - Result result = _baseFileSystemProxy.Get.OpenMultiCommitManager(ref commitManager.Ref()); + Result result = _baseFileSystemProxy.Get.OpenMultiCommitManager(ref commitManager.Ref); if (result.IsFailure()) return (ResultCode)result.Value; - MakeObject(context, new IMultiCommitManager(ref commitManager.Ref())); + MakeObject(context, new IMultiCommitManager(ref commitManager.Ref)); return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs b/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs index 4c28117b..1a85e1b2 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { using SharedRef fileSystem = GetObject(context, 0).GetBaseFileSystem(); - Result result = _baseCommitManager.Get.Add(ref fileSystem.Ref()); + Result result = _baseCommitManager.Get.Add(ref fileSystem.Ref); return (ResultCode)result.Value; } diff --git a/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs b/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs index 31c46bc0..8411693f 100644 --- a/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs +++ b/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs @@ -1,7 +1,5 @@ -using LibHac.Common; -using Ryujinx.HLE.Utilities; +using Ryujinx.Common.Utilities; using System; -using System.Diagnostics; using System.Runtime.InteropServices; namespace Ryujinx.HLE.HOS.Services.Mii.Types @@ -78,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types private ReadOnlySpan AsSpan() { - return MemoryMarshal.AsBytes(SpanHelpers.CreateReadOnlySpan(in this, 1)); + return SpanHelpers.AsReadOnlyByteSpan(ref this); } private ReadOnlySpan AsSpanWithoutDeviceCrc() diff --git a/Ryujinx.HLE/HOS/Services/Ncm/Lr/LocationResolverManager/ILocationResolver.cs b/Ryujinx.HLE/HOS/Services/Ncm/Lr/LocationResolverManager/ILocationResolver.cs index 0767b148..d97bd009 100644 --- a/Ryujinx.HLE/HOS/Services/Ncm/Lr/LocationResolverManager/ILocationResolver.cs +++ b/Ryujinx.HLE/HOS/Services/Ncm/Lr/LocationResolverManager/ILocationResolver.cs @@ -1,5 +1,5 @@ -using LibHac.FsSystem; -using LibHac.Ncm; +using LibHac.Ncm; +using LibHac.Tools.FsSystem.NcaUtils; using Ryujinx.HLE.FileSystem; using System.Text; diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/ProxySetting.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/ProxySetting.cs index 827520f1..6e534fe1 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/ProxySetting.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/ProxySetting.cs @@ -1,5 +1,5 @@ -using LibHac.Common; -using Ryujinx.Common.Memory; +using Ryujinx.Common.Memory; +using Ryujinx.Common.Utilities; using System; using System.Runtime.InteropServices; diff --git a/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs b/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs index f1ef6a2f..66a69a8b 100644 --- a/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs +++ b/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs @@ -77,7 +77,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pl using var fontFile = new UniqueRef(); - romfs.OpenFile(ref fontFile.Ref(), ("/" + fontFilename).ToU8Span(), OpenMode.Read).ThrowIfFailure(); + romfs.OpenFile(ref fontFile.Ref, ("/" + fontFilename).ToU8Span(), OpenMode.Read).ThrowIfFailure(); data = DecryptFont(fontFile.Get.AsStream()); } diff --git a/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs b/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs index 7f32ce6b..bae10d0b 100644 --- a/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs @@ -321,7 +321,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings using var firmwareFile = new UniqueRef(); - Result result = firmwareRomFs.OpenFile(ref firmwareFile.Ref(), "/file".ToU8Span(), OpenMode.Read); + Result result = firmwareRomFs.OpenFile(ref firmwareFile.Ref, "/file".ToU8Span(), OpenMode.Read); if (result.IsFailure()) { return null; diff --git a/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs b/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs index a164c745..abbc1354 100644 --- a/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs +++ b/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs @@ -133,14 +133,14 @@ namespace Ryujinx.HLE.HOS.Services.Ssl using var trustedCertsFileRef = new UniqueRef(); - Result result = romfs.OpenFile(ref trustedCertsFileRef.Ref(), "/ssl_TrustedCerts.bdf".ToU8Span(), OpenMode.Read); + Result result = romfs.OpenFile(ref trustedCertsFileRef.Ref, "/ssl_TrustedCerts.bdf".ToU8Span(), OpenMode.Read); if (!result.IsSuccess()) { // [1.0.0 - 2.3.0] if (ResultFs.PathNotFound.Includes(result)) { - result = romfs.OpenFile(ref trustedCertsFileRef.Ref(), "/ssl_TrustedCerts.tcf".ToU8Span(), OpenMode.Read); + result = romfs.OpenFile(ref trustedCertsFileRef.Ref, "/ssl_TrustedCerts.tcf".ToU8Span(), OpenMode.Read); } if (result.IsFailure()) diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs index f4b3a959..69ed56d4 100644 --- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs @@ -97,7 +97,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone using var binaryListFile = new UniqueRef(); - romfs.OpenFile(ref binaryListFile.Ref(), "/binaryList.txt".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + romfs.OpenFile(ref binaryListFile.Ref, "/binaryList.txt".ToU8Span(), OpenMode.Read).ThrowIfFailure(); StreamReader reader = new StreamReader(binaryListFile.Get.AsStream()); @@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone using var tzif = new UniqueRef(); - if (romfs.OpenFile(ref tzif.Ref(), $"/zoneinfo/{locName}".ToU8Span(), OpenMode.Read).IsFailure()) + if (romfs.OpenFile(ref tzif.Ref, $"/zoneinfo/{locName}".ToU8Span(), OpenMode.Read).IsFailure()) { Logger.Error?.Print(LogClass.ServiceTime, $"Error opening /zoneinfo/{locName}"); continue; @@ -273,7 +273,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone using var timeZoneBinaryFile = new UniqueRef(); - Result result = romfs.OpenFile(ref timeZoneBinaryFile.Ref(), $"/zoneinfo/{locationName}".ToU8Span(), OpenMode.Read); + Result result = romfs.OpenFile(ref timeZoneBinaryFile.Ref, $"/zoneinfo/{locationName}".ToU8Span(), OpenMode.Read); timeZoneBinaryStream = timeZoneBinaryFile.Release().AsStream(); diff --git a/Ryujinx.Ui.Common/App/ApplicationLibrary.cs b/Ryujinx.Ui.Common/App/ApplicationLibrary.cs index 951516c0..43510d5e 100644 --- a/Ryujinx.Ui.Common/App/ApplicationLibrary.cs +++ b/Ryujinx.Ui.Common/App/ApplicationLibrary.cs @@ -72,7 +72,7 @@ namespace Ryujinx.Ui.App.Common { using UniqueRef controlFile = new(); - controlFs.OpenFile(ref controlFile.Ref(), "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlFs.OpenFile(ref controlFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); controlFile.Get.Read(out _, 0, outProperty, ReadOption.None).ThrowIfFailure(); } @@ -178,7 +178,7 @@ namespace Ryujinx.Ui.App.Common { using UniqueRef ncaFile = new(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = new(_virtualFileSystem.KeySet, ncaFile.Get.AsStorage()); int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program); @@ -211,7 +211,7 @@ namespace Ryujinx.Ui.App.Common using UniqueRef npdmFile = new(); - Result result = pfs.OpenFile(ref npdmFile.Ref(), "/main.npdm".ToU8Span(), OpenMode.Read); + Result result = pfs.OpenFile(ref npdmFile.Ref, "/main.npdm".ToU8Span(), OpenMode.Read); if (ResultFs.PathNotFound.Includes(result)) { @@ -241,7 +241,7 @@ namespace Ryujinx.Ui.App.Common { using UniqueRef icon = new(); - controlFs.OpenFile(ref icon.Ref(), $"/icon_{_desiredTitleLanguage}.dat".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlFs.OpenFile(ref icon.Ref, $"/icon_{_desiredTitleLanguage}.dat".ToU8Span(), OpenMode.Read).ThrowIfFailure(); using MemoryStream stream = new(); @@ -259,7 +259,7 @@ namespace Ryujinx.Ui.App.Common using var icon = new UniqueRef(); - controlFs.OpenFile(ref icon.Ref(), entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlFs.OpenFile(ref icon.Ref, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); using MemoryStream stream = new(); @@ -572,7 +572,7 @@ namespace Ryujinx.Ui.App.Common { using var icon = new UniqueRef(); - controlFs.OpenFile(ref icon.Ref(), $"/icon_{_desiredTitleLanguage}.dat".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlFs.OpenFile(ref icon.Ref, $"/icon_{_desiredTitleLanguage}.dat".ToU8Span(), OpenMode.Read).ThrowIfFailure(); using MemoryStream stream = new(); @@ -590,7 +590,7 @@ namespace Ryujinx.Ui.App.Common using var icon = new UniqueRef(); - controlFs.OpenFile(ref icon.Ref(), entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlFs.OpenFile(ref icon.Ref, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); using (MemoryStream stream = new()) { diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index 5051fb5f..6d3d4aad 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -2,10 +2,10 @@ using Gtk; using LibHac.Common; using LibHac.Common.Keys; -using LibHac.FsSystem; using LibHac.Ncm; using LibHac.Ns; using LibHac.Tools.FsSystem; +using LibHac.Tools.FsSystem.NcaUtils; using Ryujinx.Audio.Backends.Dummy; using Ryujinx.Audio.Backends.OpenAL; using Ryujinx.Audio.Backends.SDL2; diff --git a/Ryujinx/Ui/Widgets/GameTableContextMenu.cs b/Ryujinx/Ui/Widgets/GameTableContextMenu.cs index e4550986..a63d68ff 100644 --- a/Ryujinx/Ui/Widgets/GameTableContextMenu.cs +++ b/Ryujinx/Ui/Widgets/GameTableContextMenu.cs @@ -224,7 +224,7 @@ namespace Ryujinx.Ui.Widgets { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = new Nca(_virtualFileSystem.KeySet, ncaFile.Release().AsStorage()); @@ -280,8 +280,8 @@ namespace Ryujinx.Ui.Widgets using var uniqueSourceFs = new UniqueRef(ncaFileSystem); using var uniqueOutputFs = new UniqueRef(new LocalFileSystem(destination)); - fsClient.Register(source.ToU8Span(), ref uniqueSourceFs.Ref()); - fsClient.Register(output.ToU8Span(), ref uniqueOutputFs.Ref()); + fsClient.Register(source.ToU8Span(), ref uniqueSourceFs.Ref); + fsClient.Register(output.ToU8Span(), ref uniqueOutputFs.Ref); (Result? resultCode, bool canceled) = CopyDirectory(fsClient, $"{source}:/", $"{output}:/"); diff --git a/Ryujinx/Ui/Windows/AvatarWindow.cs b/Ryujinx/Ui/Windows/AvatarWindow.cs index c715907d..fc928bde 100644 --- a/Ryujinx/Ui/Windows/AvatarWindow.cs +++ b/Ryujinx/Ui/Windows/AvatarWindow.cs @@ -134,7 +134,7 @@ namespace Ryujinx.Ui.Windows { using var file = new UniqueRef(); - romfs.OpenFile(ref file.Ref(), ("/" + item.FullPath).ToU8Span(), OpenMode.Read).ThrowIfFailure(); + romfs.OpenFile(ref file.Ref, ("/" + item.FullPath).ToU8Span(), OpenMode.Read).ThrowIfFailure(); using (MemoryStream stream = new MemoryStream()) using (MemoryStream streamPng = new MemoryStream()) diff --git a/Ryujinx/Ui/Windows/DlcWindow.cs b/Ryujinx/Ui/Windows/DlcWindow.cs index 0a97ac2a..9fccec19 100644 --- a/Ryujinx/Ui/Windows/DlcWindow.cs +++ b/Ryujinx/Ui/Windows/DlcWindow.cs @@ -93,7 +93,7 @@ namespace Ryujinx.Ui.Windows { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), dlcNca.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, dlcNca.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = TryCreateNca(ncaFile.Get.AsStorage(), dlcContainer.ContainerPath); if (nca != null) @@ -161,7 +161,7 @@ namespace Ryujinx.Ui.Windows { using var ncaFile = new UniqueRef(); - pfs.OpenFile(ref ncaFile.Ref(), fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); + pfs.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure(); Nca nca = TryCreateNca(ncaFile.Get.AsStorage(), containerPath); diff --git a/Ryujinx/Ui/Windows/TitleUpdateWindow.cs b/Ryujinx/Ui/Windows/TitleUpdateWindow.cs index 2618168c..4aea5895 100644 --- a/Ryujinx/Ui/Windows/TitleUpdateWindow.cs +++ b/Ryujinx/Ui/Windows/TitleUpdateWindow.cs @@ -102,7 +102,7 @@ namespace Ryujinx.Ui.Windows using var nacpFile = new UniqueRef(); - controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref(), "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); + controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); nacpFile.Get.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure(); RadioButton radioButton = new RadioButton($"Version {controlData.DisplayVersionString.ToString()} - {path}");