Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2021-04-30 16:33:21 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2022-06-06 13:21:44 +0300
commitf36dd402753eacc1b0774a240c3fb6a33515ed30 (patch)
tree9cb8d17929843f82395d392cdabd9c45bf15ca74 /winsup/utils
parentf344134a191899f2dbb480251e5d083faae8051f (diff)
Cygwin: Drop use of loadlib.h in regtool
Link directly with RegDeleteKeyExW(), available since Vista. (It's unclear the LoadLibrary wrapper was ever doing anything useful here, as (i) DLL lookup in PATH was avoided as advapi32 is already loaded into the process, and (ii) advapi32 is a 'known DLL' which is only ever loaded from system directory)
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/regtool.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc
index fd2dd0590..e919185ae 100644
--- a/winsup/utils/regtool.cc
+++ b/winsup/utils/regtool.cc
@@ -16,7 +16,6 @@ details. */
#include <windows.h>
#include <sys/cygwin.h>
#include <cygwin/version.h>
-#include "loadlib.h"
#define DEFAULT_KEY_SEPARATOR '\\'
@@ -589,10 +588,6 @@ cmd_add ()
return 0;
}
-extern "C" {
- LONG WINAPI (*regDeleteKeyEx)(HKEY, LPCWSTR, REGSAM, DWORD);
-}
-
int
cmd_remove ()
{
@@ -600,13 +595,7 @@ cmd_remove ()
find_key (2, KEY_ALL_ACCESS);
if (wow64)
- {
- HMODULE mod = LoadLibrary ("advapi32.dll");
- if (mod)
- regDeleteKeyEx = (LONG WINAPI (*)(HKEY, LPCWSTR, REGSAM, DWORD)) GetProcAddress (mod, "RegDeleteKeyExW");
- }
- if (regDeleteKeyEx)
- rv = (*regDeleteKeyEx) (key, value, wow64, 0);
+ rv = RegDeleteKeyExW (key, value, wow64, 0);
else
rv = RegDeleteKeyW (key, value);
if (rv != ERROR_SUCCESS)