Unload a delay loaded dll in Windows

499 Views Asked by At

I am trying to use __FUnloadDelayLoadedDLL2 with opengl32.dll.

I have already defined:

delayimp.lib /DELAYLOAD:OPENGL32.dll /DELAY:UNLOAD

in the linker options, and then

__FUnloadDelayLoadedDLL2("OPENGL32.dll")

but this returns false.

The name in the __FUnloadDelayLoadedDLL2 must match exactly so I got it from the DEPENDENTS table.

If I call the __FUnloadDelayLoadedDLL2("OPENGL32.dll") again in a different point in the code, it returns true which means that the dll is unloaded. BUT then I call GetModuleHandle("OPENGL32.dll") and the handle exists. Any idea?

Is it possible to unload the delay loaded opengl32.dll? Or are there any conflicts with gdi32.dll?

0

There are 0 best solutions below