From bd2086ff97db2b96ce72287a9336f27864e096a4 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 27 Oct 2020 17:40:07 -0500 Subject: [PATCH] Rebase against 2148167f2557cc6c7d1e2f5ffef28bd936503a9a. --- ...or-NtQuerySystemInformation-SystemMo.patch | 87 ------------------- .../ntdll-SystemModuleInformation/definition | 2 - patches/patchinstall.sh | 33 +------ patches/server-Object_Types/definition | 1 - ...ict-some-keywords-to-WinRT-mode-only.patch | 22 +++-- ...-widl-Support-WinRT-apicontract-type.patch | 40 +++++---- ...RT-marshaling_behavior-attribute-par.patch | 33 ++++--- ...-WinRT-exclusiveto-attribute-parsing.patch | 20 ++--- ...widl-Support-WinRT-runtimeclass-type.patch | 42 ++++----- ...inRT-eventadd-eventremove-attributes.patch | 22 ++--- ...repeated-attributes-for-WinRT-static.patch | 18 ++-- ...-Support-WinRT-activatable-attribute.patch | 22 ++--- ...t-WinRT-parameterized-interface-type.patch | 24 ++--- patches/widl-winrt-support/definition | 2 +- staging/upstream-commit | 2 +- 15 files changed, 131 insertions(+), 239 deletions(-) delete mode 100644 patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch delete mode 100644 patches/ntdll-SystemModuleInformation/definition diff --git a/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch b/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch deleted file mode 100644 index d844aafe..00000000 --- a/patches/ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 6c3862d1e2d08c9a82623e0d4ab3bb123a3efde0 Mon Sep 17 00:00:00 2001 -From: Zebediah Figura -Date: Fri, 12 Apr 2019 20:06:08 -0500 -Subject: [PATCH] ntdll: Add stub for - NtQuerySystemInformation(SystemModuleInformationEx). - -Based on a patch by Andrew Wesie. ---- - dlls/ntdll/unix/system.c | 41 ++++++++++++++++++++++++++++++++++++++++ - include/winternl.h | 9 +++++++++ - 2 files changed, 50 insertions(+) - -diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c -index c3dca7ffe28..1260326bc4b 100644 ---- a/dlls/ntdll/unix/system.c -+++ b/dlls/ntdll/unix/system.c -@@ -2328,6 +2328,47 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, - break; - } - -+ case SystemModuleInformationEx: -+ { -+ /* FIXME: return some fake info for now */ -+ static const char *fake_modules[] = -+ { -+ "\\SystemRoot\\system32\\ntoskrnl.exe", -+ "\\SystemRoot\\system32\\hal.dll", -+ "\\SystemRoot\\system32\\drivers\\mountmgr.sys" -+ }; -+ -+ if (!info) ret = STATUS_ACCESS_VIOLATION; -+ else -+ { -+ ULONG i; -+ -+ for (i = 0; i < ARRAY_SIZE(fake_modules); i++) -+ { -+ SYSTEM_MODULE_INFORMATION_EX *smi = (SYSTEM_MODULE_INFORMATION_EX *)((char *)info + len); -+ -+ len += sizeof(SYSTEM_MODULE_INFORMATION_EX); -+ if (len > size) -+ { -+ ret = STATUS_INFO_LENGTH_MISMATCH; -+ continue; -+ } -+ -+ memset(smi, 0, sizeof(*smi)); -+ if (i < ARRAY_SIZE(fake_modules) - 1) -+ smi->NextOffset = len; -+ smi->BaseInfo.ImageBaseAddress = (char *)0x10000000 + 0x200000 * i; -+ smi->BaseInfo.ImageSize = 0x200000; -+ smi->BaseInfo.LoadOrderIndex = i; -+ smi->BaseInfo.LoadCount = 1; -+ strcpy( (char *)smi->BaseInfo.Name, fake_modules[i] ); -+ smi->BaseInfo.NameOffset = strrchr( fake_modules[i], '\\' ) - fake_modules[i] + 1; -+ smi->DefaultBase = smi->BaseInfo.ImageBaseAddress; -+ } -+ } -+ break; -+ } -+ - case SystemHandleInformation: - { - struct handle_info *handle_info; -diff --git a/include/winternl.h b/include/winternl.h -index 10d109fede1..b91af1d2dbe 100644 ---- a/include/winternl.h -+++ b/include/winternl.h -@@ -2484,6 +2484,15 @@ typedef struct _SYSTEM_MODULE_INFORMATION - #define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200 - #define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400 - -+typedef struct _SYSTEM_MODULE_INFORMATION_EX -+{ -+ ULONG NextOffset; -+ SYSTEM_MODULE BaseInfo; -+ ULONG ImageCheckSum; -+ ULONG TimeDateStamp; -+ void *DefaultBase; -+} SYSTEM_MODULE_INFORMATION_EX, *PSYSTEM_MODULE_INFORMATION_EX; -+ - #define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001 - #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002 - #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004 --- -2.27.0 - diff --git a/patches/ntdll-SystemModuleInformation/definition b/patches/ntdll-SystemModuleInformation/definition deleted file mode 100644 index 57fdf002..00000000 --- a/patches/ntdll-SystemModuleInformation/definition +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: [45550] League of Legends 8.15+ anticheat fails due to incorrect implementation of NtQuerySystemInformation(SystemModuleInformation) -Fixes: [45666] League of Legends 8.15+ fails due to missing implementation of NtQuerySystemInformation(SystemModuleInformationEx) in Windows Vista+ mode diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 59ac95b9..e5a87420 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "93107c08f5aa7f37ad7ece9cd7ca248dba3030ce" + echo "2148167f2557cc6c7d1e2f5ffef28bd936503a9a" } # Show version information @@ -185,7 +185,6 @@ patch_enable_all () enable_ntdll_Status_Mapping="$1" enable_ntdll_Syscall_Emulation="$1" enable_ntdll_SystemCodeIntegrityInformation="$1" - enable_ntdll_SystemModuleInformation="$1" enable_ntdll_WRITECOPY="$1" enable_ntdll_Zero_mod_name="$1" enable_ntdll_aarch_TEB="$1" @@ -642,9 +641,6 @@ patch_enable () ntdll-SystemCodeIntegrityInformation) enable_ntdll_SystemCodeIntegrityInformation="$2" ;; - ntdll-SystemModuleInformation) - enable_ntdll_SystemModuleInformation="$2" - ;; ntdll-WRITECOPY) enable_ntdll_WRITECOPY="$2" ;; @@ -1528,13 +1524,6 @@ if test "$enable_shell32_Progress_Dialog" -eq 1; then enable_shell32_SHFileOperation_Move=1 fi -if test "$enable_server_Object_Types" -eq 1; then - if test "$enable_ntdll_SystemModuleInformation" -gt 1; then - abort "Patchset ntdll-SystemModuleInformation disabled, but server-Object_Types depends on that." - fi - enable_ntdll_SystemModuleInformation=1 -fi - if test "$enable_server_Inherited_ACLs" -eq 1; then if test "$enable_server_Stored_ACLs" -gt 1; then abort "Patchset server-Stored_ACLs disabled, but server-Inherited_ACLs depends on that." @@ -3293,21 +3282,6 @@ if test "$enable_ntdll_SystemCodeIntegrityInformation" -eq 1; then patch_apply ntdll-SystemCodeIntegrityInformation/0001-ntdll-NtQuerySystemInformation-support-SystemCodeInt.patch fi -# Patchset ntdll-SystemModuleInformation -# | -# | This patchset fixes the following Wine bugs: -# | * [#45550] League of Legends 8.15+ anticheat fails due to incorrect implementation of -# | NtQuerySystemInformation(SystemModuleInformation) -# | * [#45666] League of Legends 8.15+ fails due to missing implementation of -# | NtQuerySystemInformation(SystemModuleInformationEx) in Windows Vista+ mode -# | -# | Modified files: -# | * dlls/ntdll/unix/system.c, include/winternl.h -# | -if test "$enable_ntdll_SystemModuleInformation" -eq 1; then - patch_apply ntdll-SystemModuleInformation/0003-ntdll-Add-stub-for-NtQuerySystemInformation-SystemMo.patch -fi - # Patchset ntdll-Zero_mod_name # | # | Modified files: @@ -3639,9 +3613,6 @@ fi # Patchset server-Object_Types # | -# | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-SystemModuleInformation -# | # | This patchset fixes the following Wine bugs: # | * [#44629] Process Hacker can't enumerate handles # | * [#45374] Yet Another Process Monitor (.NET 2.0 app) reports System.AccessViolationException @@ -4299,7 +4270,7 @@ fi # Patchset widl-winrt-support # | # | This patchset fixes the following Wine bugs: -# | * [#68403] widl - Support WinRT idls +# | * [#49998] widl - Support WinRT idls # | # | Modified files: # | * include/Makefile.in, include/windows.foundation.idl, include/windows.media.speechsynthesis.idl, diff --git a/patches/server-Object_Types/definition b/patches/server-Object_Types/definition index 1da5e3dc..724bb014 100644 --- a/patches/server-Object_Types/definition +++ b/patches/server-Object_Types/definition @@ -1,4 +1,3 @@ Fixes: [44629] Process Hacker can't enumerate handles Fixes: [45374] Yet Another Process Monitor (.NET 2.0 app) reports System.AccessViolationException -Depends: ntdll-SystemModuleInformation #Depends: server-Shared_Memory diff --git a/patches/widl-winrt-support/0002-widl-Restrict-some-keywords-to-WinRT-mode-only.patch b/patches/widl-winrt-support/0002-widl-Restrict-some-keywords-to-WinRT-mode-only.patch index d896d467..65b95837 100644 --- a/patches/widl-winrt-support/0002-widl-Restrict-some-keywords-to-WinRT-mode-only.patch +++ b/patches/widl-winrt-support/0002-widl-Restrict-some-keywords-to-WinRT-mode-only.patch @@ -1,14 +1,14 @@ -From 58eea69462505e4ea88675adcbe85b49b9cf2e35 Mon Sep 17 00:00:00 2001 +From 0769c5c155be28c4bdf0c496e88cdc270ca6e90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 22 Sep 2020 18:03:23 +0200 -Subject: [PATCH 02/28] widl: Restrict some keywords to WinRT mode only. +Subject: [PATCH] widl: Restrict some keywords to WinRT mode only. --- - tools/widl/parser.l | 333 ++++++++++++++++++++++---------------------- - 1 file changed, 167 insertions(+), 166 deletions(-) + tools/widl/parser.l | 339 ++++++++++++++++++++++---------------------- + 1 file changed, 170 insertions(+), 169 deletions(-) diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index 925265d00db..eb1782d32f5 100644 +index f2c09cd8051..b715342ad59 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -248,67 +248,68 @@ int parser_wrap(void) @@ -137,11 +137,12 @@ index 925265d00db..eb1782d32f5 100644 }; #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0])) -@@ -317,113 +318,113 @@ static const struct keyword keywords[] = { +@@ -317,116 +318,116 @@ static const struct keyword keywords[] = { */ static const struct keyword attr_keywords[] = { - {"aggregatable", tAGGREGATABLE}, +- {"all_nodes", tALLNODES}, - {"allocate", tALLOCATE}, - {"annotation", tANNOTATION}, - {"apartment", tAPARTMENT}, @@ -169,6 +170,7 @@ index 925265d00db..eb1782d32f5 100644 - {"disable_consistency_check", tDISABLECONSISTENCYCHECK}, - {"displaybind", tDISPLAYBIND}, - {"dllname", tDLLNAME}, +- {"dont_free", tDONTFREE}, - {"dual", tDUAL}, - {"enable_allocate", tENABLEALLOCATE}, - {"encode", tENCODE}, @@ -230,6 +232,7 @@ index 925265d00db..eb1782d32f5 100644 - {"restricted", tRESTRICTED}, - {"retval", tRETVAL}, - {"single", tSINGLE}, +- {"single_node", tSINGLENODE}, - {"size_is", tSIZEIS}, - {"source", tSOURCE}, - {"strict_context_handle", tSTRICTCONTEXTHANDLE}, @@ -249,6 +252,7 @@ index 925265d00db..eb1782d32f5 100644 - {"vi_progid", tVIPROGID}, - {"wire_marshal", tWIREMARSHAL}, + {"aggregatable", tAGGREGATABLE, 0}, ++ {"all_nodes", tALLNODES, 0}, + {"allocate", tALLOCATE, 0}, + {"annotation", tANNOTATION, 0}, + {"apartment", tAPARTMENT, 0}, @@ -276,6 +280,7 @@ index 925265d00db..eb1782d32f5 100644 + {"disable_consistency_check", tDISABLECONSISTENCYCHECK, 0}, + {"displaybind", tDISPLAYBIND, 0}, + {"dllname", tDLLNAME, 0}, ++ {"dont_free", tDONTFREE, 0}, + {"dual", tDUAL, 0}, + {"enable_allocate", tENABLEALLOCATE, 0}, + {"encode", tENCODE, 0}, @@ -337,6 +342,7 @@ index 925265d00db..eb1782d32f5 100644 + {"restricted", tRESTRICTED, 0}, + {"retval", tRETVAL, 0}, + {"single", tSINGLE, 0}, ++ {"single_node", tSINGLENODE, 0}, + {"size_is", tSIZEIS, 0}, + {"source", tSOURCE, 0}, + {"strict_context_handle", tSTRICTCONTEXTHANDLE, 0}, @@ -358,7 +364,7 @@ index 925265d00db..eb1782d32f5 100644 }; /* attributes TODO: -@@ -446,7 +447,7 @@ static int kw_token(const char *kw) +@@ -449,7 +450,7 @@ static int kw_token(const char *kw) struct keyword key, *kwp; key.kw = kw; kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func); @@ -367,7 +373,7 @@ index 925265d00db..eb1782d32f5 100644 parser_lval.str = xstrdup(kwp->kw); return kwp->token; } -@@ -460,7 +461,7 @@ static int attr_token(const char *kw) +@@ -463,7 +464,7 @@ static int attr_token(const char *kw) key.kw = kw; kwp = bsearch(&key, attr_keywords, sizeof(attr_keywords)/sizeof(attr_keywords[0]), sizeof(attr_keywords[0]), kw_cmp_func); diff --git a/patches/widl-winrt-support/0005-widl-Support-WinRT-apicontract-type.patch b/patches/widl-winrt-support/0005-widl-Support-WinRT-apicontract-type.patch index bd89e8a2..26278a9b 100644 --- a/patches/widl-winrt-support/0005-widl-Support-WinRT-apicontract-type.patch +++ b/patches/widl-winrt-support/0005-widl-Support-WinRT-apicontract-type.patch @@ -1,7 +1,7 @@ -From 70534016bc2963703a003e9a0888ad21f5bf026e Mon Sep 17 00:00:00 2001 +From 08d9f70629420aeafddbe844dd731db81f1e3fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 13 Oct 2020 13:37:19 +0200 -Subject: [PATCH 05/28] widl: Support WinRT apicontract type. +Subject: [PATCH] widl: Support WinRT apicontract type. --- include/Makefile.in | 1 + @@ -10,19 +10,19 @@ Subject: [PATCH 05/28] widl: Support WinRT apicontract type. tools/widl/expr.c | 1 + tools/widl/header.c | 24 ++++ tools/widl/parser.l | 1 + - tools/widl/parser.y | 235 +++++++++++++++++++-------------- + tools/widl/parser.y | 237 +++++++++++++++++++-------------- tools/widl/typegen.c | 6 + tools/widl/typelib.c | 3 +- tools/widl/typetree.h | 3 + tools/widl/widltypes.h | 1 + - 11 files changed, 206 insertions(+), 103 deletions(-) + 11 files changed, 207 insertions(+), 104 deletions(-) create mode 100644 include/windowscontracts.idl diff --git a/include/Makefile.in b/include/Makefile.in -index d59b0be715d..91297753b12 100644 +index 203b0580fa1..23dab5e83aa 100644 --- a/include/Makefile.in +++ b/include/Makefile.in -@@ -737,6 +737,7 @@ SOURCES = \ +@@ -738,6 +738,7 @@ SOURCES = \ windows.foundation.idl \ windows.media.speechsynthesis.idl \ windows.h \ @@ -157,7 +157,7 @@ index d67fea4cc95..607d156ccf4 100644 { write_type_definition(header, stmt->u.type, stmt->declonly); diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index dafd17ab2f9..11debca2ebd 100644 +index b9370b8258d..20ae88beb64 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -267,6 +267,7 @@ static const struct keyword keywords[] = { @@ -169,7 +169,7 @@ index dafd17ab2f9..11debca2ebd 100644 {"byte", tBYTE, 0}, {"case", tCASE, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index 88cb9a10863..bdd019a2880 100644 +index 8a3aa2f7679..31bd5ce733f 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -99,6 +99,7 @@ static attr_list_t *check_library_attrs(const char *name, attr_list_t *attrs); @@ -184,8 +184,8 @@ index 88cb9a10863..bdd019a2880 100644 %token GREATEREQUAL LESSEQUAL %token LOGICALOR LOGICALAND %token ELLIPSIS --%token tAGGREGATABLE tALLOCATE tANNOTATION tAPPOBJECT tASYNC tASYNCUUID -+%token tAGGREGATABLE tALLOCATE tANNOTATION +-%token tAGGREGATABLE tALLNODES tALLOCATE tANNOTATION tAPPOBJECT tASYNC tASYNCUUID ++%token tAGGREGATABLE tALLNODES tALLOCATE tANNOTATION +%token tAPICONTRACT +%token tAPPOBJECT tASYNC tASYNCUUID %token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT @@ -199,7 +199,7 @@ index 88cb9a10863..bdd019a2880 100644 %type contract_ver %type pointer_type threading_type version %type libraryhdr callconv cppquote importlib import t_ident -@@ -346,6 +350,8 @@ gbl_statements: { $$ = NULL; } +@@ -347,6 +351,8 @@ gbl_statements: { $$ = NULL; } | gbl_statements coclassdef { $$ = append_statement($1, make_statement_type_decl($2)); reg_type($2, $2->name, current_namespace, 0); } @@ -208,7 +208,7 @@ index 88cb9a10863..bdd019a2880 100644 | gbl_statements moduledef { $$ = append_statement($1, make_statement_module($2)); } | gbl_statements librarydef { $$ = append_statement($1, make_statement_library($2)); } | gbl_statements statement { $$ = append_statement($1, $2); } -@@ -360,6 +366,8 @@ imp_statements: { $$ = NULL; } +@@ -361,6 +367,8 @@ imp_statements: { $$ = NULL; } | imp_statements coclassdef { $$ = append_statement($1, make_statement_type_decl($2)); reg_type($2, $2->name, current_namespace, 0); } @@ -217,7 +217,7 @@ index 88cb9a10863..bdd019a2880 100644 | imp_statements moduledef { $$ = append_statement($1, make_statement_module($2)); } | imp_statements statement { $$ = append_statement($1, $2); } | imp_statements importlib { $$ = append_statement($1, make_statement_importlib($2)); } -@@ -864,6 +872,13 @@ coclassdef: coclasshdr '{' coclass_ints '}' semicolon_opt +@@ -865,6 +873,13 @@ coclassdef: coclasshdr '{' coclass_ints '}' semicolon_opt { $$ = type_coclass_define($1, $3); } ; @@ -231,7 +231,7 @@ index 88cb9a10863..bdd019a2880 100644 namespacedef: tNAMESPACE aIDENTIFIER { $$ = $2; } | tNAMESPACE aNAMESPACE { $$ = $2; } ; -@@ -2124,112 +2139,113 @@ struct allowed_attr +@@ -2148,113 +2163,114 @@ struct allowed_attr unsigned int on_dispinterface : 1; unsigned int on_module : 1; unsigned int on_coclass : 1; @@ -243,6 +243,7 @@ index 88cb9a10863..bdd019a2880 100644 { - /* attr { D ACF I Fn ARG T En Enm St Un Fi L DI M C } */ - /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" }, +- /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, - /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, - /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" }, - /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, @@ -344,6 +345,7 @@ index 88cb9a10863..bdd019a2880 100644 - /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, + /* attr { D ACF I Fn ARG T En Enm St Un Fi L DI M C AC } */ + /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "aggregatable" }, ++ /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, + /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, + /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "appobject" }, + /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, @@ -446,7 +448,7 @@ index 88cb9a10863..bdd019a2880 100644 }; const char *get_attr_display_name(enum attr_type type) -@@ -2420,6 +2436,17 @@ static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs) +@@ -2445,6 +2461,17 @@ static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs) return attrs; } @@ -464,7 +466,7 @@ index 88cb9a10863..bdd019a2880 100644 static int is_allowed_conf_type(const type_t *type) { switch (type_get_type(type)) -@@ -2459,6 +2486,10 @@ static int is_allowed_conf_type(const type_t *type) +@@ -2484,6 +2511,10 @@ static int is_allowed_conf_type(const type_t *type) case TYPE_INTERFACE: case TYPE_BITFIELD: return FALSE; @@ -476,7 +478,7 @@ index 88cb9a10863..bdd019a2880 100644 return FALSE; } diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c -index 04280cbb722..46aae9b69e9 100644 +index 4874dfd6c24..5d0f24be06f 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -374,6 +374,10 @@ enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *att @@ -535,10 +537,10 @@ index e288c574002..7abec41a8fd 100644 return FALSE; } diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h -index 1b00b8da002..add7cedfacc 100644 +index 0f24f102215..89998056f94 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h -@@ -432,6 +432,7 @@ enum type_type +@@ -433,6 +433,7 @@ enum type_type TYPE_POINTER, TYPE_ARRAY, TYPE_BITFIELD, diff --git a/patches/widl-winrt-support/0009-widl-Support-WinRT-marshaling_behavior-attribute-par.patch b/patches/widl-winrt-support/0009-widl-Support-WinRT-marshaling_behavior-attribute-par.patch index 2837ef48..e7921477 100644 --- a/patches/widl-winrt-support/0009-widl-Support-WinRT-marshaling_behavior-attribute-par.patch +++ b/patches/widl-winrt-support/0009-widl-Support-WinRT-marshaling_behavior-attribute-par.patch @@ -1,8 +1,7 @@ -From 1a75069e45df24a09e8f364c61ad5d77115d48cd Mon Sep 17 00:00:00 2001 +From 9c78c049da7f21fae7b8f020ac17a549477385a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 12 Oct 2020 20:34:28 +0200 -Subject: [PATCH 09/28] widl: Support WinRT marshaling_behavior attribute - parsing. +Subject: [PATCH] widl: Support WinRT marshaling_behavior attribute parsing. --- tools/widl/header.c | 7 +++++++ @@ -30,7 +29,7 @@ index 0fd3eb917ea..6d5987bd4c1 100644 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 c3d0e9e2746..39a19a3c1de 100644 +index a5f04ebf8ed..d332d50a96b 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -320,6 +320,7 @@ static const struct keyword keywords[] = { @@ -38,10 +37,10 @@ index c3d0e9e2746..39a19a3c1de 100644 { {"aggregatable", tAGGREGATABLE, 0}, + {"agile", tAGILE, 1}, + {"all_nodes", tALLNODES, 0}, {"allocate", tALLOCATE, 0}, {"annotation", tANNOTATION, 0}, - {"apartment", tAPARTMENT, 0}, -@@ -378,12 +379,14 @@ static const struct keyword attr_keywords[] = +@@ -380,12 +381,14 @@ static const struct keyword attr_keywords[] = {"length_is", tLENGTHIS, 0}, {"licensed", tLICENSED, 0}, {"local", tLOCAL, 0}, @@ -56,8 +55,8 @@ index c3d0e9e2746..39a19a3c1de 100644 {"nonextensible", tNONEXTENSIBLE, 0}, {"notify", tNOTIFY, 0}, {"notify_flag", tNOTIFYFLAG, 0}, -@@ -412,6 +415,7 @@ static const struct keyword attr_keywords[] = - {"single", tSINGLE, 0}, +@@ -415,6 +418,7 @@ static const struct keyword attr_keywords[] = + {"single_node", tSINGLENODE, 0}, {"size_is", tSIZEIS, 0}, {"source", tSOURCE, 0}, + {"standard", tSTANDARD, 1}, @@ -65,15 +64,15 @@ index c3d0e9e2746..39a19a3c1de 100644 {"string", tSTRING, 0}, {"switch_is", tSWITCHIS, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index 28d7e16dad4..ebaa0fc514b 100644 +index 1ae8a843c64..4e7df9015a1 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -173,7 +173,9 @@ static typelib_t *current_typelib; %token GREATEREQUAL LESSEQUAL %token LOGICALOR LOGICALAND %token ELLIPSIS --%token tAGGREGATABLE tALLOCATE tANNOTATION -+%token tAGGREGATABLE +-%token tAGGREGATABLE tALLNODES tALLOCATE tANNOTATION ++%token tAGGREGATABLE tALLNODES +%token tAGILE +%token tALLOCATE tANNOTATION %token tAPICONTRACT @@ -111,7 +110,7 @@ index 28d7e16dad4..ebaa0fc514b 100644 %type libraryhdr callconv cppquote importlib import t_ident %type uuid_string %type import_start -@@ -502,6 +507,12 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); } +@@ -503,6 +508,12 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); } | str_list ',' aSTRING { $$ = append_str( $1, $3 ); } ; @@ -124,7 +123,7 @@ index 28d7e16dad4..ebaa0fc514b 100644 contract_ver: aNUM { $$ = MAKEVERSION(0, $1); } | aNUM '.' aNUM { $$ = MAKEVERSION($3, $1); } -@@ -568,6 +579,8 @@ attribute: { $$ = NULL; } +@@ -569,6 +580,8 @@ attribute: { $$ = NULL; } | tLCID { $$ = make_attr(ATTR_PARAMLCID); } | tLICENSED { $$ = make_attr(ATTR_LICENSED); } | tLOCAL { $$ = make_attr(ATTR_LOCAL); } @@ -133,7 +132,7 @@ index 28d7e16dad4..ebaa0fc514b 100644 | tMAYBE { $$ = make_attr(ATTR_MAYBE); } | tMESSAGE { $$ = make_attr(ATTR_MESSAGE); } | tNOCODE { $$ = make_attr(ATTR_NOCODE); } -@@ -2209,6 +2222,7 @@ struct allowed_attr allowed_attr[] = +@@ -2234,6 +2247,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_LIBLCID */ { 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, 1, 0, "licensed" }, /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" }, @@ -142,10 +141,10 @@ index 28d7e16dad4..ebaa0fc514b 100644 /* ATTR_MESSAGE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" }, /* ATTR_NOCODE */ { 0, 1, 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 3f358efecd1..62a018ab5a5 100644 +index d65adfa4368..6f4aee3a2c2 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h -@@ -122,6 +122,7 @@ enum attr_type +@@ -123,6 +123,7 @@ enum attr_type ATTR_LIBLCID, ATTR_LICENSED, ATTR_LOCAL, @@ -153,7 +152,7 @@ index 3f358efecd1..62a018ab5a5 100644 ATTR_MAYBE, ATTR_MESSAGE, ATTR_NOCODE, -@@ -268,6 +269,14 @@ enum threading_type +@@ -269,6 +270,14 @@ enum threading_type THREADING_BOTH }; diff --git a/patches/widl-winrt-support/0011-widl-Support-WinRT-exclusiveto-attribute-parsing.patch b/patches/widl-winrt-support/0011-widl-Support-WinRT-exclusiveto-attribute-parsing.patch index 4c0e2852..37db9d5b 100644 --- a/patches/widl-winrt-support/0011-widl-Support-WinRT-exclusiveto-attribute-parsing.patch +++ b/patches/widl-winrt-support/0011-widl-Support-WinRT-exclusiveto-attribute-parsing.patch @@ -1,7 +1,7 @@ -From 1d70d60ab7af24ba47e98c00d4673347883f065b Mon Sep 17 00:00:00 2001 +From defd3dabc9210023bd2d0b4487f77b7416b55b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 13 Oct 2020 00:11:08 +0200 -Subject: [PATCH 11/28] widl: Support WinRT exclusiveto attribute parsing. +Subject: [PATCH] widl: Support WinRT exclusiveto attribute parsing. --- tools/widl/header.c | 7 +++++++ @@ -36,10 +36,10 @@ index 843aba214a4..8aed9be3f57 100644 { case THREADING_SINGLE: fprintf(header, " * Class Threading Model: Single Threaded Apartment\n *\n"); break; diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index c99feffb5d6..498071a1992 100644 +index 9981e93a715..999cd1054c2 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l -@@ -355,6 +355,7 @@ static const struct keyword attr_keywords[] = +@@ -357,6 +357,7 @@ static const struct keyword attr_keywords[] = {"encode", tENCODE, 0}, {"endpoint", tENDPOINT, 0}, {"entry", tENTRY, 0}, @@ -48,18 +48,18 @@ index c99feffb5d6..498071a1992 100644 {"fault_status", tFAULTSTATUS, 0}, {"force_allocate", tFORCEALLOCATE, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index a4ad03ef037..88cc029c3ae 100644 +index d67688edcb0..57e844209f4 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -194,6 +194,7 @@ static typelib_t *current_typelib; - %token tDLLNAME tDOUBLE tDUAL + %token tDLLNAME tDONTFREE tDOUBLE tDUAL %token tENABLEALLOCATE tENCODE tENDPOINT %token tENTRY tENUM tERRORSTATUST +%token tEXCLUSIVETO %token tEXPLICITHANDLE tEXTERN %token tFALSE %token tFASTCALL tFAULTSTATUS -@@ -557,6 +558,7 @@ attribute: { $$ = NULL; } +@@ -558,6 +559,7 @@ attribute: { $$ = NULL; } | tENCODE { $$ = make_attr(ATTR_ENCODE); } | tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); } | tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); } @@ -67,7 +67,7 @@ index a4ad03ef037..88cc029c3ae 100644 | tEXPLICITHANDLE { $$ = make_attr(ATTR_EXPLICIT_HANDLE); } | tFAULTSTATUS { $$ = make_attr(ATTR_FAULTSTATUS); } | tFORCEALLOCATE { $$ = make_attr(ATTR_FORCEALLOCATE); } -@@ -2202,6 +2204,7 @@ struct allowed_attr allowed_attr[] = +@@ -2227,6 +2229,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" }, /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" }, /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" }, @@ -76,10 +76,10 @@ index a4ad03ef037..88cc029c3ae 100644 /* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" }, /* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" }, diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h -index 26634fa7f7d..e945cad33b2 100644 +index 868d05726fb..5e5ca55a2cb 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h -@@ -100,6 +100,7 @@ enum attr_type +@@ -101,6 +101,7 @@ enum attr_type ATTR_ENCODE, ATTR_ENDPOINT, ATTR_ENTRY, diff --git a/patches/widl-winrt-support/0012-widl-Support-WinRT-runtimeclass-type.patch b/patches/widl-winrt-support/0012-widl-Support-WinRT-runtimeclass-type.patch index 10054a4e..e0b6cb58 100644 --- a/patches/widl-winrt-support/0012-widl-Support-WinRT-runtimeclass-type.patch +++ b/patches/widl-winrt-support/0012-widl-Support-WinRT-runtimeclass-type.patch @@ -1,7 +1,7 @@ -From ef00d7d2e0178d9f3ad3405613c6c4a1ddd3c2b1 Mon Sep 17 00:00:00 2001 +From 46d4c130ac65bff2c20e9ac9f295bc84ad98578b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 13 Oct 2020 15:57:04 +0200 -Subject: [PATCH 12/28] widl: Support WinRT runtimeclass type. +Subject: [PATCH] widl: Support WinRT runtimeclass type. MIDL doesn't generate anything special in the header files for these types. They can however be used instead of interfaces as function @@ -12,13 +12,13 @@ type is instead used in the generated code. tools/widl/expr.c | 1 + tools/widl/header.c | 65 +++++- tools/widl/parser.l | 1 + - tools/widl/parser.y | 265 +++++++++++++--------- + tools/widl/parser.y | 267 +++++++++++++--------- tools/widl/typegen.c | 4 + tools/widl/typelib.c | 1 + tools/widl/typetree.c | 17 ++ tools/widl/typetree.h | 24 ++ tools/widl/widltypes.h | 7 + - 10 files changed, 298 insertions(+), 112 deletions(-) + 10 files changed, 299 insertions(+), 113 deletions(-) diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl index 7a1de5fcba6..90bc9f279c6 100644 @@ -194,7 +194,7 @@ index 8aed9be3f57..065a82ea384 100644 { write_type_definition(header, stmt->u.type, stmt->declonly); diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index 498071a1992..31b97951b31 100644 +index 999cd1054c2..4fcba3f2301 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -298,6 +298,7 @@ static const struct keyword keywords[] = { @@ -206,7 +206,7 @@ index 498071a1992..31b97951b31 100644 {"signed", tSIGNED, 0}, {"sizeof", tSIZEOF, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index 88cc029c3ae..8b88e031fb5 100644 +index 57e844209f4..72b9d79cba1 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -99,6 +99,7 @@ static attr_list_t *check_library_attrs(const char *name, attr_list_t *attrs); @@ -224,7 +224,7 @@ index 88cc029c3ae..8b88e031fb5 100644 +%token tRUNTIMECLASS %token tSAFEARRAY %token tSHORT - %token tSIGNED + %token tSIGNED tSINGLENODE @@ -290,8 +292,8 @@ static typelib_t *current_typelib; %type base_type int_std %type enumdef structdef uniondef typedecl @@ -244,7 +244,7 @@ index 88cc029c3ae..8b88e031fb5 100644 %type apicontract %type contract_ver %type pointer_type threading_type marshaling_behavior version -@@ -361,6 +364,9 @@ gbl_statements: { $$ = NULL; } +@@ -362,6 +365,9 @@ gbl_statements: { $$ = NULL; } } | gbl_statements apicontract ';' { $$ = append_statement($1, make_statement_type_decl($2)); reg_type($2, $2->name, current_namespace, 0); } @@ -254,7 +254,7 @@ index 88cc029c3ae..8b88e031fb5 100644 | gbl_statements moduledef { $$ = append_statement($1, make_statement_module($2)); } | gbl_statements librarydef { $$ = append_statement($1, make_statement_library($2)); } | gbl_statements statement { $$ = append_statement($1, $2); } -@@ -377,6 +383,9 @@ imp_statements: { $$ = NULL; } +@@ -378,6 +384,9 @@ imp_statements: { $$ = NULL; } } | imp_statements apicontract ';' { $$ = append_statement($1, make_statement_type_decl($2)); reg_type($2, $2->name, current_namespace, 0); } @@ -264,7 +264,7 @@ index 88cc029c3ae..8b88e031fb5 100644 | imp_statements moduledef { $$ = append_statement($1, make_statement_module($2)); } | imp_statements statement { $$ = append_statement($1, $2); } | imp_statements importlib { $$ = append_statement($1, make_statement_importlib($2)); } -@@ -558,7 +567,9 @@ attribute: { $$ = NULL; } +@@ -559,7 +568,9 @@ attribute: { $$ = NULL; } | tENCODE { $$ = make_attr(ATTR_ENCODE); } | tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); } | tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); } @@ -275,7 +275,7 @@ index 88cc029c3ae..8b88e031fb5 100644 | tEXPLICITHANDLE { $$ = make_attr(ATTR_EXPLICIT_HANDLE); } | tFAULTSTATUS { $$ = make_attr(ATTR_FAULTSTATUS); } | tFORCEALLOCATE { $$ = make_attr(ATTR_FORCEALLOCATE); } -@@ -893,10 +904,29 @@ coclasshdr: attributes coclass { $$ = $2; +@@ -894,10 +905,29 @@ coclasshdr: attributes coclass { $$ = $2; } ; @@ -306,7 +306,7 @@ index 88cc029c3ae..8b88e031fb5 100644 apicontract: attributes tAPICONTRACT aIDENTIFIER '{' '}' { $$ = get_type(TYPE_APICONTRACT, $3, current_namespace, 0); check_def($$); -@@ -908,11 +938,11 @@ namespacedef: tNAMESPACE aIDENTIFIER { $$ = $2; } +@@ -909,11 +939,11 @@ namespacedef: tNAMESPACE aIDENTIFIER { $$ = $2; } | tNAMESPACE aNAMESPACE { $$ = $2; } ; @@ -321,7 +321,7 @@ index 88cc029c3ae..8b88e031fb5 100644 m_attributes interfacedec { $$ = make_ifref($2); $$->attrs = $1; } ; -@@ -2166,115 +2196,116 @@ struct allowed_attr +@@ -2190,116 +2220,117 @@ struct allowed_attr unsigned int on_module : 1; unsigned int on_coclass : 1; unsigned int on_apicontract : 1; @@ -333,6 +333,7 @@ index 88cc029c3ae..8b88e031fb5 100644 { - /* attr { D ACF I Fn ARG T En Enm St Un Fi L DI M C AC } */ - /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "aggregatable" }, +- /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, - /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, - /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "appobject" }, - /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, @@ -437,6 +438,7 @@ index 88cc029c3ae..8b88e031fb5 100644 - /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, + /* attr { D ACF I Fn ARG T En Enm St Un Fi L DI M C AC R } */ + /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" }, ++ /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, + /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, + /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" }, + /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, @@ -542,7 +544,7 @@ index 88cc029c3ae..8b88e031fb5 100644 }; const char *get_attr_display_name(enum attr_type type) -@@ -2465,6 +2496,17 @@ static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs) +@@ -2490,6 +2521,17 @@ static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs) return attrs; } @@ -560,7 +562,7 @@ index 88cc029c3ae..8b88e031fb5 100644 static attr_list_t *check_apicontract_attrs(const char *name, attr_list_t *attrs) { const attr_t *attr; -@@ -2514,6 +2556,7 @@ static int is_allowed_conf_type(const type_t *type) +@@ -2539,6 +2581,7 @@ static int is_allowed_conf_type(const type_t *type) case TYPE_FUNCTION: case TYPE_INTERFACE: case TYPE_BITFIELD: @@ -569,7 +571,7 @@ index 88cc029c3ae..8b88e031fb5 100644 case TYPE_APICONTRACT: /* not supposed to be here */ diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c -index 46aae9b69e9..86c010aa6ae 100644 +index 5d0f24be06f..2e9be0748c1 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -353,6 +353,7 @@ enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *att @@ -706,10 +708,10 @@ index 7abec41a8fd..951084cf875 100644 { type = type_get_real_type(type); diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h -index e945cad33b2..0a2088574d3 100644 +index 5e5ca55a2cb..3d8be66f4b8 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h -@@ -418,6 +418,11 @@ struct alias_details +@@ -419,6 +419,11 @@ struct alias_details struct _decl_spec_t aliasee; }; @@ -721,7 +723,7 @@ index e945cad33b2..0a2088574d3 100644 #define HASHMAX 64 struct namespace { -@@ -445,6 +450,7 @@ enum type_type +@@ -446,6 +451,7 @@ enum type_type TYPE_ARRAY, TYPE_BITFIELD, TYPE_APICONTRACT, @@ -729,7 +731,7 @@ index e945cad33b2..0a2088574d3 100644 }; struct _type_t { -@@ -465,6 +471,7 @@ struct _type_t { +@@ -466,6 +472,7 @@ struct _type_t { struct pointer_details pointer; struct bitfield_details bitfield; struct alias_details alias; diff --git a/patches/widl-winrt-support/0013-widl-Support-WinRT-eventadd-eventremove-attributes.patch b/patches/widl-winrt-support/0013-widl-Support-WinRT-eventadd-eventremove-attributes.patch index f46148cb..888cee41 100644 --- a/patches/widl-winrt-support/0013-widl-Support-WinRT-eventadd-eventremove-attributes.patch +++ b/patches/widl-winrt-support/0013-widl-Support-WinRT-eventadd-eventremove-attributes.patch @@ -1,7 +1,7 @@ -From 4f9ad72a4381348591151271107caea8a83cef84 Mon Sep 17 00:00:00 2001 +From 2c2b50a97a60d7da4c1737f06fbd56d686aebcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 1 Oct 2020 20:10:02 +0200 -Subject: [PATCH 13/28] widl: Support WinRT eventadd/eventremove attributes. +Subject: [PATCH] widl: Support WinRT eventadd/eventremove attributes. --- tools/widl/header.c | 4 ++++ @@ -26,10 +26,10 @@ index 065a82ea384..812becad63b 100644 return buffer = strmake( "get_%s", v->name ); if (is_attr( v->attrs, ATTR_PROPPUT )) diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index 31b97951b31..02a6b47e225 100644 +index 4fcba3f2301..74e55f0d6ab 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l -@@ -356,6 +356,8 @@ static const struct keyword attr_keywords[] = +@@ -358,6 +358,8 @@ static const struct keyword attr_keywords[] = {"encode", tENCODE, 0}, {"endpoint", tENDPOINT, 0}, {"entry", tENTRY, 0}, @@ -39,18 +39,18 @@ index 31b97951b31..02a6b47e225 100644 {"explicit_handle", tEXPLICITHANDLE, 0}, {"fault_status", tFAULTSTATUS, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index 8b88e031fb5..b1b3201042f 100644 +index 72b9d79cba1..fe35bde38e7 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -195,6 +195,7 @@ static typelib_t *current_typelib; - %token tDLLNAME tDOUBLE tDUAL + %token tDLLNAME tDONTFREE tDOUBLE tDUAL %token tENABLEALLOCATE tENCODE tENDPOINT %token tENTRY tENUM tERRORSTATUST +%token tEVENTADD tEVENTREMOVE %token tEXCLUSIVETO %token tEXPLICITHANDLE tEXTERN %token tFALSE -@@ -567,6 +568,8 @@ attribute: { $$ = NULL; } +@@ -568,6 +569,8 @@ attribute: { $$ = NULL; } | tENCODE { $$ = make_attr(ATTR_ENCODE); } | tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); } | tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); } @@ -59,7 +59,7 @@ index 8b88e031fb5..b1b3201042f 100644 | tEXCLUSIVETO '(' decl_spec ')' { if ($3->type->type_type != TYPE_RUNTIMECLASS) error_loc("type %s is not a runtimeclass\n", $3->type->name); $$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); } -@@ -2235,6 +2238,8 @@ struct allowed_attr allowed_attr[] = +@@ -2260,6 +2263,8 @@ struct allowed_attr allowed_attr[] = /* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" }, /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" }, /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" }, @@ -68,7 +68,7 @@ index 8b88e031fb5..b1b3201042f 100644 /* ATTR_EXCLUSIVETO */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" }, /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" }, /* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" }, -@@ -2884,6 +2889,8 @@ static void check_functions(const type_t *iface, int is_inside_library) +@@ -2909,6 +2914,8 @@ static void check_functions(const type_t *iface, int is_inside_library) { if (func == func_iter) break; if (strcmp(func->name, func_iter->name)) continue; @@ -78,10 +78,10 @@ index 8b88e031fb5..b1b3201042f 100644 if (is_attr(func->attrs, ATTR_PROPPUT) != is_attr(func_iter->attrs, ATTR_PROPPUT)) continue; if (is_attr(func->attrs, ATTR_PROPPUTREF) != is_attr(func_iter->attrs, ATTR_PROPPUTREF)) continue; diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h -index 0a2088574d3..da70a8f97d5 100644 +index 3d8be66f4b8..b46fed49cd6 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h -@@ -100,6 +100,8 @@ enum attr_type +@@ -101,6 +101,8 @@ enum attr_type ATTR_ENCODE, ATTR_ENDPOINT, ATTR_ENTRY, diff --git a/patches/widl-winrt-support/0016-widl-Support-repeated-attributes-for-WinRT-static.patch b/patches/widl-winrt-support/0016-widl-Support-repeated-attributes-for-WinRT-static.patch index 74322d87..8f2eeacb 100644 --- a/patches/widl-winrt-support/0016-widl-Support-repeated-attributes-for-WinRT-static.patch +++ b/patches/widl-winrt-support/0016-widl-Support-repeated-attributes-for-WinRT-static.patch @@ -1,17 +1,17 @@ -From 734f1257696ef221883e92d23f653dc7188b1fcd Mon Sep 17 00:00:00 2001 +From c631587867eb72a1e166b016b08a7b1547e0c5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 13 Oct 2020 13:52:34 +0200 -Subject: [PATCH 16/28] widl: Support repeated attributes for WinRT static. +Subject: [PATCH] widl: Support repeated attributes for WinRT static. --- - tools/widl/parser.y | 258 ++++++++++++++++++++++---------------------- - 1 file changed, 130 insertions(+), 128 deletions(-) + tools/widl/parser.y | 260 ++++++++++++++++++++++---------------------- + 1 file changed, 131 insertions(+), 129 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index 8e79ce3660f..1727b5bb396 100644 +index 37ab07ba1a3..eca878002ea 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y -@@ -1310,27 +1310,6 @@ static str_list_t *append_str(str_list_t *list, char *str) +@@ -1334,27 +1334,6 @@ static str_list_t *append_str(str_list_t *list, char *str) return list; } @@ -39,7 +39,7 @@ index 8e79ce3660f..1727b5bb396 100644 static attr_list_t *move_attr(attr_list_t *dst, attr_list_t *src, enum attr_type type) { attr_t *attr; -@@ -2203,6 +2182,8 @@ struct allowed_attr +@@ -2227,6 +2206,8 @@ struct allowed_attr { unsigned int dce_compatible : 1; unsigned int acf : 1; @@ -48,12 +48,13 @@ index 8e79ce3660f..1727b5bb396 100644 unsigned int on_interface : 1; unsigned int on_function : 1; unsigned int on_arg : 1; -@@ -2223,115 +2204,136 @@ struct allowed_attr +@@ -2247,116 +2228,137 @@ struct allowed_attr struct allowed_attr allowed_attr[] = { - /* attr { D ACF I Fn ARG T En Enm St Un Fi L DI M C AC R } */ - /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" }, +- /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, - /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, - /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" }, - /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, @@ -161,6 +162,7 @@ index 8e79ce3660f..1727b5bb396 100644 - /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, + /* attr { D ACF M I Fn ARG T En Enm St Un Fi L DI M C AC R } */ + /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" }, ++ /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, + /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, + /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" }, + /* ATTR_ASYNC */ { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, diff --git a/patches/widl-winrt-support/0019-widl-Support-WinRT-activatable-attribute.patch b/patches/widl-winrt-support/0019-widl-Support-WinRT-activatable-attribute.patch index cae05311..3039a86e 100644 --- a/patches/widl-winrt-support/0019-widl-Support-WinRT-activatable-attribute.patch +++ b/patches/widl-winrt-support/0019-widl-Support-WinRT-activatable-attribute.patch @@ -1,7 +1,7 @@ -From c0c0bfcf80077cd2b5db3f7c1fb3fa597ae57321 Mon Sep 17 00:00:00 2001 +From 0e9827b742b8592c539efe970e34977383ef14ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 13 Oct 2020 11:35:29 +0200 -Subject: [PATCH 19/28] widl: Support WinRT activatable attribute. +Subject: [PATCH] widl: Support WinRT activatable attribute. --- tools/widl/header.c | 11 +++++++++++ @@ -40,7 +40,7 @@ index 5dfc5e2ff8c..5c87a997349 100644 { char *name = format_namespace(exclusiveto->namespace, "", ".", exclusiveto->name, NULL); diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index 2b41bea1bc9..a47c490ec4c 100644 +index ad4506017b2..34d24794ee0 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -321,6 +321,7 @@ static const struct keyword keywords[] = { @@ -50,9 +50,9 @@ index 2b41bea1bc9..a47c490ec4c 100644 + {"activatable", tACTIVATABLE, 1}, {"aggregatable", tAGGREGATABLE, 0}, {"agile", tAGILE, 1}, - {"allocate", tALLOCATE, 0}, + {"all_nodes", tALLNODES, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index 1da667e0ced..d24f8881147 100644 +index 28fd8ca924a..7cc4be0bd4f 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -172,6 +172,7 @@ static typelib_t *current_typelib; @@ -60,10 +60,10 @@ index 1da667e0ced..d24f8881147 100644 %token LOGICALOR LOGICALAND %token ELLIPSIS +%token tACTIVATABLE - %token tAGGREGATABLE + %token tAGGREGATABLE tALLNODES %token tAGILE %token tALLOCATE tANNOTATION -@@ -544,6 +545,7 @@ static_attr: decl_spec ',' contract_req { if ($1->type->type_type != TYPE_INTER +@@ -545,6 +546,7 @@ static_attr: decl_spec ',' contract_req { if ($1->type->type_type != TYPE_INTER } attribute: { $$ = NULL; } @@ -71,16 +71,16 @@ index 1da667e0ced..d24f8881147 100644 | tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); } | tANNOTATION '(' aSTRING ')' { $$ = make_attrp(ATTR_ANNOTATION, $3); } | tAPPOBJECT { $$ = make_attr(ATTR_APPOBJECT); } -@@ -2239,6 +2241,7 @@ struct allowed_attr +@@ -2263,6 +2265,7 @@ struct allowed_attr struct allowed_attr allowed_attr[] = { /* attr { D ACF M I Fn ARG T En Enm St Un Fi L DI M C AC R } */ + /* ATTR_ACTIVATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "activatable" }, /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" }, + /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, - /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" }, diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h -index be71886260b..7ca770b67ea 100644 +index 894edfc0a1d..a8d41485d32 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -68,6 +68,7 @@ typedef struct list warning_list_t; @@ -89,8 +89,8 @@ index be71886260b..7ca770b67ea 100644 { + ATTR_ACTIVATABLE, ATTR_AGGREGATABLE, + ATTR_ALLOCATE, ATTR_ANNOTATION, - ATTR_APPOBJECT, -- 2.28.0 diff --git a/patches/widl-winrt-support/0022-widl-Support-WinRT-parameterized-interface-type.patch b/patches/widl-winrt-support/0022-widl-Support-WinRT-parameterized-interface-type.patch index 83cabefe..04581c0e 100644 --- a/patches/widl-winrt-support/0022-widl-Support-WinRT-parameterized-interface-type.patch +++ b/patches/widl-winrt-support/0022-widl-Support-WinRT-parameterized-interface-type.patch @@ -1,7 +1,7 @@ -From dfbafe5f504cc35003199e63716c9ce5c6a5729e Mon Sep 17 00:00:00 2001 +From 43b34f506ae48e95e8d977851b799886bb6495ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 12 Oct 2020 17:38:53 +0200 -Subject: [PATCH 22/28] widl: Support WinRT parameterized interface type. +Subject: [PATCH] widl: Support WinRT parameterized interface type. This allows parameterized interfaces to be instanciated in declare blocks, in the same way MIDL does, generating a new interface to the @@ -87,7 +87,7 @@ index 283f2372fee..db83f3aac13 100644 if (type_iface_get_inherit(iface)) { diff --git a/tools/widl/parser.l b/tools/widl/parser.l -index a47c490ec4c..b7f8844c7a9 100644 +index 34d24794ee0..f1182071d25 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -276,6 +276,7 @@ static const struct keyword keywords[] = { @@ -99,7 +99,7 @@ index a47c490ec4c..b7f8844c7a9 100644 {"dispinterface", tDISPINTERFACE, 0}, {"double", tDOUBLE, 0}, diff --git a/tools/widl/parser.y b/tools/widl/parser.y -index c9806ced633..2fb73a46dc1 100644 +index f99e2f8aff1..3453468cbc6 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -83,6 +83,7 @@ static void push_lookup_namespace(const char *name); @@ -141,9 +141,9 @@ index c9806ced633..2fb73a46dc1 100644 +%type decl_block decl_statements +%type imp_decl_block imp_decl_statements %type warnings + %type allocate_option_list allocate_option - %left ',' -@@ -346,7 +352,8 @@ static typelib_t *current_typelib; +@@ -347,7 +353,8 @@ static typelib_t *current_typelib; %% @@ -153,7 +153,7 @@ index c9806ced633..2fb73a46dc1 100644 check_all_user_types($1); write_header($1); write_id_data($1); -@@ -362,6 +369,22 @@ input: gbl_statements m_acf { check_statements($1, FALSE); +@@ -363,6 +370,22 @@ input: gbl_statements m_acf { check_statements($1, FALSE); m_acf: /* empty */ | aACF acf_statements @@ -176,7 +176,7 @@ index c9806ced633..2fb73a46dc1 100644 gbl_statements: { $$ = NULL; } | gbl_statements namespacedef '{' { push_namespace($2); } gbl_statements '}' { pop_namespace($2); $$ = append_statements($1, $5); } -@@ -381,6 +404,7 @@ gbl_statements: { $$ = NULL; } +@@ -382,6 +405,7 @@ gbl_statements: { $$ = NULL; } | gbl_statements moduledef { $$ = append_statement($1, make_statement_module($2)); } | gbl_statements librarydef { $$ = append_statement($1, make_statement_library($2)); } | gbl_statements statement { $$ = append_statement($1, $2); } @@ -184,7 +184,7 @@ index c9806ced633..2fb73a46dc1 100644 ; imp_statements: { $$ = NULL; } -@@ -401,6 +425,7 @@ imp_statements: { $$ = NULL; } +@@ -402,6 +426,7 @@ imp_statements: { $$ = NULL; } | imp_statements statement { $$ = append_statement($1, $2); } | imp_statements importlib { $$ = append_statement($1, make_statement_importlib($2)); } | imp_statements librarydef { $$ = append_statement($1, make_statement_library($2)); } @@ -192,7 +192,7 @@ index c9806ced633..2fb73a46dc1 100644 ; int_statements: { $$ = NULL; } -@@ -3121,6 +3146,27 @@ static void check_async_uuid(type_t *iface) +@@ -3146,6 +3171,27 @@ static void check_async_uuid(type_t *iface) iface->details.iface->async_iface = async_iface->details.iface->async_iface = async_iface; } @@ -220,7 +220,7 @@ index c9806ced633..2fb73a46dc1 100644 static void check_statements(const statement_list_t *stmts, int is_inside_library) { const statement_t *stmt; -@@ -3302,6 +3348,15 @@ static statement_t *make_statement_typedef(declarator_list_t *decls, int declonl +@@ -3327,6 +3373,15 @@ static statement_t *make_statement_typedef(declarator_list_t *decls, int declonl return stmt; } @@ -236,7 +236,7 @@ index c9806ced633..2fb73a46dc1 100644 static statement_list_t *append_statements(statement_list_t *l1, statement_list_t *l2) { if (!l2) return l1; -@@ -3353,8 +3408,10 @@ type_t *find_parameterized_type(type_t *type, type_list_t *params, int t) +@@ -3378,8 +3433,10 @@ type_t *find_parameterized_type(type_t *type, type_list_t *params, int t) assert(type->type_type == TYPE_PARAMETERIZED_TYPE); type = type_parameterized_type_specialize_partial(type, params); } diff --git a/patches/widl-winrt-support/definition b/patches/widl-winrt-support/definition index 4b45323d..fdfd21b7 100644 --- a/patches/widl-winrt-support/definition +++ b/patches/widl-winrt-support/definition @@ -1 +1 @@ -Fixes: [68403] widl - Support WinRT idls +Fixes: [49998] widl - Support WinRT idls diff --git a/staging/upstream-commit b/staging/upstream-commit index f6f801bc..704fde9c 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -93107c08f5aa7f37ad7ece9cd7ca248dba3030ce +2148167f2557cc6c7d1e2f5ffef28bd936503a9a