[vlc-commits] [Git][videolan/vlc][master] 3 commits: contrib: fxc2: remove line spaces patching

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jun 1 09:20:05 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
da4b68e7 by Steve Lhomme at 2023-06-01T08:37:28+00:00
contrib: fxc2: remove line spaces patching

Let's keep the patch as tight as possible to avoid future conflicts.

- - - - -
b39bb8da by Steve Lhomme at 2023-06-01T08:37:28+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

- - - - -
ddf30060 by Steve Lhomme at 2023-06-01T08:37:28+00:00
contrib: mfx: update to 1.35.1

It requires some newly allowed API's (library loading, registry access)
to compile and link properly.

The new UWP patches have been merged upstream.

- - - - -


14 changed files:

- contrib/src/fxc2/0004-Revert-Fix-narrowing-conversion-from-int-to-BYTE.patch
- + contrib/src/mfx/0001-Add-missing-mfx_dispatcher_uwp.h-.cpp.patch
- − contrib/src/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch
- + contrib/src/mfx/0001-fix-UWP-build-in-ming-w64.patch
- − contrib/src/mfx/0002-Fix-linking-statically-with-intel_gfx_api-x86.dll.patch
- + contrib/src/mfx/0002-fix-UWP-build-in-ming-w64.patch
- − contrib/src/mfx/0003-Don-t-change-the-calling-convention-of-x86-gfx-api.patch
- + contrib/src/mfx/SHA512SUMS
- contrib/src/mfx/rules.mak
- + contrib/src/mingw64/0001-add-api-ms-core-registry-def-files.patch
- + contrib/src/mingw64/0001-headers-enable-GET_MODULE_HANDLE_EX_xxx-defines-in-U.patch
- + contrib/src/mingw64/0001-headers-enable-more-module-API-in-Win10-UWP-builds.patch
- + contrib/src/mingw64/0001-headers-enable-some-Registry-API-calls-in-UWP-8.1-bu.patch
- contrib/src/mingw64/rules.mak


Changes:

=====================================
contrib/src/fxc2/0004-Revert-Fix-narrowing-conversion-from-int-to-BYTE.patch
=====================================
@@ -12,27 +12,6 @@ diff --git a/fxc2.cpp b/fxc2.cpp
 index 01a8d07..ac17328 100755
 --- a/fxc2.cpp
 +++ b/fxc2.cpp
