[vlc-commits] [Git][videolan/vlc][master] 10 commits: CI: target Windows 10 19H1 for UWP builds

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jun 5 06:11:05 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
33e80e8a by Steve Lhomme at 2023-06-05T05:25:33+00:00
CI: target Windows 10 19H1 for UWP builds

This is necessary to use the API's that mfx uses in UWP mode.

We keep targeting RS5 for UCRT builds.

- - - - -
d06a0df7 by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: mingw64: allow GetHandleInformation in 19H1+ UWP

- - - - -
313a3991 by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: remove patches to disable GetHandleInformation() calls in UWP

It's now allowed. The contribs involved already depend on alloweuwp.

- - - - -
ecb34b67 by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: libarchive: update stdin patch

Don't mention SetHandleInformation is not allowed since it is.

- - - - -
5d6e1a94 by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: mingw64: allow CreateHardLinkW in 19H1+ UWP only

- - - - -
b007b981 by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: mingw64: allow some module API in 19H1+ UWP only

- - - - -
5bd64119 by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: mingw64: allow registry API in 19H1+ UWP only

- - - - -
ad4b39ce by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: mingw64: allow GetFileInformationByHandle in 19H1+ UWP only

- - - - -
91ec56be by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: mingw64: allow VirtualAlloc in 19H1+ UWP only

- - - - -
36b1865d by Steve Lhomme at 2023-06-05T05:25:33+00:00
contrib: use SF for all sourceforge contribs

- - - - -


17 changed files:

- − contrib/src/gnutls/0001-fcntl-do-not-call-GetHandleInformation-in-Winstore-a.patch
- contrib/src/gnutls/rules.mak
- − contrib/src/iconv/0001-do-not-call-GetHandleInformation-in-Winstore-apps.patch
- contrib/src/iconv/rules.mak
- contrib/src/libarchive/0008-Disable-program-call-with-stdin-stdout-usage-on-UWP-.patch
- contrib/src/libmpeg2/rules.mak
- − contrib/src/libtasn1/0001-fcntl-do-not-call-GetHandleInformation-in-Winstore-a.patch
- contrib/src/libtasn1/rules.mak
- + contrib/src/mingw64/0001-headers-check-which-version-of-UWP-Windows-contains-.patch
- contrib/src/mingw64/0001-headers-enable-GetFileInformationByHandle-in-Win10-U.patch → contrib/src/mingw64/0001-headers-only-enable-GetFileInformationByHandle-for-1.patch
- contrib/src/mingw64/0001-headers-enable-CreateHardLinkW-in-Win10-UWP-builds.patch → contrib/src/mingw64/0004-headers-enable-CreateHardLinkW-in-Win10-19H1-UWP-bui.patch
- contrib/src/mingw64/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch → contrib/src/mingw64/0006-headers-enable-more-module-API-in-Win10-19H1-UWP-bui.patch
- contrib/src/mingw64/0001-add-api-ms-core-registry-def-files.patch → contrib/src/mingw64/0008-crt-add-api-ms-core-registry-def-files.patch
- contrib/src/mingw64/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch → contrib/src/mingw64/0009-headers-enable-some-Registry-API-calls-in-Win10-19H1.patch
- + contrib/src/mingw64/0010-headers-allow-Get-SetHandleInformation-in-Win10-19H1.patch
- contrib/src/mingw64/rules.mak
- extras/ci/gitlab-ci.yml


Changes:

