From e5291eb06aa7931a8e73efc32403a1e8c30516de Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Fri, 29 Jan 2021 01:03:23 -0700 Subject: [PATCH] Fix IFatFileSystemCreator --- src/LibHac/Fat/FatAttribute.cs | 9 +++++++++ src/LibHac/Fat/FatFormatParam.cs | 12 ++++++++++++ src/LibHac/FsSrv/Creators/IFatFileSystemCreator.cs | 10 ++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/LibHac/Fat/FatAttribute.cs create mode 100644 src/LibHac/Fat/FatFormatParam.cs diff --git a/src/LibHac/Fat/FatAttribute.cs b/src/LibHac/Fat/FatAttribute.cs new file mode 100644 index 00000000..4019b8f2 --- /dev/null +++ b/src/LibHac/Fat/FatAttribute.cs @@ -0,0 +1,9 @@ +namespace LibHac.Fat +{ + public struct FatAttribute + { + public bool IsFatSafeEnabled; + public bool IsFatFormatNormalized; + public bool IsTimeStampUpdated; + } +} diff --git a/src/LibHac/Fat/FatFormatParam.cs b/src/LibHac/Fat/FatFormatParam.cs new file mode 100644 index 00000000..e6106fde --- /dev/null +++ b/src/LibHac/Fat/FatFormatParam.cs @@ -0,0 +1,12 @@ +using System; + +namespace LibHac.Fat +{ + public struct FatFormatParam + { + public bool IsSdCard; + public uint ProtectedAreaSectors; + public Result WriteVerifyErrorResult; + public Memory WorkBuffer; + } +} diff --git a/src/LibHac/FsSrv/Creators/IFatFileSystemCreator.cs b/src/LibHac/FsSrv/Creators/IFatFileSystemCreator.cs index 82d19238..6ecf6d38 100644 --- a/src/LibHac/FsSrv/Creators/IFatFileSystemCreator.cs +++ b/src/LibHac/FsSrv/Creators/IFatFileSystemCreator.cs @@ -1,10 +1,16 @@ -using LibHac.Fs; +using LibHac.Fat; +using LibHac.Fs; using LibHac.Fs.Fsa; namespace LibHac.FsSrv.Creators { public interface IFatFileSystemCreator { - Result Create(out IFileSystem fileSystem, IStorage baseStorage); + Result Create(out ReferenceCountedDisposable fileSystem, + ReferenceCountedDisposable baseStorage, FatAttribute attribute, int driveId, + Result invalidFatFormatResult, Result usableSpaceNotEnoughResult); + + Result Format(ReferenceCountedDisposable partitionStorage, FatAttribute attribute, + FatFormatParam formatParam, int driveId, Result invalidFatFormatResult, Result usableSpaceNotEnoughResult); } } \ No newline at end of file