-@@ -216,7 +216,7 @@ int main(int argc, const char* argv[])
-   memset(dllPath + bytes, '\0', MAX_PATH - bytes);
-   //Copy the dll location over top fxc2.exe
-   strcpy(strrchr(dllPath, '\\') + 1, "d3dcompiler_47.dll");
--  
-+
-   HMODULE h = LoadLibrary(dllPath);
-   if(h == NULL) {
-     printf("Error: could not load d3dcompiler_47.dll from %s\n", dllPath);
-@@ -235,9 +235,9 @@ int main(int argc, const char* argv[])
- 
-   if(verbose) {
-     printf("Calling D3DCompileFromFile(\n");
--    
-+
-     wprintf(L"\t %ls,\n", inputFile);
--    
-+
-     printf("\t");
-     for(int i=0; i<numDefines-1; i++)
-       printf(" %s=%s", defines[i].Name, defines[i].Definition);
 @@ -310,7 +310,7 @@ int main(int argc, const char* argv[])
      FILE* f;
      errno_t err = fopen_s(&f, outputFile, "w");


=====================================
contrib/src/mfx/0001-Add-missing-mfx_dispatcher_uwp.h-.cpp.patch
=====================================
@@ -0,0 +1,279 @@
+From f5a03b546070a4743603b3fe0e2474866d76622a Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 30 May 2023 12:19:15 +0200
+Subject: [PATCH] Add missing mfx_dispatcher_uwp.h/.cpp
+
+Originaly found in api/mfx_dispatch/windows/include/mfx_dispatcher_uwp.h
+And api/mfx_dispatch/windows/src/mfx_dispatcher_uwp.cpp
+---
+ Makefile.am                |   1 +
+ src/mfx_dispatcher_uwp.cpp | 201 +++++++++++++++++++++++++++++++++++++
+ src/mfx_dispatcher_uwp.h   |  36 +++++++
+ 3 files changed, 238 insertions(+)
+ create mode 100644 src/mfx_dispatcher_uwp.cpp
+ create mode 100644 src/mfx_dispatcher_uwp.h
+
+diff --git a/Makefile.am b/Makefile.am
+index 40be4b1..680f125 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -42,6 +42,7 @@ libmfx_la_LIBADD = $(DLLIB) $(LIBVA_DRM_LIBS) $(LIBVA_X11_LIBS)
+ libmfx_la_CPPFLAGS = $(LIBVA_DRM_CFLAGS) $(LIBVA_X11_CFLAGS) $(AM_CPPFLAGS)
+ 
+ if WINDOWS_STORE
++libmfx_la_SOURCES += src/mfx_dispatcher_uwp.cpp
+ libintel_gfx_api-x86.a: src/intel_gfx_api-x86.def
+ 	$(DLLTOOL) --as=as --output-lib $@ --input-def $< --as-flags=--32 -m i386 
+ libintel_gfx_api-x64.a: src/intel_gfx_api-x64.def
+diff --git a/src/mfx_dispatcher_uwp.cpp b/src/mfx_dispatcher_uwp.cpp
+new file mode 100644
+index 0000000..62c9f75
+--- /dev/null
++++ b/src/mfx_dispatcher_uwp.cpp
+@@ -0,0 +1,201 @@
++// Copyright (c) 2020 Intel Corporation
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to deal
++// in the Software without restriction, including without limitation the rights
++// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++// copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in all
++// copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++// SOFTWARE.
++
++#include "mfx_dispatcher.h"
++#include "mfx_dispatcher_uwp.h"
++#include "mfx_driver_store_loader.h"
++#include "mfx_dxva2_device.h"
++#include "mfx_load_dll.h"
++
++mfxStatus GfxApiInit(mfxInitParam par, mfxU32 deviceID, mfxSession *session, mfxModuleHandle& hModule)
++{
++    HRESULT hr = S_OK;
++    wchar_t IntelGFXAPIdllName[MFX_MAX_DLL_PATH] = { 0 };
++    MFX::DriverStoreLoader dsLoader;
++
++    if (!dsLoader.GetDriverStorePath(IntelGFXAPIdllName, sizeof(IntelGFXAPIdllName), deviceID))
++    {
++        return MFX_ERR_UNSUPPORTED;
++    }
++
++    size_t pathLen = wcslen(IntelGFXAPIdllName);
++    MFX::mfx_get_default_intel_gfx_api_dll_name(IntelGFXAPIdllName + pathLen, sizeof(IntelGFXAPIdllName) / sizeof(IntelGFXAPIdllName[0]) - pathLen);
++    DISPATCHER_LOG_INFO((("loading %S\n"), IntelGFXAPIdllName));
++
++    hModule = MFX::mfx_dll_load(IntelGFXAPIdllName);
++    if (!hModule)
++    {
++        DISPATCHER_LOG_ERROR("Can't load intel_gfx_api\n");
++        return MFX_ERR_UNSUPPORTED;
++    }
++
++    mfxFunctionPointer pFunc = (mfxFunctionPointer)MFX::mfx_dll_get_addr(hModule, "InitialiseMediaSession");
++    if (!pFunc)
++    {
++        DISPATCHER_LOG_ERROR("Can't find required API function: InitialiseMediaSession\n");
++        MFX::mfx_dll_free(hModule);
++        return MFX_ERR_UNSUPPORTED;
++    }
++
++    typedef HRESULT(APIENTRY *InitialiseMediaSessionPtr) (HANDLE*, LPVOID, LPVOID);
++    InitialiseMediaSessionPtr init = (InitialiseMediaSessionPtr)pFunc;
++    hr = init((HANDLE*)session, &par, NULL);
++
++    return (hr == S_OK) ? MFX_ERR_NONE : MFX_ERR_UNKNOWN;
++}
++
++mfxStatus GfxApiClose(mfxSession& session, mfxModuleHandle& hModule)
++{
++    HRESULT hr = S_OK;
++
++    if (!hModule)
++    {
++        return MFX_ERR_INVALID_HANDLE;
++    }
++
++    mfxFunctionPointer pFunc = (mfxFunctionPointer)MFX::mfx_dll_get_addr(hModule, "DisposeMediaSession");
++    if (!pFunc)
++    {
++        DISPATCHER_LOG_ERROR("Can't find required API function: DisposeMediaSession\n");
++        return MFX_ERR_INVALID_HANDLE;
++    }
++
++    typedef HRESULT(APIENTRY *DisposeMediaSessionPtr) (HANDLE);
++    DisposeMediaSessionPtr dispose = (DisposeMediaSessionPtr)pFunc;
++    hr = dispose((HANDLE)session);
++    session = NULL;
++
++    MFX::mfx_dll_free(hModule);
++    hModule = NULL;
++
++    return (hr == S_OK) ? MFX_ERR_NONE : MFX_ERR_UNKNOWN;
++}
++
++mfxStatus GfxApiInitByAdapterNum(mfxInitParam par, mfxU32 adapterNum, mfxSession *session, mfxModuleHandle& hModule)
++{
++    MFX::DXVA2Device dxvaDevice;
++
++    if (!dxvaDevice.InitDXGI1(adapterNum))
++    {
++        DISPATCHER_LOG_ERROR((("dxvaDevice.InitDXGI1(%d) Failed\n"), adapterNum));
++        return MFX_ERR_UNSUPPORTED;
++    }
++
++    if (dxvaDevice.GetVendorID() != INTEL_VENDOR_ID)
++    {
++        DISPATCHER_LOG_ERROR("Specified adapter is not Intel\n");
++        return MFX_ERR_UNSUPPORTED;
++    }
++
++    return GfxApiInit(par, dxvaDevice.GetDeviceID(), session, hModule);
++}
++
++struct GfxApiHandle
++{
++    mfxModuleHandle hModule;
++    mfxSession session;
++    mfxU16 mediaAdapterType;
++};
++
++static int GfxApiHandleSort(const void * plhs, const void * prhs)
++{
++    const GfxApiHandle * lhs = *(const GfxApiHandle **)plhs;
++    const GfxApiHandle * rhs = *(const GfxApiHandle **)prhs;
++
++    // prefer integrated GPU
++    if (lhs->mediaAdapterType != MFX_MEDIA_INTEGRATED && rhs->mediaAdapterType == MFX_MEDIA_INTEGRATED)
++    {
++        return 1;
++    }
++    if (lhs->mediaAdapterType == MFX_MEDIA_INTEGRATED && rhs->mediaAdapterType != MFX_MEDIA_INTEGRATED)
++    {
++        return -1;
++    }
++
++    return 0;
++}
++
++mfxStatus GfxApiInitPriorityIntegrated(mfxInitParam par, mfxSession *session, mfxModuleHandle& hModule)
++{
++    mfxStatus sts = MFX_ERR_UNSUPPORTED;
++    MFX::MFXVector<GfxApiHandle> gfxApiHandles;
++
++    for (int adapterNum = 0; adapterNum < 4; ++adapterNum)
++    {
++        MFX::DXVA2Device dxvaDevice;
++
++        if (!dxvaDevice.InitDXGI1(adapterNum) || dxvaDevice.GetVendorID() != INTEL_VENDOR_ID)
++        {
++            continue;
++        }
++
++        par.Implementation &= ~(0xf);
++        switch (adapterNum)
++        {
++        case 0:
++            par.Implementation |= MFX_IMPL_HARDWARE;
++            break;
++        case 1:
++            par.Implementation |= MFX_IMPL_HARDWARE2;
++            break;
++        case 2:
++            par.Implementation |= MFX_IMPL_HARDWARE3;
++            break;
++        case 3:
++            par.Implementation |= MFX_IMPL_HARDWARE4;
++            break;
++        }
++
++        mfxModuleHandle hModuleCur = NULL;
++        mfxSession sessionCur = NULL;
++
++        sts = GfxApiInit(par, dxvaDevice.GetDeviceID(), &sessionCur, hModuleCur);
++        if (sts != MFX_ERR_NONE)
++            continue;
++
++        mfxPlatform platform = { MFX_PLATFORM_UNKNOWN, 0, MFX_MEDIA_UNKNOWN };
++        sts = MFXVideoCORE_QueryPlatform(sessionCur, &platform);
++        if (sts != MFX_ERR_NONE)
++        {
++            sts = GfxApiClose(sessionCur, hModuleCur);
++            if (sts != MFX_ERR_NONE)
++                return sts;
++            continue;
++        }
++
++        GfxApiHandle handle = { hModuleCur, sessionCur, platform.MediaAdapterType };
++        gfxApiHandles.push_back(handle);
++    }
++
++    qsort(&(*gfxApiHandles.begin()), gfxApiHandles.size(), sizeof(GfxApiHandle), &GfxApiHandleSort);
++
++    hModule = gfxApiHandles.begin()->hModule;
++    *session = gfxApiHandles.begin()->session;
++
++    MFX::MFXVector<GfxApiHandle>::iterator it = gfxApiHandles.begin()++;
++    for (; it != gfxApiHandles.end(); ++it)
++    {
++        sts = GfxApiClose(it->session, it->hModule);
++        if (sts != MFX_ERR_NONE)
++            return sts;
++    }
++
++    return sts;
++}
+diff --git a/src/mfx_dispatcher_uwp.h b/src/mfx_dispatcher_uwp.h
+new file mode 100644
+index 0000000..c3cbad3
+--- /dev/null
++++ b/src/mfx_dispatcher_uwp.h
+@@ -0,0 +1,36 @@
++// Copyright (c) 2020 Intel Corporation
++//
++// Permission is hereby granted, free of charge, to any person obtaining a copy
++// of this software and associated documentation files (the "Software"), to deal
++// in the Software without restriction, including without limitation the rights
++// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++// copies of the Software, and to permit persons to whom the Software is
++// furnished to do so, subject to the following conditions:
++//
++// The above copyright notice and this permission notice shall be included in all
++// copies or substantial portions of the Software.
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++// SOFTWARE.
++
++#if !defined(__MFX_DISPATCHER_UWP_H)
++#define __MFX_DISPATCHER_UWP_H
++
++// Loads intel_gfx_api dll from DriverStore fro specified device and calls InitialiseMediaSession from it
++mfxStatus GfxApiInit(mfxInitParam par, mfxU32 deviceID, mfxSession *session, mfxModuleHandle& hModule);
++
++// Calls DisposeMediaSession from the intel_gfx_api dll and unloads it
++mfxStatus GfxApiClose(mfxSession& session, mfxModuleHandle& hModule);
++
++// Initializes intel_gfx_api for specified adapter number
++mfxStatus GfxApiInitByAdapterNum(mfxInitParam par, mfxU32 adapterNum, mfxSession *session, mfxModuleHandle& hModule);
++
++// Initializes intel_gfx_api for any Intel adapter, chooses integrated adapter with higher priority
++mfxStatus GfxApiInitPriorityIntegrated(mfxInitParam par, mfxSession *session, mfxModuleHandle& hModule);
++
++#endif // __MFX_DISPATCHER_UWP_H
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch deleted
=====================================
@@ -1,40 +0,0 @@
-From c51a54c15f51579804030c70592c0a26065f1242 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 28 May 2020 13:26:18 +0200
-Subject: [PATCH] detect winstore builds with a regular mingw32 toolchain
-
-It's trigerred with a mingw32winrt or mingw32uwp toolchain.
-
-Forcing the WINAPI_FAMILY should be enough to trigger the winstore mode.
----
- configure.ac | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 490432a..c6f07cb 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -35,6 +35,20 @@ AS_CASE([${host_os}],
-         AM_CONDITIONAL([WINDOWS_STORE], [true])
-         DLLIB="$(DLLIB) -ldxgi"
-     ],
-+    [mingw32], [
-+        AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
-+          [[#include <winapifamily.h>
-+           #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
-+           # error Win32 Desktop build
-+           #endif
-+          ]],[[;]])
-+        ],[
-+            AM_CONDITIONAL([WINDOWS_STORE], [true])
-+            DLLIB="$(DLLIB) -ldxgi"
-+        ],[
-+            AM_CONDITIONAL([WINDOWS_STORE], [false])
-+        ])
-+    ],
-     [
-         AM_CONDITIONAL([WINDOWS_STORE], [false])
-     ]
--- 
-2.26.0.windows.1
-


