I have a library that calls functions from foo.dll.
In my MSVS settings, I delay load foo.dll and manually check for its existence before attempting to call its functions (so that if it doesn't exist on a machine, my library won't crash).
If the DLL-existence check succeeds and I call its functions, the DLL is auto-loaded by the windows delay load helper and everything functions well.
However, on 50% of my user's machines, foo.dll was renamed to bar.dll. Even if I call LoadLibrary("path\bar.dll") and it succeeds, my library still crashes because the delay load helper still tries to load foo.dll when I call one of the functions.
I used a hex editor to view the content of my library, and in one location "foo.dll" is explicitly named. If I rename that entry to "bar.dll" using the hex editor, my library runs flawless when bar.dll is the name of the DLL on a user's machine (and crashes where foo.dll is the name). So it seems the issue is soley the delay load helper trying to load the explicitly-named DLL inside my library.
How can I tell the delay load helper that the DLL in question goes by a name that doesn't match the explicit file name in my compiled library?