X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36D9E3845854
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1670686628;
	bh=jkpEh2SsbEX3T6tyWUyrCOybQO8eeyumBoftcHcEN3U=;
	h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=X5+0LK82ksKAcMCxzCIxwoBjoc7a1mA9LZY1hoWsmksbhyqQNl7gYuCjnGGbDFCB+
	 nXZNc/9ze8hY9M4sxCvMTN+8c26Wz8cAc+Yet+wsrSCqNXVTBvLDeLR6PArcjWGeVY
	 pWYJ+anFICeskwRw8QYc2U7ofBVJPr/o7hEE+RzQ=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 757A73848E1A
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:subject:message-id:date:from:in-reply-to:references:mime-version
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=zZvifjqQ7/zKYo4MlZxHbMjL8couuFtq8w4hGKKDdVQ=;
 b=Qf3SZU93+Rotn24PB35HH4fPKLtyRopjBZ73DTjZYH6/B/lIfTaCYOpdayxVQR/r5h
 lDjI4VPhJudhY7JvOi9/cwvMQ9w8s1vpBgErA81ZI3L8ktsEFg2WBPik9RmDc5xalIUW
 UreJec4SEOBmfcvf8r8CSy6LDzQdW0fD/TzkXYy8OfIPwjY9affplx2wIJVSuZJUeJlI
 MwbSkze7G+mkgW3XkZAOYKYyiedGgx5dD7V682rTS1fslgBuU5R97JFcNUqb0fEgFbLw
 uoquWhwUcH9CnVTrXa8XLFBzBPtIW7LsnZzImiDQyrPS7z8E+GOgEFg0/dllnmJ6d4iD
 hbQg==
X-Gm-Message-State: ANoB5pksiQy/mUIjKP6rOI+q1HOtdIpLXFvj0kv7sEZQyIlqjstAAzCY
 IIqpc2pg9hLFH195kL4RfNnOiDDXrvBXp9pmj4bccGZ91uEYTA==
X-Google-Smtp-Source: AA0mqf5x1vlOC0ZgJ0iO9YEJ8n1gtaaYroDsffotBe3cjyN7tk+hu4cpr511RkwpXkrErV2eTBfuBkSZrfLiakETN5g=
X-Received: by 2002:a1f:e942:0:b0:3bd:f2ff:b8c6 with SMTP id
 g63-20020a1fe942000000b003bdf2ffb8c6mr3870353vkh.9.1670686609826; Sat, 10 Dec
 2022 07:36:49 -0800 (PST)
MIME-Version: 1.0
References: <DB9P251MB00639C367F5AA38BF0F18B55DE1C9@DB9P251MB0063.EURP251.PROD.OUTLOOK.COM>
 <ae6bc649-4c5c-ffa3-95df-a1723da87b57@cs.umass.edu>
 <DB9P251MB0063B590AF74D07C3421C04FDE1F9@DB9P251MB0063.EURP251.PROD.OUTLOOK.COM>
 <fcf0363a-b636-027d-06f3-7e94a8a1e0a1@cs.umass.edu>
In-Reply-To: <fcf0363a-b636-027d-06f3-7e94a8a1e0a1@cs.umass.edu>
Date: Sat, 10 Dec 2022 09:36:39 -0600
Message-ID: <CAOWt7BTqcJNDPen=pOUro_AsAPWbzkDzp_CurTanMN_Gqv+bhA@mail.gmail.com>
Subject: Re: Creating the sqlite3.exe stand-alone w/o cygwin dependency
To: cygwin@cygwin.com
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE,
 RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Cristobal Escamilla Cavazos via Cygwin <cygwin@cygwin.com>
Reply-To: Cristobal Escamilla Cavazos <criesca@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

Actually if the dlls is in the same directory it does mean that windows
will look there even if the current directory is not in your path (always
true if the executable is in the same location, only true if safe dll
search is off) given that windows has not found the dll registered in the
system in any other place and there are no overrides anywhere else.

The search goes in this order:
If the dll is already in memory, this is used.
If the dll is in the list of known dlls versions it is loaded from there
(list of dlls is at HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\KnownDLLs)
If it is not found in any of those locations then it is searched
Finally dependencies are resolved using this steps as well

If dll has not been found and it is not overridden by a full path
definition nor a manifest then the search goes as follow
Directory from which the application was loaded
If safe dll search mode is disabled then the current directory is searched
The system directory - starting with the current arch, then fallbacks to
previous archs
The windows directory
And finally all the path environment variable

Hopes this helps a little bit.

Reference:
https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order

Best regards - Cristobal E

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
