[setup - the official Cygwin setup program] branch master, updated. release_2.929-1-g86c0ada12dce

Corinna Vinschen corinna@sourceware.org
Mon Feb 5 20:49:47 GMT 2024




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=86c0ada12dce4403a9b796380fde9e5c1824734f

commit 86c0ada12dce4403a9b796380fde9e5c1824734f
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Feb 5 21:47:46 2024 +0100

    Disallow DLL loading from other than C:\Windows\System32
    
    Call SetDefaultDllDirectories early to make sure, delay-loaded DLLs
    are only loaded from the System32 dir.


Diff:
---
 main.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/main.cc b/main.cc
index 198a943e0859..b570c6cb18ec 100644
--- a/main.cc
+++ b/main.cc
@@ -225,9 +225,11 @@ int WINAPI
 WinMain (HINSTANCE h,
 	 HINSTANCE hPrevInstance, LPSTR command_line, int cmd_show)
 {
-
   hinstance = h;
 
+  // Make sure Windows DLLs only delay-load further DLLs from System32
+  SetDefaultDllDirectories (LOAD_LIBRARY_SEARCH_SYSTEM32);
+
   // Make sure the C runtime functions use the same codepage as the GUI
   char locale[12];
   snprintf(locale, sizeof locale, ".%u", GetACP());



More information about the Cygwin-apps-cvs mailing list