diff options
author | Alex Barney <thealexbarney@gmail.com> | 2020-09-01 13:08:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 17:08:59 -0300 |
commit | 1bb7fdaca43c5dcb016dfb9fd13319f4638cb0d2 (patch) | |
tree | c63faefdea79b66e356b4b3c9c9f1f736c9bf151 /Ryujinx.HLE/HOS/Services | |
parent | 6cc187da594a620f89df38ff537511138b03c9dc (diff) |
Update to LibHac 0.12.0 (#1485)
* Update to LibHac 0.12.0
* Auto-formatting. Fixed a bug in SetApplicationCopyrightImage
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
13 files changed, 85 insertions, 76 deletions
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 5b26b981..54de42cc 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs @@ -2,7 +2,6 @@ using LibHac; using LibHac.Account; using LibHac.Common; using LibHac.Fs; -using LibHac.Ncm; using LibHac.Ns; using Ryujinx.Common; using Ryujinx.Common.Logging; @@ -18,6 +17,7 @@ using System.Numerics; using static LibHac.Fs.ApplicationSaveDataManagement; using AccountUid = Ryujinx.HLE.HOS.Services.Account.Acc.UserId; +using ApplicationId = LibHac.Ncm.ApplicationId; namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy { @@ -29,9 +29,9 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati public IApplicationFunctions(Horizon system) { - _gpuErrorDetectedSystemEvent = new KEvent(system.KernelContext); + _gpuErrorDetectedSystemEvent = new KEvent(system.KernelContext); _friendInvitationStorageChannelEvent = new KEvent(system.KernelContext); - _notificationStorageChannelEvent = new KEvent(system.KernelContext); + _notificationStorageChannelEvent = new KEvent(system.KernelContext); } [Command(1)] @@ -48,28 +48,28 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati // EnsureSaveData(nn::account::Uid) -> u64 public ResultCode EnsureSaveData(ServiceCtx context) { - Uid userId = context.RequestData.ReadStruct<AccountUid>().ToLibHacUid(); - TitleId titleId = new TitleId(context.Process.TitleId); + Uid userId = context.RequestData.ReadStruct<AccountUid>().ToLibHacUid(); + ApplicationId applicationId = new ApplicationId(context.Process.TitleId); BlitStruct<ApplicationControlProperty> controlHolder = context.Device.Application.ControlData; ref ApplicationControlProperty control = ref controlHolder.Value; - if (Util.IsEmpty(controlHolder.ByteSpan)) + if (LibHac.Utilities.IsEmpty(controlHolder.ByteSpan)) { // If the current application doesn't have a loaded control property, create a dummy one // and set the savedata sizes so a user savedata will be created. control = ref new BlitStruct<ApplicationControlProperty>(1).Value; // The set sizes don't actually matter as long as they're non-zero because we use directory savedata. - control.UserAccountSaveDataSize = 0x4000; + control.UserAccountSaveDataSize = 0x4000; control.UserAccountSaveDataJournalSize = 0x4000; Logger.Warning?.Print(LogClass.ServiceAm, "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games."); } - Result result = EnsureApplicationSaveData(context.Device.FileSystem.FsClient, out long requiredSize, titleId, + Result result = EnsureApplicationSaveData(context.Device.FileSystem.FsClient, out long requiredSize, applicationId, ref control, ref userId); context.ResponseData.Write(requiredSize); @@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati // TODO: When above calls are implemented, switch to using ns:am long desiredLanguageCode = context.Device.System.State.DesiredLanguageCode; - + int supportedLanguages = (int)context.Device.Application.ControlData.Value.SupportedLanguages; int firstSupported = BitOperations.TrailingZeroCount(supportedLanguages); @@ -210,10 +210,10 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati // InitializeApplicationCopyrightFrameBuffer(s32 width, s32 height, handle<copy, transfer_memory> transfer_memory, u64 transfer_memory_size) public ResultCode InitializeApplicationCopyrightFrameBuffer(ServiceCtx context) { - int width = context.RequestData.ReadInt32(); - int height = context.RequestData.ReadInt32(); - ulong transferMemorySize = context.RequestData.ReadUInt64(); - int transferMemoryHandle = context.Request.HandleDesc.ToCopy[0]; + int width = context.RequestData.ReadInt32(); + int height = context.RequestData.ReadInt32(); + ulong transferMemorySize = context.RequestData.ReadUInt64(); + int transferMemoryHandle = context.Request.HandleDesc.ToCopy[0]; ulong transferMemoryAddress = context.Process.HandleTable.GetObject<KTransferMemory>(transferMemoryHandle).Address; ResultCode resultCode = ResultCode.InvalidParameters; @@ -258,12 +258,12 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati // SetApplicationCopyrightImage(buffer<bytes, 0x45> frame_buffer, s32 x, s32 y, s32 width, s32 height, s32 window_origin_mode) public ResultCode SetApplicationCopyrightImage(ServiceCtx context) { - long frameBufferPos = context.Request.SendBuff[0].Position; - long frameBufferSize = context.Request.SendBuff[0].Size; - int x = context.RequestData.ReadInt32(); - int y = context.RequestData.ReadInt32(); - int width = context.RequestData.ReadInt32(); - int height = context.RequestData.ReadInt32(); + long frameBufferPos = context.Request.SendBuff[0].Position; + long frameBufferSize = context.Request.SendBuff[0].Size; + int x = context.RequestData.ReadInt32(); + int y = context.RequestData.ReadInt32(); + int width = context.RequestData.ReadInt32(); + int height = context.RequestData.ReadInt32(); uint windowOriginMode = context.RequestData.ReadUInt32(); ResultCode resultCode = ResultCode.InvalidParameters; @@ -272,7 +272,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati { ResultCode result = SetApplicationCopyrightImageImpl(x, y, width, height, frameBufferPos, frameBufferSize, windowOriginMode); - if (resultCode != ResultCode.Success) + if (result != ResultCode.Success) { resultCode = result; } diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs index 525dff60..c4d251f9 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/FileSystemProxyHelper.cs @@ -44,7 +44,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy return ResultCode.PartitionNotFound; } - LibHac.Fs.IFileSystem fileSystem = nca.OpenFileSystem(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); + LibHac.Fs.Fsa.IFileSystem fileSystem = nca.OpenFileSystem(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel); openedFileSystem = new IFileSystem(fileSystem); } @@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy string filename = fullPath.Replace(archivePath.FullName, string.Empty).TrimStart('\\'); - Result result = nsp.OpenFile(out LibHac.Fs.IFile ncaFile, filename.ToU8Span(), OpenMode.Read); + Result result = nsp.OpenFile(out LibHac.Fs.Fsa.IFile ncaFile, filename.ToU8Span(), OpenMode.Read); if (result.IsFailure()) { return (ResultCode)result.Value; @@ -99,11 +99,11 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy return ResultCode.PathDoesNotExist; } - public static void ImportTitleKeysFromNsp(LibHac.Fs.IFileSystem nsp, Keyset keySet) + public static void ImportTitleKeysFromNsp(LibHac.Fs.Fsa.IFileSystem nsp, Keyset keySet) { foreach (DirectoryEntryEx ticketEntry in nsp.EnumerateEntries("/", "*.tik")) { - Result result = nsp.OpenFile(out LibHac.Fs.IFile ticketFile, ticketEntry.FullPath.ToU8Span(), OpenMode.Read); + Result result = nsp.OpenFile(out LibHac.Fs.Fsa.IFile ticketFile, ticketEntry.FullPath.ToU8Span(), OpenMode.Read); if (result.IsSuccess()) { diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs index 3d07b509..ccad1ce3 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs @@ -7,9 +7,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { class IDirectory : IpcService { - private LibHac.Fs.IDirectory _baseDirectory; + private LibHac.Fs.Fsa.IDirectory _baseDirectory; - public IDirectory(LibHac.Fs.IDirectory directory) + public IDirectory(LibHac.Fs.Fsa.IDirectory directory) { _baseDirectory = directory; } diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs index 02fc967f..cdec98c5 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFile.cs @@ -6,9 +6,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { class IFile : IpcService, IDisposable { - private LibHac.Fs.IFile _baseFile; + private LibHac.Fs.Fsa.IFile _baseFile; - public IFile(LibHac.Fs.IFile baseFile) + public IFile(LibHac.Fs.Fsa.IFile baseFile) { _baseFile = baseFile; } @@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { long position = context.Request.ReceiveBuff[0].Position; - ReadOption readOption = (ReadOption)context.RequestData.ReadInt32(); + ReadOption readOption = new ReadOption(context.RequestData.ReadInt32()); context.RequestData.BaseStream.Position += 4; long offset = context.RequestData.ReadInt64(); @@ -42,7 +42,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { long position = context.Request.SendBuff[0].Position; - WriteOption writeOption = (WriteOption)context.RequestData.ReadInt32(); + WriteOption writeOption = new WriteOption(context.RequestData.ReadInt32()); context.RequestData.BaseStream.Position += 4; long offset = context.RequestData.ReadInt64(); diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs index b907e17a..25d63bb9 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IFileSystem.cs @@ -1,21 +1,21 @@ using LibHac; using LibHac.Common; using LibHac.Fs; - +using LibHac.Fs.Fsa; using static Ryujinx.HLE.Utilities.StringUtils; namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { class IFileSystem : IpcService { - private LibHac.Fs.IFileSystem _fileSystem; + private LibHac.Fs.Fsa.IFileSystem _fileSystem; - public IFileSystem(LibHac.Fs.IFileSystem provider) + public IFileSystem(LibHac.Fs.Fsa.IFileSystem provider) { _fileSystem = provider; } - public LibHac.Fs.IFileSystem GetBaseFileSystem() + public LibHac.Fs.Fsa.IFileSystem GetBaseFileSystem() { return _fileSystem; } @@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy U8Span name = ReadUtf8Span(context); - Result result = _fileSystem.OpenFile(out LibHac.Fs.IFile file, name, mode); + Result result = _fileSystem.OpenFile(out LibHac.Fs.Fsa.IFile file, name, mode); if (result.IsSuccess()) { @@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy U8Span name = ReadUtf8Span(context); - Result result = _fileSystem.OpenDirectory(out LibHac.Fs.IDirectory dir, name, mode); + Result result = _fileSystem.OpenDirectory(out LibHac.Fs.Fsa.IDirectory dir, name, mode); if (result.IsSuccess()) { diff --git a/Ryujinx.HLE/HOS/Services/Fs/IDeviceOperator.cs b/Ryujinx.HLE/HOS/Services/Fs/IDeviceOperator.cs index c9f2f74c..7551d627 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IDeviceOperator.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IDeviceOperator.cs @@ -1,13 +1,13 @@ using LibHac; -using LibHac.FsService; +using LibHac.FsSrv; namespace Ryujinx.HLE.HOS.Services.Fs { class IDeviceOperator : IpcService { - private LibHac.FsService.IDeviceOperator _baseOperator; + private LibHac.FsSrv.IDeviceOperator _baseOperator; - public IDeviceOperator(LibHac.FsService.IDeviceOperator baseOperator) + public IDeviceOperator(LibHac.FsSrv.IDeviceOperator baseOperator) { _baseOperator = baseOperator; } diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index 42e778d6..44f406a0 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -1,6 +1,6 @@ using LibHac; using LibHac.Fs; -using LibHac.FsService; +using LibHac.FsSrv; using LibHac.FsSystem; using LibHac.FsSystem.NcaUtils; using LibHac.Ncm; @@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs [Service("fsp-srv")] class IFileSystemProxy : IpcService { - private LibHac.FsService.IFileSystemProxy _baseFileSystemProxy; + private LibHac.FsSrv.IFileSystemProxy _baseFileSystemProxy; public IFileSystemProxy(ServiceCtx context) { @@ -97,7 +97,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs Result rc = FileSystemProxyHelper.ReadFsPath(out FsPath path, context); if (rc.IsFailure()) return (ResultCode)rc.Value; - rc = _baseFileSystemProxy.OpenBisFileSystem(out LibHac.Fs.IFileSystem fileSystem, ref path, bisPartitionId); + rc = _baseFileSystemProxy.OpenBisFileSystem(out LibHac.Fs.Fsa.IFileSystem fileSystem, ref path, bisPartitionId); if (rc.IsFailure()) return (ResultCode)rc.Value; MakeObject(context, new FileSystemProxy.IFileSystem(fileSystem)); @@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenSdCardFileSystem() -> object<nn::fssrv::sf::IFileSystem> public ResultCode OpenSdCardFileSystem(ServiceCtx context) { - Result rc = _baseFileSystemProxy.OpenSdCardFileSystem(out LibHac.Fs.IFileSystem fileSystem); + Result rc = _baseFileSystemProxy.OpenSdCardFileSystem(out LibHac.Fs.Fsa.IFileSystem fileSystem); if (rc.IsFailure()) return (ResultCode)rc.Value; MakeObject(context, new FileSystemProxy.IFileSystem(fileSystem)); @@ -136,17 +136,17 @@ namespace Ryujinx.HLE.HOS.Services.Fs // TODO: There's currently no program registry for FS to reference. // Workaround that by setting the application ID and owner ID if they're not already set - if (attribute.TitleId == TitleId.Zero) + if (attribute.ProgramId == ProgramId.InvalidId) { - attribute.TitleId = new TitleId(context.Process.TitleId); + attribute.ProgramId = new ProgramId(context.Process.TitleId); } - if (creationInfo.OwnerId == TitleId.Zero) + if (creationInfo.OwnerId == 0) { - creationInfo.OwnerId = new TitleId(context.Process.TitleId); + creationInfo.OwnerId = 0; } - Logger.Info?.Print(LogClass.ServiceFs, $"Creating save with title ID {attribute.TitleId.Value:x16}"); + Logger.Info?.Print(LogClass.ServiceFs, $"Creating save with title ID {attribute.ProgramId.Value:x16}"); Result result = _baseFileSystemProxy.CreateSaveDataFileSystem(ref attribute, ref creationInfo, ref metaCreateInfo); @@ -213,14 +213,14 @@ namespace Ryujinx.HLE.HOS.Services.Fs // TODO: There's currently no program registry for FS to reference. // Workaround that by setting the application ID and owner ID if they're not already set - if (attribute.TitleId == TitleId.Zero) + if (attribute.ProgramId == ProgramId.InvalidId) { - attribute.TitleId = new TitleId(context.Process.TitleId); + attribute.ProgramId = new ProgramId(context.Process.TitleId); } - if (creationInfo.OwnerId == TitleId.Zero) + if (creationInfo.OwnerId == 0) { - creationInfo.OwnerId = new TitleId(context.Process.TitleId); + creationInfo.OwnerId = 0; } Result result = _baseFileSystemProxy.CreateSaveDataFileSystemWithHashSalt(ref attribute, ref creationInfo, ref metaCreateInfo, ref hashSalt); @@ -237,12 +237,12 @@ namespace Ryujinx.HLE.HOS.Services.Fs // TODO: There's currently no program registry for FS to reference. // Workaround that by setting the application ID if it's not already set - if (attribute.TitleId == TitleId.Zero) + if (attribute.ProgramId == ProgramId.InvalidId) { - attribute.TitleId = new TitleId(context.Process.TitleId); + attribute.ProgramId = new ProgramId(context.Process.TitleId); } - Result result = _baseFileSystemProxy.OpenSaveDataFileSystem(out LibHac.Fs.IFileSystem fileSystem, spaceId, ref attribute); + Result result = _baseFileSystemProxy.OpenSaveDataFileSystem(out LibHac.Fs.Fsa.IFileSystem fileSystem, spaceId, ref attribute); if (result.IsSuccess()) { @@ -259,7 +259,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>(); - Result result = _baseFileSystemProxy.OpenSaveDataFileSystemBySystemSaveDataId(out LibHac.Fs.IFileSystem fileSystem, spaceId, ref attribute); + Result result = _baseFileSystemProxy.OpenSaveDataFileSystemBySystemSaveDataId(out LibHac.Fs.Fsa.IFileSystem fileSystem, spaceId, ref attribute); if (result.IsSuccess()) { @@ -278,12 +278,12 @@ namespace Ryujinx.HLE.HOS.Services.Fs // TODO: There's currently no program registry for FS to reference. // Workaround that by setting the application ID if it's not already set - if (attribute.TitleId == TitleId.Zero) + if (attribute.ProgramId == ProgramId.InvalidId) { - attribute.TitleId = new TitleId(context.Process.TitleId); + attribute.ProgramId = new ProgramId(context.Process.TitleId); } - Result result = _baseFileSystemProxy.OpenReadOnlySaveDataFileSystem(out LibHac.Fs.IFileSystem fileSystem, spaceId, ref attribute); + Result result = _baseFileSystemProxy.OpenReadOnlySaveDataFileSystem(out LibHac.Fs.Fsa.IFileSystem fileSystem, spaceId, ref attribute); if (result.IsSuccess()) { @@ -296,7 +296,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs [Command(60)] public ResultCode OpenSaveDataInfoReader(ServiceCtx context) { - Result result = _baseFileSystemProxy.OpenSaveDataInfoReader(out LibHac.FsService.ISaveDataInfoReader infoReader); + Result result = _baseFileSystemProxy.OpenSaveDataInfoReader(out ReferenceCountedDisposable<LibHac.FsSrv.ISaveDataInfoReader> infoReader); if (result.IsSuccess()) { @@ -311,7 +311,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadByte(); - Result result = _baseFileSystemProxy.OpenSaveDataInfoReaderBySaveDataSpaceId(out LibHac.FsService.ISaveDataInfoReader infoReader, spaceId); + Result result = _baseFileSystemProxy.OpenSaveDataInfoReaderBySaveDataSpaceId(out ReferenceCountedDisposable<LibHac.FsSrv.ISaveDataInfoReader> infoReader, spaceId); if (result.IsSuccess()) { @@ -326,12 +326,12 @@ namespace Ryujinx.HLE.HOS.Services.Fs { SaveDataFilter filter = new SaveDataFilter(); filter.SetSaveDataType(SaveDataType.Cache); - filter.SetProgramId(new TitleId(context.Process.TitleId)); + filter.SetProgramId(new ProgramId(context.Process.TitleId)); // FS would query the User and SdCache space IDs to find where the existing cache is (if any). // We always have the SD card inserted, so we can always use SdCache for now. Result result = _baseFileSystemProxy.OpenSaveDataInfoReaderBySaveDataSpaceId( - out LibHac.FsService.ISaveDataInfoReader infoReader, SaveDataSpaceId.SdCache); + out ReferenceCountedDisposable<LibHac.FsSrv.ISaveDataInfoReader> infoReader, SaveDataSpaceId.SdCache); if (result.IsSuccess()) { @@ -366,7 +366,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64(); SaveDataFilter filter = context.RequestData.ReadStruct<SaveDataFilter>(); - Result result = _baseFileSystemProxy.OpenSaveDataInfoReaderWithFilter(out LibHac.FsService.ISaveDataInfoReader infoReader, spaceId, ref filter); + Result result = _baseFileSystemProxy.OpenSaveDataInfoReaderWithFilter( + out ReferenceCountedDisposable<LibHac.FsSrv.ISaveDataInfoReader> infoReader, spaceId, ref filter); if (result.IsSuccess()) { @@ -478,7 +479,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenDataStorageByCurrentProcess() -> object<nn::fssrv::sf::IStorage> dataStorage public ResultCode OpenDeviceOperator(ServiceCtx context) { - Result result = _baseFileSystemProxy.OpenDeviceOperator(out LibHac.FsService.IDeviceOperator deviceOperator); + Result result = _baseFileSystemProxy.OpenDeviceOperator(out LibHac.FsSrv.IDeviceOperator deviceOperator); if (result.IsSuccess()) { @@ -558,7 +559,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenMultiCommitManager() -> object<nn::fssrv::sf::IMultiCommitManager> public ResultCode OpenMultiCommitManager(ServiceCtx context) { - Result result = _baseFileSystemProxy.OpenMultiCommitManager(out LibHac.FsService.IMultiCommitManager commitManager); + Result result = _baseFileSystemProxy.OpenMultiCommitManager(out LibHac.FsSrv.IMultiCommitManager commitManager); if (result.IsSuccess()) { diff --git a/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs b/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs index c26f54b6..0c8ba982 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IMultiCommitManager.cs @@ -5,9 +5,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs { class IMultiCommitManager : IpcService // 6.0.0+ { - private LibHac.FsService.IMultiCommitManager _baseCommitManager; + private LibHac.FsSrv.IMultiCommitManager _baseCommitManager; - public IMultiCommitManager(LibHac.FsService.IMultiCommitManager baseCommitManager) + public IMultiCommitManager(LibHac.FsSrv.IMultiCommitManager baseCommitManager) { _baseCommitManager = baseCommitManager; } diff --git a/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs b/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs index a76a7412..943dab98 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/ISaveDataInfoReader.cs @@ -1,12 +1,13 @@ -using LibHac; +using System; +using LibHac; namespace Ryujinx.HLE.HOS.Services.Fs { - class ISaveDataInfoReader : IpcService + class ISaveDataInfoReader : IpcService, IDisposable { - private LibHac.FsService.ISaveDataInfoReader _baseReader; + private ReferenceCountedDisposable<LibHac.FsSrv.ISaveDataInfoReader> _baseReader; - public ISaveDataInfoReader(LibHac.FsService.ISaveDataInfoReader baseReader) + public ISaveDataInfoReader(ReferenceCountedDisposable<LibHac.FsSrv.ISaveDataInfoReader> baseReader) { _baseReader = baseReader; } @@ -20,12 +21,17 @@ namespace Ryujinx.HLE.HOS.Services.Fs byte[] infoBuffer = new byte[bufferLen]; - Result result = _baseReader.ReadSaveDataInfo(out long readCount, infoBuffer); + Result result = _baseReader.Target.Read(out long readCount, infoBuffer); context.Memory.Write((ulong)bufferPosition, infoBuffer); context.ResponseData.Write(readCount); return (ResultCode)result.Value; } + + public void Dispose() + { + _baseReader.Dispose(); + } } } diff --git a/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs b/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs index fcb254ff..0fe6220c 100644 --- a/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs +++ b/Ryujinx.HLE/HOS/Services/Mii/MiiDatabaseManager.cs @@ -2,7 +2,6 @@ using LibHac.Common; using LibHac.Fs; using LibHac.Fs.Shim; -using LibHac.Ncm; using Ryujinx.HLE.HOS.Services.Mii.Types; using System.Runtime.CompilerServices; @@ -137,7 +136,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii { // TODO: We're currently always specifying the owner ID because FS doesn't have a way of // knowing which process called it - result = _filesystemClient.CreateSystemSaveData(targetSaveDataId, new TitleId(targetTitleId), 0x10000, 0x10000, SaveDataFlags.KeepAfterResettingSystemSaveDataWithoutUserSaveData); + result = _filesystemClient.CreateSystemSaveData(targetSaveDataId, targetTitleId, 0x10000, + 0x10000, SaveDataFlags.KeepAfterResettingSystemSaveDataWithoutUserSaveData); if (result.IsFailure()) return result; result = _filesystemClient.MountSystemSaveData(mountName, SaveDataSpaceId.System, targetSaveDataId); diff --git a/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs b/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs index 2ccebede..7db4ab34 100644 --- a/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs +++ b/Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs @@ -73,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types private ReadOnlySpan<byte> AsSpan() { - return MemoryMarshal.AsBytes(SpanHelpers.CreateReadOnlySpan(ref this, 1)); + return MemoryMarshal.AsBytes(SpanHelpers.CreateReadOnlySpan(in this, 1)); } private ReadOnlySpan<byte> AsSpanWithoutCrc() diff --git a/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs b/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs index da7ffa86..c41e6618 100644 --- a/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs @@ -1,6 +1,7 @@ using LibHac; using LibHac.Common; using LibHac.Fs; +using LibHac.Fs.Fsa; using LibHac.FsSystem; using LibHac.FsSystem.NcaUtils; using Ryujinx.Common.Logging; diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs index 26a354da..b66ffc3f 100644 --- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs @@ -1,6 +1,7 @@ using LibHac; using LibHac.Common; using LibHac.Fs; +using LibHac.Fs.Fsa; using LibHac.FsSystem; using LibHac.FsSystem.NcaUtils; using Ryujinx.Common.Logging; |