From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 6277F383B79F; Mon, 6 Jun 2022 10:41:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6277F383B79F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon TURNEY To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: Drop use of loadlib.h in regtool X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: f344134a191899f2dbb480251e5d083faae8051f X-Git-Newrev: f36dd402753eacc1b0774a240c3fb6a33515ed30 Message-Id: <20220606104124.6277F383B79F@sourceware.org> Date: Mon, 6 Jun 2022 10:41:24 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2022 10:41:24 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Df36dd402753= eacc1b0774a240c3fb6a33515ed30 commit f36dd402753eacc1b0774a240c3fb6a33515ed30 Author: Jon Turney Date: Fri Apr 30 14:33:21 2021 +0100 Cygwin: Drop use of loadlib.h in regtool =20 Link directly with RegDeleteKeyExW(), available since Vista. =20 (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) Diff: --- winsup/utils/regtool.cc | 13 +------------ 1 file changed, 1 insertion(+), 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 #include #include -#include "loadlib.h" =20 #define DEFAULT_KEY_SEPARATOR '\\' =20 @@ -589,10 +588,6 @@ cmd_add () return 0; } =20 -extern "C" { - LONG WINAPI (*regDeleteKeyEx)(HKEY, LPCWSTR, REGSAM, DWORD); -} - int cmd_remove () { @@ -600,13 +595,7 @@ cmd_remove () =20 find_key (2, KEY_ALL_ACCESS); if (wow64) - { - HMODULE mod =3D LoadLibrary ("advapi32.dll"); - if (mod) - regDeleteKeyEx =3D (LONG WINAPI (*)(HKEY, LPCWSTR, REGSAM, DWORD)) GetPro= cAddress (mod, "RegDeleteKeyExW"); - } - if (regDeleteKeyEx) - rv =3D (*regDeleteKeyEx) (key, value, wow64, 0); + rv =3D RegDeleteKeyExW (key, value, wow64, 0); else rv =3D RegDeleteKeyW (key, value); if (rv !=3D ERROR_SUCCESS)