[vlc-commits] [Git][videolan/vlc][3.0.x] 11 commits: contrib: mingw64: patch headers to allow more API's in UWP

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Oct 18 10:25:06 UTC 2024



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
1435e5e6 by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: mingw64: patch headers to allow more API's in UWP

* libloaderapi.h to allow LoadLibraryEx, GetModuleHandle,
GetModuleHandleEx, LoadString, SizeofResource in UWP
* winreg.h to allow RegCloseKey, RegCreateKeyEx, RegDeleteKeyEx,
 RegDeleteValue, RegEnumKeyEx, RegEnumValue, RegGetValue,
  RegNotifyChangeKeyValue, RegOpenKeyEx, RegQueryInfoKey,
   RegQueryValueEx, RegSetValueEx and RegDeleteTree in UWP 8.1

(cherry picked from commit b39bb8da1b7760c999bdc6d381c56f17eca4cfd2) (edited)
edited:
- 3.0 uses pthreads/rules.mak

- - - - -
f09f7796 by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: add some command to factorize configure/make calls

(cherry picked from commit b7c5ba6eca052a965e933f5d64564b25e645f403) (rebased)
rebased:
- 3.0 already has BUILD_DIR

- - - - -
467230e0 by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: use a variable for the build dir and source dir from there

(cherry picked from commit 66fdd2d83faee83de38a351b28d69c9b32fdf279) (edited)
edited:
- only apply to autotools as it was already used for CMake

- - - - -
78fa990e by Rémi Denis-Courmont at 2024-10-18T09:37:16+00:00
contrib: mingw: fix ARCH usage

IA-32 is canonicalised as i386 by the ad-hoc script.
$(ARCH) will never equal i686.

(cherry picked from commit 93907682b4c68fda13b15b7961f38863baaf944d) (edited)
edited:
- 3.0 uses pthreads/rules.mak

- - - - -
010edeea by Marvin Scholz at 2024-10-18T09:37:16+00:00
contrib/gpg-error: simplify darwin triplet handling

Instead of copying the header files around, change the triplet
canonicalization function to correctly remove version numbers for
darwin triplets.

(cherry picked from commit ebd6b48b5fbe543bcacc2f9a877a350528b1bd3f)

- - - - -
c2297601 by Rémi Denis-Courmont at 2024-10-18T09:37:16+00:00
contrib: gpg-error: sanitise POSIX lock object

This provides a sane portable lock object definition for all platforms
with basic POSIX threads. This replaces the insane gpg-error build
system attempting and failing to second guess the platform-specific
size and alignment of pthread_mutex_t.

(cherry picked from commit ba314fb4c19977d45ce76f2412f2decc6afd4c6c)

- - - - -
5fd266ef by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: gpg-error: disable documentation building

(cherry picked from commit 0d5e38ce25f0757b2fddf44a573eb1024ff84378)

- - - - -
5b274360 by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: gpg-error: fix UWP build

(cherry picked from commit c441dda9b51fd650354d81ebb0b781039c0905b2)

- - - - -
c14736b1 by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: gpg-error: always apply Windows patches

They only apply to Windows specific code and are safe for all Windows versions.

(cherry picked from commit a1c663c13086da89a1c79d5e8bcef09fe2e72e14)

- - - - -
f4eef641 by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: gpg-error: avoid more forbidden UWP calls in gnulib

(cherry picked from commit 156b76ba9a9441fc321954cc2e03920cfdce7e78)

- - - - -
83a1a1eb by Steve Lhomme at 2024-10-18T09:37:16+00:00
contrib: gpg-error: remove configure setting found in HOSTCONF

(cherry picked from commit ebdae4eaf4d0cb4531b8f640e4b12f73cf688210)

- - - - -


12 changed files:

- + contrib/src/gpg-error/darwin-triplet.patch
- + contrib/src/gpg-error/gpg-error-createfile2.patch
- + contrib/src/gpg-error/gpg-error-uwp-GetFileSize.patch
- + contrib/src/gpg-error/gpg-error-uwp-fix.patch
- + contrib/src/gpg-error/lock-obj-pub.posix.h
- contrib/src/gpg-error/rules.mak
- contrib/src/main.mak
- + contrib/src/pthreads/0001-add-api-ms-core-registry-def-files.patch
- + contrib/src/pthreads/0001-headers-enable-GET_MODULE_HANDLE_EX_xxx-defines-in-U.patch
- + contrib/src/pthreads/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch
- + contrib/src/pthreads/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch
- contrib/src/pthreads/rules.mak


Changes:

=====================================
contrib/src/gpg-error/darwin-triplet.patch
=====================================
@@ -0,0 +1,25 @@
+--- libgpg-error-1.27_orig/src/mkheader.c	2017-02-28 13:32:33.000000000 +0100
++++ libgpg-error-1.27/src/mkheader.c	2020-01-23 11:36:50.000000000 +0100
+@@ -107,7 +107,21 @@
+           return xstrdup (lastalias);
+         }
+     }
+-  return xstrdup (triplet);
++  /* Darwin triplet de-versioning */
++  char *res_triplet = xstrdup (triplet);
++
++  char *triplet_last = strrchr(res_triplet, '-');
++  if (triplet_last == NULL) {
++    fprintf (stderr, PGM ": unexpected host triplet missing any separator: '%s'",
++               res_triplet);
++    exit (1);
++  }
++  triplet_last++; /* Advance past the dash */
++  if (strncmp("darwin", triplet_last, 6) == 0) {
++    triplet_last[6] = '\0';
++  }
++
++  return res_triplet;
+ }
+ 
+ 