=====================================
contrib/src/gnutls/0001-fcntl-do-not-call-GetHandleInformation-in-Winstore-a.patch deleted
=====================================
@@ -1,41 +0,0 @@
-From 0c8ca1736ee07c7d7dbce05108120cf4f8937bd0 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 4 Jun 2020 10:15:38 +0200
-Subject: [PATCH] fcntl: do not call GetHandleInformation() in Winstore apps
-
-The API is forbidden [1] and HANDLE_FLAG_INHERIT would never be set as exec()
-is not allowed either [2].
-
-[1] https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation
-[2] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps
----
- gl/fcntl.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/gl/fcntl.c b/gl/fcntl.c
-index 6b9927ec4..e316ca306 100644
---- a/gl/fcntl.c
-+++ b/gl/fcntl.c
-@@ -229,12 +229,19 @@ fcntl (int fd, int action, /* arg */...)
-       {
- # if defined _WIN32 && ! defined __CYGWIN__
-         HANDLE handle = (HANDLE) _get_osfhandle (fd);
-+#  if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
-         DWORD flags;
-         if (handle == INVALID_HANDLE_VALUE
-             || GetHandleInformation (handle, &flags) == 0)
-           errno = EBADF;
-         else
-           result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC;
-+#  else /* ! WINAPI_PARTITION_DESKTOP */
-+        if (handle == INVALID_HANDLE_VALUE)
-+          errno = EBADF;
-+        else
-+          result = 0;
-+#  endif /* ! WINAPI_PARTITION_DESKTOP */
- # else /* !W32 */
-         /* Use dup2 to reject invalid file descriptors.  No way to
-            access this information, so punt.  */
---
-2.26.0.windows.1
-


=====================================
contrib/src/gnutls/rules.mak
=====================================
@@ -24,10 +24,6 @@ gnutls: gnutls-$(GNUTLS_VERSION).tar.xz .sum-gnutls
 	# backport gnulib patch
 	$(APPLY) $(SRC)/gnutls/0001-Don-t-assume-that-UNICODE-is-not-defined.patch
 
-	# fix forbidden UWP call which can't be upstreamed as they won't
-	# differentiate for winstore, only _WIN32_WINNT
-	$(APPLY) $(SRC)/gnutls/0001-fcntl-do-not-call-GetHandleInformation-in-Winstore-a.patch
-
 	# forbidden RtlSecureZeroMemory call in winstore builds
 	$(APPLY) $(SRC)/gnutls/0001-explicit_bzero-Do-not-call-SecureZeroMemory-on-UWP-b.patch
 


=====================================
contrib/src/iconv/0001-do-not-call-GetHandleInformation-in-Winstore-apps.patch deleted
=====================================
@@ -1,41 +0,0 @@
-From c934bfdfc343fbb4d84e59a339cde57b30779581 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 4 Jun 2020 10:15:38 +0200
-Subject: [PATCH] do not call GetHandleInformation() in Winstore apps
-
-The API is forbidden [1] and HANDLE_FLAG_INHERIT would never be set as exec()
-is not allowed either [2].
-
-[1] https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation
-[2] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps
----
- lib/fcntl.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/srclib/fcntl.c b/srclib/fcntl.c
-index e220800845..c95322b2d4 100644
---- a/srclib/fcntl.c
-+++ b/srclib/fcntl.c
-@@ -45,6 +45,19 @@
- #  include <io.h>
- # endif
- 
-+# if defined WINAPI_FAMILY && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+/* GetHandleInformation is not available in UWP, the flags it would provide
-+   are also not available, so we just return 0.
-+   <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation>
-+   <https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis> */
-+static inline BOOL GetHandleInformation(HANDLE h, DWORD *pf)
-+{
-+  *pf = 0;
-+  return TRUE;
-+}
-+#  define HANDLE_FLAG_INHERIT          (1)
-+# endif /*  WINAPI_PARTITION_DESKTOP */
-+
- /* Upper bound on getdtablesize().  See lib/getdtablesize.c.  */
- # define OPEN_MAX_MAX 0x10000
- 
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/iconv/rules.mak
=====================================
@@ -33,10 +33,6 @@ iconv: libiconv-$(LIBICONV_VERSION).tar.gz .sum-iconv
 	# use CreateFile2 in Win8 as CreateFileW is forbidden in UWP
 	$(APPLY) $(SRC)/iconv/0001-Use-CreateFile2-in-UWP-builds.patch
 
-	# fix forbidden UWP call which can't be upstreamed as they won't
-	# differentiate for winstore, only _WIN32_WINNT
-	$(APPLY) $(SRC)/iconv/0001-do-not-call-GetHandleInformation-in-Winstore-apps.patch
-
 	$(UPDATE_AUTOCONFIG)
 	cd $(UNPACK_DIR) && cp config.guess config.sub build-aux \
 	                 && mv config.guess config.sub libcharset/build-aux


=====================================
contrib/src/libarchive/0008-Disable-program-call-with-stdin-stdout-usage-on-UWP-.patch
=====================================
@@ -6,11 +6,9 @@ Subject: [PATCH 8/9] Disable program call with stdin/stdout usage on UWP
 
 Some calls are not allowed:
 * WaitForInputIdle [1]
-* SetHandleInformation [2]
 * STARTF_XXX flags for CreateProcess are not allowed
 
 [1] https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-waitforinputidle#requirements
-[2] https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-sethandleinformation#requirements
 ---
  libarchive/filter_fork_windows.c | 9 +++++++++
  1 file changed, 9 insertions(+)


=====================================
contrib/src/libmpeg2/rules.mak
=====================================
@@ -1,7 +1,7 @@
 # libmpeg2
 
 LIBMPEG2_VERSION := 0.5.1
-LIBMPEG2_URL := http://libmpeg2.sourceforge.net/files/libmpeg2-$(LIBMPEG2_VERSION).tar.gz
+LIBMPEG2_URL := $(SF)/libmpeg2/libmpeg2-$(LIBMPEG2_VERSION).tar.gz
 
 ifdef GPL
 PKGS += libmpeg2


=====================================
contrib/src/libtasn1/0001-fcntl-do-not-call-GetHandleInformation-in-Winstore-a.patch deleted
=====================================
@@ -1,41 +0,0 @@
-From 0c8ca1736ee07c7d7dbce05108120cf4f8937bd0 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 4 Jun 2020 10:15:38 +0200
-Subject: [PATCH] fcntl: do not call GetHandleInformation() in Winstore apps
-
-The API is forbidden [1] and HANDLE_FLAG_INHERIT would never be set as exec()
-is not allowed either [2].
-
-[1] https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation
-[2] https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps
----
- src/gl/fcntl.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/gl/fcntl.c b/src/gl/fcntl.c
-index 6b9927ec4..e316ca306 100644
---- a/src/gl/fcntl.c
-+++ b/src/gl/fcntl.c
-@@ -229,12 +229,19 @@ fcntl (int fd, int action, /* arg */...)
-       {
- # if defined _WIN32 && ! defined __CYGWIN__
-         HANDLE handle = (HANDLE) _get_osfhandle (fd);
-+#  if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
-         DWORD flags;
-         if (handle == INVALID_HANDLE_VALUE
-             || GetHandleInformation (handle, &flags) == 0)
-           errno = EBADF;
-         else
-           result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC;
-+#  else /* ! WINAPI_PARTITION_DESKTOP */
-+        if (handle == INVALID_HANDLE_VALUE)
-+          errno = EBADF;
-+        else
-+          result = 0;
-+#  endif /* ! WINAPI_PARTITION_DESKTOP */
- # else /* !W32 */
-         /* Use dup2 to reject invalid file descriptors.  No way to
-            access this information, so punt.  */
---
-2.26.0.windows.1
-


=====================================
contrib/src/libtasn1/rules.mak
=====================================
@@ -21,7 +21,6 @@ $(TARBALLS)/libtasn1-$(LIBTASN1_VERSION).tar.gz:
 
 libtasn1: libtasn1-$(LIBTASN1_VERSION).tar.gz .sum-libtasn1
 	$(UNPACK)
-	$(APPLY) $(SRC)/libtasn1/0001-fcntl-do-not-call-GetHandleInformation-in-Winstore-a.patch
 
 	# use CreateFile2 in Win8 as CreateFileW is forbidden in UWP
 	$(APPLY) $(SRC)/libtasn1/0001-Use-CreateFile2-in-UWP-builds.patch


=====================================
contrib/src/mingw64/0001-headers-check-which-version-of-UWP-Windows-contains-.patch
=====================================
@@ -0,0 +1,40 @@
+From c060d692db86b56ef8b7da16776be69d31ff97e4 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 1 Jun 2023 13:04:21 +0200
+Subject: [PATCH] headers: check which version of UWP Windows contains Virtual
+ functions
+
+* VirtualFree is always available in UWP
+* VirtualAlloc is only available since 19H1/18362 SDK
+* VirtualAllocEx is only available since 20H1/19041 SDK
+
+They are all found in api-ms-win-core-memory-l1-1-0 which is in mincore
+and windowsapp. It's one of the target DLLs [1]
+
+[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-memory-l1-1-0dll
+---
+ mingw-w64-headers/include/memoryapi.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/mingw-w64-headers/include/memoryapi.h b/mingw-w64-headers/include/memoryapi.h
+index 152671c18..889c2a504 100644
+--- a/mingw-w64-headers/include/memoryapi.h
++++ b/mingw-w64-headers/include/memoryapi.h
+@@ -29,9 +29,13 @@ extern "C" {
+ #endif
+ 
+ #if (WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) && _WIN32_WINNT >= _WIN32_WINNT_WIN10) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
++    WINBASEAPI WINBOOL WINAPI VirtualFree (LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
++#endif
++#if (WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) && NTDDI_VERSION >= NTDDI_WIN10_19H1) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+     WINBASEAPI LPVOID WINAPI VirtualAlloc (LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
++#endif
++#if (WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) && NTDDI_VERSION >= NTDDI_WIN10_VB) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+     WINBASEAPI LPVOID WINAPI VirtualAllocEx (HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
+-    WINBASEAPI WINBOOL WINAPI VirtualFree (LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
+ #endif
+ 
+ #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/mingw64/0001-headers-enable-GetFileInformationByHandle-in-Win10-U.patch → contrib/src/mingw64/0001-headers-only-enable-GetFileInformationByHandle-for-1.patch
=====================================
@@ -1,17 +1,18 @@
-From ad395a3d5a9873e4388bf34687fd3e705e384a0d Mon Sep 17 00:00:00 2001
+From e769423cf0acfbda5810025a57942465110ed9ff Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Wed, 24 May 2023 08:39:51 +0200
-Subject: [PATCH] headers: enable GetFileInformationByHandle in Win10 UWP
- builds
+Date: Thu, 1 Jun 2023 11:49:51 +0200
+Subject: [PATCH 01/10] headers: only enable GetFileInformationByHandle for
+ 19H1 UWP builds
 
-Contrary to what the documentation says, it's available in the Windows SDK,
-both in the headers and when linking with WindowsApp.lib.
+It is not allowed in older SDK. It won't compile or won't link. The target DLL
+will likely not have the function, so it should not be used when targetting older
+Windows 10 versions in UWP mode.
 ---
  mingw-w64-headers/include/fileapi.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/mingw-w64-headers/include/fileapi.h b/mingw-w64-headers/include/fileapi.h
-index ffbe12560..d22c62704 100644
+index ffbe12560..3640efd52 100644
 --- a/mingw-w64-headers/include/fileapi.h
 +++ b/mingw-w64-headers/include/fileapi.h
 @@ -32,7 +32,7 @@ WINBASEAPI DWORD WINAPI GetFileAttributesW (LPCWSTR lpFileName);
@@ -19,7 +20,7 @@ index ffbe12560..d22c62704 100644
  WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
  #endif
 -#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
-+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1 || defined(WINSTORECOMPAT)
    typedef struct _BY_HANDLE_FILE_INFORMATION {
      DWORD dwFileAttributes;
      FILETIME ftCreationTime;


=====================================
contrib/src/mingw64/0001-headers-enable-CreateHardLinkW-in-Win10-UWP-builds.patch → contrib/src/mingw64/0004-headers-enable-CreateHardLinkW-in-Win10-19H1-UWP-bui.patch
=====================================
@@ -1,13 +1,17 @@
-From dd4f835601548529980550ddb0a66a7c8881ce9b Mon Sep 17 00:00:00 2001
+From b7ce09e8a811dc60e4c6ca68ca60773757b6cf20 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Thu, 25 May 2023 09:44:35 +0200
-Subject: [PATCH] headers: enable CreateHardLinkW in Win10 UWP builds
+Subject: [PATCH 04/10] headers: enable CreateHardLinkW in Win10 19H1 UWP
+ builds
 
-The documentation doesn't say it's allowed, but the WIndows SDK allow it and
-the Windows App Certification as well.
+The documentation doesn't say it's allowed but they are allowed by the
+Windows Application Certification Kit and the 18362 Windows SDK.
 
-The official page for allowed API's also doesn't say it's allowed [1]
-but the DLL that contains it is there.
+It is not allowed in older SDK. It won't compile or won't link.
+The target DLL [1] will likely not have the function, so it should not
+be used when targeting older Windows 10 versions in UWP mode.
+
+We already have api-ms-win-core-file-l2-1-0 in mincore and windowsapp.
 
 [1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-file-l2-1-0dll
 ---
@@ -15,14 +19,14 @@ but the DLL that contains it is there.
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/mingw-w64-headers/include/winbase.h b/mingw-w64-headers/include/winbase.h
-index 82c8b7cc3..94f5df309 100644
+index 82c8b7cc3..c6c34ed3b 100644
 --- a/mingw-w64-headers/include/winbase.h
 +++ b/mingw-w64-headers/include/winbase.h
 @@ -2464,9 +2464,11 @@ typedef enum FILE_FLUSH_MODE {
    WINBASEAPI WINBOOL WINAPI ReplaceFileA (LPCSTR lpReplacedFileName, LPCSTR lpReplacementFileName, LPCSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved);
    WINBASEAPI WINBOOL WINAPI ReplaceFileW (LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileName, LPCWSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved);
  #endif
-+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1
 +  WINBASEAPI WINBOOL WINAPI CreateHardLinkW (LPCWSTR lpFileName, LPCWSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
 +#endif
  #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)


=====================================
contrib/src/mingw64/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch → contrib/src/mingw64/0006-headers-enable-more-module-API-in-Win10-19H1-UWP-bui.patch
=====================================
@@ -1,18 +1,25 @@
-From f24fb397cf423d55d363ac4fdc7e6b7aeb7ae830 Mon Sep 17 00:00:00 2001
+From c9bb6512f22df36c104d1539ed1de52b8d41b322 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
+Subject: [PATCH 06/10] headers: enable more module API in Win10 19H1 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.
+The documentation doesn't say it's allowed but they are allowed by the
+Windows Application Certification Kit and the 18362 Windows SDK.
+
+It is not allowed in older SDK. It won't compile or won't link.
+The target DLL [1] will likely not have the function, so it should not
+be used when targeting older Windows 10 versions in UWP mode.
+
+We already have api-ms-win-core-libraryloader-l1-2-0 in mincore and windowsapp.
+
+[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-libraryloader-l1-2-0dll
 ---
- mingw-w64-headers/include/libloaderapi.h | 51 ++++++++++++++----------
- 1 file changed, 29 insertions(+), 22 deletions(-)
+ mingw-w64-headers/include/libloaderapi.h | 44 ++++++++++++++----------
+ 1 file changed, 26 insertions(+), 18 deletions(-)
 
 diff --git a/mingw-w64-headers/include/libloaderapi.h b/mingw-w64-headers/include/libloaderapi.h
-index d4c82ef8c..288e78d9f 100644
+index d4c82ef8c..c96e1a07b 100644
 --- a/mingw-w64-headers/include/libloaderapi.h
 +++ b/mingw-w64-headers/include/libloaderapi.h
 @@ -37,11 +37,6 @@ extern "C" {
@@ -27,7 +34,7 @@ index d4c82ef8c..288e78d9f 100644
    typedef PVOID DLL_DIRECTORY_COOKIE, *PDLL_DIRECTORY_COOKIE;
  
  #define FIND_RESOURCE_DIRECTORY_TYPES (0x0100)
-@@ -90,32 +85,18 @@ extern "C" {
+@@ -90,31 +85,21 @@ 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);
@@ -36,8 +43,8 @@ index d4c82ef8c..288e78d9f 100644
 -  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);
+   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);
@@ -53,14 +60,13 @@ index d4c82ef8c..288e78d9f 100644
  #endif
  
 -#define PGET_MODULE_HANDLE_EX __MINGW_NAME_AW(PGET_MODULE_HANDLE_EX)
--#define LoadString __MINGW_NAME_AW(LoadString)
+ #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" {
+@@ -136,11 +121,8 @@ extern "C" {
  #endif
  #endif
  #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
@@ -72,11 +78,11 @@ index d4c82ef8c..288e78d9f 100644
  #define LoadLibrary __MINGW_NAME_AW(LoadLibrary)
  #endif
  
-@@ -176,6 +154,35 @@ typedef const REDIRECTION_DESCRIPTOR *PCREDIRECTION_DESCRIPTOR;
+@@ -176,6 +158,32 @@ typedef const REDIRECTION_DESCRIPTOR *PCREDIRECTION_DESCRIPTOR;
  #endif
  #endif
  
-+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0A00
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1
 +  WINBASEAPI HRSRC WINAPI FindResourceExW (HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage);
 +  WINBASEAPI HMODULE WINAPI GetModuleHandleA (LPCSTR lpModuleName);
 +  WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
@@ -84,8 +90,6 @@ index d4c82ef8c..288e78d9f 100644
 +  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
@@ -95,7 +99,6 @@ index d4c82ef8c..288e78d9f 100644
 +#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);


=====================================
contrib/src/mingw64/0001-add-api-ms-core-registry-def-files.patch → contrib/src/mingw64/0008-crt-add-api-ms-core-registry-def-files.patch
=====================================
@@ -1,33 +1,26 @@
-From bc8986696605c29c8ef54f9c448ab889c2195d93 Mon Sep 17 00:00:00 2001
+From c6538fe93fcc5930e5ddf33ce910346787f09375 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
+Subject: [PATCH 08/10] crt: add api-ms-core-registry-* def files
 
 These are needed to enable the registry API calls available in UWP.
+
+Add the target DLL to windowsapp, but not mincore (Win8) where it doesn't
+exist.
 ---
- mingw-w64-crt/Makefile.in                     |  4 ++
+ mingw-w64-crt/Makefile.in                     |  2 +
  .../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(-)
+ 4 files changed, 88 insertions(+)
  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
+diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
+index 0454ecec3..cff260421 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
+@@ -2237,6 +2237,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 \
@@ -132,20 +125,6 @@ index 000000000..3e05bbf74
 +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


=====================================
contrib/src/mingw64/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch → contrib/src/mingw64/0009-headers-enable-some-Registry-API-calls-in-Win10-19H1.patch
=====================================
@@ -1,17 +1,24 @@
-From 9349ece34b6fc36264d0d61ba3f45727de777d4c Mon Sep 17 00:00:00 2001
+From 7bfb7d0537f1e1dc67a0993c96a92b6b26705315 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
+Subject: [PATCH 09/10] headers: enable some Registry API calls in Win10 19H1
+ UWP 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.
+The documentation doesn't say it's allowed but they are allowed by the
+Windows Application Certification Kit and the 18362 Windows SDK.
+
+It is not allowed in older SDK. It won't compile or won't link.
+The target DLL api-ms-win-core-registry-l1-1-0 will likely not have the
+function, so it should not be used when targeting older Windows 10 versions
+in UWP mode.
+
+We now have api-ms-win-core-registry-l1-1-0 in windowsapp.
 ---
  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
+index dab9324e8..2f340fa92 100644
 --- a/mingw-w64-headers/include/winreg.h
 +++ b/mingw-w64-headers/include/winreg.h
 @@ -131,31 +131,20 @@ extern "C" {
@@ -122,7 +129,7 @@ index dab9324e8..6c5743a28 100644
  
  #endif /* WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) */
  
-+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0603
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1
 +  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);
@@ -157,7 +164,7 @@ index dab9324e8..6c5743a28 100644
 +#define RegSetValueEx __MINGW_NAME_AW(RegSetValueEx)
 +#endif
 +
-+#if _WIN32_WINNT >= 0x0600 && (WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0603)
++#if _WIN32_WINNT >= 0x0600 && (WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1)
 +WINADVAPI LONG WINAPI RegDeleteTreeA(
 +  HKEY hKey,
 +  LPCSTR lpSubKey


=====================================
contrib/src/mingw64/0010-headers-allow-Get-SetHandleInformation-in-Win10-19H1.patch
=====================================
@@ -0,0 +1,60 @@
+From d4758caa1d6ffc1f800dce06aa38f6d7a3b6d306 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Wed, 31 May 2023 13:55:51 +0200
+Subject: [PATCH 10/10] headers: allow Get/SetHandleInformation in Win10 19H1
+ UWP builds
+
+The documentation doesn't say it's allowed but they are allowed by the
+Windows Application Certification Kit and the 18362 Windows SDK.
+
+It is not allowed in older SDK. It won't compile or won't link.
+The target DLL [1] will likely not have the function, so it should not
+be used when targeting older Windows 10 versions in UWP mode.
+
+We already have api-ms-win-core-handle-l1-1-0 in mincore and windowsapp.
+
+[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-handle-l1-1-0dll
+---
+ mingw-w64-headers/include/handleapi.h | 2 +-
+ mingw-w64-headers/include/winbase.h   | 5 ++---
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/mingw-w64-headers/include/handleapi.h b/mingw-w64-headers/include/handleapi.h
+index 9f814f151..f33ceef71 100644
+--- a/mingw-w64-headers/include/handleapi.h
++++ b/mingw-w64-headers/include/handleapi.h
+@@ -23,7 +23,7 @@ extern "C" {
+ #endif
+ #endif
+ 
+-#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1
+   WINBASEAPI WINBOOL WINAPI GetHandleInformation (HANDLE hObject, LPDWORD lpdwFlags);
+   WINBASEAPI WINBOOL WINAPI SetHandleInformation (HANDLE hObject, DWORD dwMask, DWORD dwFlags);
+ #endif
+diff --git a/mingw-w64-headers/include/winbase.h b/mingw-w64-headers/include/winbase.h
+index c6c34ed3b..6e114e28f 100644
+--- a/mingw-w64-headers/include/winbase.h
++++ b/mingw-w64-headers/include/winbase.h
+@@ -1346,6 +1346,8 @@ typedef enum FILE_FLUSH_MODE {
+ 
+ #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
+   WINBASEAPI DWORD WINAPI WaitForMultipleObjects (DWORD nCount, CONST HANDLE *lpHandles, WINBOOL bWaitAll, DWORD dwMilliseconds);
++#define HANDLE_FLAG_INHERIT 0x1
++#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x2
+ #endif
+ 
+ #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+@@ -1357,9 +1359,6 @@ typedef enum FILE_FLUSH_MODE {
+     DEPTotalPolicyCount
+   } DEP_SYSTEM_POLICY_TYPE;
+ 
+-#define HANDLE_FLAG_INHERIT 0x1
+-#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x2
+-
+ #define HINSTANCE_ERROR 32
+ 
+ #define GET_TAPE_MEDIA_INFORMATION 0
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/mingw64/rules.mak
=====================================
@@ -1,7 +1,7 @@
 # winpthreads, dxvahd, winrt_headers, dcomp
 
 MINGW64_VERSION := 11.0.0
-MINGW64_URL := https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v$(MINGW64_VERSION).tar.bz2/download
+MINGW64_URL := $(SF)/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v$(MINGW64_VERSION).tar.bz2
 MINGW64_HASH=2c35e8ff0d33916bd490e8932cba2049cd1af3d0
 MINGW64_GITURL := https://git.code.sf.net/p/mingw-w64/mingw-w64
 
@@ -56,14 +56,16 @@ $(TARBALLS)/mingw-w64-v$(MINGW64_VERSION).tar.bz2:
 mingw64: mingw-w64-v$(MINGW64_VERSION).tar.bz2 .sum-mingw64
 # mingw64: mingw-w64-$(MINGW64_HASH).tar.xz .sum-mingw64
 	$(UNPACK)
-	$(APPLY) $(SRC)/mingw64/0001-headers-enable-GetFileInformationByHandle-in-Win10-U.patch
+	$(APPLY) $(SRC)/mingw64/0001-headers-only-enable-GetFileInformationByHandle-for-1.patch
 	$(APPLY) $(SRC)/mingw64/0001-headers-enable-VirtualAlloc-Ex-in-Win10-UWP-builds.patch
-	$(APPLY) $(SRC)/mingw64/0001-headers-enable-CreateHardLinkW-in-Win10-UWP-builds.patch
+	$(APPLY) $(SRC)/mingw64/0001-headers-check-which-version-of-UWP-Windows-contains-.patch
+	$(APPLY) $(SRC)/mingw64/0004-headers-enable-CreateHardLinkW-in-Win10-19H1-UWP-bui.patch
 	$(APPLY) $(SRC)/mingw64/0001-headers-enable-GetVolumePathNameW-in-Win10-UWP-build.patch
-	$(APPLY) $(SRC)/mingw64/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch
+	$(APPLY) $(SRC)/mingw64/0006-headers-enable-more-module-API-in-Win10-19H1-UWP-bui.patch
 	$(APPLY) $(SRC)/mingw64/0001-headers-enable-GET_MODULE_HANDLE_EX_xxx-defines-in-U.patch
-	$(APPLY) $(SRC)/mingw64/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch
-	$(APPLY) $(SRC)/mingw64/0001-add-api-ms-core-registry-def-files.patch
+	$(APPLY) $(SRC)/mingw64/0008-crt-add-api-ms-core-registry-def-files.patch
+	$(APPLY) $(SRC)/mingw64/0009-headers-enable-some-Registry-API-calls-in-Win10-19H1.patch
+	$(APPLY) $(SRC)/mingw64/0010-headers-allow-Get-SetHandleInformation-in-Win10-19H1.patch
 	$(MOVE)
 
 .mingw64: mingw64
@@ -156,6 +158,7 @@ endif
 	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"
+	install $</mingw-w64-headers/include/handleapi.h "$(PREFIX)/include"
 
 	# Trick mingw-w64 into just building libwindowsapp.a
 	$(MAKEBUILDDIR)


=====================================
extras/ci/gitlab-ci.yml
=====================================
@@ -193,7 +193,7 @@ uwp64-libvlc-llvm:
         <<: *variables-win64
         VLCARCH: win64-uwp
         LIBVLC_EXTRA_BUILD_FLAGS: -z
-        UWP_EXTRA_BUILD_FLAGS: -u -w -x -S 0x0A000006
+        UWP_EXTRA_BUILD_FLAGS: -u -w -x -S 0x0A000007
 
 .nightly-win-common:
     extends: .win-common



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7dc1fc2f60ace07723bd6f420f5be926666e2999...36b1865d9588c47fb2b136f367d5fb6455dd0fd0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7dc1fc2f60ace07723bd6f420f5be926666e2999...36b1865d9588c47fb2b136f367d5fb6455dd0fd0
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