PC Review


Reply
Thread Tools Rate Thread

DLL Search order

 
 
Sasha
Guest
Posts: n/a
 
      22nd Aug 2005
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?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGFyZGlrIFNoYWg=?=
Guest
Posts: n/a
 
      25th Aug 2005
Hi,

You are right, no longer is the current directory searched first when
loading DLLs! This change was also made in Windows XP SP1. The default
behavior now is to look in all the system locations first, then the current
directory, and finally any user-defined paths.

The reason this change was made was to mitigate some kinds of trojaning
attacks. An attacker may be able to sneak a bad DLL into your application
directory or a directory that has files associated with your application. The
DLL search order change removes this attack vector.

The SetDllDirectory function modifies the search path used to locate DLLs
for the application. The Syntax and more information on SetDllDirectory
function is available on
http://msdn.microsoft.com/library/de...ldirectory.asp

--
Regards,
Hardik Shah
Microsoft Student Ambassador
http://hardiks.blogspot.com


"Sasha" wrote:

> 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?
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Order your search Adam Microsoft Access 1 17th Jan 2008 05:18 PM
Specifying search order =?Utf-8?B?RGF2ZW4xMjM=?= Microsoft Outlook Discussion 1 22nd Mar 2006 06:25 AM
Search order =?Utf-8?B?Ymo=?= Microsoft Excel Misc 1 21st May 2005 02:27 PM
Search order Phat Joe Microsoft Outlook 0 29th Apr 2004 03:35 PM
What order does Search For Files or Folders search in? Mark Fineman Windows XP Performance 0 8th Jan 2004 05:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:37 PM.