Add names to Results missing them

This commit is contained in:
Alex Barney 2020-02-27 22:45:45 -07:00
parent 14dd2190a5
commit 24f293c27a
5 changed files with 56 additions and 50 deletions

View file

@ -35,7 +35,7 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
2,2961,,InvalidGameCardHandleOnOpenSecurePartition,
2,3001,,NotImplemented,
2,3002,,,
2,3002,,UnsupportedVersion,
2,3003,,SaveDataPathAlreadyExists,
2,3005,,OutOfRange,
@ -59,17 +59,17 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
2,4245,,InvalidRomHostHandle,
2,4301,4499,SaveDataCorrupted,
2,4302,,,
2,4302,,UnsupportedSaveVersion,
2,4303,,InvalidSaveDataEntryType,
2,4315,,InvalidSaveDataHeader,
2,4362,,,
2,4363,,,
2,4364,,InvalidHashInSaveIvfc,
2,4372,,SaveIvfcHashIsEmpty,
2,4373,,InvalidHashInSaveIvfcTopLayer,
2,4362,,InvalidSaveDataIvfcMagic,
2,4363,,InvalidSaveDataIvfcHashValidationBit,
2,4364,,InvalidSaveDataIvfcHash,
2,4372,,EmptySaveDataIvfcHash,
2,4373,,InvalidSaveDataHashInIvfcTopLayer,
2,4402,,,
2,4427,,,
2,4402,,SaveDataInvalidGptPartitionSignature,
2,4427,,IncompleteBlockInZeroBitmapHashStorageFileSaveData,
2,4441,4459,SaveDataHostFileSystemCorrupted,
2,4442,,SaveDataHostEntryCorrupted,
2,4443,,SaveDataHostFileDataCorrupted,
@ -83,10 +83,10 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
2,4501,4599,NcaCorrupted,
2,4601,4639,IntegrityVerificationStorageCorrupted,
2,4602,,,
2,4603,,,
2,4604,,InvalidHashInIvfc,
2,4612,,IvfcHashIsEmpty,
2,4602,,InvalidIvfcMagic,
2,4603,,InvalidIvfcHashValidationBit,
2,4604,,InvalidIvfcHash,
2,4612,,EmptyIvfcHash,
2,4613,,InvalidHashInIvfcTopLayer,
2,4641,4659,PartitionFileSystemCorrupted,
@ -97,7 +97,7 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
2,4646,,InvalidPartitionFileSystemEntryNameOffset,
2,4661,4679,BuiltInStorageCorrupted,
2,4662,,,
2,4662,,InvalidGptPartitionSignature,
2,4681,4699,FatFileSystemCorrupted,
@ -125,8 +125,9 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
2,4771,4779,SignedSystemPartitionDataCorrupted,
2,4781,,GameCardLogoDataCorrupted,
2,4811,4819,,
2,4812,,,
# The range name is a guess. 4812 is currently the only result in it
2,4811,4819,ZeroBitmapFileCorrupted,
2,4812,,IncompleteBlockInZeroBitmapHashStorageFile,
2,5000,5999,Unexpected,
2,5307,,UnexpectedErrorInHostFileFlush,
@ -197,6 +198,7 @@ Module,DescriptionStart,DescriptionEnd,Name,Summary
2,6465,,UserNotExist,
2,6600,6699,EntryNotFound,
2,6606,,TargetProgramIndexNotFound,Specified program index is not found
2,6700,6799,OutOfResource,
2,6706,,MappingTableFull,
2,6707,,AllocationTableInsufficientFreeBlocks,

