Updating system files

S

Sasha

Hello,
It appears that the dll search order has somehow changed on my system.
When i use either static linking or LoadLibrary, it first searches for
the dll in the \system32 dir instead of the local directory.
Can i modify the search order?
 
G

Gary Chanson

Sasha said:
Hello,
It appears that the dll search order has somehow changed on my system.
When i use either static linking or LoadLibrary, it first searches for
the dll in the \system32 dir instead of the local directory.
Can i modify the search order?

As far as I know, it's hard wired and can't change. Since you're asking
about system files, I'd guess that the DLL you're referencing is on the
KnownDLL list and therefore the path in that list is overriding your path.
 
S

Stubby

Gary said:
As far as I know, it's hard wired and can't change. Since you're asking
about system files, I'd guess that the DLL you're referencing is on the
KnownDLL list and therefore the path in that list is overriding your path.

I think the environment variable "path" can be edited. Prepend "."
(current directory) to it. Windows should look for DLLs in the same
places that it looks for executables. Right click My Computer,
Properties, Advanced, Environment Variables, System Variables, ...
 
G

Gary Chanson

Stubby said:
path.

I think the environment variable "path" can be edited. Prepend "."
(current directory) to it. Windows should look for DLLs in the same
places that it looks for executables. Right click My Computer,
Properties, Advanced, Environment Variables, System Variables, ...

The path is searched but not until after the system folders. According
to MSDN, the order is:

The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of
this directory.
The 16-bit system directory. There is no function that obtains the path of
this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path
of this directory.
The directories that are listed in the PATH environment variable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top