diff --git a/include/sysapp/args.h b/include/sysapp/args.h index 411266e7d..f5159fb94 100644 --- a/include/sysapp/args.h +++ b/include/sysapp/args.h @@ -22,7 +22,7 @@ typedef struct SYSStandardArgs SYSStandardArgs; typedef struct SYSStandardArgsIn SYSStandardArgsIn; typedef struct SYSStandardArgsOut SYSStandardArgsOut; -typedef void (*SYSDeserializeCallback)(SYSDeserializeArg *arg, void *userptr); +typedef void (*SYSDeserializeCallback)(SYSDeserializeArg *arg, void *userArg); typedef enum SYSArgIDEnum { @@ -136,18 +136,38 @@ int32_t SYSGetArguments(SYSArgDataBlock *args, SYSCallerInfo *callerInfo); +int32_t +SYSGetStandardArgs(SYSStandardArgs *stdArgs); + void SYSClearSysArgs(); +int32_t +SYSPackArgs(); + int32_t SYSSerializeSysArgs(const char *argName, const void *data, uint32_t size); +int32_t +SYSSerializeSysArgsToBuffer(char *buffer, + uint32_t *bytesWritten, + uint32_t bufferSize, + const char *argName, + const void *data, + uint32_t dataSize); + int32_t SYSDeserializeSysArgs(SYSDeserializeCallback callback, void *userArg); +int32_t +SYSDeserializeSysArgsFromBlock(void *block, + uint32_t blockSize, + SYSDeserializeCallback callback, + void *userArg); + int32_t _SYSDirectlyReturnToCaller(SYSStandardArgsOut *arg); diff --git a/include/sysapp/launch.h b/include/sysapp/launch.h index 3db84adca..a4e01e924 100644 --- a/include/sysapp/launch.h +++ b/include/sysapp/launch.h @@ -1,6 +1,7 @@ #pragma once #include <wut.h> +#include "args.h" #include "switch.h" #include "nn/ffl/miidata.h" @@ -25,7 +26,7 @@ typedef struct SysAppParentalArgs SysAppParentalArgs; typedef struct SysAppNotificationArgs SysAppNotificationArgs; struct SysAppMiiMakerArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; uint32_t slotId; FFLStoreData *mii; }; @@ -35,7 +36,7 @@ WUT_CHECK_OFFSET(SysAppMiiMakerArgs, 0x0C, mii); WUT_CHECK_SIZE(SysAppMiiMakerArgs, 0x10); struct _SysAppMiiMakerArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; uint32_t mode; uint32_t slotId; FFLStoreData *mii; @@ -47,7 +48,7 @@ WUT_CHECK_OFFSET(_SysAppMiiMakerArgs, 0x10, mii); WUT_CHECK_SIZE(_SysAppMiiMakerArgs, 0x14); struct SysAppSettingsArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; int32_t jumpTo; uint32_t firstBootKind; }; @@ -57,7 +58,7 @@ WUT_CHECK_OFFSET(SysAppSettingsArgs, 0x0C, firstBootKind); WUT_CHECK_SIZE(SysAppSettingsArgs, 0x10); struct SysAppParentalArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; uint32_t mode; }; WUT_CHECK_OFFSET(SysAppParentalArgs, 0x0, stdArgs); @@ -65,7 +66,7 @@ WUT_CHECK_OFFSET(SysAppParentalArgs, 0x8, mode); WUT_CHECK_SIZE(SysAppParentalArgs, 0x0C); struct SysAppNotificationArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; uint32_t notificationFile; }; WUT_CHECK_OFFSET(SysAppNotificationArgs, 0x0, stdArgs); @@ -123,7 +124,7 @@ SYSLaunchTitle(uint64_t TitleId); void _SYSLaunchTitleWithStdArgsInNoSplash(uint64_t titleId, - void *unknwn); + SYSStandardArgsIn *stdArgs); void _SYSLaunchMenuWithCheckingAccount(uint8_t slot); diff --git a/include/sysapp/switch.h b/include/sysapp/switch.h index 641d2b476..f28ed2876 100644 --- a/include/sysapp/switch.h +++ b/include/sysapp/switch.h @@ -1,5 +1,6 @@ #pragma once #include <wut.h> +#include "args.h" /** * \defgroup sysapp_switch SYSAPP Switch @@ -19,24 +20,14 @@ extern "C" { #endif -typedef struct SysAppStandardArgs SysAppStandardArgs; typedef struct SysAppBrowserArgs SysAppBrowserArgs; typedef struct SysAppBrowserArgsWithCallback SysAppBrowserArgsWithCallback; typedef struct SysAppEShopArgs SysAppEShopArgs; typedef struct SysAppEManualArgs SysAppEManualArgs; -struct SysAppStandardArgs -{ - void *anchor; - uint32_t anchorSize; -}; -WUT_CHECK_OFFSET(SysAppStandardArgs, 0x0, anchor); -WUT_CHECK_OFFSET(SysAppStandardArgs, 0x4, anchorSize); -WUT_CHECK_SIZE(SysAppStandardArgs, 0x8); - struct SysAppEManualArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; uint64_t titleId; }; WUT_CHECK_OFFSET(SysAppEManualArgs, 0x0, stdArgs); @@ -45,7 +36,7 @@ WUT_CHECK_SIZE(SysAppEManualArgs, 0x10); struct SysAppEShopArgs { - SysAppStandardArgs stdArgs; + SYSStandardArgsIn stdArgs; char *query; uint32_t querySize; }; @@ -56,9 +47,9 @@ WUT_CHECK_SIZE(SysAppEShopArgs, 0x10); struct SysAppBrowserArgs { - SysAppStandardArgs stdArgs; - char *url; - uint32_t urlSize; + SYSStandardArgsIn stdArgs; + char *url; + uint32_t urlSize; }; WUT_CHECK_OFFSET(SysAppBrowserArgs, 0x0, stdArgs); WUT_CHECK_OFFSET(SysAppBrowserArgs, 0x8, url); @@ -69,8 +60,8 @@ struct SysAppBrowserArgsWithCallback { SysAppBrowserArgs browserArgs; char *cbUrl; - uint32_t cbUrlSize; - BOOL hbmDisable; + uint32_t cbUrlSize; + BOOL hbmDisable; }; WUT_CHECK_OFFSET(SysAppBrowserArgsWithCallback, 0x0, browserArgs); WUT_CHECK_OFFSET(SysAppBrowserArgsWithCallback, 0x10, cbUrl); @@ -134,7 +125,7 @@ int32_t SYSSwitchToEShop(SysAppEShopArgs *); int32_t -SYSSwitchToEShopTicketList(SysAppStandardArgs *); +SYSSwitchToEShopTicketList(SYSStandardArgsIn *); int32_t _SYSSwitchToEShopFromHBM(SysAppEShopArgs *);