1 Module,DescriptionStart,DescriptionEnd,Name,Summary
35 2,3005,,OutOfRange,
36 2,3200,3499,AllocationMemoryFailed,
37 2,3312,,AesXtsFileFileStorageAllocationError,
38 2,3313,,AesXtsFileXtsStorageAllocationError,
39 2,3314,,AesXtsFileAlignmentStorageAllocationError,
40 2,3315,,AesXtsFileStorageFileAllocationError,
41 2,3383,,AesXtsFileSubStorageAllocationError,
59 2,4373,,InvalidHashInSaveIvfcTopLayer, 2,4373,,InvalidSaveDataHashInIvfcTopLayer,
60 2,4402,,, 2,4402,,SaveDataInvalidGptPartitionSignature,
61 2,4427,,, 2,4427,,IncompleteBlockInZeroBitmapHashStorageFileSaveData,
62 2,4441,4459,SaveDataHostFileSystemCorrupted,
63 2,4442,,SaveDataHostEntryCorrupted,
64 2,4443,,SaveDataHostFileDataCorrupted,
65 2,4444,,SaveDataHostFileCorrupted,
66 2,4445,,InvalidSaveDataHostHandle,
67 2,4462,,SaveDataAllocationTableCorrupted,
68 2,4463,,SaveDataFileTableCorrupted,
69 2,4464,,AllocationTableIteratedRangeEntry,
70 2,4501,4599,NcaCorrupted,
71 2,4601,4639,IntegrityVerificationStorageCorrupted,
72 2,4602,,, 2,4602,,InvalidIvfcMagic,
73 2,4603,,, 2,4603,,InvalidIvfcHashValidationBit,
74 2,4604,,InvalidHashInIvfc, 2,4604,,InvalidIvfcHash,
75 2,4612,,IvfcHashIsEmpty, 2,4612,,EmptyIvfcHash,
83 2,4661,4679,BuiltInStorageCorrupted,
84 2,4662,,, 2,4662,,InvalidGptPartitionSignature,
85 2,4681,4699,FatFileSystemCorrupted,
86 2,4701,4719,HostFileSystemCorrupted,
87 2,4702,,HostEntryCorrupted,
88 2,4703,,HostFileDataCorrupted,
89 2,4704,,HostFileCorrupted,
90 2,4705,,InvalidHostHandle,
91 2,4721,4739,DatabaseCorrupted,
92 2,4722,,SaveDataAllocationTableCorruptedInternal,
97 2,4743,,AesXtsFileHeaderInvalidKeys,
98 2,4744,,AesXtsFileHeaderInvalidMagic,
99 2,4745,,AesXtsFileTooShort,
100 2,4746,,AesXtsFileHeaderTooShortInSetSize,
101 2,4747,,AesXtsFileHeaderInvalidKeysInRenameFile,
102 2,4748,,AesXtsFileHeaderInvalidKeysInSetSize,
103 2,4761,4769,SaveDataTransferDataCorrupted,
125 2,6034,,DifferentDestFileSystem, 2,6033,,PathNotFoundInSaveDataFileTable,
126 2,6061,,InvalidOffset, 2,6034,,DifferentDestFileSystem,
127 2,6062,,InvalidSize, 2,6061,,InvalidOffset,
128 2,6063,,NullArgument, 2,6062,,InvalidSize,
129 2,6065,,InvalidMountName, 2,6063,,NullArgument,
130 2,6065,,InvalidMountName,
131 2,6066,,ExtensionSizeTooLarge,
132 2,6067,,ExtensionSizeInvalid,
133 2,6068,,ReadOldSaveDataInfoReader,
198 202,3101,,Canceled, 202,604,,ControllerNotConnected,
199 202,3102,,NotSupportedNpadStyle, 202,3101,,Canceled,
200 202,3200,3209,ControllerFirmwareUpdateError, 202,3102,,NotSupportedNpadStyle,
201 202,3200,3209,ControllerFirmwareUpdateError,
202 202,3201,,ControllerFirmwareUpdateFailed,
203 205,110,119,IrsensorUnavailable,
204 205,110,,IrsensorUnconnected,

View file

