public inbox for
help / color / mirror / Atom feed
From: Jon TURNEY <>
Subject: [newlib-cygwin] Cygwin: Drop use of loadlib.h in regtool
Date: Mon,  6 Jun 2022 10:41:24 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=f36dd402753eacc1b0774a240c3fb6a33515ed30

commit f36dd402753eacc1b0774a240c3fb6a33515ed30
Author: Jon Turney <>
Date:   Fri Apr 30 14:33:21 2021 +0100

    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)

 winsup/utils/ | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/winsup/utils/ b/winsup/utils/
index fd2dd0590..e919185ae 100644
--- a/winsup/utils/
+++ b/winsup/utils/
@@ -16,7 +16,6 @@ details. */
 #include <windows.h>
 #include <sys/cygwin.h>
 #include <cygwin/version.h>
-#include "loadlib.h"
@@ -589,10 +588,6 @@ cmd_add ()
   return 0;
-extern "C" {
 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);
     rv = RegDeleteKeyW (key, value);
   if (rv != ERROR_SUCCESS)

                 reply	other threads:[~2022-06-06 10:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).