=====================================
contrib/src/mfx/0001-fix-UWP-build-in-ming-w64.patch
=====================================
@@ -0,0 +1,32 @@
+From ca523b11e2e4e6a33708353095585a44cbd3d818 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 12 May 2023 11:45:47 +0200
+Subject: [PATCH] fix UWP build in ming-w64
+
+minwg-w64 doesn't define these types in UWP mode and would require
+a bit of code refactoring to do so.
+---
+ src/mfx_driver_store_loader.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/mfx_driver_store_loader.h b/src/mfx_driver_store_loader.h
+index 372794f..650e170 100644
+--- a/src/mfx_driver_store_loader.h
++++ b/src/mfx_driver_store_loader.h
+@@ -35,6 +35,13 @@
+ #endif
+ #endif
+ 
++#if defined(__MINGW64_VERSION_MAJOR) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
++// mingw-w64 doesn't set these types for WINAPI_PARTITION_APP
++typedef DWORD      DEVINST;
++typedef DEVINST    *PDEVINST;
++typedef ULONG      REGDISPOSITION;
++#endif
++
+ namespace MFX
+ {
+ 
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/mfx/0002-Fix-linking-statically-with-intel_gfx_api-x86.dll.patch deleted
=====================================
@@ -1,39 +0,0 @@
-From d16955c72e423954145fed985ad1fbda0e5ca977 Mon Sep 17 00:00:00 2001
-From: Johannes Kauffmann <19662702+JohannesKauffmann at users.noreply.github.com>
-Date: Fri, 15 Oct 2021 21:53:51 +0200
-Subject: [PATCH 2/3] Fix linking statically with intel_gfx_api-x86.dll
-
----
- src/intel_api_factory.h   | 4 ++--
- src/intel_gfx_api-x86.def | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/intel_api_factory.h b/src/intel_api_factory.h
-index 0be5dcb..29e9773 100644
---- a/src/intel_api_factory.h
-+++ b/src/intel_api_factory.h
-@@ -25,8 +25,8 @@ extern "C"
- {
- #endif /* __cplusplus */
- 
--HRESULT APIENTRY InitialiseMediaSession(_Out_ HANDLE* handle, _In_ LPVOID lpParam, _Reserved_ LPVOID lpReserved);
--HRESULT APIENTRY DisposeMediaSession(_In_ const HANDLE handle);
-+HRESULT InitialiseMediaSession(_Out_ HANDLE* handle, _In_ LPVOID lpParam, _Reserved_ LPVOID lpReserved);
-+HRESULT DisposeMediaSession(_In_ const HANDLE handle);
- 
- #ifdef __cplusplus
- }
-diff --git a/src/intel_gfx_api-x86.def b/src/intel_gfx_api-x86.def
-index 19d0727..c9c15e6 100644
---- a/src/intel_gfx_api-x86.def
-+++ b/src/intel_gfx_api-x86.def
-@@ -1,4 +1,4 @@
- LIBRARY intel_gfx_api-x86.dll
- EXPORTS
--InitialiseMediaSession at 12
--DisposeMediaSession at 4
-+InitialiseMediaSession
-+DisposeMediaSession
--- 
-2.27.0.windows.1
-


=====================================
contrib/src/mfx/0002-fix-UWP-build-in-ming-w64.patch
=====================================
@@ -0,0 +1,45 @@
+From 0070532c09865a95f63987ccec25d529ce198683 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 30 May 2023 15:29:31 +0200
+Subject: [PATCH] fix UWP build in ming-w64
+
+minwg-w64 doesn't define these types in UWP mode and would require
+a bit of code refactoring to do so.
+---
+ src/mfx_driver_store_loader.h | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/src/mfx_driver_store_loader.h b/src/mfx_driver_store_loader.h
+index 650e170..3895854 100644
+--- a/src/mfx_driver_store_loader.h
++++ b/src/mfx_driver_store_loader.h
+@@ -35,11 +35,24 @@
+ #endif
+ #endif
+ 
+-#if defined(__MINGW64_VERSION_MAJOR) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+-// mingw-w64 doesn't set these types for WINAPI_PARTITION_APP
++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
++// these are not defined for WINAPI_PARTITION_APP
+ typedef DWORD      DEVINST;
+ typedef DEVINST    *PDEVINST;
+ typedef ULONG      REGDISPOSITION;
++#include <initguid.h>
++DEFINE_GUID( GUID_DEVCLASS_DISPLAY,             0x4d36e968L, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18 );
++
++#if defined(__MINGW64_VERSION_MAJOR)
++#define CR_SUCCESS                     (0x00)
++#define CR_BUFFER_SMALL                (0x1A)
++#define CM_LOCATE_DEVNODE_NORMAL       (0x00000000)
++#define CM_REGISTRY_SOFTWARE           (0x00000001)
++#define CM_GETIDLIST_FILTER_PRESENT    (0x00000100)
++#define CM_GETIDLIST_FILTER_CLASS      (0x00000200)
++#define RegDisposition_OpenExisting    (0x00000001)
++#endif
++
+ #endif
+ 
+ namespace MFX
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/mfx/0003-Don-t-change-the-calling-convention-of-x86-gfx-api.patch deleted
=====================================
@@ -1,35 +0,0 @@
-From 0d15135fe441acfdbbb840abea53cf696cd21470 Mon Sep 17 00:00:00 2001
-From: Johannes Kauffmann <19662702+JohannesKauffmann at users.noreply.github.com>
-Date: Tue, 19 Oct 2021 21:03:39 +0200
-Subject: [PATCH 3/3] Don't change the calling convention of x86 gfx api
-
-Upstream MediaSDK, since ae85eb2, uses __cdecl, which corresponds to
-WINAPIV in mingw64 and MSDK. The removal of APIENTRY (since f45c0c2)
-changes the calling convention from __stdcall.
-
-The removal of the '@' name decorations (also gone since f45c0c2)
-remains.
-
-Co-authored-by: Steve Lhomme <robux4 at ycbcr.xyz>
----
- src/intel_api_factory.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/intel_api_factory.h b/src/intel_api_factory.h
-index 29e9773..44ee7eb 100644
---- a/src/intel_api_factory.h
-+++ b/src/intel_api_factory.h
-@@ -25,8 +25,8 @@ extern "C"
- {
- #endif /* __cplusplus */
- 
--HRESULT InitialiseMediaSession(_Out_ HANDLE* handle, _In_ LPVOID lpParam, _Reserved_ LPVOID lpReserved);
--HRESULT DisposeMediaSession(_In_ const HANDLE handle);
-+HRESULT WINAPIV InitialiseMediaSession(_Out_ HANDLE* handle, _In_ LPVOID lpParam, _Reserved_ LPVOID lpReserved);
-+HRESULT WINAPIV DisposeMediaSession(_In_ const HANDLE handle);
- 
- #ifdef __cplusplus
- }
--- 
-2.27.0.windows.1
-


=====================================
contrib/src/mfx/SHA512SUMS
=====================================
@@ -0,0 +1 @@
+12517338342d3e653043a57e290eb9cffd190aede0c3a3948956f1c7f12f0ea859361cf3e534ab066b96b1c211f68409c67ef21fd6d76b68cc31daef541941b0  mfx_dispatch-1.35.1.tar.gz


=====================================
contrib/src/mfx/rules.mak
=====================================
@@ -1,7 +1,7 @@
 # mfx (Media SDK)
 
-mfx_GITURL := $(GITHUB)/lu-zero/mfx_dispatch.git
-MFX_GITHASH := 7efc7505465bc1f16fbd1da3d24aa5bd9d46c5ca
+MFX_VERSION := 1.35.1
+MFX_URL := $(GITHUB)/lu-zero/mfx_dispatch/archive/refs/tags/$(MFX_VERSION).tar.gz
 
 ifeq ($(call need_pkg,"mfx"),)
 PKGS_FOUND += mfx
@@ -12,27 +12,30 @@ PKGS += mfx
 endif
 endif
 
+DEPS_mfx :=
 ifdef HAVE_WINSTORE
-MFX_CONF := CFLAGS="$(CFLAGS) -DMEDIASDK_UWP_LOADER -DMEDIASDK_UWP_PROCTABLE"
-MFX_CONF += CXXFLAGS="$(CXXFLAGS) -DMEDIASDK_UWP_LOADER -DMEDIASDK_UWP_PROCTABLE"
+DEPS_mfx += alloweduwp $(DEPS_alloweduwp)
 endif
 
-$(TARBALLS)/mfx-$(MFX_GITHASH).tar.xz:
-	$(call download_git,$(mfx_GITURL),,$(MFX_GITHASH))
+ifdef HAVE_WINSTORE
+MFX_CONF := CFLAGS="$(CFLAGS) -DMEDIASDK_UWP_DISPATCHER"
+MFX_CONF += CXXFLAGS="$(CXXFLAGS) -DMEDIASDK_UWP_DISPATCHER"
+endif
 
-.sum-mfx: mfx-$(MFX_GITHASH).tar.xz
-	$(call check_githash,$(MFX_GITHASH))
-	touch $@
+$(TARBALLS)/mfx_dispatch-$(MFX_VERSION).tar.gz:
+	$(call download_pkg,$(MFX_URL),mfx)
+
+.sum-mfx: mfx_dispatch-$(MFX_VERSION).tar.gz
 
-mfx: mfx-$(MFX_GITHASH).tar.xz .sum-mfx
+mfx: mfx_dispatch-$(MFX_VERSION).tar.gz .sum-mfx
 	$(UNPACK)
-	$(APPLY) $(SRC)/mfx/0001-detect-winstore-builds-with-a-regular-mingw32-toolch.patch
-	$(APPLY) $(SRC)/mfx/0002-Fix-linking-statically-with-intel_gfx_api-x86.dll.patch
-	$(APPLY) $(SRC)/mfx/0003-Don-t-change-the-calling-convention-of-x86-gfx-api.patch
-	cd $(UNPACK_DIR) && autoreconf -ivf
+	$(APPLY) $(SRC)/mfx/0001-fix-UWP-build-in-ming-w64.patch
+	$(APPLY) $(SRC)/mfx/0002-fix-UWP-build-in-ming-w64.patch
+	$(APPLY) $(SRC)/mfx/0001-Add-missing-mfx_dispatcher_uwp.h-.cpp.patch
 	$(MOVE)
 
 .mfx: mfx
+	$(RECONF)
 	$(MAKEBUILDDIR)
 	$(MAKECONFIGURE) $(MFX_CONF)
 	+$(MAKEBUILD)


=====================================
contrib/src/mingw64/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/mingw64/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/mingw64/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/mingw64/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/mingw64/rules.mak
=====================================
@@ -60,6 +60,10 @@ mingw64: mingw-w64-v$(MINGW64_VERSION).tar.bz2 .sum-mingw64
 	$(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-enable-GetVolumePathNameW-in-Win10-UWP-build.patch
+	$(APPLY) $(SRC)/mingw64/0001-headers-enable-more-module-API-in-Win10-UWP-builds.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
 	$(MOVE)
 
 .mingw64: mingw64
@@ -127,6 +131,21 @@ MINGW_HEADERS_D3D9 := d3d9.h d3d9caps.h
 	install $</mingw-w64-headers/include/dxva.h "$(PREFIX)/include"
 	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),i686)
+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-mingw64
 	touch $@
 
@@ -135,5 +154,14 @@ MINGW_HEADERS_D3D9 := d3d9.h d3d9caps.h
 	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/dca001da448a7a46004833e4da332eb4017fea64...ddf30060ea25a9dfbbbf9061efcd9acc253b5875

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