mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Pull in some results from Atmosphere
This commit is contained in:
parent
6b8b1515c2
commit
f2f68958a8
@ -28,7 +28,7 @@ namespace LibHacBuild.CodeGen.Stage1
|
||||
ValidateHierarchy(modules);
|
||||
CheckIfAggressiveInliningNeeded(modules);
|
||||
|
||||
foreach (ModuleInfo module in modules)
|
||||
foreach (ModuleInfo module in modules.Where(x => !string.IsNullOrWhiteSpace(x.Path)))
|
||||
{
|
||||
string moduleResultFile = PrintModule(module);
|
||||
|
||||
@ -39,6 +39,9 @@ namespace LibHacBuild.CodeGen.Stage1
|
||||
byte[] compressedArchive = Build.DeflateBytes(archive);
|
||||
string archiveStr = PrintArchive(compressedArchive);
|
||||
WriteOutput("LibHac/ResultNameResolver.Generated.cs", archiveStr);
|
||||
|
||||
string enumStr = PrintEnum(modules);
|
||||
WriteOutput("../.tmp/result_enums.txt", enumStr);
|
||||
}
|
||||
|
||||
private static ModuleInfo[] ReadResults()
|
||||
@ -122,13 +125,26 @@ namespace LibHacBuild.CodeGen.Stage1
|
||||
|
||||
private static void CheckForDuplicates(ModuleInfo[] modules)
|
||||
{
|
||||
var moduleIndexSet = new HashSet<int>();
|
||||
var moduleNameSet = new HashSet<string>();
|
||||
|
||||
foreach (ModuleInfo module in modules)
|
||||
{
|
||||
var set = new HashSet<int>();
|
||||
var descriptionSet = new HashSet<int>();
|
||||
|
||||
if (!moduleIndexSet.Add(module.Index))
|
||||
{
|
||||
throw new InvalidDataException($"Duplicate result module index {module.Index}.");
|
||||
}
|
||||
|
||||
if (!moduleNameSet.Add(module.Name))
|
||||
{
|
||||
throw new InvalidDataException($"Duplicate result module name {module.Name}.");
|
||||
}
|
||||
|
||||
foreach (ResultInfo result in module.Results)
|
||||
{
|
||||
if (!set.Add(result.DescriptionStart))
|
||||
if (!descriptionSet.Add(result.DescriptionStart))
|
||||
{
|
||||
throw new InvalidDataException($"Duplicate result {result.Module}-{result.DescriptionStart}-{result.DescriptionEnd}.");
|
||||
}
|
||||
@ -378,6 +394,50 @@ namespace LibHacBuild.CodeGen.Stage1
|
||||
return 5; // ldc.i4 XXXXXXXX
|
||||
}
|
||||
}
|
||||
|
||||
public static string PrintEnum(ModuleInfo[] modules)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
int[] printUnknownResultsForModules = { 2 };
|
||||
int[] skipModules = { 428 };
|
||||
|
||||
foreach (ModuleInfo module in modules.Where(x => !skipModules.Contains(x.Index)))
|
||||
{
|
||||
bool printAllResults = printUnknownResultsForModules.Contains(module.Index);
|
||||
int prevResult = 1;
|
||||
|
||||
foreach (ResultInfo result in module.Results)
|
||||
{
|
||||
if (printAllResults && result.DescriptionStart > prevResult + 1)
|
||||
{
|
||||
for (int i = prevResult + 1; i < result.DescriptionStart; i++)
|
||||
{
|
||||
int innerValue = 2 & 0x1ff | ((i & 0x7ffff) << 9);
|
||||
string unknownResultLine = $"Result_{result.Module}_{i} = {innerValue},";
|
||||
sb.AppendLine(unknownResultLine);
|
||||
}
|
||||
}
|
||||
|
||||
string name = string.IsNullOrWhiteSpace(result.Name) ? string.Empty : $"_{result.Name}";
|
||||
string line = $"Result_{result.Module}_{result.DescriptionStart}{name} = {result.InnerValue},";
|
||||
|
||||
sb.AppendLine(line);
|
||||
prevResult = result.DescriptionStart;
|
||||
}
|
||||
|
||||
if (printAllResults)
|
||||
{
|
||||
for (int i = prevResult + 1; i < 8192; i++)
|
||||
{
|
||||
int innerValue = 2 & 0x1ff | ((i & 0x7ffff) << 9);
|
||||
string unknownResultLine = $"Result_{module.Index}_{i} = {innerValue},";
|
||||
sb.AppendLine(unknownResultLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public class ResultArchiveBuilder
|
||||
|
@ -1,11 +1,39 @@
|
||||
Name,Index
|
||||
Svc,1
|
||||
Fs,2
|
||||
Os,3
|
||||
Ncm,5
|
||||
Dd,6
|
||||
Lr,8
|
||||
Loader,9
|
||||
Sf,10
|
||||
Hipc,11
|
||||
Dnmt,13
|
||||
Pm,15
|
||||
Ns,16
|
||||
Kvdb,20
|
||||
Sm,21
|
||||
Ro,22
|
||||
Sdmmc,24
|
||||
Spl,26
|
||||
Ddsf,30
|
||||
I2C,101
|
||||
Gpio,102
|
||||
Settings,105
|
||||
Vi,114
|
||||
Time,116
|
||||
Bcat,122
|
||||
Pcv,133
|
||||
Nim,137
|
||||
Psc,138
|
||||
Erpt,147
|
||||
Updater,158
|
||||
Err,162
|
||||
Fatal,163
|
||||
CReport,168
|
||||
Debug,183
|
||||
Pwm,189
|
||||
Powctl,198
|
||||
Capture,206
|
||||
Pgl,228
|
||||
LibHac,428
|
|
@ -1,11 +1,39 @@
|
||||
Name,Namespace,Path
|
||||
Svc,LibHac.Svc,LibHac/Svc/ResultSvc.cs
|
||||
Fs,LibHac.Fs,LibHac/Fs/ResultFs.cs
|
||||
Os,,
|
||||
Ncm,LibHac.Ncm,LibHac/Ncm/ResultNcm.cs
|
||||
Dd,,
|
||||
Lr,LibHac.Lr,LibHac/Lr/ResultLr.cs
|
||||
Loader,LibHac.Loader,LibHac/Loader/ResultLoader.cs
|
||||
Sf,LibHac.Sf,LibHac/Sf/ResultSf.cs
|
||||
Hipc,,
|
||||
Dnmt,,
|
||||
Pm,,
|
||||
Ns,,
|
||||
Kvdb,LibHac.Kvdb,LibHac/Kvdb/ResultKvdb.cs
|
||||
Sm,LibHac.Sm,LibHac/Sm/ResultSm.cs
|
||||
Ro,,
|
||||
Sdmmc,LibHac.FsSrv,LibHac/FsSrv/ResultSdmmc.cs
|
||||
Spl,LibHac.Spl,LibHac/Spl/ResultSpl.cs
|
||||
Ddsf,,
|
||||
I2C,,
|
||||
Gpio,,
|
||||
Settings,,
|
||||
Vi,,
|
||||
Time,,
|
||||
Bcat,LibHac.Bcat,LibHac/Bcat/ResultBcat.cs
|
||||
Pcv,,
|
||||
Nim,,
|
||||
Psc,,
|
||||
Erpt,,
|
||||
Updater,,
|
||||
Err,,
|
||||
Fatal,,
|
||||
CReport,,
|
||||
Debug,,
|
||||
Pwm,,
|
||||
Powctl,,
|
||||
Capture,,
|
||||
Pgl,,
|
||||
LibHac,LibHac.Common,LibHac/Common/ResultLibHac.cs
|
|
File diff suppressed because it is too large
Load Diff
@ -27,14 +27,14 @@ namespace LibHac.Common
|
||||
ERROR_ACCESS_DENIED => ResultFs.TargetLocked.Value,
|
||||
ERROR_SHARING_VIOLATION => ResultFs.TargetLocked.Value,
|
||||
ERROR_HANDLE_EOF => ResultFs.OutOfRange.Value,
|
||||
ERROR_HANDLE_DISK_FULL => ResultFs.InsufficientFreeSpace.Value,
|
||||
ERROR_HANDLE_DISK_FULL => ResultFs.UsableSpaceNotEnough.Value,
|
||||
ERROR_FILE_EXISTS => ResultFs.PathAlreadyExists.Value,
|
||||
ERROR_DISK_FULL => ResultFs.InsufficientFreeSpace.Value,
|
||||
ERROR_DISK_FULL => ResultFs.UsableSpaceNotEnough.Value,
|
||||
ERROR_INVALID_NAME => ResultFs.PathNotFound.Value,
|
||||
ERROR_DIR_NOT_EMPTY => ResultFs.DirectoryNotEmpty.Value,
|
||||
ERROR_ALREADY_EXISTS => ResultFs.PathAlreadyExists.Value,
|
||||
ERROR_DIRECTORY => ResultFs.PathNotFound.Value,
|
||||
ERROR_SPACES_NOT_ENOUGH_DRIVES => ResultFs.InsufficientFreeSpace.Value,
|
||||
ERROR_SPACES_NOT_ENOUGH_DRIVES => ResultFs.UsableSpaceNotEnough.Value,
|
||||
_ => ResultFs.UnknownHostFileSystemError.Value
|
||||
};
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace LibHac.Fs
|
||||
|
||||
if (bcatRc.IsFailure())
|
||||
{
|
||||
if (!ResultFs.InsufficientFreeSpace.Includes(bcatRc))
|
||||
if (!ResultFs.UsableSpaceNotEnough.Includes(bcatRc))
|
||||
{
|
||||
return bcatRc;
|
||||
}
|
||||
@ -112,7 +112,7 @@ namespace LibHac.Fs
|
||||
|
||||
if (createRc.IsFailure())
|
||||
{
|
||||
if (ResultFs.InsufficientFreeSpace.Includes(createRc))
|
||||
if (ResultFs.UsableSpaceNotEnough.Includes(createRc))
|
||||
{
|
||||
Result queryRc = fs.QuerySaveDataTotalSize(out long tempSaveTotalSize,
|
||||
nacp.TemporaryStorageSize, 0);
|
||||
@ -135,7 +135,7 @@ namespace LibHac.Fs
|
||||
|
||||
requiredSize = requiredSizeSum;
|
||||
|
||||
return requiredSize == 0 ? Result.Success : ResultFs.InsufficientFreeSpace.Log();
|
||||
return requiredSize == 0 ? Result.Success : ResultFs.UsableSpaceNotEnough.Log();
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
|
||||
@ -158,7 +158,7 @@ namespace LibHac.Fs
|
||||
if (rc.IsSuccess())
|
||||
return Result.Success;
|
||||
|
||||
if (ResultFs.InsufficientFreeSpace.Includes(rc))
|
||||
if (ResultFs.UsableSpaceNotEnough.Includes(rc))
|
||||
{
|
||||
Result queryRc = fs.QuerySaveDataTotalSize(out long totalSize, dataSize, journalSize);
|
||||
if (queryRc.IsFailure()) return queryRc;
|
||||
@ -193,7 +193,7 @@ namespace LibHac.Fs
|
||||
|
||||
if (rc.IsFailure())
|
||||
{
|
||||
if (!ResultFs.InsufficientFreeSpace.Includes(rc))
|
||||
if (!ResultFs.UsableSpaceNotEnough.Includes(rc))
|
||||
return rc;
|
||||
|
||||
requiredSize += requiredSizeExtend;
|
||||
@ -229,7 +229,7 @@ namespace LibHac.Fs
|
||||
if (rc.IsFailure()) return rc;
|
||||
|
||||
requiredSize = requiredSizeBcat;
|
||||
return requiredSizeBcat > 0 ? ResultFs.InsufficientFreeSpace.Log() : Result.Success;
|
||||
return requiredSizeBcat > 0 ? ResultFs.UsableSpaceNotEnough.Log() : Result.Success;
|
||||
}
|
||||
|
||||
private static Result EnsureApplicationCacheStorageImpl(this FileSystemClient fs, out long requiredSize,
|
||||
@ -291,7 +291,7 @@ namespace LibHac.Fs
|
||||
{
|
||||
target = CacheStorageTargetMedia.None;
|
||||
requiredSize = requiredSizeLocal;
|
||||
return ResultFs.InsufficientFreeSpace.Log();
|
||||
return ResultFs.UsableSpaceNotEnough.Log();
|
||||
}
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@ namespace LibHac.Fs
|
||||
|
||||
rc = ExtendSaveDataIfNeeded(fs, out requiredSizeLocal, spaceId, info.SaveDataId, dataSize, journalSize);
|
||||
|
||||
if (rc.IsSuccess() || ResultFs.InsufficientFreeSpace.Includes(rc))
|
||||
if (rc.IsSuccess() || ResultFs.UsableSpaceNotEnough.Includes(rc))
|
||||
{
|
||||
requiredSize = requiredSizeLocal;
|
||||
return Result.Success;
|
||||
|
@ -124,7 +124,7 @@ namespace LibHac.Fs
|
||||
return BaseFile.OperateRange(outBuffer, operationId, offset, size, inBuffer);
|
||||
|
||||
default:
|
||||
return ResultFs.UnsupportedOperationInFileStorageOperateRange.Log();
|
||||
return ResultFs.UnsupportedOperateRangeForFileStorage.Log();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ namespace LibHac.Fs
|
||||
|
||||
if (oldFileSystem != newFileSystem)
|
||||
{
|
||||
return ResultFs.DifferentDestFileSystem.Log();
|
||||
return ResultFs.RenameToOtherFileSystem.Log();
|
||||
}
|
||||
|
||||
if (IsEnabledAccessLog() && oldFileSystem.IsAccessLogEnabled)
|
||||
@ -177,7 +177,7 @@ namespace LibHac.Fs
|
||||
|
||||
if (oldFileSystem != newFileSystem)
|
||||
{
|
||||
return ResultFs.DifferentDestFileSystem.Log();
|
||||
return ResultFs.RenameToOtherFileSystem.Log();
|
||||
}
|
||||
|
||||
if (IsEnabledAccessLog() && oldFileSystem.IsAccessLogEnabled)
|
||||
|
@ -161,7 +161,7 @@ namespace LibHac.Fs.Fsa
|
||||
if (!openMode.HasFlag(OpenMode.Read))
|
||||
{
|
||||
readableBytes = default;
|
||||
return ResultFs.InvalidOpenModeForRead.Log();
|
||||
return ResultFs.ReadUnpermitted.Log();
|
||||
}
|
||||
|
||||
// Get the file size, and validate our offset.
|
||||
@ -186,7 +186,7 @@ namespace LibHac.Fs.Fsa
|
||||
{
|
||||
// Check that we can write.
|
||||
if (!openMode.HasFlag(OpenMode.Write))
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
|
||||
Assert.True(size >= 0);
|
||||
|
||||
@ -200,7 +200,7 @@ namespace LibHac.Fs.Fsa
|
||||
if (!openMode.HasFlag(OpenMode.Write))
|
||||
{
|
||||
needsAppend = default;
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
}
|
||||
|
||||
// Get the file size.
|
||||
|
@ -24,7 +24,7 @@ namespace LibHac.Fs.Fsa
|
||||
///
|
||||
/// The parent directory of the specified path does not exist: <see cref="ResultFs.PathNotFound"/>
|
||||
/// Specified path already exists as either a file or directory: <see cref="ResultFs.PathAlreadyExists"/>
|
||||
/// Insufficient free space to create the file: <see cref="ResultFs.InsufficientFreeSpace"/>
|
||||
/// Insufficient free space to create the file: <see cref="ResultFs.UsableSpaceNotEnough"/>
|
||||
/// </remarks>
|
||||
public Result CreateFile(U8Span path, long size, CreateFileOptions option)
|
||||
{
|
||||
@ -49,7 +49,7 @@ namespace LibHac.Fs.Fsa
|
||||
///
|
||||
/// The parent directory of the specified path does not exist: <see cref="ResultFs.PathNotFound"/>
|
||||
/// Specified path already exists as either a file or directory: <see cref="ResultFs.PathAlreadyExists"/>
|
||||
/// Insufficient free space to create the file: <see cref="ResultFs.InsufficientFreeSpace"/>
|
||||
/// Insufficient free space to create the file: <see cref="ResultFs.UsableSpaceNotEnough"/>
|
||||
/// </remarks>
|
||||
public Result CreateFile(U8Span path, long size)
|
||||
{
|
||||
@ -90,7 +90,7 @@ namespace LibHac.Fs.Fsa
|
||||
///
|
||||
/// The parent directory of the specified path does not exist: <see cref="ResultFs.PathNotFound"/>
|
||||
/// Specified path already exists as either a file or directory: <see cref="ResultFs.PathAlreadyExists"/>
|
||||
/// Insufficient free space to create the directory: <see cref="ResultFs.InsufficientFreeSpace"/>
|
||||
/// Insufficient free space to create the directory: <see cref="ResultFs.UsableSpaceNotEnough"/>
|
||||
/// </remarks>
|
||||
public Result CreateDirectory(U8Span path)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ namespace LibHac.Fs.Impl
|
||||
|
||||
return BaseFile.Target.OperateRange(out info, (int)OperationId.QueryRange, offset, size);
|
||||
default:
|
||||
return ResultFs.UnsupportedOperationInFileServiceObjectAdapterA.Log();
|
||||
return ResultFs.UnsupportedOperateRangeForFileServiceObjectAdapter.Log();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ namespace LibHac.Fs.Impl
|
||||
|
||||
return BaseStorage.Target.OperateRange(out info, (int)OperationId.QueryRange, offset, size);
|
||||
default:
|
||||
return ResultFs.UnsupportedOperationInFileServiceObjectAdapterA.Log();
|
||||
return ResultFs.UnsupportedOperateRangeForFileServiceObjectAdapter.Log();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ namespace LibHac.Fs
|
||||
if (!Mode.HasFlag(OpenMode.Read))
|
||||
{
|
||||
bytesRead = 0;
|
||||
return ResultFs.InvalidOpenModeForRead.Log();
|
||||
return ResultFs.ReadUnpermitted.Log();
|
||||
}
|
||||
|
||||
return BaseStream.Read(out bytesRead, offset, destination);
|
||||
@ -198,7 +198,7 @@ namespace LibHac.Fs
|
||||
{
|
||||
if (!Mode.HasFlag(OpenMode.Write))
|
||||
{
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
}
|
||||
|
||||
return BaseStream.Write(offset, source, Mode.HasFlag(OpenMode.AllowAppend));
|
||||
|
@ -44,7 +44,7 @@ namespace LibHac.Fs
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInMemoryStorageSetSize.Log();
|
||||
return ResultFs.UnsupportedSetSizeForMemoryStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoGetSize(out long size)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -173,7 +173,7 @@ namespace LibHac.Fs
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
if (!IsValid()) return ResultFs.NotInitialized.Log();
|
||||
if (!IsResizable) return ResultFs.UnsupportedOperationInSubStorageSetSize.Log();
|
||||
if (!IsResizable) return ResultFs.UnsupportedSetSizeForNotResizableSubStorage.Log();
|
||||
if (!IsOffsetAndSizeValid(Offset, size)) return ResultFs.InvalidSize.Log();
|
||||
|
||||
Result rc = BaseStorage.GetSize(out long currentSize);
|
||||
@ -182,7 +182,7 @@ namespace LibHac.Fs
|
||||
if (currentSize != Offset + Size)
|
||||
{
|
||||
// SubStorage cannot be resized unless it is located at the end of the base storage.
|
||||
return ResultFs.UnsupportedOperationInResizableSubStorageSetSize.Log();
|
||||
return ResultFs.UnsupportedSetSizeForResizableSubStorage.Log();
|
||||
}
|
||||
|
||||
rc = BaseStorage.SetSize(Offset + size);
|
||||
|
@ -101,7 +101,7 @@ namespace LibHac.FsSrv.Creators
|
||||
|
||||
protected override Result DoWrite(long offset, ReadOnlySpan<byte> source)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInRoGameCardStorageWrite.Log();
|
||||
return ResultFs.UnsupportedWriteForReadOnlyGameCardStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoFlush()
|
||||
@ -111,7 +111,7 @@ namespace LibHac.FsSrv.Creators
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInRoGameCardStorageSetSize.Log();
|
||||
return ResultFs.UnsupportedSetSizeForReadOnlyGameCardStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoGetSize(out long size)
|
||||
|
@ -33,7 +33,7 @@ namespace LibHac.FsSrv.Creators
|
||||
|
||||
if (!SdCard.IsSdCardInserted())
|
||||
{
|
||||
return ResultFs.SdCardNotFound.Log();
|
||||
return ResultFs.PortSdCardNoDevice.Log();
|
||||
}
|
||||
|
||||
if (SdCardFileSystem != null)
|
||||
|
@ -40,7 +40,7 @@ namespace LibHac.FsSrv
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
return ResultFs.ExternalKeyNotFound.Log();
|
||||
return ResultFs.NcaExternalKeyUnavailable.Log();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -427,7 +427,7 @@ namespace LibHac.FsSrv
|
||||
fileSystem = FileSystemInterfaceAdapter.CreateShared(ref hostFs, isRootPath);
|
||||
|
||||
if (fileSystem is null)
|
||||
return ResultFs.AllocationFailureInCreateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInCreateShared.Log();
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
@ -313,11 +313,11 @@ namespace LibHac.FsSrv
|
||||
|
||||
tempFileSystem = AsynchronousAccessFileSystem.CreateShared(ref tempFileSystem);
|
||||
if (tempFileSystem is null)
|
||||
return ResultFs.AllocationFailureInAllocateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInAllocateShared.Log();
|
||||
|
||||
fileSystem = FileSystemInterfaceAdapter.CreateShared(ref tempFileSystem);
|
||||
if (fileSystem is null)
|
||||
return ResultFs.AllocationFailureInCreateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInCreateShared.Log();
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
@ -532,15 +532,15 @@ namespace LibHac.FsSrv
|
||||
|
||||
tempFileSystem = StorageLayoutTypeSetFileSystem.CreateShared(ref tempFileSystem, storageFlag);
|
||||
if (tempFileSystem is null)
|
||||
return ResultFs.AllocationFailureInAllocateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInAllocateShared.Log();
|
||||
|
||||
tempFileSystem = AsynchronousAccessFileSystem.CreateShared(ref tempFileSystem);
|
||||
if (tempFileSystem is null)
|
||||
return ResultFs.AllocationFailureInAllocateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInAllocateShared.Log();
|
||||
|
||||
fileSystem = FileSystemInterfaceAdapter.CreateShared(ref tempFileSystem);
|
||||
if (fileSystem is null)
|
||||
return ResultFs.AllocationFailureInCreateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInCreateShared.Log();
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ namespace LibHac.FsSrv
|
||||
|
||||
readOnlyFileSystem = ReadOnlyFileSystem.CreateShared(ref manualFileSystem);
|
||||
if (readOnlyFileSystem?.Target is null)
|
||||
return ResultFs.AllocationFailureInAllocateShared.Log();
|
||||
return ResultFs.AllocationMemoryFailedInAllocateShared.Log();
|
||||
|
||||
Shared.Move(out fileSystem, ref readOnlyFileSystem);
|
||||
return Result.Success;
|
||||
|
@ -9,6 +9,8 @@
|
||||
// code generation portion of the build.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace LibHac.FsSrv
|
||||
{
|
||||
public static class ResultSdmmc
|
||||
@ -16,8 +18,168 @@ namespace LibHac.FsSrv
|
||||
public const int ModuleSdmmc = 24;
|
||||
|
||||
/// <summary>Error code: 2024-0001; Inner value: 0x218</summary>
|
||||
public static Result.Base DeviceNotFound => new Result.Base(ModuleSdmmc, 1);
|
||||
public static Result.Base NoDevice => new Result.Base(ModuleSdmmc, 1);
|
||||
/// <summary>Error code: 2024-0002; Inner value: 0x418</summary>
|
||||
public static Result.Base NotActivated => new Result.Base(ModuleSdmmc, 2);
|
||||
/// <summary>Error code: 2024-0003; Inner value: 0x618</summary>
|
||||
public static Result.Base DeviceRemoved => new Result.Base(ModuleSdmmc, 3);
|
||||
/// <summary>Error code: 2024-0004; Inner value: 0x818</summary>
|
||||
public static Result.Base DeviceAsleep => new Result.Base(ModuleSdmmc, 4);
|
||||
public static Result.Base NotAwakened => new Result.Base(ModuleSdmmc, 4);
|
||||
|
||||
/// <summary>Error code: 2024-0032; Range: 32-126; Inner value: 0x4018</summary>
|
||||
public static Result.Base CommunicationError => new Result.Base(ModuleSdmmc, 32, 126);
|
||||
/// <summary>Error code: 2024-0033; Range: 33-46; Inner value: 0x4218</summary>
|
||||
public static Result.Base CommunicationNotAttained => new Result.Base(ModuleSdmmc, 33, 46);
|
||||
/// <summary>Error code: 2024-0034; Inner value: 0x4418</summary>
|
||||
public static Result.Base ResponseIndexError => new Result.Base(ModuleSdmmc, 34);
|
||||
/// <summary>Error code: 2024-0035; Inner value: 0x4618</summary>
|
||||
public static Result.Base ResponseEndBitError => new Result.Base(ModuleSdmmc, 35);
|
||||
/// <summary>Error code: 2024-0036; Inner value: 0x4818</summary>
|
||||
public static Result.Base ResponseCrcError => new Result.Base(ModuleSdmmc, 36);
|
||||
/// <summary>Error code: 2024-0037; Inner value: 0x4a18</summary>
|
||||
public static Result.Base ResponseTimeoutError => new Result.Base(ModuleSdmmc, 37);
|
||||
/// <summary>Error code: 2024-0038; Inner value: 0x4c18</summary>
|
||||
public static Result.Base DataEndBitError => new Result.Base(ModuleSdmmc, 38);
|
||||
/// <summary>Error code: 2024-0039; Inner value: 0x4e18</summary>
|
||||
public static Result.Base DataCrcError => new Result.Base(ModuleSdmmc, 39);
|
||||
/// <summary>Error code: 2024-0040; Inner value: 0x5018</summary>
|
||||
public static Result.Base DataTimeoutError => new Result.Base(ModuleSdmmc, 40);
|
||||
/// <summary>Error code: 2024-0041; Inner value: 0x5218</summary>
|
||||
public static Result.Base AutoCommandResponseIndexError => new Result.Base(ModuleSdmmc, 41);
|
||||
/// <summary>Error code: 2024-0042; Inner value: 0x5418</summary>
|
||||
public static Result.Base AutoCommandResponseEndBitError => new Result.Base(ModuleSdmmc, 42);
|
||||
/// <summary>Error code: 2024-0043; Inner value: 0x5618</summary>
|
||||
public static Result.Base AutoCommandResponseCrcError => new Result.Base(ModuleSdmmc, 43);
|
||||
/// <summary>Error code: 2024-0044; Inner value: 0x5818</summary>
|
||||
public static Result.Base AutoCommandResponseTimeoutError => new Result.Base(ModuleSdmmc, 44);
|
||||
/// <summary>Error code: 2024-0045; Inner value: 0x5a18</summary>
|
||||
public static Result.Base CommandCompleteSoftwareTimeout => new Result.Base(ModuleSdmmc, 45);
|
||||
/// <summary>Error code: 2024-0046; Inner value: 0x5c18</summary>
|
||||
public static Result.Base TransferCompleteSoftwareTimeout => new Result.Base(ModuleSdmmc, 46);
|
||||
|
||||
/// <summary>Error code: 2024-0048; Range: 48-70; Inner value: 0x6018</summary>
|
||||
public static Result.Base DeviceStatusHasError => new Result.Base(ModuleSdmmc, 48, 70);
|
||||
/// <summary>Error code: 2024-0049; Inner value: 0x6218</summary>
|
||||
public static Result.Base DeviceStatusAddressOutOfRange => new Result.Base(ModuleSdmmc, 49);
|
||||
/// <summary>Error code: 2024-0050; Inner value: 0x6418</summary>
|
||||
public static Result.Base DeviceStatusAddressMisaligned => new Result.Base(ModuleSdmmc, 50);
|
||||
/// <summary>Error code: 2024-0051; Inner value: 0x6618</summary>
|
||||
public static Result.Base DeviceStatusBlockLenError => new Result.Base(ModuleSdmmc, 51);
|
||||
/// <summary>Error code: 2024-0052; Inner value: 0x6818</summary>
|
||||
public static Result.Base DeviceStatusEraseSeqError => new Result.Base(ModuleSdmmc, 52);
|
||||
/// <summary>Error code: 2024-0053; Inner value: 0x6a18</summary>
|
||||
public static Result.Base DeviceStatusEraseParam => new Result.Base(ModuleSdmmc, 53);
|
||||
/// <summary>Error code: 2024-0054; Inner value: 0x6c18</summary>
|
||||
public static Result.Base DeviceStatusWpViolation => new Result.Base(ModuleSdmmc, 54);
|
||||
/// <summary>Error code: 2024-0055; Inner value: 0x6e18</summary>
|
||||
public static Result.Base DeviceStatusLockUnlockFailed => new Result.Base(ModuleSdmmc, 55);
|
||||
/// <summary>Error code: 2024-0056; Inner value: 0x7018</summary>
|
||||
public static Result.Base DeviceStatusComCrcError => new Result.Base(ModuleSdmmc, 56);
|
||||
/// <summary>Error code: 2024-0057; Inner value: 0x7218</summary>
|
||||
public static Result.Base DeviceStatusIllegalCommand => new Result.Base(ModuleSdmmc, 57);
|
||||
/// <summary>Error code: 2024-0058; Inner value: 0x7418</summary>
|
||||
public static Result.Base DeviceStatusDeviceEccFailed => new Result.Base(ModuleSdmmc, 58);
|
||||
/// <summary>Error code: 2024-0059; Inner value: 0x7618</summary>
|
||||
public static Result.Base DeviceStatusCcError => new Result.Base(ModuleSdmmc, 59);
|
||||
/// <summary>Error code: 2024-0060; Inner value: 0x7818</summary>
|
||||
public static Result.Base DeviceStatusError => new Result.Base(ModuleSdmmc, 60);
|
||||
/// <summary>Error code: 2024-0061; Inner value: 0x7a18</summary>
|
||||
public static Result.Base DeviceStatusCidCsdOverwrite => new Result.Base(ModuleSdmmc, 61);
|
||||
/// <summary>Error code: 2024-0062; Inner value: 0x7c18</summary>
|
||||
public static Result.Base DeviceStatusWpEraseSkip => new Result.Base(ModuleSdmmc, 62);
|
||||
/// <summary>Error code: 2024-0063; Inner value: 0x7e18</summary>
|
||||
public static Result.Base DeviceStatusEraseReset => new Result.Base(ModuleSdmmc, 63);
|
||||
/// <summary>Error code: 2024-0064; Inner value: 0x8018</summary>
|
||||
public static Result.Base DeviceStatusSwitchError => new Result.Base(ModuleSdmmc, 64);
|
||||
|
||||
/// <summary>Error code: 2024-0072; Inner value: 0x9018</summary>
|
||||
public static Result.Base UnexpectedDeviceState => new Result.Base(ModuleSdmmc, 72);
|
||||
/// <summary>Error code: 2024-0073; Inner value: 0x9218</summary>
|
||||
public static Result.Base UnexpectedDeviceCsdValue => new Result.Base(ModuleSdmmc, 73);
|
||||
/// <summary>Error code: 2024-0074; Inner value: 0x9418</summary>
|
||||
public static Result.Base AbortTransactionSoftwareTimeout => new Result.Base(ModuleSdmmc, 74);
|
||||
/// <summary>Error code: 2024-0075; Inner value: 0x9618</summary>
|
||||
public static Result.Base CommandInhibitCmdSoftwareTimeout => new Result.Base(ModuleSdmmc, 75);
|
||||
/// <summary>Error code: 2024-0076; Inner value: 0x9818</summary>
|
||||
public static Result.Base CommandInhibitDatSoftwareTimeout => new Result.Base(ModuleSdmmc, 76);
|
||||
/// <summary>Error code: 2024-0077; Inner value: 0x9a18</summary>
|
||||
public static Result.Base BusySoftwareTimeout => new Result.Base(ModuleSdmmc, 77);
|
||||
/// <summary>Error code: 2024-0078; Inner value: 0x9c18</summary>
|
||||
public static Result.Base IssueTuningCommandSoftwareTimeout => new Result.Base(ModuleSdmmc, 78);
|
||||
/// <summary>Error code: 2024-0079; Inner value: 0x9e18</summary>
|
||||
public static Result.Base TuningFailed => new Result.Base(ModuleSdmmc, 79);
|
||||
/// <summary>Error code: 2024-0080; Inner value: 0xa018</summary>
|
||||
public static Result.Base MmcInitializationSoftwareTimeout => new Result.Base(ModuleSdmmc, 80);
|
||||
/// <summary>Error code: 2024-0081; Inner value: 0xa218</summary>
|
||||
public static Result.Base MmcNotSupportExtendedCsd => new Result.Base(ModuleSdmmc, 81);
|
||||
/// <summary>Error code: 2024-0082; Inner value: 0xa418</summary>
|
||||
public static Result.Base UnexpectedMmcExtendedCsdValue => new Result.Base(ModuleSdmmc, 82);
|
||||
/// <summary>Error code: 2024-0083; Inner value: 0xa618</summary>
|
||||
public static Result.Base MmcEraseSoftwareTimeout => new Result.Base(ModuleSdmmc, 83);
|
||||
/// <summary>Error code: 2024-0084; Inner value: 0xa818</summary>
|
||||
public static Result.Base SdCardValidationError => new Result.Base(ModuleSdmmc, 84);
|
||||
/// <summary>Error code: 2024-0085; Inner value: 0xaa18</summary>
|
||||
public static Result.Base SdCardInitializationSoftwareTimeout => new Result.Base(ModuleSdmmc, 85);
|
||||
/// <summary>Error code: 2024-0086; Inner value: 0xac18</summary>
|
||||
public static Result.Base SdCardGetValidRcaSoftwareTimeout => new Result.Base(ModuleSdmmc, 86);
|
||||
/// <summary>Error code: 2024-0087; Inner value: 0xae18</summary>
|
||||
public static Result.Base UnexpectedSdCardAcmdDisabled => new Result.Base(ModuleSdmmc, 87);
|
||||
/// <summary>Error code: 2024-0088; Inner value: 0xb018</summary>
|
||||
public static Result.Base SdCardNotSupportSwitchFunctionStatus => new Result.Base(ModuleSdmmc, 88);
|
||||
/// <summary>Error code: 2024-0089; Inner value: 0xb218</summary>
|
||||
public static Result.Base UnexpectedSdCardSwitchFunctionStatus => new Result.Base(ModuleSdmmc, 89);
|
||||
/// <summary>Error code: 2024-0090; Inner value: 0xb418</summary>
|
||||
public static Result.Base SdCardNotSupportAccessMode => new Result.Base(ModuleSdmmc, 90);
|
||||
/// <summary>Error code: 2024-0091; Inner value: 0xb618</summary>
|
||||
public static Result.Base SdCardNot4BitBusWidthAtUhsIMode => new Result.Base(ModuleSdmmc, 91);
|
||||
/// <summary>Error code: 2024-0092; Inner value: 0xb818</summary>
|
||||
public static Result.Base SdCardNotSupportSdr104AndSdr50 => new Result.Base(ModuleSdmmc, 92);
|
||||
/// <summary>Error code: 2024-0093; Inner value: 0xba18</summary>
|
||||
public static Result.Base SdCardCannotSwitchAccessMode => new Result.Base(ModuleSdmmc, 93);
|
||||
/// <summary>Error code: 2024-0094; Inner value: 0xbc18</summary>
|
||||
public static Result.Base SdCardFailedSwitchAccessMode => new Result.Base(ModuleSdmmc, 94);
|
||||
/// <summary>Error code: 2024-0095; Inner value: 0xbe18</summary>
|
||||
public static Result.Base SdCardUnacceptableCurrentConsumption => new Result.Base(ModuleSdmmc, 95);
|
||||
/// <summary>Error code: 2024-0096; Inner value: 0xc018</summary>
|
||||
public static Result.Base SdCardNotReadyToVoltageSwitch => new Result.Base(ModuleSdmmc, 96);
|
||||
/// <summary>Error code: 2024-0097; Inner value: 0xc218</summary>
|
||||
public static Result.Base SdCardNotCompleteVoltageSwitch => new Result.Base(ModuleSdmmc, 97);
|
||||
|
||||
/// <summary>Error code: 2024-0128; Range: 128-158; Inner value: 0x10018</summary>
|
||||
public static Result.Base HostControllerUnexpected { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleSdmmc, 128, 158); }
|
||||
/// <summary>Error code: 2024-0129; Inner value: 0x10218</summary>
|
||||
public static Result.Base InternalClockStableSoftwareTimeout => new Result.Base(ModuleSdmmc, 129);
|
||||
/// <summary>Error code: 2024-0130; Inner value: 0x10418</summary>
|
||||
public static Result.Base SdHostStandardUnknownAutoCmdError => new Result.Base(ModuleSdmmc, 130);
|
||||
/// <summary>Error code: 2024-0131; Inner value: 0x10618</summary>
|
||||
public static Result.Base SdHostStandardUnknownError => new Result.Base(ModuleSdmmc, 131);
|
||||
/// <summary>Error code: 2024-0132; Inner value: 0x10818</summary>
|
||||
public static Result.Base SdmmcDllCalibrationSoftwareTimeout => new Result.Base(ModuleSdmmc, 132);
|
||||
/// <summary>Error code: 2024-0133; Inner value: 0x10a18</summary>
|
||||
public static Result.Base SdmmcDllApplicationSoftwareTimeout => new Result.Base(ModuleSdmmc, 133);
|
||||
/// <summary>Error code: 2024-0134; Inner value: 0x10c18</summary>
|
||||
public static Result.Base SdHostStandardFailSwitchTo18V => new Result.Base(ModuleSdmmc, 134);
|
||||
/// <summary>Error code: 2024-0135; Inner value: 0x10e18</summary>
|
||||
public static Result.Base DriveStrengthCalibrationNotCompleted => new Result.Base(ModuleSdmmc, 135);
|
||||
/// <summary>Error code: 2024-0136; Inner value: 0x11018</summary>
|
||||
public static Result.Base DriveStrengthCalibrationSoftwareTimeout => new Result.Base(ModuleSdmmc, 136);
|
||||
/// <summary>Error code: 2024-0137; Inner value: 0x11218</summary>
|
||||
public static Result.Base SdmmcCompShortToGnd => new Result.Base(ModuleSdmmc, 137);
|
||||
/// <summary>Error code: 2024-0138; Inner value: 0x11418</summary>
|
||||
public static Result.Base SdmmcCompOpen => new Result.Base(ModuleSdmmc, 138);
|
||||
|
||||
/// <summary>Error code: 2024-0160; Range: 160-190; Inner value: 0x14018</summary>
|
||||
public static Result.Base InternalError { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleSdmmc, 160, 190); }
|
||||
/// <summary>Error code: 2024-0161; Inner value: 0x14218</summary>
|
||||
public static Result.Base NoWaitedInterrupt => new Result.Base(ModuleSdmmc, 161);
|
||||
/// <summary>Error code: 2024-0162; Inner value: 0x14418</summary>
|
||||
public static Result.Base WaitInterruptSoftwareTimeout => new Result.Base(ModuleSdmmc, 162);
|
||||
|
||||
/// <summary>Error code: 2024-0192; Inner value: 0x18018</summary>
|
||||
public static Result.Base AbortCommandIssued => new Result.Base(ModuleSdmmc, 192);
|
||||
/// <summary>Error code: 2024-0200; Inner value: 0x19018</summary>
|
||||
public static Result.Base NotSupported => new Result.Base(ModuleSdmmc, 200);
|
||||
/// <summary>Error code: 2024-0201; Inner value: 0x19218</summary>
|
||||
public static Result.Base NotImplemented => new Result.Base(ModuleSdmmc, 201);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ namespace LibHac.FsSystem
|
||||
|
||||
protected override Result DoWrite(long offset, ReadOnlySpan<byte> source)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInAesCtrExStorageWrite.Log();
|
||||
return ResultFs.UnsupportedWriteForAesCtrCounterExtendedStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoFlush()
|
||||
|
@ -252,7 +252,7 @@ namespace LibHac.FsSystem
|
||||
InternalFreeLists = GC.AllocateArray<PageList>(OrderMax + 1, true);
|
||||
FreeLists = (PageList*)Unsafe.AsPointer(ref MemoryMarshal.GetArrayDataReference(InternalFreeLists));
|
||||
if (InternalFreeLists == null)
|
||||
return ResultFs.AllocationFailureInFileSystemBuddyHeapA.Log();
|
||||
return ResultFs.AllocationMemoryFailedInFileSystemBuddyHeapA.Log();
|
||||
}
|
||||
|
||||
// All but the last page region should go to the max order.
|
||||
|
@ -98,7 +98,7 @@ namespace LibHac.FsSystem
|
||||
|
||||
if (Entries == null)
|
||||
{
|
||||
return ResultFs.AllocationFailureInFileSystemBufferManagerA.Log();
|
||||
return ResultFs.AllocationMemoryFailedInFileSystemBufferManagerA.Log();
|
||||
}
|
||||
|
||||
// Set entries.
|
||||
|
@ -319,7 +319,7 @@ namespace LibHac.FsSystem
|
||||
protected override Result DoQueryEntry(Span<byte> outBuffer, ReadOnlySpan<byte> inBuffer, QueryId queryId,
|
||||
U8Span path)
|
||||
{
|
||||
if (queryId != QueryId.MakeConcatFile) return ResultFs.UnsupportedOperationInConcatFsQueryEntry.Log();
|
||||
if (queryId != QueryId.MakeConcatFile) return ResultFs.UnsupportedQueryEntryForConcatenationFileSystem.Log();
|
||||
|
||||
return SetConcatenationFileAttribute(path);
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ namespace LibHac.FsSystem
|
||||
protected override Result DoCommitProvisionally(long counter)
|
||||
{
|
||||
if (!CanCommitProvisionally)
|
||||
return ResultFs.UnsupportedOperationInDirectorySaveDataFileSystem.Log();
|
||||
return ResultFs.UnsupportedCommitProvisionallyForDirectorySaveDataFileSystem.Log();
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ namespace LibHac.FsSystem
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInHierarchicalIvfcStorageSetSize.Log();
|
||||
return ResultFs.UnsupportedSetSizeForHierarchicalIntegrityVerificationStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoGetSize(out long size)
|
||||
|
@ -182,7 +182,7 @@ namespace LibHac.FsSystem
|
||||
|
||||
protected override Result DoWrite(long offset, ReadOnlySpan<byte> source)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInIndirectStorageWrite.Log();
|
||||
return ResultFs.UnsupportedWriteForIndirectStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoFlush()
|
||||
@ -192,7 +192,7 @@ namespace LibHac.FsSystem
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInIndirectStorageSetSize.Log();
|
||||
return ResultFs.UnsupportedSetSizeForIndirectStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoGetSize(out long size)
|
||||
|
@ -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.InvalidIvfcHash.Value, "Hash error!");
|
||||
ThrowHelper.ThrowResult(ResultFs.NonRealDataVerificationFailed.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.InvalidIvfcHash.Value, "Hash error!");
|
||||
ThrowHelper.ThrowResult(ResultFs.NonRealDataVerificationFailed.Value, "Hash error!");
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
@ -39,7 +39,7 @@ namespace LibHac.FsSystem
|
||||
Result rc = DryWrite(out bool isResizeNeeded, offset, source.Length, in option, Mode);
|
||||
if (rc.IsFailure()) return rc;
|
||||
|
||||
if (isResizeNeeded) return ResultFs.UnsupportedOperationInPartitionFileSetSize.Log();
|
||||
if (isResizeNeeded) return ResultFs.UnsupportedWriteForPartitionFile.Log();
|
||||
|
||||
if (offset > Size) return ResultFs.OutOfRange.Log();
|
||||
|
||||
@ -81,10 +81,10 @@ namespace LibHac.FsSystem
|
||||
{
|
||||
if (!Mode.HasFlag(OpenMode.Write))
|
||||
{
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
}
|
||||
|
||||
return ResultFs.UnsupportedOperationInPartitionFileSetSize.Log();
|
||||
return ResultFs.UnsupportedWriteForPartitionFile.Log();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,14 +76,14 @@ namespace LibHac.FsSystem
|
||||
return ResultFs.PathNotFound.Log();
|
||||
}
|
||||
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
|
||||
protected override Result DoCommit()
|
||||
{
|
||||
@ -123,7 +123,7 @@ namespace LibHac.FsSystem
|
||||
Type = PartitionFileSystemType.Hashed;
|
||||
break;
|
||||
default:
|
||||
ThrowHelper.ThrowResult(ResultFs.InvalidPartitionFileSystemMagic.Value, $"Invalid Partition FS type \"{Magic}\"");
|
||||
ThrowHelper.ThrowResult(ResultFs.PartitionSignatureVerificationFailed.Value, $"Invalid Partition FS type \"{Magic}\"");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -122,15 +122,15 @@ namespace LibHac.FsSystem
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyPartitionFileSystem.Log();
|
||||
protected override Result DoCommitProvisionally(long counter) => ResultFs.UnsupportedOperationInPartitionFileSystem.Log();
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForPartitionFileSystem.Log();
|
||||
protected override Result DoCommitProvisionally(long counter) => ResultFs.UnsupportedCommitProvisionallyForPartitionFileSystem.Log();
|
||||
|
||||
private class PartitionFile : IFile
|
||||
{
|
||||
@ -181,7 +181,7 @@ namespace LibHac.FsSystem
|
||||
// Make sure the hashed region doesn't extend past the end of the file
|
||||
// N's code requires that the hashed region starts at the beginning of the file
|
||||
if (entry.HashOffset != 0 || hashEnd > entry.Size)
|
||||
return ResultFs.InvalidPartitionFileSystemHashOffset.Log();
|
||||
return ResultFs.InvalidSha256PartitionHashTarget.Log();
|
||||
|
||||
long storageOffset = fileStorageOffset + offset;
|
||||
|
||||
@ -208,7 +208,7 @@ namespace LibHac.FsSystem
|
||||
// Can't start a read in the middle of the hashed region
|
||||
if (readEnd > hashEnd || entry.HashOffset > offset)
|
||||
{
|
||||
return ResultFs.InvalidPartitionFileSystemHashOffset.Log();
|
||||
return ResultFs.InvalidSha256PartitionHashTarget.Log();
|
||||
}
|
||||
|
||||
int hashRemaining = entry.HashSize;
|
||||
@ -251,7 +251,7 @@ namespace LibHac.FsSystem
|
||||
{
|
||||
destination.Slice(0, (int)bytesToRead).Clear();
|
||||
|
||||
return ResultFs.InvalidPartitionFileSystemHash.Log();
|
||||
return ResultFs.Sha256PartitionHashVerificationFailed.Log();
|
||||
}
|
||||
|
||||
rc = Result.Success;
|
||||
@ -269,7 +269,7 @@ namespace LibHac.FsSystem
|
||||
if (rc.IsFailure()) return rc;
|
||||
|
||||
if (isResizeNeeded)
|
||||
return ResultFs.UnsupportedOperationInPartitionFileSetSize.Log();
|
||||
return ResultFs.UnsupportedWriteForPartitionFile.Log();
|
||||
|
||||
if (_entry.Size < offset)
|
||||
return ResultFs.OutOfRange.Log();
|
||||
@ -294,10 +294,10 @@ namespace LibHac.FsSystem
|
||||
{
|
||||
if (Mode.HasFlag(OpenMode.Write))
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInPartitionFileSetSize.Log();
|
||||
return ResultFs.UnsupportedWriteForPartitionFile.Log();
|
||||
}
|
||||
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
}
|
||||
|
||||
protected override Result DoGetSize(out long size)
|
||||
@ -313,16 +313,16 @@ namespace LibHac.FsSystem
|
||||
{
|
||||
case OperationId.InvalidateCache:
|
||||
if (!Mode.HasFlag(OpenMode.Read))
|
||||
return ResultFs.InvalidOpenModeForRead.Log();
|
||||
return ResultFs.ReadUnpermitted.Log();
|
||||
|
||||
if (Mode.HasFlag(OpenMode.Write))
|
||||
return ResultFs.UnsupportedOperationIdInPartitionFileSystem.Log();
|
||||
return ResultFs.UnsupportedOperateRangeForPartitionFile.Log();
|
||||
|
||||
break;
|
||||
case OperationId.QueryRange:
|
||||
break;
|
||||
default:
|
||||
return ResultFs.UnsupportedOperationIdInPartitionFileSystem.Log();
|
||||
return ResultFs.UnsupportedOperateRangeForPartitionFile.Log();
|
||||
}
|
||||
|
||||
if (offset < 0 || offset > _entry.Size)
|
||||
|
@ -97,7 +97,7 @@ namespace LibHac.FsSystem
|
||||
{
|
||||
if (stringTableSize <= entries[i].NameOffset)
|
||||
{
|
||||
throw new HorizonResultException(ResultFs.InvalidPartitionFileSystemEntryNameOffset.Log());
|
||||
throw new HorizonResultException(ResultFs.InvalidPartitionEntryOffset.Log());
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> entryName = names.Slice(entries[i].NameOffset);
|
||||
@ -127,7 +127,7 @@ namespace LibHac.FsSystem
|
||||
// Nintendo doesn't check the offset here like they do in FindEntry, but we will for safety
|
||||
if (table.Length <= nameOffset)
|
||||
{
|
||||
throw new HorizonResultException(ResultFs.InvalidPartitionFileSystemEntryNameOffset.Log());
|
||||
throw new HorizonResultException(ResultFs.InvalidPartitionEntryOffset.Log());
|
||||
}
|
||||
|
||||
return new U8Span(table.Slice(nameOffset));
|
||||
@ -157,12 +157,12 @@ namespace LibHac.FsSystem
|
||||
{
|
||||
if (typeof(T) == typeof(StandardEntry))
|
||||
{
|
||||
return ResultFs.InvalidPartitionFileSystemMagic.Log();
|
||||
return ResultFs.PartitionSignatureVerificationFailed.Log();
|
||||
}
|
||||
|
||||
if (typeof(T) == typeof(HashedEntry))
|
||||
{
|
||||
return ResultFs.InvalidHashedPartitionFileSystemMagic.Log();
|
||||
return ResultFs.Sha256PartitionSignatureVerificationFailed.Log();
|
||||
}
|
||||
|
||||
throw new NotSupportedException();
|
||||
|
@ -31,12 +31,12 @@ namespace LibHac.FsSystem
|
||||
|
||||
protected override Result DoWrite(long offset, ReadOnlySpan<byte> source, in WriteOption option)
|
||||
{
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
}
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
}
|
||||
|
||||
protected override Result DoOperateRange(Span<byte> outBuffer, OperationId operationId, long offset, long size, ReadOnlySpan<byte> inBuffer)
|
||||
@ -47,7 +47,7 @@ namespace LibHac.FsSystem
|
||||
case OperationId.QueryRange:
|
||||
return BaseFile.OperateRange(outBuffer, operationId, offset, size, inBuffer);
|
||||
default:
|
||||
return ResultFs.UnsupportedOperationInReadOnlyFile.Log();
|
||||
return ResultFs.UnsupportedOperateRangeForReadOnlyFile.Log();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,21 +75,21 @@ namespace LibHac.FsSystem
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyReadOnlyFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForReadOnlyFileSystem.Log();
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ namespace LibHac.FsSystem.RomFs
|
||||
|
||||
protected override Result DoWrite(long offset, ReadOnlySpan<byte> source, in WriteOption option)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationModifyRomFsFile.Log();
|
||||
return ResultFs.UnsupportedWriteForRomFsFile.Log();
|
||||
}
|
||||
|
||||
protected override Result DoFlush()
|
||||
@ -53,7 +53,7 @@ namespace LibHac.FsSystem.RomFs
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationModifyRomFsFile.Log();
|
||||
return ResultFs.UnsupportedWriteForRomFsFile.Log();
|
||||
}
|
||||
|
||||
protected override Result DoOperateRange(Span<byte> outBuffer, OperationId operationId, long offset, long size,
|
||||
|
@ -86,26 +86,26 @@ namespace LibHac.FsSystem.RomFs
|
||||
return BaseStorage;
|
||||
}
|
||||
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedOperationModifyRomFsFileSystem.Log();
|
||||
protected override Result DoCommitProvisionally(long counter) => ResultFs.UnsupportedOperationInRomFsFileSystem.Log();
|
||||
protected override Result DoCreateDirectory(U8Span path) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoCreateFile(U8Span path, long size, CreateFileOptions options) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoDeleteDirectory(U8Span path) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoDeleteDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoCleanDirectoryRecursively(U8Span path) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoDeleteFile(U8Span path) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoRenameDirectory(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoRenameFile(U8Span oldPath, U8Span newPath) => ResultFs.UnsupportedWriteForRomFsFileSystem.Log();
|
||||
protected override Result DoCommitProvisionally(long counter) => ResultFs.UnsupportedCommitProvisionallyForRomFsFileSystem.Log();
|
||||
|
||||
protected override Result DoGetFreeSpaceSize(out long freeSpace, U8Span path)
|
||||
{
|
||||
freeSpace = default;
|
||||
return ResultFs.UnsupportedOperationRomFsFileSystemGetSpace.Log();
|
||||
freeSpace = 0;
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
protected override Result DoGetTotalSpaceSize(out long totalSpace, U8Span path)
|
||||
{
|
||||
totalSpace = default;
|
||||
return ResultFs.UnsupportedOperationRomFsFileSystemGetSpace.Log();
|
||||
return ResultFs.UnsupportedGetTotalSpaceSizeForRomFsFileSystem.Log();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ namespace LibHac.FsSystem.Save
|
||||
Caches = new Cache[cacheCount];
|
||||
if (Caches == null)
|
||||
{
|
||||
return ResultFs.AllocationFailureInBufferedStorageA.Log();
|
||||
return ResultFs.AllocationMemoryFailedInBufferedStorageA.Log();
|
||||
}
|
||||
|
||||
// Initialize the caches.
|
||||
@ -1294,7 +1294,7 @@ namespace LibHac.FsSystem.Save
|
||||
|
||||
// If the read fails due to insufficient pooled buffer size,
|
||||
// then we want to fall back to the normal read path.
|
||||
if (!ResultFs.AllocationFailurePooledBufferNotEnoughSize.Includes(rc))
|
||||
if (!ResultFs.AllocationMemoryFailedPooledBufferNotEnoughSize.Includes(rc))
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
@ -1518,7 +1518,7 @@ namespace LibHac.FsSystem.Save
|
||||
{
|
||||
pooledBuffer.AllocateParticularlyLarge((int)alignedSize, 1);
|
||||
if (pooledBuffer.GetSize() < alignedSize)
|
||||
return ResultFs.AllocationFailurePooledBufferNotEnoughSize.Log();
|
||||
return ResultFs.AllocationMemoryFailedPooledBufferNotEnoughSize.Log();
|
||||
|
||||
workBuffer = pooledBuffer.GetBuffer();
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ namespace LibHac.FsSystem.Save
|
||||
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
return ResultFs.UnsupportedOperationInHierarchicalIvfcStorageSetSize.Log();
|
||||
return ResultFs.UnsupportedSetSizeForHierarchicalIntegrityVerificationStorage.Log();
|
||||
}
|
||||
|
||||
protected override Result DoGetSize(out long size)
|
||||
|
@ -25,27 +25,27 @@ namespace LibHac.FsSystem.Save
|
||||
|
||||
if (ResultFs.IntegrityVerificationStorageCorrupted.Includes(result))
|
||||
{
|
||||
if (ResultFs.InvalidIvfcMagic.Includes(result))
|
||||
if (ResultFs.IncorrectIntegrityVerificationMagic.Includes(result))
|
||||
{
|
||||
return ResultFs.InvalidSaveDataIvfcMagic.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.InvalidIvfcHashValidationBit.Includes(result))
|
||||
if (ResultFs.InvalidZeroHash.Includes(result))
|
||||
{
|
||||
return ResultFs.InvalidSaveDataIvfcHashValidationBit.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.InvalidIvfcHash.Includes(result))
|
||||
if (ResultFs.NonRealDataVerificationFailed.Includes(result))
|
||||
{
|
||||
return ResultFs.InvalidSaveDataIvfcHash.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.EmptyIvfcHash.Includes(result))
|
||||
if (ResultFs.ClearedRealDataVerificationFailed.Includes(result))
|
||||
{
|
||||
return ResultFs.EmptySaveDataIvfcHash.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.InvalidHashInIvfcTopLayer.Includes(result))
|
||||
if (ResultFs.UnclearedRealDataVerificationFailed.Includes(result))
|
||||
{
|
||||
return ResultFs.InvalidSaveDataHashInIvfcTopLayer.Value;
|
||||
}
|
||||
@ -98,7 +98,7 @@ namespace LibHac.FsSystem.Save
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ResultFs.EntryNotFound.Includes(result))
|
||||
if (ResultFs.NotFound.Includes(result))
|
||||
{
|
||||
return ResultFs.PathNotFound.Value;
|
||||
}
|
||||
@ -108,7 +108,7 @@ namespace LibHac.FsSystem.Save
|
||||
return ResultFs.PathAlreadyExists.Value;
|
||||
}
|
||||
|
||||
if (ResultFs.PathNotFoundInSaveDataFileTable.Includes(result))
|
||||
if (ResultFs.IncompatiblePath.Includes(result))
|
||||
{
|
||||
return ResultFs.PathNotFound.Value;
|
||||
}
|
||||
@ -120,7 +120,7 @@ namespace LibHac.FsSystem.Save
|
||||
|
||||
if (ResultFs.AllocationTableInsufficientFreeBlocks.Includes(result))
|
||||
{
|
||||
return ResultFs.InsufficientFreeSpace.Value;
|
||||
return ResultFs.UsableSpaceNotEnough.Value;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -74,7 +74,7 @@ namespace LibHac.FsSystem
|
||||
protected override Result DoSetSize(long size)
|
||||
{
|
||||
if (!Mode.HasFlag(OpenMode.Write))
|
||||
return ResultFs.InvalidOpenModeForWrite.Log();
|
||||
return ResultFs.WriteUnpermitted.Log();
|
||||
|
||||
return BaseStorage.SetSize(size);
|
||||
}
|
||||
|
@ -25,5 +25,9 @@ namespace LibHac.Kvdb
|
||||
public static Result.Base InvalidKeyValue => new Result.Base(ModuleKvdb, 5);
|
||||
/// <summary>Error code: 2020-0006; Inner value: 0xc14</summary>
|
||||
public static Result.Base BufferInsufficient => new Result.Base(ModuleKvdb, 6);
|
||||
/// <summary>Error code: 2020-0008; Inner value: 0x1014</summary>
|
||||
public static Result.Base InvalidFileSystemState => new Result.Base(ModuleKvdb, 8);
|
||||
/// <summary>Error code: 2020-0009; Inner value: 0x1214</summary>
|
||||
public static Result.Base NotCreated => new Result.Base(ModuleKvdb, 9);
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,10 @@ namespace LibHac.Loader
|
||||
public static Result.Base InvalidProgramId => new Result.Base(ModuleLoader, 9);
|
||||
/// <summary>Error code: 2009-0010; Inner value: 0x1409</summary>
|
||||
public static Result.Base InvalidVersion => new Result.Base(ModuleLoader, 10);
|
||||
/// <summary>Error code: 2009-0011; Inner value: 0x1609</summary>
|
||||
public static Result.Base InvalidAcidSignature => new Result.Base(ModuleLoader, 11);
|
||||
/// <summary>Error code: 2009-0012; Inner value: 0x1809</summary>
|
||||
public static Result.Base InvalidNcaSignature => new Result.Base(ModuleLoader, 12);
|
||||
/// <summary>Error code: 2009-0051; Inner value: 0x6609</summary>
|
||||
public static Result.Base InsufficientAddressSpace => new Result.Base(ModuleLoader, 51);
|
||||
/// <summary>Error code: 2009-0052; Inner value: 0x6809</summary>
|
||||
|
113
src/LibHac/Ncm/ResultNcm.cs
Normal file
113
src/LibHac/Ncm/ResultNcm.cs
Normal file
@ -0,0 +1,113 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file was automatically generated.
|
||||
// Changes to this file will be lost when the file is regenerated.
|
||||
//
|
||||
// To change this file, modify /build/CodeGen/results.csv at the root of this
|
||||
// repo and run the build script.
|
||||
//
|
||||
// The script can be run with the "codegen" option to run only the
|
||||
// code generation portion of the build.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace LibHac.Ncm
|
||||
{
|
||||
public static class ResultNcm
|
||||
{
|
||||
public const int ModuleNcm = 5;
|
||||
|
||||
/// <summary>Error code: 2005-0001; Inner value: 0x205</summary>
|
||||
public static Result.Base InvalidContentStorageBase => new Result.Base(ModuleNcm, 1);
|
||||
/// <summary>Error code: 2005-0002; Inner value: 0x405</summary>
|
||||
public static Result.Base PlaceHolderAlreadyExists => new Result.Base(ModuleNcm, 2);
|
||||
/// <summary>Error code: 2005-0003; Inner value: 0x605</summary>
|
||||
public static Result.Base PlaceHolderNotFound => new Result.Base(ModuleNcm, 3);
|
||||
/// <summary>Error code: 2005-0004; Inner value: 0x805</summary>
|
||||
public static Result.Base ContentAlreadyExists => new Result.Base(ModuleNcm, 4);
|
||||
/// <summary>Error code: 2005-0005; Inner value: 0xa05</summary>
|
||||
public static Result.Base ContentNotFound => new Result.Base(ModuleNcm, 5);
|
||||
/// <summary>Error code: 2005-0007; Inner value: 0xe05</summary>
|
||||
public static Result.Base ContentMetaNotFound => new Result.Base(ModuleNcm, 7);
|
||||
/// <summary>Error code: 2005-0008; Inner value: 0x1005</summary>
|
||||
public static Result.Base AllocationFailed => new Result.Base(ModuleNcm, 8);
|
||||
/// <summary>Error code: 2005-0012; Inner value: 0x1805</summary>
|
||||
public static Result.Base UnknownStorage => new Result.Base(ModuleNcm, 12);
|
||||
/// <summary>Error code: 2005-0100; Inner value: 0xc805</summary>
|
||||
public static Result.Base InvalidContentStorage => new Result.Base(ModuleNcm, 100);
|
||||
/// <summary>Error code: 2005-0110; Inner value: 0xdc05</summary>
|
||||
public static Result.Base InvalidContentMetaDatabase => new Result.Base(ModuleNcm, 110);
|
||||
/// <summary>Error code: 2005-0130; Inner value: 0x10405</summary>
|
||||
public static Result.Base InvalidPackageFormat => new Result.Base(ModuleNcm, 130);
|
||||
/// <summary>Error code: 2005-0140; Inner value: 0x11805</summary>
|
||||
public static Result.Base InvalidContentHash => new Result.Base(ModuleNcm, 140);
|
||||
/// <summary>Error code: 2005-0160; Inner value: 0x14005</summary>
|
||||
public static Result.Base InvalidInstallTaskState => new Result.Base(ModuleNcm, 160);
|
||||
/// <summary>Error code: 2005-0170; Inner value: 0x15405</summary>
|
||||
public static Result.Base InvalidPlaceHolderFile => new Result.Base(ModuleNcm, 170);
|
||||
/// <summary>Error code: 2005-0180; Inner value: 0x16805</summary>
|
||||
public static Result.Base BufferInsufficient => new Result.Base(ModuleNcm, 180);
|
||||
/// <summary>Error code: 2005-0190; Inner value: 0x17c05</summary>
|
||||
public static Result.Base WriteToReadOnlyContentStorage => new Result.Base(ModuleNcm, 190);
|
||||
/// <summary>Error code: 2005-0200; Inner value: 0x19005</summary>
|
||||
public static Result.Base NotEnoughInstallSpace => new Result.Base(ModuleNcm, 200);
|
||||
/// <summary>Error code: 2005-0210; Inner value: 0x1a405</summary>
|
||||
public static Result.Base SystemUpdateNotFoundInPackage => new Result.Base(ModuleNcm, 210);
|
||||
/// <summary>Error code: 2005-0220; Inner value: 0x1b805</summary>
|
||||
public static Result.Base ContentInfoNotFound => new Result.Base(ModuleNcm, 220);
|
||||
/// <summary>Error code: 2005-0237; Inner value: 0x1da05</summary>
|
||||
public static Result.Base DeltaNotFound => new Result.Base(ModuleNcm, 237);
|
||||
/// <summary>Error code: 2005-0240; Inner value: 0x1e005</summary>
|
||||
public static Result.Base InvalidContentMetaKey => new Result.Base(ModuleNcm, 240);
|
||||
|
||||
/// <summary>Error code: 2005-0250; Range: 250-258; Inner value: 0x1f405</summary>
|
||||
public static Result.Base ContentStorageNotActive { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleNcm, 250, 258); }
|
||||
/// <summary>Error code: 2005-0251; Inner value: 0x1f605</summary>
|
||||
public static Result.Base GameCardContentStorageNotActive => new Result.Base(ModuleNcm, 251);
|
||||
/// <summary>Error code: 2005-0252; Inner value: 0x1f805</summary>
|
||||
public static Result.Base BuiltInSystemContentStorageNotActive => new Result.Base(ModuleNcm, 252);
|
||||
/// <summary>Error code: 2005-0253; Inner value: 0x1fa05</summary>
|
||||
public static Result.Base BuiltInUserContentStorageNotActive => new Result.Base(ModuleNcm, 253);
|
||||
/// <summary>Error code: 2005-0254; Inner value: 0x1fc05</summary>
|
||||
public static Result.Base SdCardContentStorageNotActive => new Result.Base(ModuleNcm, 254);
|
||||
/// <summary>Error code: 2005-0258; Inner value: 0x20405</summary>
|
||||
public static Result.Base UnknownContentStorageNotActive => new Result.Base(ModuleNcm, 258);
|
||||
|
||||
/// <summary>Error code: 2005-0260; Range: 260-268; Inner value: 0x20805</summary>
|
||||
public static Result.Base ContentMetaDatabaseNotActive { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleNcm, 260, 268); }
|
||||
/// <summary>Error code: 2005-0261; Inner value: 0x20a05</summary>
|
||||
public static Result.Base GameCardContentMetaDatabaseNotActive => new Result.Base(ModuleNcm, 261);
|
||||
/// <summary>Error code: 2005-0262; Inner value: 0x20c05</summary>
|
||||
public static Result.Base BuiltInSystemContentMetaDatabaseNotActive => new Result.Base(ModuleNcm, 262);
|
||||
/// <summary>Error code: 2005-0263; Inner value: 0x20e05</summary>
|
||||
public static Result.Base BuiltInUserContentMetaDatabaseNotActive => new Result.Base(ModuleNcm, 263);
|
||||
/// <summary>Error code: 2005-0264; Inner value: 0x21005</summary>
|
||||
public static Result.Base SdCardContentMetaDatabaseNotActive => new Result.Base(ModuleNcm, 264);
|
||||
/// <summary>Error code: 2005-0268; Inner value: 0x21805</summary>
|
||||
public static Result.Base UnknownContentMetaDatabaseNotActive => new Result.Base(ModuleNcm, 268);
|
||||
|
||||
/// <summary>Error code: 2005-0280; Inner value: 0x23005</summary>
|
||||
public static Result.Base IgnorableInstallTicketFailure => new Result.Base(ModuleNcm, 280);
|
||||
|
||||
/// <summary>Error code: 2005-0290; Range: 290-299; Inner value: 0x24405</summary>
|
||||
public static Result.Base InstallTaskCancelled { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleNcm, 290, 299); }
|
||||
/// <summary>Error code: 2005-0291; Inner value: 0x24605</summary>
|
||||
public static Result.Base CreatePlaceHolderCancelled => new Result.Base(ModuleNcm, 291);
|
||||
/// <summary>Error code: 2005-0292; Inner value: 0x24805</summary>
|
||||
public static Result.Base WritePlaceHolderCancelled => new Result.Base(ModuleNcm, 292);
|
||||
|
||||
/// <summary>Error code: 2005-0310; Inner value: 0x26c05</summary>
|
||||
public static Result.Base ContentStorageBaseNotFound => new Result.Base(ModuleNcm, 310);
|
||||
/// <summary>Error code: 2005-0330; Inner value: 0x29405</summary>
|
||||
public static Result.Base ListPartiallyNotCommitted => new Result.Base(ModuleNcm, 330);
|
||||
/// <summary>Error code: 2005-0360; Inner value: 0x2d005</summary>
|
||||
public static Result.Base UnexpectedContentMetaPrepared => new Result.Base(ModuleNcm, 360);
|
||||
/// <summary>Error code: 2005-0380; Inner value: 0x2f805</summary>
|
||||
public static Result.Base InvalidFirmwareVariation => new Result.Base(ModuleNcm, 380);
|
||||
|
||||
/// <summary>Error code: 2005-8181; Range: 8181-8191; Inner value: 0x3fea05</summary>
|
||||
public static Result.Base InvalidArgument { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new Result.Base(ModuleNcm, 8181, 8191); }
|
||||
/// <summary>Error code: 2005-8182; Inner value: 0x3fec05</summary>
|
||||
public static Result.Base InvalidOffset => new Result.Base(ModuleNcm, 8182);
|
||||
}
|
||||
}
|
52
src/LibHac/Spl/ResultSpl.cs
Normal file
52
src/LibHac/Spl/ResultSpl.cs
Normal file
@ -0,0 +1,52 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// This file was automatically generated.
|
||||
// Changes to this file will be lost when the file is regenerated.
|
||||
//
|
||||
// To change this file, modify /build/CodeGen/results.csv at the root of this
|
||||
// repo and run the build script.
|
||||
//
|
||||
// The script can be run with the "codegen" option to run only the
|
||||
// code generation portion of the build.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace LibHac.Spl
|
||||
{
|
||||
public static class ResultSpl
|
||||
{
|
||||
public const int ModuleSpl = 26;
|
||||
|
||||
/// <summary>Error code: 2026-0000; Range: 0-99; Inner value: 0x1a</summary>
|
||||
public static Result.Base SecureMonitorError => new Result.Base(ModuleSpl, 0, 99);
|
||||
/// <summary>Error code: 2026-0001; Inner value: 0x21a</summary>
|
||||
public static Result.Base SecureMonitorNotImplemented => new Result.Base(ModuleSpl, 1);
|
||||
/// <summary>Error code: 2026-0002; Inner value: 0x41a</summary>
|
||||
public static Result.Base SecureMonitorInvalidArgument => new Result.Base(ModuleSpl, 2);
|
||||
/// <summary>Error code: 2026-0003; Inner value: 0x61a</summary>
|
||||
public static Result.Base SecureMonitorBusy => new Result.Base(ModuleSpl, 3);
|
||||
/// <summary>Error code: 2026-0004; Inner value: 0x81a</summary>
|
||||
public static Result.Base SecureMonitorNoAsyncOperation => new Result.Base(ModuleSpl, 4);
|
||||
/// <summary>Error code: 2026-0005; Inner value: 0xa1a</summary>
|
||||
public static Result.Base SecureMonitorInvalidAsyncOperation => new Result.Base(ModuleSpl, 5);
|
||||
/// <summary>Error code: 2026-0006; Inner value: 0xc1a</summary>
|
||||
public static Result.Base SecureMonitorNotPermitted => new Result.Base(ModuleSpl, 6);
|
||||
/// <summary>Error code: 2026-0007; Inner value: 0xe1a</summary>
|
||||
public static Result.Base SecureMonitorNotInitialized => new Result.Base(ModuleSpl, 7);
|
||||
|
||||
/// <summary>Error code: 2026-0100; Inner value: 0xc81a</summary>
|
||||
public static Result.Base InvalidSize => new Result.Base(ModuleSpl, 100);
|
||||
/// <summary>Error code: 2026-0101; Inner value: 0xca1a</summary>
|
||||
public static Result.Base UnknownSecureMonitorError => new Result.Base(ModuleSpl, 101);
|
||||
/// <summary>Error code: 2026-0102; Inner value: 0xcc1a</summary>
|
||||
public static Result.Base DecryptionFailed => new Result.Base(ModuleSpl, 102);
|
||||
/// <summary>Error code: 2026-0104; Inner value: 0xd01a</summary>
|
||||
public static Result.Base OutOfKeySlots => new Result.Base(ModuleSpl, 104);
|
||||
/// <summary>Error code: 2026-0105; Inner value: 0xd21a</summary>
|
||||
public static Result.Base InvalidKeySlot => new Result.Base(ModuleSpl, 105);
|
||||
/// <summary>Error code: 2026-0106; Inner value: 0xd41a</summary>
|
||||
public static Result.Base BootReasonAlreadySet => new Result.Base(ModuleSpl, 106);
|
||||
/// <summary>Error code: 2026-0107; Inner value: 0xd61a</summary>
|
||||
public static Result.Base BootReasonNotSet => new Result.Base(ModuleSpl, 107);
|
||||
/// <summary>Error code: 2026-0108; Inner value: 0xd81a</summary>
|
||||
public static Result.Base InvalidArgument => new Result.Base(ModuleSpl, 108);
|
||||
}
|
||||
}
|
@ -49,7 +49,7 @@ namespace LibHac.Tests.Fs.FileSystemClientTests.ShimTests
|
||||
var applicationId = new Ncm.ApplicationId(1);
|
||||
FileSystemClient fs = FileSystemServerFactory.CreateClient(false);
|
||||
|
||||
Assert.Result(ResultFs.SdCardNotFound, fs.CreateCacheStorage(applicationId, SaveDataSpaceId.SdCache, applicationId.Value, 0, 0, SaveDataFlags.None));
|
||||
Assert.Result(ResultFs.PortSdCardNoDevice, fs.CreateCacheStorage(applicationId, SaveDataSpaceId.SdCache, applicationId.Value, 0, 0, SaveDataFlags.None));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -21,7 +21,7 @@ namespace LibHac.Tests.Fs.FileSystemClientTests.ShimTests
|
||||
{
|
||||
FileSystemClient fs = FileSystemServerFactory.CreateClient(false);
|
||||
|
||||
Assert.Result(ResultFs.SdCardNotFound, fs.MountSdCard("sdcard".ToU8Span()));
|
||||
Assert.Result(ResultFs.PortSdCardNoDevice, fs.MountSdCard("sdcard".ToU8Span()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -52,7 +52,7 @@ namespace LibHac.Tests.Fs.IFileSystemTestBase
|
||||
using (file)
|
||||
{
|
||||
Result rc = file.Read(out _, 0, buffer, ReadOption.None);
|
||||
Assert.Result(ResultFs.InvalidOpenModeForRead, rc);
|
||||
Assert.Result(ResultFs.ReadUnpermitted, rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace LibHac.Tests.Fs.IFileSystemTestBase
|
||||
using (file)
|
||||
{
|
||||
Result rc = file.Write(5, buffer, WriteOption.None);
|
||||
Assert.Result(ResultFs.InvalidOpenModeForWrite, rc);
|
||||
Assert.Result(ResultFs.WriteUnpermitted, rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user