Re: CryptAcquireContext _sometimes_ fails with NTE_PROVIDER_DLL_FA

From: Stephan Keil (Stephan.Keil_at_gmx.de)
Date: 11/25/05


Date: Fri, 25 Nov 2005 07:54:19 +0100


> What I'm suggesting is that your stack is _already_ blown before you hit
> "LoadLibrary", and something inside of LoadLibrary (probably the return)
> demonstrates this.

I played with the location of the LoadLibrary call:
- I put it into InitInstance()
- called it from a global initializer,
- even one in the 'lib' section (#pragma init_seg(lib), i.e. initialized
   before anything else),
- called it later in a call back (triggered by a menu item),
- put other LoadLibary() calls around it
- and moved it to and fro

Result is always the same, other LoadLibary()-calls succeed, but
LoadLibrary("rsaenh.dll") fails with ERROR_NOACCESS. And always,
when a debugger is connected, the call succeeds.
It _must_ have something to do with the application, because a simpler
application does not have this problem, but what the heck is it?

- Stephan