[REGAPI] Import regapi.dll from Wine Staging 5.7 CORE-16458 (#2723)
authorOleg Dubinskiy <oleg.dubinskij2013@yandex.ua>
Thu, 14 May 2020 12:21:16 +0000 (15:21 +0300)
committerGitHub <noreply@github.com>
Thu, 14 May 2020 12:21:16 +0000 (14:21 +0200)
- Comment some other missing exports Windows regapi.dll has them, but Wine's one doesn't.

Required by MS winlogon with Win32SS replaced. I double-rechecked: now it doesn't fail due to missing regapi.dll in system32 or separate missing functions in this dll, exactly the same as with MS regapi. In pair with my profmap.dll (which was merged recently), now it fails due to InitializeUserProfile() stub in our userenv.dll (if to replace msgina too).
Also I compared the exports of MS regapi.dll and Wine's one. Win2k3 version has all exports that Wine version has and some others (which looks like were dropped in NT6). But those exports which already exist, are enough to allow MS winlogon no longer fail.

CORE-16458

dll/win32/CMakeLists.txt
dll/win32/regapi/CMakeLists.txt [new file with mode: 0644]
dll/win32/regapi/main.c [new file with mode: 0644]
dll/win32/regapi/regapi.spec [new file with mode: 0644]
media/doc/README.WINE

index 476aaec..533d1dc 100644 (file)
@@ -168,6 +168,7 @@ add_subdirectory(rasadhlp)
 add_subdirectory(rasapi32)
 add_subdirectory(rasdlg)
 add_subdirectory(rasman)
+add_subdirectory(regapi)
 add_subdirectory(resutils)
 add_subdirectory(riched20)
 add_subdirectory(riched32)
diff --git a/dll/win32/regapi/CMakeLists.txt b/dll/win32/regapi/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c5d45a1
--- /dev/null
@@ -0,0 +1,15 @@
+
+add_definitions(-D__WINESRC__)
+include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
+spec2def(regapi.dll regapi.spec)
+
+list(APPEND SOURCE
+    main.c
+    ${CMAKE_CURRENT_BINARY_DIR}/regapi_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/regapi.def)
+
+add_library(regapi MODULE ${SOURCE})
+set_module_type(regapi win32dll)
+target_link_libraries(regapi wine)
+add_importlibs(regapi advapi32 msvcrt kernel32 ntdll)
+add_cd_file(TARGET regapi DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/regapi/main.c b/dll/win32/regapi/main.c
new file mode 100644 (file)
index 0000000..1164e92
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * regapi implementation
+ *
+ * Copyright 2011 Austin English
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(regapi);
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
+
+    switch (fdwReason)
+    {
+        case DLL_WINE_PREATTACH:
+            return FALSE;    /* prefer native version */
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls(hinstDLL);
+            break;
+        default:
+            break;
+    }
+
+    return TRUE;
+}
diff --git a/dll/win32/regapi/regapi.spec b/dll/win32/regapi/regapi.spec
new file mode 100644 (file)
index 0000000..717939e
--- /dev/null
@@ -0,0 +1,84 @@
+# GetDomainName
+# QueryUserProperty
+@ stub RegBuildNumberQuery
+@ stub RegCdCreateA
+@ stub RegCdCreateW
+@ stub RegCdDeleteA
+@ stub RegCdDeleteW
+@ stub RegCdEnumerateA
+@ stub RegCdEnumerateW
+@ stub RegCdQueryA
+@ stub RegCdQueryW
+@ stub RegCloseServer
+@ stub RegConsoleShadowQueryA
+@ stub RegConsoleShadowQueryW
+# RegCreateUserConfigW
+@ stub RegDefaultUserConfigQueryA
+@ stub RegDefaultUserConfigQueryW
+@ stub RegDenyTSConnectionsPolicy
+@ stub RegFreeUtilityCommandList
+# RegGetLicensingModePolicy
+@ stub RegGetMachinePolicy
+@ stub RegGetMachinePolicyEx
+# RegGetMachinePolicyNew
+@ stub RegGetTServerVersion
+@ stub RegGetUserConfigFromUserParameters
+@ stub RegGetUserPolicy
+@ stub RegIsMachineInHelpMode
+@ stub RegIsMachinePolicyAllowHelp
+# RegIsTimeZoneRedirectionEnabled
+@ stub RegIsTServer
+@ stub RegMergeUserConfigWithUserParameters
+@ stub RegOpenServerA
+@ stub RegOpenServerW
+@ stub RegPdCreateA
+@ stub RegPdCreateW
+@ stub RegPdDeleteA
+@ stub RegPdDeleteW
+@ stub RegPdEnumerateA
+@ stub RegPdEnumerateW
+@ stub RegPdQueryA
+@ stub RegPdQueryW
+@ stub RegQueryOEMId
+@ stub RegQueryUtilityCommandList
+@ stub RegSAMUserConfig
+@ stub RegUserConfigDelete
+@ stub RegUserConfigQuery
+@ stub RegUserConfigRename
+@ stub RegUserConfigSet
+@ stub RegWdCreateA
+@ stub RegWdCreateW
+@ stub RegWdDeleteA
+@ stub RegWdDeleteW
+@ stub RegWdEnumerateA
+@ stub RegWdEnumerateW
+@ stub RegWdQueryA
+@ stub RegWdQueryW
+@ stub RegWinStationAccessCheck
+@ stub RegWinStationCreateA
+@ stub RegWinStationCreateW
+@ stub RegWinStationDeleteA
+@ stub RegWinStationDeleteW
+@ stub RegWinStationEnumerateA
+@ stub RegWinStationEnumerateW
+@ stub RegWinStationQueryA
+@ stub RegWinStationQueryDefaultSecurity
+@ stub RegWinStationQueryEx
+# RegWinStationQueryExNew
+@ stub RegWinStationQueryNumValueW
+@ stub RegWinStationQuerySecurityA
+# RegWinstationQuerySecurityConfig_Machine
+# RegWinstationQuerySecurityConfig_Merged
+@ stub RegWinStationQuerySecurityW
+@ stub RegWinStationQueryValueW
+@ stub RegWinStationQueryW
+@ stub RegWinStationSetNumValueW
+@ stub RegWinStationSetSecurityA
+# RegWinstationSetSecurityConfig
+@ stub RegWinStationSetSecurityW
+# SetUserProperty
+# UsrPropGetString
+# UsrPropGetValue
+# UsrPropSetString
+# UsrPropSetValue
+@ stub WaitForTSConnectionsPolicyChanges
index 718ba24..b174c23 100644 (file)
@@ -158,6 +158,7 @@ dll/win32/qmgr                # Synced to WineStaging-4.18
 dll/win32/qmgrprxy            # Synced to WineStaging-2.9
 dll/win32/query               # Synced to WineStaging-4.18
 dll/win32/rasapi32            # Synced to WineStaging-3.3
+dll/win32/regapi              # Synced to WineStaging-5.7
 dll/win32/resutils            # Synced to WineStaging-3.3
 dll/win32/riched20            # Synced to WineStaging-4.18
 dll/win32/riched32            # Synced to WineStaging-3.3