Exception when delay loading of binaries fail

Hi,

My program (myApp.exe) delay loads a dll (TestDLL.dll). I am doing a negative test, where I deliberately deleted TestDLL from its location. So when the program runs, delay load of dll fails, however when destructor of my class gets called, I get this runtime exception.

It looks like program is trying to call some function inside the delay loaded dll. I am not explicitly doing that in my code. This is done as part of cleanup. Any idea as to why and what is the compiler doing here?

Thanks.

1
2
3
4
5
6
7
8
KERNELBASE!RaiseException+0x68 [d:\rs1\minkernel\kernelbase\xcpt.c @ 904] 
KERNELBASE!DelayLoadFailureHookInternal+0x22
KERNELBASE!DelayLoadFailureHook+0x3277a
ntdll!LdrpRedirectDelayloadFailure+0xa3
ntdll!LdrpHandleUnprotectedDelayLoad+0xaa9f5
ntdll!LdrResolveDelayLoadedAPI+0xe4
myApp!__delayLoadHelper2+0x30
myApp!_tailMerge_TestDLL_dll+0x3f
Last edited on
What does your destructor do ?
Topic archived. No new replies allowed.