4

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?

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 2
    Is the only thing, in your library dependency tree, that depends on `opengl32.dll`, is your application? Maybe there are other libraries, that are loaded, that depends on said library being loaded, and your unload DLL call merely reduced the refcount, of it. – Algirdas Preidžius Nov 17 '19 at 10:51

0 Answers0