@ -88,7 +88,7 @@ namespace LibHac.Fs
/// <summary>Error code: 2002-3001; Inner value: 0x177202</summary>
public static Result.Base NotImplemented => new Result.Base(ModuleFs, 3001);
/// <summary>Error code: 2002-3002; Inner value: 0x177402</summary>
public static Result.Base Result3002 => new Result.Base(ModuleFs, 3002);
public static Result.Base UnsupportedVersion => new Result.Base(ModuleFs, 3002);
/// <summary>Error code: 2002-3003; Inner value: 0x177602</summary>
public static Result.Base SaveDataPathAlreadyExists => new Result.Base(ModuleFs, 3003);
/// <summary>Error code: 2002-3005; Inner value: 0x177a02</summary>
@ -131,25 +131,25 @@ namespace LibHac.Fs
/// <summary>Error code: 2002-4301; Range: 4301-4499; Inner value: 0x219a02</summary>
public static Result.Base SaveDataCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4301, 4499); }
/// <summary>Error code: 2002-4302; Inner value: 0x219c02</summary>
public static Result.Base Result4302 => new Result.Base(ModuleFs, 4302);
public static Result.Base UnsupportedSaveVersion => new Result.Base(ModuleFs, 4302);
/// <summary>Error code: 2002-4303; Inner value: 0x219e02</summary>
public static Result.Base InvalidSaveDataEntryType => new Result.Base(ModuleFs, 4303);
/// <summary>Error code: 2002-4315; Inner value: 0x21b602</summary>
public static Result.Base InvalidSaveDataHeader => new Result.Base(ModuleFs, 4315);
/// <summary>Error code: 2002-4362; Inner value: 0x221402</summary>
public static Result.Base Result4362 => new Result.Base(ModuleFs, 4362);
public static Result.Base InvalidSaveDataIvfcMagic => new Result.Base(ModuleFs, 4362);
/// <summary>Error code: 2002-4363; Inner value: 0x221602</summary>
public static Result.Base Result4363 => new Result.Base(ModuleFs, 4363);
public static Result.Base InvalidSaveDataIvfcHashValidationBit => new Result.Base(ModuleFs, 4363);
/// <summary>Error code: 2002-4364; Inner value: 0x221802</summary>
public static Result.Base InvalidHashInSaveIvfc => new Result.Base(ModuleFs, 4364);
public static Result.Base InvalidSaveDataIvfcHash => new Result.Base(ModuleFs, 4364);
/// <summary>Error code: 2002-4372; Inner value: 0x222802</summary>
public static Result.Base SaveIvfcHashIsEmpty => new Result.Base(ModuleFs, 4372);
public static Result.Base EmptySaveDataIvfcHash => new Result.Base(ModuleFs, 4372);
/// <summary>Error code: 2002-4373; Inner value: 0x222a02</summary>
public static Result.Base InvalidHashInSaveIvfcTopLayer => new Result.Base(ModuleFs, 4373);
public static Result.Base InvalidSaveDataHashInIvfcTopLayer => new Result.Base(ModuleFs, 4373);
/// <summary>Error code: 2002-4402; Inner value: 0x226402</summary>
public static Result.Base Result4402 => new Result.Base(ModuleFs, 4402);
public static Result.Base SaveDataInvalidGptPartitionSignature => new Result.Base(ModuleFs, 4402);
/// <summary>Error code: 2002-4427; Inner value: 0x229602</summary>
public static Result.Base Result4427 => new Result.Base(ModuleFs, 4427);
public static Result.Base IncompleteBlockInZeroBitmapHashStorageFileSaveData => new Result.Base(ModuleFs, 4427);
/// <summary>Error code: 2002-4441; Range: 4441-4459; Inner value: 0x22b202</summary>
public static Result.Base SaveDataHostFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4441, 4459); }
@ -175,13 +175,13 @@ namespace LibHac.Fs
/// <summary>Error code: 2002-4601; Range: 4601-4639; Inner value: 0x23f202</summary>
public static Result.Base IntegrityVerificationStorageCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4601, 4639); }
/// <summary>Error code: 2002-4602; Inner value: 0x23f402</summary>
public static Result.Base Result4602 => new Result.Base(ModuleFs, 4602);
public static Result.Base InvalidIvfcMagic => new Result.Base(ModuleFs, 4602);
/// <summary>Error code: 2002-4603; Inner value: 0x23f602</summary>
public static Result.Base Result4603 => new Result.Base(ModuleFs, 4603);
public static Result.Base InvalidIvfcHashValidationBit => new Result.Base(ModuleFs, 4603);
/// <summary>Error code: 2002-4604; Inner value: 0x23f802</summary>
public static Result.Base InvalidHashInIvfc => new Result.Base(ModuleFs, 4604);
public static Result.Base InvalidIvfcHash => new Result.Base(ModuleFs, 4604);
/// <summary>Error code: 2002-4612; Inner value: 0x240802</summary>
public static Result.Base IvfcHashIsEmpty => new Result.Base(ModuleFs, 4612);
public static Result.Base EmptyIvfcHash => new Result.Base(ModuleFs, 4612);
/// <summary>Error code: 2002-4613; Inner value: 0x240a02</summary>
public static Result.Base InvalidHashInIvfcTopLayer => new Result.Base(ModuleFs, 4613);
@ -201,7 +201,7 @@ namespace LibHac.Fs
/// <summary>Error code: 2002-4661; Range: 4661-4679; Inner value: 0x246a02</summary>
public static Result.Base BuiltInStorageCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4661, 4679); }
/// <summary>Error code: 2002-4662; Inner value: 0x246c02</summary>
public static Result.Base Result4662 => new Result.Base(ModuleFs, 4662);
public static Result.Base InvalidGptPartitionSignature => new Result.Base(ModuleFs, 4662);
/// <summary>Error code: 2002-4681; Range: 4681-4699; Inner value: 0x249202</summary>
public static Result.Base FatFileSystemCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4681, 4699); }
@ -253,9 +253,9 @@ namespace LibHac.Fs
public static Result.Base GameCardLogoDataCorrupted => new Result.Base(ModuleFs, 4781);
/// <summary>Error code: 2002-4811; Range: 4811-4819; Inner value: 0x259602</summary>
public static Result.Base Range4811To4819 { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4811, 4819); }
public static Result.Base ZeroBitmapFileCorrupted { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 4811, 4819); }
/// <summary>Error code: 2002-4812; Inner value: 0x259802</summary>
public static Result.Base Result4812 => new Result.Base(ModuleFs, 4812);
public static Result.Base IncompleteBlockInZeroBitmapHashStorageFile => new Result.Base(ModuleFs, 4812);
/// <summary>Error code: 2002-5000; Range: 5000-5999; Inner value: 0x271002</summary>
public static Result.Base Unexpected { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 5000, 5999); }
@ -386,6 +386,8 @@ namespace LibHac.Fs
/// <summary>Error code: 2002-6600; Range: 6600-6699; Inner value: 0x339002</summary>
public static Result.Base EntryNotFound { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6600, 6699); }
/// <summary>Specified program index is not found<br/>Error code: 2002-6606; Inner value: 0x339c02</summary>
public static Result.Base TargetProgramIndexNotFound => new Result.Base(ModuleFs, 6606);
/// <summary>Error code: 2002-6700; Range: 6700-6799; Inner value: 0x345802</summary>
public static Result.Base OutOfResource { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleFs, 6700, 6799); }

