mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Add CreateApplicationCacheStorage
This commit is contained in:
parent
3018eeb8e8
commit
c59e72606f
4 changed files with 27 additions and 7 deletions
|
@ -905,9 +905,9 @@ Module,DescriptionStart,DescriptionEnd,Flags,Namespace,Name,Summary
|
|||
2,6065,,,,InvalidMountName,
|
||||
2,6066,,,,ExtensionSizeTooLarge,
|
||||
2,6067,,,,ExtensionSizeInvalid,
|
||||
2,6068,,,,InvalidSaveDataInfoReader,
|
||||
2,6069,,,,InvalidCacheStorageSize,
|
||||
2,6070,,,,InvalidCacheStorageIndex,
|
||||
2,6068,,,,InvalidHandle,
|
||||
2,6069,,,,CacheStorageSizeTooLarge,
|
||||
2,6070,,,,CacheStorageIndexTooLarge,
|
||||
2,6071,,,,InvalidCommitNameCount,Up to 10 file systems can be committed at the same time.
|
||||
2,6072,,,,InvalidOpenMode,
|
||||
2,6073,,,,InvalidFileSize,
|
||||
|
|
|
|
@ -325,6 +325,26 @@ namespace LibHac.Fs
|
|||
|
||||
return EnsureApplicationCacheStorageImpl(fs, out requiredSize, out target, applicationId,
|
||||
nacp.SaveDataOwnerId.Value, 0, nacp.CacheStorageSize, nacp.CacheStorageJournalSize, true);
|
||||
|
||||
}
|
||||
|
||||
public static Result CreateApplicationCacheStorage(this FileSystemClient fs, out long requiredSize,
|
||||
out CacheStorageTargetMedia target, Ncm.ApplicationId applicationId, ref ApplicationControlProperty nacp,
|
||||
ushort index, long dataSize, long journalSize)
|
||||
{
|
||||
UnsafeHelpers.SkipParamInit(out requiredSize, out target);
|
||||
|
||||
if (index > nacp.CacheStorageMaxIndex)
|
||||
return ResultFs.CacheStorageIndexTooLarge.Log();
|
||||
|
||||
if (dataSize + journalSize > nacp.CacheStorageMaxSizeAndMaxJournalSize)
|
||||
return ResultFs.CacheStorageSizeTooLarge.Log();
|
||||
|
||||
Result rc = fs.EnsureApplicationCacheStorage(out requiredSize, out target, applicationId,
|
||||
nacp.SaveDataOwnerId.Value, index, dataSize, journalSize, false);
|
||||
|
||||
fs.Impl.AbortIfNeeded(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
public static Result EnsureApplicationBcatDeliveryCacheStorage(this FileSystemClient fs, out long requiredSize,
|
||||
|
|
|
@ -1622,11 +1622,11 @@ namespace LibHac.Fs
|
|||
/// <summary>Error code: 2002-6067; Inner value: 0x2f6602</summary>
|
||||
public static Result.Base ExtensionSizeInvalid => new Result.Base(ModuleFs, 6067);
|
||||
/// <summary>Error code: 2002-6068; Inner value: 0x2f6802</summary>
|
||||
public static Result.Base InvalidSaveDataInfoReader => new Result.Base(ModuleFs, 6068);
|
||||
public static Result.Base InvalidHandle => new Result.Base(ModuleFs, 6068);
|
||||
/// <summary>Error code: 2002-6069; Inner value: 0x2f6a02</summary>
|
||||
public static Result.Base InvalidCacheStorageSize => new Result.Base(ModuleFs, 6069);
|
||||
public static Result.Base CacheStorageSizeTooLarge => new Result.Base(ModuleFs, 6069);
|
||||
/// <summary>Error code: 2002-6070; Inner value: 0x2f6c02</summary>
|
||||
public static Result.Base InvalidCacheStorageIndex => new Result.Base(ModuleFs, 6070);
|
||||
public static Result.Base CacheStorageIndexTooLarge => new Result.Base(ModuleFs, 6070);
|
||||
/// <summary>Up to 10 file systems can be committed at the same time.<br/>Error code: 2002-6071; Inner value: 0x2f6e02</summary>
|
||||
public static Result.Base InvalidCommitNameCount => new Result.Base(ModuleFs, 6071);
|
||||
/// <summary>Error code: 2002-6072; Inner value: 0x2f7002</summary>
|
||||
|
|
|
@ -828,7 +828,7 @@ namespace LibHac.FsSrv
|
|||
// Indexer has been reloaded since this info reader was created
|
||||
if (_handle != _indexer.Handle)
|
||||
{
|
||||
return ResultFs.InvalidSaveDataInfoReader.Log();
|
||||
return ResultFs.InvalidHandle.Log();
|
||||
}
|
||||
|
||||
Span<SaveDataInfo> outInfo = MemoryMarshal.Cast<byte, SaveDataInfo>(saveDataInfoBuffer.Buffer);
|
||||
|
|
Loading…
Reference in a new issue