diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
15 files changed, 93 insertions, 91 deletions
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<SaveDataIterator>(); - _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref(), SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); + _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure(); Span<SaveDataInfo> 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<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>(); - 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<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>(); - 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<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService>(); - 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<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService>(); - 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<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); } 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<IFileSystem>(); - 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<IStorage>(); - 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<IFileSystem>(); - 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<IStorage>(); - 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<IFileSystem>(); - 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<SaveDataAttribute>(); using var fileSystem = new SharedRef<IFileSystem>(); - 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<SaveDataAttribute>(); using var fileSystem = new SharedRef<IFileSystem>(); - 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<SaveDataAttribute>(); using var fileSystem = new SharedRef<IFileSystem>(); - 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<LibHac.FsSrv.Sf.ISaveDataInfoReader>(); - 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<LibHac.FsSrv.Sf.ISaveDataInfoReader>(); - 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<LibHac.FsSrv.Sf.ISaveDataInfoReader>(); - 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<IFileSystem>(); - 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<SaveDataFilter>(); using var infoReader = new SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader>(); - 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<SaveDataAttribute>(); using var file = new SharedRef<LibHac.FsSrv.Sf.IFile>(); - 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<IFileSystem>(); - 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<IFileSystem>(); - 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<IFileSystem>(); - 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<IFileSystem>(); - 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<IFileSystem>(); - 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<LibHac.Fs.IStorage>(storage); - using var sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef<IStorage>(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<LibHac.Fs.IStorage>(storage); - using var sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef<IStorage>(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<LibHac.Fs.IStorage>(romfsStorage); - using var sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef<IStorage>(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<LibHac.Fs.IStorage>(storage); - using var sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef<IStorage>(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<LibHac.Fs.IStorage>(storage); - using var sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref())); + using var sfStorage = new SharedRef<IStorage>(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<LibHac.FsSrv.Sf.IDeviceOperator>(); - 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<IFileSystem>(); - 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<LibHac.FsSrv.Sf.IMultiCommitManager>(); - 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<LibHac.FsSrv.Sf.IFileSystem> fileSystem = GetObject<IFileSystem>(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<byte> AsSpan() { - return MemoryMarshal.AsBytes(SpanHelpers.CreateReadOnlySpan(in this, 1)); + return SpanHelpers.AsReadOnlyByteSpan(ref this); } private ReadOnlySpan<byte> 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<IFile>(); - 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<IFile>(); - 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<IFile>(); - 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<IFile>(); - 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<IFile>(); - 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<IFile>(); - 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(); |