=====================================
contrib/src/gpg-error/gpg-error-createfile2.patch
=====================================
@@ -0,0 +1,62 @@
+--- libgpg-error/src/estream.c.uwp	2023-05-23 09:53:33.222246200 +0200
++++ libgpg-error/src/estream.c	2023-05-22 12:00:18.105186500 +0200
+@@ -4561,6 +4561,17 @@ tmpfd (void)
+ #else
+       strcpy (p, ".tmp");
+ #endif
++#if _WIN32_WINNT >= 0x0602 // _WIN32_WINNT_WIN8
++      CREATEFILE2_EXTENDED_PARAMETERS params;
++      memset (&params, 0, sizeof params);
++      params.dwSize = sizeof(params);
++      params.dwFileFlags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE;
++      file = CreateFile2 (buffer,
++                         GENERIC_READ | GENERIC_WRITE,
++                         0,
++                         CREATE_NEW,
++                         &params);
++#else
+       file = CreateFile (buffer,
+                          GENERIC_READ | GENERIC_WRITE,
+                          0,
+@@ -4568,6 +4579,7 @@ tmpfd (void)
+                          CREATE_NEW,
+                          FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE,
+                          NULL);
++#endif
+       if (file != INVALID_HANDLE_VALUE)
+         {
+ #ifdef HAVE_W32CE_SYSTEM
+--- libgpg-error/src/w32-gettext.c.uwp	2023-05-23 09:53:33.184247600 +0200
++++ libgpg-error/src/w32-gettext.c	2023-05-22 11:45:24.077340000 +0200
+@@ -53,7 +53,7 @@
+ #include "init.h"
+ #include "gpg-error.h"
+ 
+-#if defined(HAVE_W32CE_SYSTEM) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
++#if defined(HAVE_W32CE_SYSTEM) || !WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+ /* Forward declaration.  */
+ static wchar_t *utf8_to_wchar (const char *string, size_t length, size_t *retlen);
+ 
+@@ -72,9 +72,22 @@ MyCreateFileA (LPCSTR lpFileName, DWORD
+   if (!filename)
+     return INVALID_HANDLE_VALUE;
+ 
++#if !WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
++  CREATEFILE2_EXTENDED_PARAMETERS createExParams;
++  createExParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
++  createExParams.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
++  createExParams.dwFileFlags = dwFlagsAndAttributes & 0xFFF00000;
++  createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F0000;
++  createExParams.lpSecurityAttributes = lpSecurityAttributes;
++  createExParams.hTemplateFile = hTemplateFile;
++
++  result = CreateFile2 (filename, dwDesiredAccess, dwSharedMode,
++			dwCreationDisposition, &createExParams);
++#else
+   result = CreateFileW (filename, dwDesiredAccess, dwSharedMode,
+ 			lpSecurityAttributes, dwCreationDisposition,
+ 			dwFlagsAndAttributes, hTemplateFile);
++#endif
+ 
+   err = GetLastError ();
+   free (filename);


=====================================
contrib/src/gpg-error/gpg-error-uwp-GetFileSize.patch
=====================================
@@ -0,0 +1,18 @@
+--- libgpg-error/src/w32-gettext.c.uwp	2023-05-23 09:53:33.184247600 +0200
++++ libgpg-error/src/w32-gettext.c	2023-05-22 11:45:24.077340000 +0200
+@@ -1240,7 +1253,15 @@ load_domain (const char *filename)
+   if (fh == INVALID_HANDLE_VALUE)
+     return NULL;
+ 
++#if !WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
++  FILE_STANDARD_INFO fStdInfo;
++  if (GetFileInformationByHandleEx(fh, FileStandardInfo, (LPVOID)&fStdInfo, sizeof(fStdInfo)))
++    size = fStdInfo.EndOfFile.LowPart;
++  else
++      size = INVALID_FILE_SIZE;
++#else
+   size = GetFileSize (fh, NULL);
++#endif
+   if (size == INVALID_FILE_SIZE)
+     {
+       CloseHandle (fh);


=====================================
contrib/src/gpg-error/gpg-error-uwp-fix.patch
=====================================
@@ -0,0 +1,11 @@
+--- libgpg-error/src/mkheader.c.orig	2023-05-12 13:24:34.270562700 +0200
++++ libgpg-error/src/mkheader.c	2023-05-15 08:26:10.678024100 +0200
+@@ -518,7 +518,7 @@ write_special (const char *fname, int ln
+     }
+   else if (!strcmp (tag, "include:os-add"))
+     {
+-      if (!strcmp (host_os, "mingw32"))
++      if (!strcmp (host_os, "mingw32") || !strcmp (host_os, "mingw32uwp") || !strcmp (host_os, "mingw32ucrt"))
+         {
+           include_file (fname, lnr, "w32-add.h", write_line);
+         }


=====================================
contrib/src/gpg-error/lock-obj-pub.posix.h
=====================================
@@ -0,0 +1,18 @@
+## lock-obj-pub.posix.h
+## File created by Rémi Denis-Courmont - DO EDIT
+## To be included by mkheader into gpg-error.h
+
+#include <pthread.h>
+
+typedef struct
+{
+  long vers;
+  union {
+    pthread_mutex_t mtx;
+    /* In theory, pointers could have a higher alignment than pthread_mutex_t,
+     * so keep in the union to match _gpgrt_lock_t. */
+    long *alignme;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER { 1, { PTHREAD_MUTEX_INITIALIZER } }


=====================================
contrib/src/gpg-error/rules.mak
=====================================
@@ -13,17 +13,29 @@ endif
 
 libgpg-error: libgpg-error-$(GPGERROR_VERSION).tar.bz2 .sum-gpg-error
 	$(UNPACK)
-ifdef HAVE_WIN32
 	$(APPLY) $(SRC)/gpg-error/windres-make.patch
-ifdef HAVE_WINSTORE
 	$(APPLY) $(SRC)/gpg-error/winrt.patch
-endif
-endif
 	$(APPLY) $(SRC)/gpg-error/missing-unistd-include.patch
 	$(APPLY) $(SRC)/gpg-error/no-executable.patch
 	$(APPLY) $(SRC)/gpg-error/win32-unicode.patch
 	$(APPLY) $(SRC)/gpg-error/version-bump-gawk-5.patch
 	$(APPLY) $(SRC)/gpg-error/win32-extern-struct.patch
+	$(APPLY) $(SRC)/gpg-error/darwin-triplet.patch
+ifndef HAVE_WIN32
+	cp -f -- "$(SRC)/gpg-error/lock-obj-pub.posix.h" \
+		"$(UNPACK_DIR)/src/lock-obj-pub.native.h"
+endif
+	# gpg-error doesn't know about mingw32uwp but it's the same as mingw32
+	cp -f -- "$(UNPACK_DIR)/src/syscfg/lock-obj-pub.mingw32.h" \
+		"$(UNPACK_DIR)/src/syscfg/lock-obj-pub.mingw32uwp.h"
+	$(APPLY) $(SRC)/gpg-error/gpg-error-uwp-fix.patch
+
+	# use CreateFile2 in Win8 as CreateFileW is forbidden in UWP
+	$(APPLY) $(SRC)/gpg-error/gpg-error-createfile2.patch
+
+	# don't use GetFileSize on UWP
+	$(APPLY) $(SRC)/gpg-error/gpg-error-uwp-GetFileSize.patch
+
 	$(MOVE)
 ifdef HAVE_ANDROID
 ifeq ($(ARCH),aarch64)
@@ -38,26 +50,16 @@ ifeq ($(TIZEN_ABI), x86)
 	cp $@/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h $@/src/syscfg/lock-obj-pub.linux-gnueabi.h
 endif
 endif
-ifdef HAVE_DARWIN_OS
-ifdef HAVE_ARMV7A
-	cp $@/src/syscfg/lock-obj-pub.arm-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
-else
-ifeq ($(ARCH),aarch64)
-	cp $@/src/syscfg/lock-obj-pub.aarch64-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
-else
-	cp $@/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h $@/src/syscfg/lock-obj-pub.$(HOST).h
-endif
-endif
-endif
 
 GPGERROR_CONF := \
 	--disable-nls \
-	--disable-shared \
 	--disable-languages \
-	--disable-tests
+	--disable-tests \
+	--disable-doc
 
 .gpg-error: libgpg-error
 	$(RECONF)
 	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) $(GPGERROR_CONF)
-	cd $< && $(MAKE) install
+	# pre_mkheader_cmds would delete our lock-obj-pub-native.h
+	cd $< && $(MAKE) pre_mkheader_cmds=true install
 	touch $@


=====================================
contrib/src/main.mak
=====================================
@@ -391,6 +391,12 @@ BUILD_SRC := ..
 # build directory relative to UNPACK_DIR
 BUILD_DIRUNPACK = _build
 
+
+MAKEBUILDDIR = mkdir -p $(BUILD_DIR) && rm -f $(BUILD_DIR)/config.status
+MAKEBUILD = $(MAKE) -C $(BUILD_DIR)
+MAKECONFDIR = cd $(BUILD_DIR) && $(HOSTVARS) $(BUILD_SRC)
+MAKECONFIGURE = $(MAKECONFDIR)/configure $(HOSTCONF)
+
 # Work around for https://lists.nongnu.org/archive/html/bug-gnulib/2020-05/msg00237.html
 # When using a single command, make might take a shortcut and fork/exec
 # itself instead of relying on a shell, but a bug in gnulib ends up


=====================================
contrib/src/pthreads/0001-add-api-ms-core-registry-def-files.patch
=====================================
@@ -0,0 +1,164 @@
+From bc8986696605c29c8ef54f9c448ab889c2195d93 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 30 May 2023 16:54:31 +0200
+Subject: [PATCH] add api-ms-core-registry-* def files
+
+These are needed to enable the registry API calls available in UWP.
+---
+ mingw-w64-crt/Makefile.in                     |  4 ++
+ .../api-ms-win-core-registry-l1-1-0.def       | 47 +++++++++++++++++++
+ .../api-ms-win-core-registry-l2-1-0.def       | 37 +++++++++++++++
+ mingw-w64-crt/lib-common/mincore.mri          |  3 +-
+ mingw-w64-crt/lib-common/windowsapp.mri       |  2 +
+ 5 files changed, 92 insertions(+), 1 deletion(-)
+ create mode 100644 mingw-w64-crt/lib-common/api-ms-win-core-registry-l1-1-0.def
+ create mode 100644 mingw-w64-crt/lib-common/api-ms-win-core-registry-l2-1-0.def
+
+diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
+index a4a1ed922..6087f050e 100644
+--- a/mingw-w64-crt/Makefile.in
++++ b/mingw-w64-crt/Makefile.in
+@@ -2104,6 +2104,8 @@ endif
+ 		%/libapi-ms-win-core-realtime-l1-1-0.a \
+ 		%/libapi-ms-win-core-realtime-l1-1-1.a \
+ 		%/libapi-ms-win-core-realtime-l1-1-2.a \
++		%/libapi-ms-win-core-registry-l1-1-0.a \
++		%/libapi-ms-win-core-registry-l2-1-0.a \
+ 		%/libapi-ms-win-core-rtlsupport-l1-2-0.a \
+ 		%/libapi-ms-win-core-string-l1-1-0.a \
+ 		%/libapi-ms-win-core-synch-l1-1-0.a \
+@@ -2237,6 +2239,8 @@ endif
+ 		%/libapi-ms-win-core-profile-l1-1-0.a \
+ 		%/libapi-ms-win-core-realtime-l1-1-0.a \
+ 		%/libapi-ms-win-core-realtime-l1-1-1.a \
++		%/libapi-ms-win-core-registry-l1-1-0.a \
++		%/libapi-ms-win-core-registry-l2-1-0.a \
+ 		%/libapi-ms-win-core-rtlsupport-l1-2-0.a \
+ 		%/libapi-ms-win-core-string-l1-1-0.a \
+ 		%/libapi-ms-win-core-synch-ansi-l1-1-0.a \
+diff --git a/mingw-w64-crt/lib-common/api-ms-win-core-registry-l1-1-0.def b/mingw-w64-crt/lib-common/api-ms-win-core-registry-l1-1-0.def
+new file mode 100644
+index 000000000..5cb72046b
+--- /dev/null
++++ b/mingw-w64-crt/lib-common/api-ms-win-core-registry-l1-1-0.def
+@@ -0,0 +1,47 @@
++LIBRARY api-ms-win-core-registry-l1-1-0
++
++EXPORTS
++
++RegCloseKey
++RegCopyTreeW
++RegCreateKeyExA
++RegCreateKeyExW
++RegDeleteKeyExA
++RegDeleteKeyExW
++RegDeleteTreeA
++RegDeleteTreeW
++RegDeleteValueA
++RegDeleteValueW
++RegDisablePredefinedCacheEx
++RegEnumKeyExA
++RegEnumKeyExW
++RegEnumValueA
++RegEnumValueW
++RegFlushKey
++RegGetKeySecurity
++RegGetValueA
++RegGetValueW
++RegLoadAppKeyA
++RegLoadAppKeyW
++RegLoadKeyA
++RegLoadKeyW
++RegLoadMUIStringA
++RegLoadMUIStringW
++RegNotifyChangeKeyValue
++RegOpenCurrentUser
++RegOpenKeyExA
++RegOpenKeyExW
++RegOpenUserClassesRoot
++RegQueryInfoKeyA
++RegQueryInfoKeyW
++RegQueryValueExA
++RegQueryValueExW
++RegRestoreKeyA
++RegRestoreKeyW
++RegSaveKeyExA
++RegSaveKeyExW
++RegSetKeySecurity
++RegSetValueExA
++RegSetValueExW
++RegUnLoadKeyA
++RegUnLoadKeyW
+diff --git a/mingw-w64-crt/lib-common/api-ms-win-core-registry-l2-1-0.def b/mingw-w64-crt/lib-common/api-ms-win-core-registry-l2-1-0.def
+new file mode 100644
+index 000000000..3e05bbf74
+--- /dev/null
++++ b/mingw-w64-crt/lib-common/api-ms-win-core-registry-l2-1-0.def
+@@ -0,0 +1,37 @@
++LIBRARY api-ms-win-core-registry-l2-1-0
++
++EXPORTS
++
++RegConnectRegistryA
++RegConnectRegistryW
++RegCopyTreeA
++RegCreateKeyA
++RegCreateKeyTransactedA
++RegCreateKeyTransactedW
++RegCreateKeyW
++RegDeleteKeyA
++RegDeleteKeyTransactedA
++RegDeleteKeyTransactedW
++RegDeleteKeyValueA
++RegDeleteKeyValueW
++RegDeleteKeyW
++RegDisablePredefinedCache
++RegEnumKeyA
++RegEnumKeyW
++RegOpenKeyA
++RegOpenKeyTransactedA
++RegOpenKeyTransactedW
++RegOpenKeyW
++RegOverridePredefKey
++RegQueryMultipleValuesA
++RegQueryMultipleValuesW
++RegQueryValueA
++RegQueryValueW
++RegReplaceKeyA
++RegReplaceKeyW
++RegSaveKeyA
++RegSaveKeyW
++RegSetKeyValueA
++RegSetKeyValueW
++RegSetValueA
++RegSetValueW
+diff --git a/mingw-w64-crt/lib-common/mincore.mri b/mingw-w64-crt/lib-common/mincore.mri
+index 7073eeb8d..03f4b4c37 100644
+--- a/mingw-w64-crt/lib-common/mincore.mri
++++ b/mingw-w64-crt/lib-common/mincore.mri
+@@ -85,7 +85,8 @@ ADDLIB libapi-ms-win-core-psapi-ansi-l1-1-0.a
+ ADDLIB libapi-ms-win-core-realtime-l1-1-0.a
+ ADDLIB libapi-ms-win-core-realtime-l1-1-1.a
+ ADDLIB libapi-ms-win-core-realtime-l1-1-2.a
+-; FIXME libapi-ms-win-core-registry-l1-1-0.a
++ADDLIB libapi-ms-win-core-registry-l1-1-0.a
++ADDLIB libapi-ms-win-core-registry-l2-1-0.a
+ ; FIXME libapi-ms-win-core-registry-l1-1-1.a
+ ; FIXME libapi-ms-win-core-registry-l1-1-2.a
+ ; FIXME libapi-ms-win-core-rtlsupport-l1-1-0.a
+diff --git a/mingw-w64-crt/lib-common/windowsapp.mri b/mingw-w64-crt/lib-common/windowsapp.mri
+index 8e0e3d888..2496280a5 100644
+--- a/mingw-w64-crt/lib-common/windowsapp.mri
++++ b/mingw-w64-crt/lib-common/windowsapp.mri
+@@ -51,6 +51,8 @@ ADDLIB libapi-ms-win-core-psapi-ansi-l1-1-0.a
+ ADDLIB libapi-ms-win-core-profile-l1-1-0.a
+ ADDLIB libapi-ms-win-core-realtime-l1-1-0.a
+ ADDLIB libapi-ms-win-core-realtime-l1-1-1.a
++ADDLIB libapi-ms-win-core-registry-l1-1-0.a
++ADDLIB libapi-ms-win-core-registry-l2-1-0.a
+ ADDLIB libapi-ms-win-core-rtlsupport-l1-2-0.a
+ ADDLIB libapi-ms-win-core-string-l1-1-0.a
+ ADDLIB libapi-ms-win-core-synch-ansi-l1-1-0.a
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/pthreads/0001-headers-enable-GET_MODULE_HANDLE_EX_xxx-defines-in-U.patch
=====================================
@@ -0,0 +1,32 @@
+From 5ce33c808919cc129fe04fa306ca64cdd9762248 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 30 May 2023 15:52:28 +0200
+Subject: [PATCH] headers: enable GET_MODULE_HANDLE_EX_xxx defines in UWP
+ builds
+
+It's available in the Windows 11 SDK for all builds targeting FAMILY_APP and more.
+---
+ mingw-w64-headers/include/libloaderapi.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mingw-w64-headers/include/libloaderapi.h b/mingw-w64-headers/include/libloaderapi.h
+index 26115ad9e..2705c18a4 100644
+--- a/mingw-w64-headers/include/libloaderapi.h
++++ b/mingw-w64-headers/include/libloaderapi.h
+@@ -79,11 +79,13 @@ extern "C" {
+ #if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
+ #define LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY 0x00008000
+ #endif
++#endif /* WINAPI_PARTITION_DESKTOP */
+ 
+ #define GET_MODULE_HANDLE_EX_FLAG_PIN (0x1)
+ #define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x2)
+ #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x4)
+ 
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+ #define ENUMRESLANGPROC __MINGW_NAME_AW(ENUMRESLANGPROC)
+ #define ENUMRESNAMEPROC __MINGW_NAME_AW(ENUMRESNAMEPROC)
+ #define ENUMRESTYPEPROC __MINGW_NAME_AW(ENUMRESTYPEPROC)
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/pthreads/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch
=====================================
@@ -0,0 +1,113 @@
+From f24fb397cf423d55d363ac4fdc7e6b7aeb7ae830 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 30 May 2023 14:42:07 +0200
+Subject: [PATCH] headers: enable more module API in Win10 UWP builds
+
+The documentation doesn't say they're allowed, but the WIndows SDK allow it
+since 22000 and the Windows App Certification as well.
+It is not restricted to Win11 in both cases but applies when targeting Win10
+as well.
+---
+ mingw-w64-headers/include/libloaderapi.h | 51 ++++++++++++++----------
+ 1 file changed, 29 insertions(+), 22 deletions(-)
+
+diff --git a/mingw-w64-headers/include/libloaderapi.h b/mingw-w64-headers/include/libloaderapi.h
+index d4c82ef8c..288e78d9f 100644
+--- a/mingw-w64-headers/include/libloaderapi.h
++++ b/mingw-w64-headers/include/libloaderapi.h
+@@ -37,11 +37,6 @@ extern "C" {
+   typedef FARPROC ENUMRESLANGPROCW;
+ #endif
+ 
+-#ifndef RC_INVOKED
+-  typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXA) (DWORD dwFlags, LPCSTR lpModuleName, HMODULE *phModule);
+-  typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXW) (DWORD dwFlags, LPCWSTR lpModuleName, HMODULE *phModule);
+-#endif
+-
+   typedef PVOID DLL_DIRECTORY_COOKIE, *PDLL_DIRECTORY_COOKIE;
+ 
+ #define FIND_RESOURCE_DIRECTORY_TYPES (0x0100)
+@@ -90,32 +85,18 @@ extern "C" {
+ 
+   WINBASEAPI WINBOOL WINAPI EnumResourceNamesW(HMODULE hModule, LPCWSTR lpType, ENUMRESNAMEPROCW lpEnumFunc, LONG_PTR lParam);
+   WINBASEAPI HRSRC WINAPI FindResourceW(HMODULE hModule, LPCWSTR lpName, LPCWSTR lpType);
+-  WINBASEAPI HRSRC WINAPI FindResourceExW (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage);
+   WINBASEAPI WINBOOL WINAPI FreeResource (HGLOBAL hResData);
+-  WINBASEAPI HMODULE WINAPI LoadLibraryExA (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
+-  WINBASEAPI HMODULE WINAPI LoadLibraryExW (LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
+   WINBASEAPI HGLOBAL WINAPI LoadResource (HMODULE hModule, HRSRC hResInfo);
+-  WINUSERAPI int WINAPI LoadStringA (HINSTANCE hInstance, UINT uID, LPSTR lpBuffer, int cchBufferMax);
+-  WINUSERAPI int WINAPI LoadStringW (HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int cchBufferMax);
+   WINBASEAPI LPVOID WINAPI LockResource (HGLOBAL hResData);
+-  WINBASEAPI DWORD WINAPI SizeofResource (HMODULE hModule, HRSRC hResInfo);
+   WINBASEAPI DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory (PCWSTR NewDirectory);
+   WINBASEAPI WINBOOL WINAPI RemoveDllDirectory (DLL_DIRECTORY_COOKIE Cookie);
+   WINBASEAPI WINBOOL WINAPI SetDefaultDllDirectories (DWORD DirectoryFlags);
+-  WINBASEAPI WINBOOL WINAPI GetModuleHandleExA (DWORD dwFlags, LPCSTR lpModuleName, HMODULE *phModule);
+-  WINBASEAPI WINBOOL WINAPI GetModuleHandleExW (DWORD dwFlags, LPCWSTR lpModuleName, HMODULE *phModule);
+ 
+ #ifdef UNICODE
+ #define EnumResourceNames EnumResourceNamesW
+ #define FindResource FindResourceW
+-#define FindResourceEx FindResourceExW
+ #endif
+ 
+-#define PGET_MODULE_HANDLE_EX __MINGW_NAME_AW(PGET_MODULE_HANDLE_EX)
+-#define LoadString __MINGW_NAME_AW(LoadString)
+-#define GetModuleHandleEx __MINGW_NAME_AW(GetModuleHandleEx)
+-#define LoadLibraryEx __MINGW_NAME_AW(LoadLibraryEx)
+-
+ #define EnumResourceLanguages __MINGW_NAME_AW(EnumResourceLanguages)
+   WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesA(HMODULE hModule,LPCSTR lpType,LPCSTR lpName,ENUMRESLANGPROCA lpEnumFunc,LONG_PTR lParam);
+   WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesW(HMODULE hModule,LPCWSTR lpType,LPCWSTR lpName,ENUMRESLANGPROCW lpEnumFunc,LONG_PTR lParam);
+@@ -136,11 +117,8 @@ extern "C" {
+ #endif
+ #endif
+ #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
+-WINBASEAPI HMODULE WINAPI GetModuleHandleA (LPCSTR lpModuleName);
+-WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
+ WINBASEAPI HMODULE WINAPI LoadLibraryA(LPCSTR lpLibFileName);
+ WINBASEAPI HMODULE WINAPI LoadLibraryW(LPCWSTR lpLibFileName);
+-#define GetModuleHandle __MINGW_NAME_AW(GetModuleHandle)
+ #define LoadLibrary __MINGW_NAME_AW(LoadLibrary)
+ #endif
+ 
+@@ -176,6 +154,35 @@ typedef const REDIRECTION_DESCRIPTOR *PCREDIRECTION_DESCRIPTOR;
+ #endif
+ #endif
+ 
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0A00
++  WINBASEAPI HRSRC WINAPI FindResourceExW (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage);
++  WINBASEAPI HMODULE WINAPI GetModuleHandleA (LPCSTR lpModuleName);
++  WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
++  WINBASEAPI WINBOOL WINAPI GetModuleHandleExA (DWORD dwFlags, LPCSTR lpModuleName, HMODULE *phModule);
++  WINBASEAPI WINBOOL WINAPI GetModuleHandleExW (DWORD dwFlags, LPCWSTR lpModuleName, HMODULE *phModule);
++  WINBASEAPI HMODULE WINAPI LoadLibraryExA (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
++  WINBASEAPI HMODULE WINAPI LoadLibraryExW (LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
++  WINUSERAPI int WINAPI LoadStringA (HINSTANCE hInstance, UINT uID, LPSTR lpBuffer, int cchBufferMax);
++  WINUSERAPI int WINAPI LoadStringW (HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int cchBufferMax);
++  WINBASEAPI DWORD WINAPI SizeofResource (HMODULE hModule, HRSRC hResInfo);
++
++#ifdef UNICODE
++#define FindResourceEx FindResourceExW
++#endif
++
++#define GetModuleHandle __MINGW_NAME_AW(GetModuleHandle)
++#define GetModuleHandleEx __MINGW_NAME_AW(GetModuleHandleEx)
++#define LoadLibraryEx __MINGW_NAME_AW(LoadLibraryEx)
++#define LoadString __MINGW_NAME_AW(LoadString)
++
++#ifndef RC_INVOKED
++  typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXA) (DWORD dwFlags, LPCSTR lpModuleName, HMODULE *phModule);
++  typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXW) (DWORD dwFlags, LPCWSTR lpModuleName, HMODULE *phModule);
++#endif
++
++#define PGET_MODULE_HANDLE_EX __MINGW_NAME_AW(PGET_MODULE_HANDLE_EX)
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/pthreads/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch
=====================================
@@ -0,0 +1,179 @@
+From 9349ece34b6fc36264d0d61ba3f45727de777d4c Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 30 May 2023 15:16:03 +0200
+Subject: [PATCH] headers: enable some Registry API calls in UWP 8.1+ builds
+
+The documentation doesn't say it's allowed, but the WIndows SDK allow it since 22000 and
+the Windows App Certification as well. It is not restricted to Win11 in both
+cases. It's even allowed for 8.1 in api-ms-win-core-registry-l1-1-0.dll.
+---
+ mingw-w64-headers/include/winreg.h | 92 ++++++++++++++++--------------
+ 1 file changed, 49 insertions(+), 43 deletions(-)
+
+diff --git a/mingw-w64-headers/include/winreg.h b/mingw-w64-headers/include/winreg.h
+index dab9324e8..6c5743a28 100644
+--- a/mingw-w64-headers/include/winreg.h
++++ b/mingw-w64-headers/include/winreg.h
+@@ -131,31 +131,20 @@ extern "C" {
+ #define RegConnectRegistry __MINGW_NAME_AW(RegConnectRegistry)
+ #define RegConnectRegistryEx __MINGW_NAME_AW(RegConnectRegistryEx)
+ #define RegCreateKey __MINGW_NAME_AW(RegCreateKey)
+-#define RegCreateKeyEx __MINGW_NAME_AW(RegCreateKeyEx)
+ #define RegDeleteKey __MINGW_NAME_AW(RegDeleteKey)
+-#define RegDeleteKeyEx __MINGW_NAME_AW(RegDeleteKeyEx)
+-#define RegDeleteValue __MINGW_NAME_AW(RegDeleteValue)
+ #define RegEnumKey __MINGW_NAME_AW(RegEnumKey)
+-#define RegEnumKeyEx __MINGW_NAME_AW(RegEnumKeyEx)
+-#define RegEnumValue __MINGW_NAME_AW(RegEnumValue)
+ #define RegLoadKey __MINGW_NAME_AW(RegLoadKey)
+ #define RegOpenKey __MINGW_NAME_AW(RegOpenKey)
+-#define RegOpenKeyEx __MINGW_NAME_AW(RegOpenKeyEx)
+-#define RegQueryInfoKey __MINGW_NAME_AW(RegQueryInfoKey)
+ #define RegQueryValue __MINGW_NAME_AW(RegQueryValue)
+ #define RegQueryMultipleValues __MINGW_NAME_AW(RegQueryMultipleValues)
+-#define RegQueryValueEx __MINGW_NAME_AW(RegQueryValueEx)
+ #define RegReplaceKey __MINGW_NAME_AW(RegReplaceKey)
+ #define RegRestoreKey __MINGW_NAME_AW(RegRestoreKey)
+ #define RegSaveKey __MINGW_NAME_AW(RegSaveKey)
+ #define RegSetValue __MINGW_NAME_AW(RegSetValue)
+-#define RegSetValueEx __MINGW_NAME_AW(RegSetValueEx)
+ #define RegUnLoadKey __MINGW_NAME_AW(RegUnLoadKey)
+-#define RegGetValue __MINGW_NAME_AW(RegGetValue)
+ #define InitiateSystemShutdown __MINGW_NAME_AW(InitiateSystemShutdown)
+ #define AbortSystemShutdown __MINGW_NAME_AW(AbortSystemShutdown)
+ 
+-  WINADVAPI LONG WINAPI RegCloseKey(HKEY hKey);
+   WINADVAPI LONG WINAPI RegOverridePredefKey(HKEY hKey,HKEY hNewHKey);
+   WINADVAPI LONG WINAPI RegOpenUserClassesRoot(HANDLE hToken,DWORD dwOptions,REGSAM samDesired,PHKEY phkResult);
+   WINADVAPI LONG WINAPI RegOpenCurrentUser(REGSAM samDesired,PHKEY phkResult);
+@@ -167,40 +156,23 @@ extern "C" {
+   WINADVAPI LONG WINAPI RegConnectRegistryExW(LPCWSTR lpMachineName,HKEY hKey,ULONG Flags,PHKEY phkResult);
+   WINADVAPI LONG WINAPI RegCreateKeyA(HKEY hKey,LPCSTR lpSubKey,PHKEY phkResult);
+   WINADVAPI LONG WINAPI RegCreateKeyW(HKEY hKey,LPCWSTR lpSubKey,PHKEY phkResult);
+-  WINADVAPI LONG WINAPI RegCreateKeyExA(HKEY hKey,LPCSTR lpSubKey,DWORD Reserved,LPSTR lpClass,DWORD dwOptions,REGSAM samDesired,LPSECURITY_ATTRIBUTES lpSecurityAttributes,PHKEY phkResult,LPDWORD lpdwDisposition);
+-  WINADVAPI LONG WINAPI RegCreateKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD Reserved,LPWSTR lpClass,DWORD dwOptions,REGSAM samDesired,LPSECURITY_ATTRIBUTES lpSecurityAttributes,PHKEY phkResult,LPDWORD lpdwDisposition);
+   WINADVAPI LONG WINAPI RegDeleteKeyA(HKEY hKey,LPCSTR lpSubKey);
+   WINADVAPI LONG WINAPI RegDeleteKeyW(HKEY hKey,LPCWSTR lpSubKey);
+-  WINADVAPI LONG WINAPI RegDeleteKeyExA(HKEY hKey,LPCSTR lpSubKey,REGSAM samDesired,DWORD Reserved);
+-  WINADVAPI LONG WINAPI RegDeleteKeyExW(HKEY hKey,LPCWSTR lpSubKey,REGSAM samDesired,DWORD Reserved);
+   WINADVAPI LONG WINAPI RegDisableReflectionKey(HKEY hBase);
+   WINADVAPI LONG WINAPI RegEnableReflectionKey(HKEY hBase);
+   WINADVAPI LONG WINAPI RegQueryReflectionKey(HKEY hBase,WINBOOL *bIsReflectionDisabled);
+-  WINADVAPI LONG WINAPI RegDeleteValueA(HKEY hKey,LPCSTR lpValueName);
+-  WINADVAPI LONG WINAPI RegDeleteValueW(HKEY hKey,LPCWSTR lpValueName);
+   WINADVAPI LONG WINAPI RegEnumKeyA(HKEY hKey,DWORD dwIndex,LPSTR lpName,DWORD cchName);
+   WINADVAPI LONG WINAPI RegEnumKeyW(HKEY hKey,DWORD dwIndex,LPWSTR lpName,DWORD cchName);
+-  WINADVAPI LONG WINAPI RegEnumKeyExA(HKEY hKey,DWORD dwIndex,LPSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPSTR lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
+-  WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
+-  WINADVAPI LONG WINAPI RegEnumValueA(HKEY hKey,DWORD dwIndex,LPSTR lpValueName,LPDWORD lpcchValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
+-  WINADVAPI LONG WINAPI RegEnumValueW(HKEY hKey,DWORD dwIndex,LPWSTR lpValueName,LPDWORD lpcchValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
+   WINADVAPI LONG WINAPI RegFlushKey(HKEY hKey);
+   WINADVAPI LONG WINAPI RegGetKeySecurity(HKEY hKey,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor,LPDWORD lpcbSecurityDescriptor);
+   WINADVAPI LONG WINAPI RegLoadKeyA(HKEY hKey,LPCSTR lpSubKey,LPCSTR lpFile);
+   WINADVAPI LONG WINAPI RegLoadKeyW(HKEY hKey,LPCWSTR lpSubKey,LPCWSTR lpFile);
+-  WINADVAPI LONG WINAPI RegNotifyChangeKeyValue(HKEY hKey,WINBOOL bWatchSubtree,DWORD dwNotifyFilter,HANDLE hEvent,WINBOOL fAsynchronous);
+   WINADVAPI LONG WINAPI RegOpenKeyA(HKEY hKey,LPCSTR lpSubKey,PHKEY phkResult);
+   WINADVAPI LONG WINAPI RegOpenKeyW(HKEY hKey,LPCWSTR lpSubKey,PHKEY phkResult);
+-  WINADVAPI LONG WINAPI RegOpenKeyExA(HKEY hKey,LPCSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
+-  WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
+-  WINADVAPI LONG WINAPI RegQueryInfoKeyA(HKEY hKey,LPSTR lpClass,LPDWORD lpcchClass,LPDWORD lpReserved,LPDWORD lpcSubKeys,LPDWORD lpcbMaxSubKeyLen,LPDWORD lpcbMaxClassLen,LPDWORD lpcValues,LPDWORD lpcbMaxValueNameLen,LPDWORD lpcbMaxValueLen,LPDWORD lpcbSecurityDescriptor,PFILETIME lpftLastWriteTime);
+-  WINADVAPI LONG WINAPI RegQueryInfoKeyW(HKEY hKey,LPWSTR lpClass,LPDWORD lpcchClass,LPDWORD lpReserved,LPDWORD lpcSubKeys,LPDWORD lpcbMaxSubKeyLen,LPDWORD lpcbMaxClassLen,LPDWORD lpcValues,LPDWORD lpcbMaxValueNameLen,LPDWORD lpcbMaxValueLen,LPDWORD lpcbSecurityDescriptor,PFILETIME lpftLastWriteTime);
+   WINADVAPI LONG WINAPI RegQueryValueA(HKEY hKey,LPCSTR lpSubKey,LPSTR lpData,PLONG lpcbData);
+   WINADVAPI LONG WINAPI RegQueryValueW(HKEY hKey,LPCWSTR lpSubKey,LPWSTR lpData,PLONG lpcbData);
+   WINADVAPI LONG WINAPI RegQueryMultipleValuesA(HKEY hKey,PVALENTA val_list,DWORD num_vals,LPSTR lpValueBuf,LPDWORD ldwTotsize);
+   WINADVAPI LONG WINAPI RegQueryMultipleValuesW(HKEY hKey,PVALENTW val_list,DWORD num_vals,LPWSTR lpValueBuf,LPDWORD ldwTotsize);
+-  WINADVAPI LONG WINAPI RegQueryValueExA(HKEY hKey,LPCSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
+-  WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
+   WINADVAPI LONG WINAPI RegReplaceKeyA(HKEY hKey,LPCSTR lpSubKey,LPCSTR lpNewFile,LPCSTR lpOldFile);
+   WINADVAPI LONG WINAPI RegReplaceKeyW(HKEY hKey,LPCWSTR lpSubKey,LPCWSTR lpNewFile,LPCWSTR lpOldFile);
+   WINADVAPI LONG WINAPI RegRestoreKeyA(HKEY hKey,LPCSTR lpFile,DWORD dwFlags);
+@@ -210,12 +182,8 @@ extern "C" {
+   WINADVAPI LONG WINAPI RegSetKeySecurity(HKEY hKey,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor);
+   WINADVAPI LONG WINAPI RegSetValueA(HKEY hKey,LPCSTR lpSubKey,DWORD dwType,LPCSTR lpData,DWORD cbData);
+   WINADVAPI LONG WINAPI RegSetValueW(HKEY hKey,LPCWSTR lpSubKey,DWORD dwType,LPCWSTR lpData,DWORD cbData);
+-  WINADVAPI LONG WINAPI RegSetValueExA(HKEY hKey,LPCSTR lpValueName,DWORD Reserved,DWORD dwType,CONST BYTE *lpData,DWORD cbData);
+-  WINADVAPI LONG WINAPI RegSetValueExW(HKEY hKey,LPCWSTR lpValueName,DWORD Reserved,DWORD dwType,CONST BYTE *lpData,DWORD cbData);
+   WINADVAPI LONG WINAPI RegUnLoadKeyA(HKEY hKey,LPCSTR lpSubKey);
+   WINADVAPI LONG WINAPI RegUnLoadKeyW(HKEY hKey,LPCWSTR lpSubKey);
+-  WINADVAPI LONG WINAPI RegGetValueA(HKEY hkey,LPCSTR lpSubKey,LPCSTR lpValue,DWORD dwFlags,LPDWORD pdwType,PVOID pvData,LPDWORD pcbData);
+-  WINADVAPI LONG WINAPI RegGetValueW(HKEY hkey,LPCWSTR lpSubKey,LPCWSTR lpValue,DWORD dwFlags,LPDWORD pdwType,PVOID pvData,LPDWORD pcbData);
+   WINADVAPI WINBOOL WINAPI InitiateSystemShutdownA(LPSTR lpMachineName,LPSTR lpMessage,DWORD dwTimeout,WINBOOL bForceAppsClosed,WINBOOL bRebootAfterShutdown);
+   WINADVAPI WINBOOL WINAPI InitiateSystemShutdownW(LPWSTR lpMachineName,LPWSTR lpMessage,DWORD dwTimeout,WINBOOL bForceAppsClosed,WINBOOL bRebootAfterShutdown);
+   WINADVAPI WINBOOL WINAPI AbortSystemShutdownA(LPSTR lpMachineName);
+@@ -320,17 +288,6 @@ WINADVAPI LONG WINAPI RegDeleteKeyValueW(
+   LPCWSTR lpValueName
+ );
+ 
+-#define RegDeleteTree __MINGW_NAME_AW(RegDeleteTree)
+-WINADVAPI LONG WINAPI RegDeleteTreeA(
+-  HKEY hKey,
+-  LPCSTR lpSubKey
+-);
+-
+-WINADVAPI LONG WINAPI RegDeleteTreeW(
+-  HKEY hKey,
+-  LPCWSTR lpSubKey
+-);
+-
+ WINADVAPI LONG WINAPI RegLoadAppKeyA(
+   LPCSTR lpFile,
+   PHKEY phkResult,
+@@ -442,6 +399,55 @@ WINADVAPI DWORD WINAPI CheckForHiberboot(
+ 
+ #endif /* WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) */
+ 
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0603
++  WINADVAPI LONG WINAPI RegCloseKey(HKEY hKey);
++  WINADVAPI LONG WINAPI RegCreateKeyExA(HKEY hKey,LPCSTR lpSubKey,DWORD Reserved,LPSTR lpClass,DWORD dwOptions,REGSAM samDesired,LPSECURITY_ATTRIBUTES lpSecurityAttributes,PHKEY phkResult,LPDWORD lpdwDisposition);
++  WINADVAPI LONG WINAPI RegCreateKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD Reserved,LPWSTR lpClass,DWORD dwOptions,REGSAM samDesired,LPSECURITY_ATTRIBUTES lpSecurityAttributes,PHKEY phkResult,LPDWORD lpdwDisposition);
++  WINADVAPI LONG WINAPI RegDeleteKeyExA(HKEY hKey,LPCSTR lpSubKey,REGSAM samDesired,DWORD Reserved);
++  WINADVAPI LONG WINAPI RegDeleteKeyExW(HKEY hKey,LPCWSTR lpSubKey,REGSAM samDesired,DWORD Reserved);
++  WINADVAPI LONG WINAPI RegDeleteValueA(HKEY hKey,LPCSTR lpValueName);
++  WINADVAPI LONG WINAPI RegDeleteValueW(HKEY hKey,LPCWSTR lpValueName);
++  WINADVAPI LONG WINAPI RegEnumKeyExA(HKEY hKey,DWORD dwIndex,LPSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPSTR lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
++  WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
++  WINADVAPI LONG WINAPI RegEnumValueA(HKEY hKey,DWORD dwIndex,LPSTR lpValueName,LPDWORD lpcchValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
++  WINADVAPI LONG WINAPI RegEnumValueW(HKEY hKey,DWORD dwIndex,LPWSTR lpValueName,LPDWORD lpcchValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
++  WINADVAPI LONG WINAPI RegGetValueA(HKEY hkey,LPCSTR lpSubKey,LPCSTR lpValue,DWORD dwFlags,LPDWORD pdwType,PVOID pvData,LPDWORD pcbData);
++  WINADVAPI LONG WINAPI RegGetValueW(HKEY hkey,LPCWSTR lpSubKey,LPCWSTR lpValue,DWORD dwFlags,LPDWORD pdwType,PVOID pvData,LPDWORD pcbData);
++  WINADVAPI LONG WINAPI RegNotifyChangeKeyValue(HKEY hKey,WINBOOL bWatchSubtree,DWORD dwNotifyFilter,HANDLE hEvent,WINBOOL fAsynchronous);
++  WINADVAPI LONG WINAPI RegOpenKeyExA(HKEY hKey,LPCSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
++  WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
++  WINADVAPI LONG WINAPI RegQueryInfoKeyA(HKEY hKey,LPSTR lpClass,LPDWORD lpcchClass,LPDWORD lpReserved,LPDWORD lpcSubKeys,LPDWORD lpcbMaxSubKeyLen,LPDWORD lpcbMaxClassLen,LPDWORD lpcValues,LPDWORD lpcbMaxValueNameLen,LPDWORD lpcbMaxValueLen,LPDWORD lpcbSecurityDescriptor,PFILETIME lpftLastWriteTime);
++  WINADVAPI LONG WINAPI RegQueryInfoKeyW(HKEY hKey,LPWSTR lpClass,LPDWORD lpcchClass,LPDWORD lpReserved,LPDWORD lpcSubKeys,LPDWORD lpcbMaxSubKeyLen,LPDWORD lpcbMaxClassLen,LPDWORD lpcValues,LPDWORD lpcbMaxValueNameLen,LPDWORD lpcbMaxValueLen,LPDWORD lpcbSecurityDescriptor,PFILETIME lpftLastWriteTime);
++  WINADVAPI LONG WINAPI RegQueryValueExA(HKEY hKey,LPCSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
++  WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
++  WINADVAPI LONG WINAPI RegSetValueExA(HKEY hKey,LPCSTR lpValueName,DWORD Reserved,DWORD dwType,CONST BYTE *lpData,DWORD cbData);
++  WINADVAPI LONG WINAPI RegSetValueExW(HKEY hKey,LPCWSTR lpValueName,DWORD Reserved,DWORD dwType,CONST BYTE *lpData,DWORD cbData);
++#define RegCreateKeyEx __MINGW_NAME_AW(RegCreateKeyEx)
++#define RegDeleteKeyEx __MINGW_NAME_AW(RegDeleteKeyEx)
++#define RegDeleteValue __MINGW_NAME_AW(RegDeleteValue)
++#define RegEnumKeyEx __MINGW_NAME_AW(RegEnumKeyEx)
++#define RegEnumValue __MINGW_NAME_AW(RegEnumValue)
++#define RegGetValue __MINGW_NAME_AW(RegGetValue)
++#define RegOpenKeyEx __MINGW_NAME_AW(RegOpenKeyEx)
++#define RegQueryInfoKey __MINGW_NAME_AW(RegQueryInfoKey)
++#define RegQueryValueEx __MINGW_NAME_AW(RegQueryValueEx)
++#define RegSetValueEx __MINGW_NAME_AW(RegSetValueEx)
++#endif
++
++#if _WIN32_WINNT >= 0x0600 && (WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0603)
++WINADVAPI LONG WINAPI RegDeleteTreeA(
++  HKEY hKey,
++  LPCSTR lpSubKey
++);
++
++WINADVAPI LONG WINAPI RegDeleteTreeW(
++  HKEY hKey,
++  LPCWSTR lpSubKey
++);
++
++#define RegDeleteTree __MINGW_NAME_AW(RegDeleteTree)
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/pthreads/rules.mak
=====================================
@@ -46,6 +46,10 @@ pthreads: mingw-w64-$(MINGW64_HASH).tar.xz .sum-pthreads
 	$(APPLY) $(SRC)/pthreads/0001-headers-enable-VirtualAlloc-Ex-in-Win10-UWP-builds.patch
 	$(APPLY) $(SRC)/pthreads/0001-headers-enable-CreateHardLinkW-in-Win10-UWP-builds.patch
 	$(APPLY) $(SRC)/pthreads/0001-headers-enable-GetVolumePathNameW-in-Win10-UWP-build.patch
+	$(APPLY) $(SRC)/pthreads/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch
+	$(APPLY) $(SRC)/pthreads/0001-headers-enable-GET_MODULE_HANDLE_EX_xxx-defines-in-U.patch
+	$(APPLY) $(SRC)/pthreads/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch
+	$(APPLY) $(SRC)/pthreads/0001-add-api-ms-core-registry-def-files.patch
 	$(MOVE)
 
 .pthreads: pthreads
@@ -70,6 +74,21 @@ pthreads: mingw-w64-$(MINGW64_HASH).tar.xz .sum-pthreads
 	touch $@
 
 
+MINGW64_UWP_CONF := --without-headers --with-crt --without-libraries --without-tools
+ifeq ($(ARCH),x86_64)
+MINGW64_UWP_CONF +=--disable-lib32 --enable-lib64
+MINGW64_BUILDDIR := lib64
+else ifeq ($(ARCH),i386)
+MINGW64_UWP_CONF +=--enable-lib32 --disable-lib64
+MINGW64_BUILDDIR := lib32
+else ifeq ($(ARCH),aarch64)
+MINGW64_UWP_CONF +=--disable-lib32 --disable-lib64 --enable-libarm64
+MINGW64_BUILDDIR := libarm64
+else ifeq ($(ARCH),arm)
+MINGW64_UWP_CONF +=--disable-lib32 --disable-lib64 --enable-libarm32
+MINGW64_BUILDDIR := libarm32
+endif
+
 .sum-alloweduwp: .sum-pthreads
 	touch $@
 
@@ -78,4 +97,13 @@ pthreads: mingw-w64-$(MINGW64_HASH).tar.xz .sum-pthreads
 	install $</mingw-w64-headers/include/fileapi.h "$(PREFIX)/include"
 	install $</mingw-w64-headers/include/memoryapi.h "$(PREFIX)/include"
 	install $</mingw-w64-headers/include/winbase.h "$(PREFIX)/include"
+	install $</mingw-w64-headers/include/libloaderapi.h "$(PREFIX)/include"
+	install $</mingw-w64-headers/include/winreg.h "$(PREFIX)/include"
+
+	# Trick mingw-w64 into just building libwindowsapp.a
+	$(MAKEBUILDDIR)
+	$(MAKECONFIGURE) $(MINGW64_UWP_CONF)
+	mkdir -p $(BUILD_DIR)/mingw-w64-crt/$(MINGW64_BUILDDIR)
+	+$(MAKEBUILD) -C mingw-w64-crt LIBRARIES=$(MINGW64_BUILDDIR)/libwindowsapp.a DATA= HEADERS=
+	+$(MAKEBUILD) -C mingw-w64-crt $(MINGW64_BUILDDIR)_LIBRARIES=$(MINGW64_BUILDDIR)/libwindowsapp.a install-$(MINGW64_BUILDDIR)LIBRARIES
 	touch $@



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/524bd5debd3dd6e37154b774d18d5d25d640393d...83a1a1eb37ff75524878041a8c00a13ee8ec2098

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/524bd5debd3dd6e37154b774d18d5d25d640393d...83a1a1eb37ff75524878041a8c00a13ee8ec2098
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list