From 76fd03e55a7a3cd9c828082b3507fb75cb02f23c Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Tue, 15 Dec 2020 04:10:53 -0400 Subject: [PATCH] fs: Added fsDeleteSaveDataFileSystemBySaveDataAttribute(). --- nx/include/switch/services/fs.h | 1 + nx/source/services/fs.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/nx/include/switch/services/fs.h b/nx/include/switch/services/fs.h index e3c77cc7..6a0b87b6 100644 --- a/nx/include/switch/services/fs.h +++ b/nx/include/switch/services/fs.h @@ -341,6 +341,7 @@ Result fsDeleteSaveDataFileSystem(u64 application_id); Result fsCreateSaveDataFileSystem(const FsSaveDataAttribute* attr, const FsSaveDataCreationInfo* creation_info, const FsSaveDataMetaInfo* meta); Result fsCreateSaveDataFileSystemBySystemSaveDataId(const FsSaveDataAttribute* attr, const FsSaveDataCreationInfo* creation_info); Result fsDeleteSaveDataFileSystemBySaveDataSpaceId(FsSaveDataSpaceId save_data_space_id, u64 saveID); ///< [2.0.0+] +Result fsDeleteSaveDataFileSystemBySaveDataAttribute(FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute* attr); ///< [4.0.0+] Result fsIsExFatSupported(bool* out); diff --git a/nx/source/services/fs.c b/nx/source/services/fs.c index 6f748892..7667e812 100644 --- a/nx/source/services/fs.c +++ b/nx/source/services/fs.c @@ -259,6 +259,18 @@ Result fsDeleteSaveDataFileSystemBySaveDataSpaceId(FsSaveDataSpaceId save_data_s return _fsObjectDispatchIn(&g_fsSrv, 25, in); } +Result fsDeleteSaveDataFileSystemBySaveDataAttribute(FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute* attr) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + const struct { + u8 save_data_space_id; + FsSaveDataAttribute attr; + } in = { (u8)save_data_space_id, *attr }; + + return _fsObjectDispatchIn(&g_fsSrv, 28, in); +} + Result fsIsExFatSupported(bool* out) { if (hosversionBefore(2,0,0)) { *out = false;