Updating system files

  • Thread starter Thread starter Sasha
  • Start date Start date
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?
 
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.
 
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, ...
 
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.
 
Back
Top