widl: Update to current Wine version

Includes https://gitlab.winehq.org/wine/wine/-/merge_requests/10570

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-tools/widl/VERSION b/mingw-w64-tools/widl/VERSION
index cbf3f7b..15747fc 100644
--- a/mingw-w64-tools/widl/VERSION
+++ b/mingw-w64-tools/widl/VERSION
@@ -1 +1 @@
-WIDL version 11.5
+WIDL version 11.6
diff --git a/mingw-w64-tools/widl/configure b/mingw-w64-tools/widl/configure
index fc5062b..727d080 100755
--- a/mingw-w64-tools/widl/configure
+++ b/mingw-w64-tools/widl/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for widl 11.5.
+# Generated by GNU Autoconf 2.72 for widl 11.6.
 #
 # Report bugs to <mingw-w64-public@lists.sourceforge.net>.
 #
@@ -603,8 +603,8 @@
 # Identity of this package.
 PACKAGE_NAME='widl'
 PACKAGE_TARNAME='widl'
-PACKAGE_VERSION='11.5'
-PACKAGE_STRING='widl 11.5'
+PACKAGE_VERSION='11.6'
+PACKAGE_STRING='widl 11.6'
 PACKAGE_BUGREPORT='mingw-w64-public@lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -1311,7 +1311,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-'configure' configures widl 11.5 to adapt to many kinds of systems.
+'configure' configures widl 11.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1383,7 +1383,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of widl 11.5:";;
+     short | recursive ) echo "Configuration of widl 11.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1485,7 +1485,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-widl configure 11.5
+widl configure 11.6
 generated by GNU Autoconf 2.72
 
 Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1910,7 +1910,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by widl $as_me 11.5, which was
+It was created by widl $as_me 11.6, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3327,7 +3327,7 @@
 
 # Define the identity of the package.
  PACKAGE='widl'
- VERSION='11.5'
+ VERSION='11.6'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -5797,7 +5797,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by widl $as_me 11.5, which was
+This file was extended by widl $as_me 11.6, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5865,7 +5865,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-widl config.status 11.5
+widl config.status 11.6
 configured by $0, generated by GNU Autoconf 2.72,
   with options \\"\$ac_cs_config\\"
 
diff --git a/mingw-w64-tools/widl/include/bcrypt.h b/mingw-w64-tools/widl/include/bcrypt.h
index b0cdf6e..bf22f6d 100644
--- a/mingw-w64-tools/widl/include/bcrypt.h
+++ b/mingw-w64-tools/widl/include/bcrypt.h
@@ -44,6 +44,10 @@
 #define BCRYPT_SUCCESS(st) ((NTSTATUS)(st) >= 0)
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #define BCRYPT_ALGORITHM_NAME       L"AlgorithmName"
 #define BCRYPT_AUTH_TAG_LENGTH      L"AuthTagLength"
