From bc8986696605c29c8ef54f9c448ab889c2195d93 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@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

