diff --git a/build/CodeGen/results.csv b/build/CodeGen/results.csv index 86b52cd1..c26e8a7f 100644 --- a/build/CodeGen/results.csv +++ b/build/CodeGen/results.csv @@ -1,16 +1,20 @@ Module,DescriptionStart,DescriptionEnd,Name +2,0,999,HandledByAllProcess 2,1,,PathNotFound 2,2,,PathAlreadyExists 2,7,,TargetLocked 2,8,,DirectoryNotEmpty +2,13,,DirectoryStatusChanged 2,30,45,InsufficientFreeSpace +2,31,,UsableSpaceNotEnoughForSaveData 2,34,38,InsufficientFreeSpaceBis 2,35,,InsufficientFreeSpaceBisCalibration 2,36,,InsufficientFreeSpaceBisSafe 2,37,,InsufficientFreeSpaceBisUser 2,38,,InsufficientFreeSpaceBisSystem 2,39,,InsufficientFreeSpaceSdCard +2,50,,UnsupportedSdkVersion 2,60,,MountNameAlreadyExists 2,1001,,PartitionNotFound @@ -48,6 +52,12 @@ Module,DescriptionStart,DescriptionEnd,Name 2,4001,4299,RomCorrupted 2,4023,,InvalidIndirectStorageSource +2,4241,4259,RomHostFileSystemCorrupted +2,4242,,RomHostEntryCorrupted +2,4243,,RomHostFileDataCorrupted +2,4244,,RomHostFileCorrupted +2,4245,,InvalidRomHostHandle + 2,4301,4499,SaveDataCorrupted 2,4302,, 2,4303,,InvalidSaveDataEntryType @@ -60,6 +70,12 @@ Module,DescriptionStart,DescriptionEnd,Name 2,4402,, 2,4427,, +2,4441,4459,SaveDataHostFileSystemCorrupted +2,4442,,SaveDataHostEntryCorrupted +2,4443,,SaveDataHostFileDataCorrupted +2,4444,,SaveDataHostFileCorrupted +2,4445,,InvalidSaveDataHostHandle + 2,4462,,SaveDataAllocationTableCorrupted 2,4463,,SaveDataFileTableCorrupted 2,4464,,AllocationTableIteratedRangeEntry @@ -84,7 +100,12 @@ Module,DescriptionStart,DescriptionEnd,Name 2,4662,, 2,4681,4699,FatFileSystemCorrupted + 2,4701,4719,HostFileSystemCorrupted +2,4702,,HostEntryCorrupted +2,4703,,HostFileDataCorrupted +2,4704,,HostFileCorrupted +2,4705,,InvalidHostHandle 2,4721,4739,DatabaseCorrupted 2,4722,,SaveDataAllocationTableCorruptedInternal @@ -113,9 +134,9 @@ Module,DescriptionStart,DescriptionEnd,Name 2,5309,,UnknownHostFileSystemError 2,5320,,InvalidNcaMountPoint -2,6000,,PreconditionViolation -2,6001,,InvalidArgument -2,6002,,InvalidPath +2,6000,6499,PreconditionViolation +2,6001,6199,InvalidArgument +2,6002,6029,InvalidPath 2,6003,,TooLongPath 2,6004,,InvalidCharacter 2,6005,,InvalidPathFormat @@ -171,7 +192,7 @@ Module,DescriptionStart,DescriptionEnd,Name 2,6452,,ExternalKeyAlreadyRegistered 2,6454,,WriteStateUnflushed -2,6457,,WritableFileOpen +2,6457,,WriteModeFileNotClosed 2,6461,,AllocatorAlignmentViolation 2,6465,,UserNotExist @@ -196,4 +217,29 @@ Module,DescriptionStart,DescriptionEnd,Name 20,6,,BufferInsufficient 24,1,,DeviceNotFound -24,4,,DeviceAsleep \ No newline at end of file +24,4,,DeviceAsleep + +123,0,4999,SslService + +124,0,,Cancelled +124,1,,CancelledByUser +124,100,,UserNotExist +124,200,269,NetworkServiceAccountUnavailable +124,430,499,TokenCacheUnavailable +124,3000,8191,NetworkCommunicationError + +202,140,149,Invalid +202,601,,DualConnected +202,602,,SameJoyTypeConnected +202,603,,ColorNotAvailable +202,604,,ControllerNotConnected +202,3101,,Canceled +202,3102,,NotSupportedNpadStyle +202,3200,3209,ControllerFirmwareUpdateError +202,3201,,ControllerFirmwareUpdateFailed + +205,110,119,IrsensorUnavailable +205,110,,IrsensorUnconnected +205,111,,IrsensorUnsupported +205,120,,IrsensorNotReady +205,122,139,IrsensorDeviceError \ No newline at end of file diff --git a/src/LibHac/Fs/Accessors/FileSystemAccessor.cs b/src/LibHac/Fs/Accessors/FileSystemAccessor.cs index abe91a07..22bc24f4 100644 --- a/src/LibHac/Fs/Accessors/FileSystemAccessor.cs +++ b/src/LibHac/Fs/Accessors/FileSystemAccessor.cs @@ -138,7 +138,7 @@ namespace LibHac.Fs.Accessors { if (OpenFiles.Any(x => (x.OpenMode & OpenMode.Write) != 0)) { - return ResultFs.WritableFileOpen.Log(); + return ResultFs.WriteModeFileNotClosed.Log(); } return FileSystem.Commit(); diff --git a/src/LibHac/Fs/ResultFs.cs b/src/LibHac/Fs/ResultFs.cs index a4d5366b..07b45851 100644 --- a/src/LibHac/Fs/ResultFs.cs +++ b/src/LibHac/Fs/ResultFs.cs @@ -6,17 +6,21 @@ namespace LibHac.Fs { public const int ModuleFs = 2; + public static Result.Base HandledByAllProcess => new Result.Base(ModuleFs, 0, 999); public static Result.Base PathNotFound => new Result.Base(ModuleFs, 1); public static Result.Base PathAlreadyExists => new Result.Base(ModuleFs, 2); public static Result.Base TargetLocked => new Result.Base(ModuleFs, 7); public static Result.Base DirectoryNotEmpty => new Result.Base(ModuleFs, 8); + public static Result.Base DirectoryStatusChanged => new Result.Base(ModuleFs, 13); public static Result.Base InsufficientFreeSpace => new Result.Base(ModuleFs, 30, 45); + public static Result.Base UsableSpaceNotEnoughForSaveData => new Result.Base(ModuleFs, 31); public static Result.Base InsufficientFreeSpaceBis => new Result.Base(ModuleFs, 34, 38); public static Result.Base InsufficientFreeSpaceBisCalibration => new Result.Base(ModuleFs, 35); public static Result.Base InsufficientFreeSpaceBisSafe => new Result.Base(ModuleFs, 36); public static Result.Base InsufficientFreeSpaceBisUser => new Result.Base(ModuleFs, 37); public static Result.Base InsufficientFreeSpaceBisSystem => new Result.Base(ModuleFs, 38); public static Result.Base InsufficientFreeSpaceSdCard => new Result.Base(ModuleFs, 39); + public static Result.Base UnsupportedSdkVersion => new Result.Base(ModuleFs, 50); public static Result.Base MountNameAlreadyExists => new Result.Base(ModuleFs, 60); public static Result.Base PartitionNotFound => new Result.Base(ModuleFs, 1001); public static Result.Base TargetNotFound => new Result.Base(ModuleFs, 1002); @@ -46,6 +50,11 @@ namespace LibHac.Fs public static Result.Base DataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4000, 4999); } public static Result.Base RomCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4001, 4299); } public static Result.Base InvalidIndirectStorageSource => new Result.Base(ModuleFs, 4023); + public static Result.Base RomHostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4241, 4259); } + public static Result.Base RomHostEntryCorrupted => new Result.Base(ModuleFs, 4242); + public static Result.Base RomHostFileDataCorrupted => new Result.Base(ModuleFs, 4243); + public static Result.Base RomHostFileCorrupted => new Result.Base(ModuleFs, 4244); + public static Result.Base InvalidRomHostHandle => new Result.Base(ModuleFs, 4245); public static Result.Base SaveDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4301, 4499); } public static Result.Base Result4302 => new Result.Base(ModuleFs, 4302); public static Result.Base InvalidSaveDataEntryType => new Result.Base(ModuleFs, 4303); @@ -57,6 +66,11 @@ namespace LibHac.Fs public static Result.Base InvalidHashInSaveIvfcTopLayer => new Result.Base(ModuleFs, 4373); public static Result.Base Result4402 => new Result.Base(ModuleFs, 4402); public static Result.Base Result4427 => new Result.Base(ModuleFs, 4427); + public static Result.Base SaveDataHostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4441, 4459); } + public static Result.Base SaveDataHostEntryCorrupted => new Result.Base(ModuleFs, 4442); + public static Result.Base SaveDataHostFileDataCorrupted => new Result.Base(ModuleFs, 4443); + public static Result.Base SaveDataHostFileCorrupted => new Result.Base(ModuleFs, 4444); + public static Result.Base InvalidSaveDataHostHandle => new Result.Base(ModuleFs, 4445); public static Result.Base SaveDataAllocationTableCorrupted => new Result.Base(ModuleFs, 4462); public static Result.Base SaveDataFileTableCorrupted => new Result.Base(ModuleFs, 4463); public static Result.Base AllocationTableIteratedRangeEntry => new Result.Base(ModuleFs, 4464); @@ -77,6 +91,10 @@ namespace LibHac.Fs public static Result.Base Result4662 => new Result.Base(ModuleFs, 4662); public static Result.Base FatFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4681, 4699); } public static Result.Base HostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4701, 4719); } + public static Result.Base HostEntryCorrupted => new Result.Base(ModuleFs, 4702); + public static Result.Base HostFileDataCorrupted => new Result.Base(ModuleFs, 4703); + public static Result.Base HostFileCorrupted => new Result.Base(ModuleFs, 4704); + public static Result.Base InvalidHostHandle => new Result.Base(ModuleFs, 4705); public static Result.Base DatabaseCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4721, 4739); } public static Result.Base SaveDataAllocationTableCorruptedInternal => new Result.Base(ModuleFs, 4722); public static Result.Base SaveDataFileTableCorruptedInternal => new Result.Base(ModuleFs, 4723); @@ -99,9 +117,9 @@ namespace LibHac.Fs public static Result.Base UnexpectedErrorInHostFileGetSize => new Result.Base(ModuleFs, 5308); public static Result.Base UnknownHostFileSystemError => new Result.Base(ModuleFs, 5309); public static Result.Base InvalidNcaMountPoint => new Result.Base(ModuleFs, 5320); - public static Result.Base PreconditionViolation => new Result.Base(ModuleFs, 6000); - public static Result.Base InvalidArgument => new Result.Base(ModuleFs, 6001); - public static Result.Base InvalidPath => new Result.Base(ModuleFs, 6002); + public static Result.Base PreconditionViolation { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6000, 6499); } + public static Result.Base InvalidArgument { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6001, 6199); } + public static Result.Base InvalidPath { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6002, 6029); } public static Result.Base TooLongPath => new Result.Base(ModuleFs, 6003); public static Result.Base InvalidCharacter => new Result.Base(ModuleFs, 6004); public static Result.Base InvalidPathFormat => new Result.Base(ModuleFs, 6005); @@ -150,7 +168,7 @@ namespace LibHac.Fs public static Result.Base PermissionDenied { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6400, 6449); } public static Result.Base ExternalKeyAlreadyRegistered => new Result.Base(ModuleFs, 6452); public static Result.Base WriteStateUnflushed => new Result.Base(ModuleFs, 6454); - public static Result.Base WritableFileOpen => new Result.Base(ModuleFs, 6457); + public static Result.Base WriteModeFileNotClosed => new Result.Base(ModuleFs, 6457); public static Result.Base AllocatorAlignmentViolation => new Result.Base(ModuleFs, 6461); public static Result.Base UserNotExist => new Result.Base(ModuleFs, 6465); public static Result.Base EntryNotFound { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6600, 6699); } diff --git a/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs b/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs index aa0d2d1a..4eea8b81 100644 --- a/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs +++ b/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs @@ -215,7 +215,7 @@ namespace LibHac.FsSystem if (OpenWritableFileCount > 0) { // All files must be closed before commiting save data. - return ResultFs.WritableFileOpen.Log(); + return ResultFs.WriteModeFileNotClosed.Log(); } // Get rid of the previous commit by renaming the folder