From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 839863858C2F; Mon, 5 Feb 2024 20:49:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 839863858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707166187; bh=ns1wvYbwNH4uxrm5IaaVvoqUMBvQ4nAAXI/++/0MZ/E=; h=To:Subject:Date:From:From; b=xrSzDY8+zcydITUck59AbwA8fdMC4sSzZkPgv8y1xU6VJmsaJdHrrHQ38VEZGq/3w JH+DVDvtOYjY/gDsZq43ge9kxLaL9DH0M26GS5a3UaGM6FS0H12Ro1053a3UPuS0Ml Y0v2ZOeqjRnUeeWpeA+CEXQGKRbOkf7rmxGaK7WM= To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.929-1-g86c0ada12dce X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 9cee1581fcbf9c5a0fee2fd24b2789fe6216f947 X-Git-Newrev: 86c0ada12dce4403a9b796380fde9e5c1824734f Message-Id: <20240205204947.839863858C2F@sourceware.org> Date: Mon, 5 Feb 2024 20:49:47 +0000 (GMT) From: Corinna Vinschen List-Id: https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=86c0ada12dce4403a9b796380fde9e5c1824734f commit 86c0ada12dce4403a9b796380fde9e5c1824734f Author: Corinna Vinschen 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());