mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 21:02:39 +02:00
webConfigShow now uses new struct WebCommonReply as the output, for supporting WebCommonTLVStorage reply data.
This commit is contained in:
parent
e55dfd69c7
commit
2ed160624a
@ -68,6 +68,12 @@ typedef struct {
|
|||||||
u32 version;
|
u32 version;
|
||||||
} WebCommonConfig;
|
} WebCommonConfig;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool type; ///< false = ret, true = storage.
|
||||||
|
WebCommonReturnValue ret;
|
||||||
|
WebCommonTLVStorage storage;
|
||||||
|
} WebCommonReply;
|
||||||
|
|
||||||
/// Types for \ref WebArgTLV.
|
/// Types for \ref WebArgTLV.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
WebArgType_Url = 0x1, ///< [1.0.0+] String, size 0xC00. Initial URL.
|
WebArgType_Url = 0x1, ///< [1.0.0+] String, size 0xC00. Initial URL.
|
||||||
@ -466,5 +472,5 @@ Result webConfigSetPageScrollIndicator(WebCommonConfig* config, bool flag);
|
|||||||
* @param config WebCommonConfig object.
|
* @param config WebCommonConfig object.
|
||||||
* @param out Optional output applet reply data, can be NULL.
|
* @param out Optional output applet reply data, can be NULL.
|
||||||
*/
|
*/
|
||||||
Result webConfigShow(WebCommonConfig* config, WebCommonReturnValue *out);
|
Result webConfigShow(WebCommonConfig* config, WebCommonReply *out);
|
||||||
|
|
||||||
|
@ -506,7 +506,23 @@ Result webConfigSetPageScrollIndicator(WebCommonConfig* config, bool flag) {
|
|||||||
return _webConfigSetFlag(config, WebArgType_PageScrollIndicator, flag);
|
return _webConfigSetFlag(config, WebArgType_PageScrollIndicator, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result webConfigShow(WebCommonConfig* config, WebCommonReturnValue *out) {
|
Result webConfigShow(WebCommonConfig* config, WebCommonReply *out) {
|
||||||
return _webShow(config->appletid, config->version, &config->arg, sizeof(config->arg), out, sizeof(*out));
|
void* reply;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
|
// ShareApplet on [3.0.0+] uses TLV storage for the reply, while older versions + everything else uses *ReturnValue.
|
||||||
|
memset(out, 0, sizeof(*out));
|
||||||
|
if (config->version >= 0x30000 && _webGetShimKind(config) == WebShimKind_Share) out->type = true;
|
||||||
|
|
||||||
|
if (!out->type) {
|
||||||
|
reply = &out->ret;
|
||||||
|
size = sizeof(out->ret);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
reply = &out->storage;
|
||||||
|
size = sizeof(out->storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _webShow(config->appletid, config->version, &config->arg, sizeof(config->arg), reply, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user