@@ -604,4 +608,8 @@
 NTSTATUS WINAPI BCryptSignHash(BCRYPT_KEY_HANDLE, void *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
 NTSTATUS WINAPI BCryptVerifySignature(BCRYPT_KEY_HANDLE, void *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif  /* __WINE_BCRYPT_H */
diff --git a/mingw-w64-tools/widl/include/memoryapi.h b/mingw-w64-tools/widl/include/memoryapi.h
index 2cfcdd5..79c01aa 100644
--- a/mingw-w64-tools/widl/include/memoryapi.h
+++ b/mingw-w64-tools/widl/include/memoryapi.h
@@ -14,6 +14,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#ifndef _MEMORY_API_H_
+#define _MEMORY_API_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum WIN32_MEMORY_INFORMATION_CLASS
 {
     MemoryRegionInfo
@@ -44,3 +51,9 @@
 WINBASEAPI HANDLE WINAPI CreateFileMapping2(HANDLE,LPSECURITY_ATTRIBUTES,ULONG,ULONG,ULONG,ULONG64,const WCHAR*,MEM_EXTENDED_PARAMETER*,ULONG);
 WINBASEAPI DWORD  WINAPI DiscardVirtualMemory(void *addr, SIZE_T size);
 WINBASEAPI BOOL   WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MEMORY_API_H_ */
diff --git a/mingw-w64-tools/widl/include/processthreadsapi.h b/mingw-w64-tools/widl/include/processthreadsapi.h
index 16e0c45..c389b61 100644
--- a/mingw-w64-tools/widl/include/processthreadsapi.h
+++ b/mingw-w64-tools/widl/include/processthreadsapi.h
@@ -36,6 +36,13 @@
     ThreadInformationClassMax
 } THREAD_INFORMATION_CLASS;
 
+typedef enum _MACHINE_ATTRIBUTES
+{
+    UserEnabled    = 0x00000001,
+    KernelEnabled  = 0x00000002,
+    Wow64Container = 0x00000004,
+} MACHINE_ATTRIBUTES;
+
 typedef struct _MEMORY_PRIORITY_INFORMATION
 {
     ULONG MemoryPriority;
@@ -49,6 +56,7 @@
 } THREAD_POWER_THROTTLING_STATE;
 
 WINBASEAPI VOID WINAPI GetCurrentThreadStackLimits(ULONG_PTR *, ULONG_PTR *);
+WINBASEAPI HRESULT WINAPI GetMachineTypeAttributes(USHORT,MACHINE_ATTRIBUTES *);
 WINBASEAPI HRESULT WINAPI GetThreadDescription(HANDLE,PWSTR *);
 WINBASEAPI HRESULT WINAPI SetThreadDescription(HANDLE,PCWSTR);
 WINBASEAPI BOOL WINAPI SetThreadInformation(HANDLE,THREAD_INFORMATION_CLASS,LPVOID,DWORD);
diff --git a/mingw-w64-tools/widl/include/winbase.h b/mingw-w64-tools/widl/include/winbase.h
index d02b2bd..ed0e2bb 100644
--- a/mingw-w64-tools/widl/include/winbase.h
+++ b/mingw-w64-tools/widl/include/winbase.h
@@ -1416,13 +1416,6 @@
     SIZE_T NumberOfBytes;
 } WIN32_MEMORY_RANGE_ENTRY, *PWIN32_MEMORY_RANGE_ENTRY;
 
-typedef enum _MACHINE_ATTRIBUTES
-{
-    UserEnabled    = 0x00000001,
-    KernelEnabled  = 0x00000002,
-    Wow64Container = 0x00000004,
-} MACHINE_ATTRIBUTES;
-
 typedef struct _PROCESS_MACHINE_INFORMATION
 {
     USHORT ProcessMachine;
@@ -1473,6 +1466,7 @@
 #define                       AddAtom WINELIB_NAME_AW(AddAtom)
 WINADVAPI  BOOL        WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
 WINADVAPI  BOOL        WINAPI AddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
+WINADVAPI  BOOL        WINAPI AddConditionalAce(PACL,DWORD,DWORD,UCHAR,DWORD,PSID,PWCHAR,DWORD *);
 WINADVAPI  BOOL        WINAPI AddMandatoryAce(PACL,DWORD,DWORD,DWORD,PSID);
 WINBASEAPI VOID        WINAPI AddRefActCtx(HANDLE);
 WINBASEAPI PVOID       WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
diff --git a/mingw-w64-tools/widl/include/wincrypt.h b/mingw-w64-tools/widl/include/wincrypt.h
index 9c42586..6ee077c 100644
--- a/mingw-w64-tools/widl/include/wincrypt.h
+++ b/mingw-w64-tools/widl/include/wincrypt.h
@@ -1942,6 +1942,7 @@
 /* Key Specs*/
 #define AT_KEYEXCHANGE          1
 #define AT_SIGNATURE            2
+#define CERT_NCRYPT_KEY_SPEC    0xffffffff
 
 /* Provider Types */
 #define PROV_RSA_FULL             1
diff --git a/mingw-w64-tools/widl/src/parser.l b/mingw-w64-tools/widl/src/parser.l
index c57ad99..c18c7dd 100644
--- a/mingw-w64-tools/widl/src/parser.l
+++ b/mingw-w64-tools/widl/src/parser.l
@@ -185,11 +185,9 @@
     return token_ident( str, yylval );
 }
 
-static void winrt_enable( int ns_prefix )
+static void winrt_enable(void)
 {
     if (!list_empty( &import_stack ) && !winrt_mode) error_loc( "WinRT IDL file imported in non-winrt mode.\n" );
-
-    use_abi_namespace = ns_prefix;
     winrt_mode = TRUE;
 }
 
@@ -210,12 +208,14 @@
     winrt{ws}+ns_prefix[^\n]*                   {
                                                     yy_pop_state();
                                                     yylloc->first_line -= 1;
-                                                    winrt_enable( TRUE );
+                                                    winrt_enable();
+                                                    if (list_empty( &import_stack )) use_abi_namespace = TRUE;
+
                                                 }
     winrt[^\n]*                                 {
                                                     yy_pop_state();
                                                     yylloc->first_line -= 1;
-                                                    winrt_enable( FALSE );
+                                                    winrt_enable();
                                                 }
     [^\n]*                                      {
                                                     yy_pop_state();
diff --git a/mingw-w64-tools/widl/src/parser.yy.c b/mingw-w64-tools/widl/src/parser.yy.c
index aaad3b3..6188893 100644
--- a/mingw-w64-tools/widl/src/parser.yy.c
+++ b/mingw-w64-tools/widl/src/parser.yy.c
@@ -1958,21 +1958,19 @@
     return token_ident( str, yylval );
 }
 
-static void winrt_enable( int ns_prefix )
+static void winrt_enable(void)
 {
     if (!list_empty( &import_stack ) && !winrt_mode) error_loc( "WinRT IDL file imported in non-winrt mode.\n" );
-
-    use_abi_namespace = ns_prefix;
     winrt_mode = TRUE;
 }
 
-#line 1969 "tools/widl/parser.yy.c"
+#line 1967 "tools/widl/parser.yy.c"
 /*
  **************************************************************************
  * The flexer starts here
  **************************************************************************
  */
-#line 1975 "tools/widl/parser.yy.c"
+#line 1973 "tools/widl/parser.yy.c"
 
 #define INITIAL 0
 #define ATTR 1
@@ -2220,9 +2218,9 @@
 		}
 
 	{
-#line 203 "tools/widl/parser.l"
+#line 201 "tools/widl/parser.l"
 
-#line 2225 "tools/widl/parser.yy.c"
+#line 2223 "tools/widl/parser.yy.c"
 
 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
 		{
@@ -2281,7 +2279,7 @@
 (yy_c_buf_p) = yy_cp = yy_bp + 9;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 205 "tools/widl/parser.l"
+#line 203 "tools/widl/parser.l"
 {
                                                     yy_pop_state();
                                                     yylloc->first_line -= 1;
@@ -2290,11 +2288,13 @@
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 210 "tools/widl/parser.l"
+#line 208 "tools/widl/parser.l"
 {
                                                     yy_pop_state();
                                                     yylloc->first_line -= 1;
-                                                    winrt_enable( TRUE );
+                                                    winrt_enable();
+                                                    if (list_empty( &import_stack )) use_abi_namespace = TRUE;
+
                                                 }
 	YY_BREAK
 case 3:
@@ -2303,7 +2303,7 @@
 {
                                                     yy_pop_state();
                                                     yylloc->first_line -= 1;
-                                                    winrt_enable( FALSE );
+                                                    winrt_enable();
                                                 }
 	YY_BREAK
 case 4: