From 52a892ca3196677f669a90601d3849ea1651c53c Mon Sep 17 00:00:00 2001 From: yellows8 Date: Thu, 6 Feb 2020 20:07:02 -0500 Subject: [PATCH] ns: Fixed cmd order. --- nx/include/switch/services/ns.h | 40 ++++++++++++++++----------------- nx/source/services/ns.c | 28 +++++++++++------------ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/nx/include/switch/services/ns.h b/nx/include/switch/services/ns.h index a850e1aa..4b29546e 100644 --- a/nx/include/switch/services/ns.h +++ b/nx/include/switch/services/ns.h @@ -163,26 +163,6 @@ Service* nsGetServiceSession_ApplicationManagerInterface(void); */ Result nsListApplicationRecord(NsApplicationRecord* records, s32 count, s32 entry_offset, s32* out_entrycount); -/** - * @brief Gets an listing of \ref NsApplicationContentMetaStatus. - * @param[in] application_id ApplicationId. - * @param[in] index Starting entry index. - * @param[out] list Output array of \ref NsApplicationContentMetaStatus. - * @param[in] count Size of the list array in entries. - * @param[out] out_entrycount Total output entries. - */ -Result nsListApplicationContentMetaStatus(u64 application_id, s32 index, NsApplicationContentMetaStatus* list, s32 count, s32* out_entrycount); - -/** - * @brief Gets the \ref NsApplicationControlData for the specified application. - * @param[in] source Source, official sw uses ::NsApplicationControlSource_Storage. - * @param[in] application_id ApplicationId. - * @param[out] buffer \ref NsApplicationControlData - * @param[in] size Size of the buffer. - * @param[out] actual_size Actual output size. - */ -Result nsGetApplicationControlData(NsApplicationControlSource source, u64 application_id, NsApplicationControlData* buffer, size_t size, u64* actual_size); - /** * @brief Returns the total storage capacity (used + free) from content manager services. * @param[in] storage_id \ref NcmStorageId. Must be ::NcmStorageId_SdCard. @@ -197,6 +177,26 @@ Result nsGetTotalSpaceSize(NcmStorageId storage_id, u64 *size); */ Result nsGetFreeSpaceSize(NcmStorageId storage_id, u64 *size); +/** + * @brief Gets the \ref NsApplicationControlData for the specified application. + * @param[in] source Source, official sw uses ::NsApplicationControlSource_Storage. + * @param[in] application_id ApplicationId. + * @param[out] buffer \ref NsApplicationControlData + * @param[in] size Size of the buffer. + * @param[out] actual_size Actual output size. + */ +Result nsGetApplicationControlData(NsApplicationControlSource source, u64 application_id, NsApplicationControlData* buffer, size_t size, u64* actual_size); + +/** + * @brief Gets an listing of \ref NsApplicationContentMetaStatus. + * @param[in] application_id ApplicationId. + * @param[in] index Starting entry index. + * @param[out] list Output array of \ref NsApplicationContentMetaStatus. + * @param[in] count Size of the list array in entries. + * @param[out] out_entrycount Total output entries. + */ +Result nsListApplicationContentMetaStatus(u64 application_id, s32 index, NsApplicationContentMetaStatus* list, s32 count, s32* out_entrycount); + /** * @brief Generates a \ref NsSystemDeliveryInfo using the currently installed SystemUpdate meta. * @note Only available on [4.0.0+]. diff --git a/nx/source/services/ns.c b/nx/source/services/ns.c index e4ba6f23..8849664f 100644 --- a/nx/source/services/ns.c +++ b/nx/source/services/ns.c @@ -175,16 +175,12 @@ Result nsListApplicationRecord(NsApplicationRecord* records, s32 count, s32 entr ); } -Result nsListApplicationContentMetaStatus(u64 application_id, s32 index, NsApplicationContentMetaStatus* list, s32 count, s32* out_entrycount) { - const struct { - s32 index; - u64 application_id; - } in = { index, application_id }; +Result nsGetTotalSpaceSize(NcmStorageId storage_id, u64 *size) { + return _nsCmdInU64OutU64(&g_nsAppManSrv, storage_id, size, 47); +} - return serviceDispatchInOut(&g_nsAppManSrv, 601, in, *out_entrycount, - .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, - .buffers = { { list, count*sizeof(NsApplicationContentMetaStatus) } }, - ); +Result nsGetFreeSpaceSize(NcmStorageId storage_id, u64 *size) { + return _nsCmdInU64OutU64(&g_nsAppManSrv, storage_id, size, 48); } Result nsGetApplicationControlData(NsApplicationControlSource source, u64 application_id, NsApplicationControlData* buffer, size_t size, u64* actual_size) { @@ -203,12 +199,16 @@ Result nsGetApplicationControlData(NsApplicationControlSource source, u64 applic return rc; } -Result nsGetTotalSpaceSize(NcmStorageId storage_id, u64 *size) { - return _nsCmdInU64OutU64(&g_nsAppManSrv, storage_id, size, 47); -} +Result nsListApplicationContentMetaStatus(u64 application_id, s32 index, NsApplicationContentMetaStatus* list, s32 count, s32* out_entrycount) { + const struct { + s32 index; + u64 application_id; + } in = { index, application_id }; -Result nsGetFreeSpaceSize(NcmStorageId storage_id, u64 *size) { - return _nsCmdInU64OutU64(&g_nsAppManSrv, storage_id, size, 48); + return serviceDispatchInOut(&g_nsAppManSrv, 601, in, *out_entrycount, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { list, count*sizeof(NsApplicationContentMetaStatus) } }, + ); } Result nsGetSystemDeliveryInfo(NsSystemDeliveryInfo *info) {