View file

@ -45,7 +45,7 @@ namespace LibHac.FsSystem
if (BlockValidities[blockIndex] == Validity.Invalid && integrityCheckLevel == IntegrityCheckLevel.ErrorOnInvalid)
{
// Todo: Differentiate between the top and lower layers
ThrowHelper.ThrowResult(ResultFs.InvalidHashInIvfc.Value, "Hash error!");
ThrowHelper.ThrowResult(ResultFs.InvalidIvfcHash.Value, "Hash error!");
}
bool needsHashCheck = integrityCheckLevel != IntegrityCheckLevel.None &&
@ -106,7 +106,7 @@ namespace LibHac.FsSystem
if (validity == Validity.Invalid && integrityCheckLevel == IntegrityCheckLevel.ErrorOnInvalid)
{
ThrowHelper.ThrowResult(ResultFs.InvalidHashInIvfc.Value, "Hash error!");
ThrowHelper.ThrowResult(ResultFs.InvalidIvfcHash.Value, "Hash error!");
}
}
finally

View file

@ -18,36 +18,36 @@ namespace LibHac.FsSystem.Save
return result;
}
if (ResultFs.Result3002.Includes(result))
if (ResultFs.UnsupportedVersion.Includes(result))
{
return ResultFs.Result4302.Value;
return ResultFs.UnsupportedSaveVersion.Value;
}
if (ResultFs.IntegrityVerificationStorageCorrupted.Includes(result))
{
if (ResultFs.Result4602.Includes(result))
if (ResultFs.InvalidIvfcMagic.Includes(result))
{
return ResultFs.Result4362.Value;
return ResultFs.InvalidSaveDataIvfcMagic.Value;
}
if (ResultFs.Result4603.Includes(result))
if (ResultFs.InvalidIvfcHashValidationBit.Includes(result))
{
return ResultFs.Result4363.Value;
return ResultFs.InvalidSaveDataIvfcHashValidationBit.Value;
}
if (ResultFs.InvalidHashInIvfc.Includes(result))
if (ResultFs.InvalidIvfcHash.Includes(result))
{
return ResultFs.InvalidHashInSaveIvfc.Value;
return ResultFs.InvalidSaveDataIvfcHash.Value;
}
if (ResultFs.IvfcHashIsEmpty.Includes(result))
if (ResultFs.EmptyIvfcHash.Includes(result))
{
return ResultFs.SaveIvfcHashIsEmpty.Value;
return ResultFs.EmptySaveDataIvfcHash.Value;
}
if (ResultFs.InvalidHashInIvfcTopLayer.Includes(result))
{
return ResultFs.InvalidHashInSaveIvfcTopLayer.Value;
return ResultFs.InvalidSaveDataHashInIvfcTopLayer.Value;
}
return result;
@ -55,9 +55,9 @@ namespace LibHac.FsSystem.Save
if (ResultFs.BuiltInStorageCorrupted.Includes(result))
{
if (ResultFs.Result4662.Includes(result))
if (ResultFs.InvalidGptPartitionSignature.Includes(result))
{
return ResultFs.Result4402.Value;
return ResultFs.SaveDataInvalidGptPartitionSignature.Value;
}
return result;
@ -73,11 +73,11 @@ namespace LibHac.FsSystem.Save
return result;
}
if (ResultFs.Range4811To4819.Includes(result))
if (ResultFs.ZeroBitmapFileCorrupted.Includes(result))
{
if (ResultFs.Result4812.Includes(result))
if (ResultFs.IncompleteBlockInZeroBitmapHashStorageFile.Includes(result))
{
return ResultFs.Result4427.Value;
return ResultFs.IncompleteBlockInZeroBitmapHashStorageFileSaveData.Value;
}
return result;

View file

@ -21,6 +21,8 @@ namespace LibHac
return archiveReader.GetDictionary();
}
// To save a bunch of space in the assembly, Results with their names are packed into
// an archive and unpacked at runtime.
private readonly ref struct ResultArchiveReader
{
private readonly ReadOnlySpan<byte> _data;