mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +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;
|
||||
} WebCommonConfig;
|
||||
|
||||
typedef struct {
|
||||
bool type; ///< false = ret, true = storage.
|
||||
WebCommonReturnValue ret;
|
||||
WebCommonTLVStorage storage;
|
||||
} WebCommonReply;
|
||||
|
||||
/// Types for \ref WebArgTLV.
|
||||
typedef enum {
|
||||
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 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);
|
||||
}
|
||||
|
||||
Result webConfigShow(WebCommonConfig* config, WebCommonReturnValue *out) {
|
||||
return _webShow(config->appletid, config->version, &config->arg, sizeof(config->arg), out, sizeof(*out));
|
||||
Result webConfigShow(WebCommonConfig* config, WebCommonReply *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