diff --git a/src/LibHac/FsSrv/FileSystemProxyImpl.cs b/src/LibHac/FsSrv/FileSystemProxyImpl.cs index 0299f61d..72d5f91c 100644 --- a/src/LibHac/FsSrv/FileSystemProxyImpl.cs +++ b/src/LibHac/FsSrv/FileSystemProxyImpl.cs @@ -55,9 +55,9 @@ internal struct FileSystemProxyImplGlobals } /// -/// Dispatches calls to the main file system service interface. +/// Dispatches calls to the various file system service objects. /// -/// Based on FS 12.1.0 (nnSdk 12.3.1) +/// Based on FS 13.1.0 (nnSdk 13.4.0) public class FileSystemProxyImpl : IFileSystemProxy, IFileSystemProxyForLoader { private FileSystemProxyCoreImpl _fsProxyCore; @@ -251,6 +251,15 @@ public class FileSystemProxyImpl : IFileSystemProxy, IFileSystemProxyForLoader return ncaFsService.OpenDataStorageByDataId(ref outStorage, dataId, storageId); } + public Result OpenDataStorageByPath(ref SharedRef outFileSystem, in FspPath path, + FileSystemProxyType fsType) + { + Result rc = GetNcaFileSystemService(out NcaFileSystemService ncaFsService); + if (rc.IsFailure()) return rc; + + return ncaFsService.OpenDataStorageByPath(ref outFileSystem, in path, fsType); + } + public Result OpenPatchDataStorageByCurrentProcess(ref SharedRef outStorage) { return ResultFs.TargetNotFound.Log(); diff --git a/src/LibHac/FsSrv/NcaFileSystemService.cs b/src/LibHac/FsSrv/NcaFileSystemService.cs index d067160e..c0f025db 100644 --- a/src/LibHac/FsSrv/NcaFileSystemService.cs +++ b/src/LibHac/FsSrv/NcaFileSystemService.cs @@ -178,6 +178,12 @@ internal class NcaFileSystemService : IRomFileSystemAccessFailureManager throw new NotImplementedException(); } + public Result OpenDataStorageByPath(ref SharedRef outFileSystem, in FspPath path, + FileSystemProxyType fsType) + { + throw new NotImplementedException(); + } + private Result TryAcquireAddOnContentOpenCountSemaphore(ref UniqueRef outSemaphoreLock) { throw new NotImplementedException(); diff --git a/src/LibHac/FsSrv/Sf/IFileSystemProxy.cs b/src/LibHac/FsSrv/Sf/IFileSystemProxy.cs index 8a179974..c04a7be0 100644 --- a/src/LibHac/FsSrv/Sf/IFileSystemProxy.cs +++ b/src/LibHac/FsSrv/Sf/IFileSystemProxy.cs @@ -10,6 +10,10 @@ using IStorageSf = LibHac.FsSrv.Sf.IStorage; namespace LibHac.FsSrv.Sf; +/// +/// The interface most programs use to interact with the FS service. +/// +/// Based on FS 13.1.0 (nnSdk 13.4.0) public interface IFileSystemProxy : IDisposable { Result SetCurrentProcess(ulong processId); @@ -74,6 +78,7 @@ public interface IFileSystemProxy : IDisposable Result OpenDataStorageByDataId(ref SharedRef outStorage, DataId dataId, StorageId storageId); Result OpenPatchDataStorageByCurrentProcess(ref SharedRef outStorage); Result OpenDataFileSystemWithProgramIndex(ref SharedRef outFileSystem, byte programIndex); + Result OpenDataStorageByPath(ref SharedRef outFileSystem, in FspPath path, FileSystemProxyType fsType); Result OpenDataStorageWithProgramIndex(ref SharedRef outStorage, byte programIndex); Result OpenDeviceOperator(ref SharedRef outDeviceOperator); Result OpenSdCardDetectionEventNotifier(ref SharedRef outEventNotifier);