From e49523eed6de79733813bc80621a1e34284bb262 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Wed, 15 Nov 2023 18:10:36 -0700 Subject: [PATCH] Update save data transfer interfaces for FS 17 --- src/LibHac/Fs/Shim/SaveDataTransferVersion2.cs | 13 ++++++++++--- src/LibHac/FsSrv/Impl/SaveDataTransferVersion2.cs | 2 +- .../Sf/ISaveDataTransferManagerWithDivision.cs | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/LibHac/Fs/Shim/SaveDataTransferVersion2.cs b/src/LibHac/Fs/Shim/SaveDataTransferVersion2.cs index 035c160f..f22a2023 100644 --- a/src/LibHac/Fs/Shim/SaveDataTransferVersion2.cs +++ b/src/LibHac/Fs/Shim/SaveDataTransferVersion2.cs @@ -165,12 +165,18 @@ namespace LibHac.Fs } public Result OpenSaveDataImporterImpl(ref UniqueRef outImporter, - in InitialDataVersion2 initialData, in UserId userId, SaveDataSpaceId spaceId, bool useSwap) + in InitialDataVersion2 initialData, ulong staticSaveDataId, in UserId userId, ulong ownerId, + SaveDataSpaceId spaceId, bool useSwap) { using var importerInterface = new SharedRef(); + SaveDataCreationInfo2 creationInfo = default; + creationInfo.Attribute.StaticSaveDataId = staticSaveDataId; + creationInfo.Attribute.UserId = userId; + creationInfo.OwnerId = ownerId; + Result res = _baseInterface.Get.OpenSaveDataImporter(ref importerInterface.Ref, - InBuffer.FromStruct(in initialData), in userId, spaceId, useSwap); + InBuffer.FromStruct(in initialData), in creationInfo, spaceId, useSwap); _fsClient.Impl.LogResultErrorMessage(res); if (res.IsFailure()) return res.Miss(); @@ -182,7 +188,8 @@ namespace LibHac.Fs public Result OpenSaveDataImporter(ref UniqueRef outImporter, in InitialDataVersion2 initialData, SaveDataSpaceId spaceId, bool useSwap) { - return OpenSaveDataImporterImpl(ref outImporter, in initialData, InvalidUserId, spaceId, useSwap); + return OpenSaveDataImporterImpl(ref outImporter, in initialData, InvalidSystemSaveDataId, InvalidUserId, + ownerId: 0, spaceId, useSwap); } public Result OpenSaveDataImporterByContext(ref UniqueRef outImporter, diff --git a/src/LibHac/FsSrv/Impl/SaveDataTransferVersion2.cs b/src/LibHac/FsSrv/Impl/SaveDataTransferVersion2.cs index 55773e99..44482155 100644 --- a/src/LibHac/FsSrv/Impl/SaveDataTransferVersion2.cs +++ b/src/LibHac/FsSrv/Impl/SaveDataTransferVersion2.cs @@ -226,7 +226,7 @@ public class SaveDataTransferManagerVersion2 : ISaveDataTransferManagerWithDivis } public Result OpenSaveDataImporter(ref SharedRef outImporter, InBuffer initialData, - in UserId userId, SaveDataSpaceId spaceId, bool useSwap) + in SaveDataCreationInfo2 creationInfo, SaveDataSpaceId spaceId, bool useSwap) { throw new NotImplementedException(); } diff --git a/src/LibHac/FsSrv/Sf/ISaveDataTransferManagerWithDivision.cs b/src/LibHac/FsSrv/Sf/ISaveDataTransferManagerWithDivision.cs index 41aae313..8a5a61cf 100644 --- a/src/LibHac/FsSrv/Sf/ISaveDataTransferManagerWithDivision.cs +++ b/src/LibHac/FsSrv/Sf/ISaveDataTransferManagerWithDivision.cs @@ -15,7 +15,7 @@ public interface ISaveDataTransferManagerWithDivision : IDisposable public Result OpenSaveDataImporterDeprecated(ref SharedRef outImporter, InBuffer initialData, in UserId userId, SaveDataSpaceId spaceId); public Result OpenSaveDataImporterForDiffImport(ref SharedRef outImporter, InBuffer initialData, SaveDataSpaceId spaceId, ulong saveDataId); public Result OpenSaveDataImporterForDuplicateDiffImport(ref SharedRef outImporter, InBuffer initialData, SaveDataSpaceId spaceId, ulong saveDataId); - public Result OpenSaveDataImporter(ref SharedRef outImporter, InBuffer initialData, in UserId userId, SaveDataSpaceId spaceId, bool useSwap); + public Result OpenSaveDataImporter(ref SharedRef outImporter, InBuffer initialData, in SaveDataCreationInfo2 creationInfo, SaveDataSpaceId spaceId, bool useSwap); public Result OpenSaveDataImporterByContext(ref SharedRef outImporter, InBuffer importContext); public Result CancelSuspendingImport(Ncm.ApplicationId applicationId, in UserId userId); public Result CancelSuspendingImportByAttribute(in SaveDataAttribute attribute);