public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Cristobal Escamilla Cavazos <criesca@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Creating the sqlite3.exe stand-alone w/o cygwin dependency
Date: Sat, 10 Dec 2022 09:36:39 -0600	[thread overview]
Message-ID: <CAOWt7BTqcJNDPen=pOUro_AsAPWbzkDzp_CurTanMN_Gqv+bhA@mail.gmail.com> (raw)
In-Reply-To: <fcf0363a-b636-027d-06f3-7e94a8a1e0a1@cs.umass.edu>

[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]

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

  reply	other threads:[~2022-12-10 15:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 21:34 Jose Isaias Cabrera
2022-12-09 23:33 ` Eliot Moss
2022-12-10  2:43   ` Jose Isaias Cabrera
2022-12-10 14:47     ` Eliot Moss
2022-12-10 15:36       ` Cristobal Escamilla Cavazos [this message]
2022-12-10 16:35       ` Jose Isaias Cabrera
2022-12-10 14:42 ` Ken Brown
2022-12-10 15:20   ` Michael Soegtrop
2022-12-10 18:00     ` Jose Isaias Cabrera
2022-12-11  3:31       ` Jose Isaias Cabrera
2022-12-11 10:23         ` Michael Soegtrop
2022-12-11 20:03           ` Jose Isaias Cabrera
2022-12-11 20:41             ` Michael Soegtrop
2022-12-12 23:22               ` Jose Isaias Cabrera

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to='CAOWt7BTqcJNDPen=pOUro_AsAPWbzkDzp_CurTanMN_Gqv+bhA@mail.gmail.com' \
    --to=criesca@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).