web: Added 11.0 webConfigSetTransferMemory().

This commit is contained in:
yellows8 2020-12-15 19:22:24 -05:00
parent 41fc8bb17c
commit 55179074cc
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
2 changed files with 15 additions and 0 deletions

View File

@ -227,6 +227,7 @@ typedef enum {
WebArgType_SessionBootMode = 0x41, ///< [7.0.0+] u32 enum \ref WebSessionBootMode
WebArgType_SessionFlag = 0x42, ///< [7.0.0+] u8 bool, enables using WebSession when set.
WebArgType_MediaPlayerUi = 0x43, ///< [8.0.0+] u8 bool
WebArgType_TransferMemory = 0x44, ///< [11.0.0+] u8 bool
} WebArgType;
/// Types for \ref WebArgTLV, output storage.
@ -713,6 +714,14 @@ Result webConfigSetBootMode(WebCommonConfig* config, WebSessionBootMode mode);
*/
Result webConfigSetMediaPlayerUi(WebCommonConfig* config, bool flag);
/**
* @brief Sets whether TransferMemory is enabled.
* @note Only available with config created by \ref webPageCreate on [11.0.0+].
* @param config WebCommonConfig object.
* @param flag Flag
*/
Result webConfigSetTransferMemory(WebCommonConfig* config, bool flag);
/**
* @brief Launches the {web applet} with the specified config and waits for it to exit.
* @param config WebCommonConfig object.

View File

@ -702,6 +702,12 @@ Result webConfigSetMediaPlayerUi(WebCommonConfig* config, bool flag) {
return _webConfigSetFlag(config, WebArgType_MediaPlayerUi, flag);
}
Result webConfigSetTransferMemory(WebCommonConfig* config, bool flag) {
if (_webGetShimKind(config) != WebShimKind_Web) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(11,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _webConfigSetFlag(config, WebArgType_TransferMemory, flag);
}
static void _webConfigInitReply(WebCommonConfig* config, WebCommonReply *out, void** reply, size_t *reply_size) {
if (out) {
// ShareApplet on [3.0.0+] uses TLV storage for the reply, while older versions + everything else uses *ReturnValue.