diff --git a/src/LibHac/FsService/Creators/EmulatedSdFileSystemCreator.cs b/src/LibHac/FsService/Creators/EmulatedSdFileSystemCreator.cs index 8000510d..aee47b1a 100644 --- a/src/LibHac/FsService/Creators/EmulatedSdFileSystemCreator.cs +++ b/src/LibHac/FsService/Creators/EmulatedSdFileSystemCreator.cs @@ -3,20 +3,26 @@ using LibHac.Fs; namespace LibHac.FsService.Creators { - class EmulatedSdFileSystemCreator : ISdFileSystemCreator + public class EmulatedSdFileSystemCreator : ISdFileSystemCreator { private const string DefaultPath = "/sdcard"; - public IFileSystem RootFileSystem { get; set; } - public string Path { get; set; } + private IFileSystem RootFileSystem { get; } + private string Path { get; } - public IFileSystem SdCardFileSystem { get; set; } + private IFileSystem SdCardFileSystem { get; set; } public EmulatedSdFileSystemCreator(IFileSystem rootFileSystem) { RootFileSystem = rootFileSystem; } + public EmulatedSdFileSystemCreator(IFileSystem rootFileSystem, string path) + { + RootFileSystem = rootFileSystem; + Path = path; + } + public Result Create(out IFileSystem fileSystem) { fileSystem = default; @@ -37,7 +43,13 @@ namespace LibHac.FsService.Creators // Todo: Add ProxyFileSystem? - return Util.CreateSubFileSystem(out fileSystem, RootFileSystem, path, true); + Result rc = Util.CreateSubFileSystem(out IFileSystem sdFileSystem, RootFileSystem, path, true); + if (rc.IsFailure()) return rc; + + SdCardFileSystem = sdFileSystem; + fileSystem = sdFileSystem; + + return Result.Success; } public Result Format(bool closeOpenEntries) diff --git a/src/LibHac/FsService/EmulatedDeviceOperator.cs b/src/LibHac/FsService/EmulatedDeviceOperator.cs index 5e529756..e1378f96 100644 --- a/src/LibHac/FsService/EmulatedDeviceOperator.cs +++ b/src/LibHac/FsService/EmulatedDeviceOperator.cs @@ -3,7 +3,7 @@ using LibHac.Fs; namespace LibHac.FsService { - class EmulatedDeviceOperator : IDeviceOperator + public class EmulatedDeviceOperator : IDeviceOperator { private EmulatedGameCard GameCard { get; set; } diff --git a/src/hactoolnet/ProcessNca.cs b/src/hactoolnet/ProcessNca.cs index 9a078e85..169d19d4 100644 --- a/src/hactoolnet/ProcessNca.cs +++ b/src/hactoolnet/ProcessNca.cs @@ -234,9 +234,9 @@ namespace hactoolnet PrintItem(sb, colLen, "TitleID:", $"{nca.Header.TitleId:X16}"); if (nca.CanOpenSection(NcaSectionType.Code)) { IFileSystem fs = nca.OpenFileSystem(NcaSectionType.Code, IntegrityCheckLevel.None); - Result r = fs.OpenFile(out var file, "/main.npdm", OpenMode.Read); + Result r = fs.OpenFile(out IFile file, "/main.npdm", OpenMode.Read); if (r.IsSuccess()) { - NpdmBinary npdm = new NpdmBinary(file.AsStream(), null); + var npdm = new NpdmBinary(file.AsStream(), null); PrintItem(sb, colLen, "Title Name:", npdm.TitleName); } }