Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Noticed LOAD_WITH_ALTERED_SEARCH_PATH flag in LoadLibraryEx

Post Reply
hvassbotn
Posts: 29
Joined: Tue Apr 25, 2017 3:02 pm
Location: Oslo, Norway
Contact:

Noticed LOAD_WITH_ALTERED_SEARCH_PATH flag in LoadLibraryEx

Post by hvassbotn »

I guess this is a way to avoid loading old DLLs that remain in the applications .exe folder?

FLibHandle := LoadLibraryEx(PChar(LibCefPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH);

https://msdn.microsoft.com/en-us/librar ... s.85).aspx
If lpFileName specifies an absolute path and dwFlags is set to LOAD_WITH_ALTERED_SEARCH_PATH, LoadLibraryEx uses the altered search path. The behavior is undefined when LOAD_WITH_ALTERED_SEARCH_PATHflag is set, and lpFileName specifiies a relative path.
https://msdn.microsoft.com/en-us/librar ... 82586.aspx
Note that the standard search strategy and the alternate search strategy specified by LoadLibraryEx with LOAD_WITH_ALTERED_SEARCH_PATH differ in just one way: The standard search begins in the calling application's directory, and the alternate search begins in the directory of the executable module that LoadLibraryEx is loading.
User avatar
salvadordf
Posts: 4563
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Noticed LOAD_WITH_ALTERED_SEARCH_PATH flag in LoadLibraryEx

Post by salvadordf »

Yes. It's part of the code Yoo sent here :
viewtopic.php?f=8&t=52

It's used to load all CEF binaries in a different directory. You also need to set some GlobalCEFApp properties.
Post Reply