python - DLL not loaded from documented search path -


i have process loading dll place not listed in documented search order (docs linked below). want know why.

here's description of setup:

  1. i have folder 'c:\foo' containing a.dll , b.dll.
  2. i have python script stored in c:\foo.
  3. the python script loadlibrary('c:/foo/a.dll') (via ctypes)
  4. a.dll linked against import library b.dll (ie using implicit linking).
  5. i run python script current directory of, say, c:. anything.
  6. b.dll loaded c:\foo, though isn't on search path.
  7. looking @ process monitor trace, can see documented search paths tried first, , failed. python process tried , failed open "c:\windows\assembly\gac\microsoft.vc80.crt.mui\8.0.50727.4053_en-us_1fc8b3b9a1e18e3b\microsoft.vc80.crt.mui.dll", then opened c:\foo\b.dll.

so, seems a.dll's directory being searched b.dll though docs don't should be. also, happens after looking on system path, mad. can shed light on this?

the same thing happens matlab script uses a.dll.

i'm running windows xp sp 3.

this msdn article explains default search order. quote:

  1. the directory specified lpfilename.
  2. the system directory. use getsystemdirectory function path of directory.
  3. the 16-bit system directory. there no function obtains path of directory, searched.
  4. the windows directory. use getwindowsdirectory function path of directory.
  5. the current directory.
  6. the directories listed in path environment variable. note not include per-application path specified app paths registry key. app paths key not used when computing dll search path.

a.dll using runtime dynamic linking last resort http://msdn.microsoft.com/en-us/library/ms686944%28vs.85%29.aspx


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -