From 5ca698eda1dcc3d634ae33a0fba708c922b1a44d Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Wed, 18 Sep 2019 18:07:08 -0500 Subject: [PATCH] More IFileSystemProxy functions --- src/LibHac/Common/Id128.cs | 2 +- src/LibHac/FsService/IFileSystemProxy.cs | 4 ++++ src/LibHac/Ncm/StorageId.cs | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/LibHac/Ncm/StorageId.cs diff --git a/src/LibHac/Common/Id128.cs b/src/LibHac/Common/Id128.cs index eab8ab95..68deec6c 100644 --- a/src/LibHac/Common/Id128.cs +++ b/src/LibHac/Common/Id128.cs @@ -12,7 +12,7 @@ namespace LibHac.Common public readonly ulong High; public readonly ulong Low; - public static Id128 InvalidId = new Id128(0, 0); + public static readonly Id128 InvalidId = new Id128(0, 0); public Id128(ulong high, ulong low) { diff --git a/src/LibHac/FsService/IFileSystemProxy.cs b/src/LibHac/FsService/IFileSystemProxy.cs index 0498556d..146219ba 100644 --- a/src/LibHac/FsService/IFileSystemProxy.cs +++ b/src/LibHac/FsService/IFileSystemProxy.cs @@ -52,6 +52,10 @@ namespace LibHac.FsService Result OpenContentStorageFileSystem(out IFileSystem fileSystem, ContentStorageId storageId); Result OpenCustomStorageFileSystem(out IFileSystem fileSystem, CustomStorageId storageId); + Result OpenDataStorageByCurrentProcess(out IStorage storage); + Result OpenDataStorageByProgramId(out IStorage storage, TitleId programId); + Result OpenDataStorageByDataId(out IStorage storage, TitleId dataId, StorageId storageId); + Result SetSdCardEncryptionSeed(ReadOnlySpan seed); Result SetSaveDataSize(long saveDataSize, long saveDataJournalSize); Result SetSaveDataRootPath(U8Span path); diff --git a/src/LibHac/Ncm/StorageId.cs b/src/LibHac/Ncm/StorageId.cs new file mode 100644 index 00000000..a19d8493 --- /dev/null +++ b/src/LibHac/Ncm/StorageId.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LibHac.Ncm +{ + public enum StorageId : byte + { + None = 0, + Host = 1, + GameCard = 2, + BuiltInSystem = 3, + BuiltInUser = 4, + SdCard = 5 + } +}