Rebase against 2d6462cdee2bd87a49382794e5a554f33c367f09.

This commit is contained in:
Alistair Leslie-Hughes 2021-01-26 15:37:12 +11:00
parent 3dec70bf32
commit fd3372e71c
5 changed files with 39 additions and 191 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "2d4dd4252b0cf6526b3cc8194cce642b16eb12f6"
echo "2d6462cdee2bd87a49382794e5a554f33c367f09"
}
# Show version information
@ -4514,7 +4514,6 @@ fi
# | tools/widl/widltypes.h
# |
if test "$enable_widl_winrt_support" -eq 1; then
patch_apply widl-winrt-support/0002-widl-Support-WinRT-marshaling_behavior-attribute-par.patch
patch_apply widl-winrt-support/0003-widl-Support-WinRT-mta-threading-attribute-parsing.patch
patch_apply widl-winrt-support/0004-widl-Support-WinRT-exclusiveto-attribute-parsing.patch
patch_apply widl-winrt-support/0005-widl-Support-WinRT-runtimeclass-type.patch

View File

@ -1,172 +0,0 @@
From 2b18a86a118e0db756742e0030c08d093458c8fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 20:34:28 +0200
Subject: [PATCH] widl: Support WinRT marshaling_behavior attribute parsing.
---
tools/widl/header.c | 7 +++++++
tools/widl/parser.l | 4 ++++
tools/widl/parser.y | 18 ++++++++++++++++--
tools/widl/widltypes.h | 9 +++++++++
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 223ab5c5ca9..21f8528c31d 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1494,6 +1494,13 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
fprintf(header, " * Introduced to %s in version %d.%d\n *\n", name, (ver >> 16) & 0xffff, ver & 0xffff);
free(name);
}
+ switch (get_attrv(type->attrs, ATTR_MARSHALING_BEHAVIOR))
+ {
+ case MARSHALING_AGILE: fprintf(header, " * Class Marshaling Behavior: Agile - Class is agile\n *\n"); break;
+ case MARSHALING_STANDARD: fprintf(header, " * Class Marshaling Behavior: Standard - Class marshals using the standard marshaler\n *\n"); break;
+ case MARSHALING_NONE: fprintf(header, " * Class Marshaling Behavior: None - Class cannot be marshaled\n *\n"); break;
+ default: break;
+ }
}
static void write_apicontract_guard_start(FILE *header, const expr_t *expr)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 9dce03577c6..01c6f800a08 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -320,6 +320,7 @@ static const struct keyword keywords[] = {
static const struct keyword attr_keywords[] =
{
{"aggregatable", tAGGREGATABLE, 0},
+ {"agile", tAGILE, 1},
{"all_nodes", tALLNODES, 0},
{"allocate", tALLOCATE, 0},
{"annotation", tANNOTATION, 0},
@@ -381,12 +382,14 @@ static const struct keyword attr_keywords[] =
{"length_is", tLENGTHIS, 0},
{"licensed", tLICENSED, 0},
{"local", tLOCAL, 0},
+ {"marshaling_behavior", tMARSHALINGBEHAVIOR, 1},
{"maybe", tMAYBE, 0},
{"message", tMESSAGE, 0},
{"neutral", tNEUTRAL, 0},
{"nocode", tNOCODE, 0},
{"nonbrowsable", tNONBROWSABLE, 0},
{"noncreatable", tNONCREATABLE, 0},
+ {"none", tNONE, 1},
{"nonextensible", tNONEXTENSIBLE, 0},
{"notify", tNOTIFY, 0},
{"notify_flag", tNOTIFYFLAG, 0},
@@ -416,6 +419,7 @@ static const struct keyword attr_keywords[] =
{"single_node", tSINGLENODE, 0},
{"size_is", tSIZEIS, 0},
{"source", tSOURCE, 0},
+ {"standard", tSTANDARD, 1},
{"strict_context_handle", tSTRICTCONTEXTHANDLE, 0},
{"string", tSTRING, 0},
{"switch_is", tSWITCHIS, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 1d413ca74f4..a8160df900a 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -174,7 +174,9 @@ static typelib_t *current_typelib;
%token GREATEREQUAL LESSEQUAL
%token LOGICALOR LOGICALAND
%token ELLIPSIS
-%token tAGGREGATABLE tALLNODES tALLOCATE tANNOTATION
+%token tAGGREGATABLE
+%token tAGILE
+%token tALLNODES tALLOCATE tANNOTATION
%token tAPICONTRACT
%token tAPPOBJECT tASYNC tASYNCUUID
%token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT
@@ -216,12 +218,14 @@ static typelib_t *current_typelib;
%token tLENGTHIS tLIBRARY
%token tLICENSED tLOCAL
%token tLONG
+%token tMARSHALINGBEHAVIOR
%token tMAYBE tMESSAGE
%token tMETHODS
%token tMODULE
%token tNAMESPACE
%token tNOCODE tNONBROWSABLE
%token tNONCREATABLE
+%token tNONE
%token tNONEXTENSIBLE
%token tNOTIFY tNOTIFYFLAG
%token tNULL
@@ -247,6 +251,7 @@ static typelib_t *current_typelib;
%token tSIZEIS tSIZEOF
%token tSMALL
%token tSOURCE
+%token tSTANDARD
%token tSTATIC
%token tSTDCALL
%token tSTRICTCONTEXTHANDLE
@@ -299,7 +304,7 @@ static typelib_t *current_typelib;
%type <type> coclass coclasshdr coclassdef
%type <type> apicontract
%type <num> contract_ver
-%type <num> pointer_type threading_type version
+%type <num> pointer_type threading_type marshaling_behavior version
%type <str> libraryhdr callconv cppquote importlib import t_ident
%type <uuid> uuid_string
%type <import> import_start
@@ -505,6 +510,12 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); }
| str_list ',' aSTRING { $$ = append_str( $1, $3 ); }
;
+marshaling_behavior:
+ tAGILE { $$ = MARSHALING_AGILE; }
+ | tNONE { $$ = MARSHALING_NONE; }
+ | tSTANDARD { $$ = MARSHALING_STANDARD; }
+ ;
+
contract_ver:
aNUM { $$ = MAKEVERSION(0, $1); }
| aNUM '.' aNUM { $$ = MAKEVERSION($3, $1); }
@@ -572,6 +583,8 @@ attribute: { $$ = NULL; }
| tLCID { $$ = make_attr(ATTR_PARAMLCID); }
| tLICENSED { $$ = make_attr(ATTR_LICENSED); }
| tLOCAL { $$ = make_attr(ATTR_LOCAL); }
+ | tMARSHALINGBEHAVIOR '(' marshaling_behavior ')'
+ { $$ = make_attrv(ATTR_MARSHALING_BEHAVIOR, $3); }
| tMAYBE { $$ = make_attr(ATTR_MAYBE); }
| tMESSAGE { $$ = make_attr(ATTR_MESSAGE); }
| tNOCODE { $$ = make_attr(ATTR_NOCODE); }
@@ -2230,6 +2243,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "lcid" },
/* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "licensed" },
/* ATTR_LOCAL */ { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
+ /* ATTR_MARSHALING_BEHAVIOR */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "marshaling_behavior" },
/* ATTR_MAYBE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
/* ATTR_MESSAGE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
/* ATTR_NOCODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index d5862426ad4..6c130d4701e 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -125,6 +125,7 @@ enum attr_type
ATTR_LIBLCID,
ATTR_LICENSED,
ATTR_LOCAL,
+ ATTR_MARSHALING_BEHAVIOR,
ATTR_MAYBE,
ATTR_MESSAGE,
ATTR_NOCODE,
@@ -271,6 +272,14 @@ enum threading_type
THREADING_BOTH
};
+enum marshaling_type
+{
+ MARSHALING_INVALID = 0,
+ MARSHALING_NONE,
+ MARSHALING_AGILE,
+ MARSHALING_STANDARD,
+};
+
enum type_basic_type
{
TYPE_BASIC_INT8 = 1,
--
2.29.2

View File

@ -1,23 +1,35 @@
From 7c1a17a13dce8da80f97defd5f4caef61c2f9ce3 Mon Sep 17 00:00:00 2001
From feb19e6a9ae86a2a17a981ab7f69481e57c2a465 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 11:35:49 +0200
Subject: [PATCH] widl: Support WinRT mta threading attribute parsing.
---
tools/widl/header.c | 7 +++++++
tools/widl/parser.l | 1 +
tools/widl/parser.y | 2 ++
tools/widl/widltypes.h | 3 ++-
4 files changed, 12 insertions(+), 1 deletion(-)
tools/widl/header.c | 28 ++++++++++++++++++++++++++++
tools/widl/parser.l | 1 +
tools/widl/parser.y | 2 ++
tools/widl/widltypes.h | 3 ++-
4 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 21f8528c31d..3fa938192d3 100644
index d5e35aac92f..aaae2fcf3c8 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1494,6 +1494,13 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
fprintf(header, " * Introduced to %s in version %d.%d\n *\n", name, (ver >> 16) & 0xffff, ver & 0xffff);
free(name);
}
@@ -1480,6 +1480,34 @@ static char *format_apicontract_macro(const type_t *type)
return name;
}
+static void write_winrt_type_comments(FILE *header, const type_t *type)
+{
+ expr_t *contract = get_attrp(type->attrs, ATTR_CONTRACT);
+ fprintf(header, " *\n");
+ if (contract)
+ {
+ const type_t *type = contract->u.tref.type;
+ char *name = format_namespace(type->namespace, "", ".", type->name, NULL);
+ int ver = contract->ref->u.lval;
+ fprintf(header, " * Introduced to %s in version %d.%d\n *\n", name, (ver >> 16) & 0xffff, ver & 0xffff);
+ free(name);
+ }
+ switch (get_attrv(type->attrs, ATTR_THREADING))
+ {
+ case THREADING_SINGLE: fprintf(header, " * Class Threading Model: Single Threaded Apartment\n *\n"); break;
@ -25,9 +37,18 @@ index 21f8528c31d..3fa938192d3 100644
+ case THREADING_MTA: fprintf(header, " * Class Threading Model: Multi Threaded Apartment\n *\n"); break;
+ default: break;
+ }
switch (get_attrv(type->attrs, ATTR_MARSHALING_BEHAVIOR))
{
case MARSHALING_AGILE: fprintf(header, " * Class Marshaling Behavior: Agile - Class is agile\n *\n"); break;
+ switch (get_attrv(type->attrs, ATTR_MARSHALING_BEHAVIOR))
+ {
+ case MARSHALING_AGILE: fprintf(header, " * Class Marshaling Behavior: Agile - Class is agile\n *\n"); break;
+ case MARSHALING_STANDARD: fprintf(header, " * Class Marshaling Behavior: Standard - Class marshals using the standard marshaler\n *\n"); break;
+ case MARSHALING_NONE: fprintf(header, " * Class Marshaling Behavior: None - Class cannot be marshaled\n *\n"); break;
+ default: break;
+ }
+}
+
static void write_apicontract_guard_start(FILE *header, const expr_t *expr)
{
const type_t *type;
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 01c6f800a08..067966a85d4 100644
--- a/tools/widl/parser.l
@ -41,7 +62,7 @@ index 01c6f800a08..067966a85d4 100644
{"nocode", tNOCODE, 0},
{"nonbrowsable", tNONBROWSABLE, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index a8160df900a..caaa2f49d0c 100644
index 48f180cdb49..fd994ae70bb 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -222,6 +222,7 @@ static typelib_t *current_typelib;

View File

@ -35,7 +35,7 @@ index 4ededa838b4..b0c4853ca48 100644
}
+
+ RtlInitUnicodeString( &nt_name, L"\\??\\C:\\windows\\system32\\wow64cpu.dll" );
+ if ((status = load_builtin_dll( NULL, &nt_name, 0, 0, &wow64cpu_wm )) == STATUS_SUCCESS)
+ if ((status = load_builtin_dll( NULL, &nt_name, 0, &wow64cpu_wm )) == STATUS_SUCCESS)
+ Wow64Transition = wow64cpu_wm->ldr.DllBase;
+ else
+ WARN( "could not load wow64cpu.dll, status %#x\n", status );

View File

@ -1 +1 @@
2d4dd4252b0cf6526b3cc8194cce642b16eb12f6
2d6462cdee2bd87a49382794e5a554f33c367f09