LoadLibrary("rsaenh.dll") exits process with code 128 (Windows 2003 Server)

Hi all,

don't know if this is the correct newsgroup, sorry if it's not; at
least the problem occurs in a MFC MDI application.
I tracked the problem down to the following:

In a (huge) MFC MDI app I do
   LoadLibrary("rsaenh.dll")
somewhere (doesn't matter where) in MyApp::InitInstance().

This works on WinXP, but on Win2003 Server SE I have the following effects:
1. When using the call within the target application (huge MFC MDI
application with ComServer etc., but started as normal EXE) and the
rsaenh.dll shipped with Win2003 Server (version 5.2.3790.1830
(srv03_sp1_rtm.050324-1447)), the LoadLibrary() exits the whole application
with an exit code 128
2. When using the call within a test application (tested with command line app
and other MFC MDI app), it works just fine
3. Doing 1. with a remote debugger connected to the application
(connected before the call) the call succeeds

I've checked with ProcessExplorer (SysInternals) that just before the LoadLibrary
call the preferred base address of rsaenh.dll is available (0x68000000).

Anyone has a hint what's going on here?

Thx & regards, Stephan
0
11/23/2005 12:15:29 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
606 Views

Similar Articles

[PageSpeed] 45

An additional test revealed that LoadLibary() exits only in Debug mode.
In Release it returns with error, where GetLastError() yields
0x000003E6 == 998 == ERROR_NOACCESS  ("Invalid access to memory location")

Stephan Keil wrote:
> Hi all,
> 
> don't know if this is the correct newsgroup, sorry if it's not; at
> least the problem occurs in a MFC MDI application.
> I tracked the problem down to the following:
> 
> In a (huge) MFC MDI app I do
>   LoadLibrary("rsaenh.dll")
> somewhere (doesn't matter where) in MyApp::InitInstance().
> 
> This works on WinXP, but on Win2003 Server SE I have the following effects:
> 1. When using the call within the target application (huge MFC MDI
> application with ComServer etc., but started as normal EXE) and the
> rsaenh.dll shipped with Win2003 Server (version 5.2.3790.1830
> (srv03_sp1_rtm.050324-1447)), the LoadLibrary() exits the whole application
> with an exit code 128
> 2. When using the call within a test application (tested with command 
> line app
> and other MFC MDI app), it works just fine
> 3. Doing 1. with a remote debugger connected to the application
> (connected before the call) the call succeeds
> 
> I've checked with ProcessExplorer (SysInternals) that just before the 
> LoadLibrary
> call the preferred base address of rsaenh.dll is available (0x68000000).
> 
> Anyone has a hint what's going on here?
> 
> Thx & regards, Stephan
0
11/23/2005 1:10:25 PM
OK, I tracked the problem even further. Again, I call
LoadLibrary("rsaenh.dll") (which is done implicitly by CryptAcquireContext(),
my actual target API call :)).
On Windows 2003 Server it fails, GetLastError() yields
   0x000003E6 == 998 == ERROR_NOACCESS  ("Invalid access to memory location")
which probably means an access violation during dll startup.
If I connect a remote debugger (msvcmon -anyuser -tcpip) just before the call,
again, it succeeds.
Also on WinXP and Win2000 Server the call succeeds.

Calling LoadLibraryEx() with DONT_RESOLVE_DLL_REFERENCES succeeds also
on Win2003 Server, but a subsequent CryptAcquireContext() fails, supposedly
because the library is not fully loaded.

I obtained a hot fix from Microsoft support which seems to fit my problem
(see http://support.microsoft.com/default.aspx?scid=kb;en-us;899750&sd=rss&spid=3198),
but unfortunately it didn't help.

I am digging deeper and depper, but it's digging in the mist  :(

Calling for help again :o

Thx & regards, Stephan
0
11/23/2005 7:08:50 PM
Reply:

Similar Artilces:

LoadLibrary("rsaenh.dll") exits process with code 128 (Windows 2003 Server)
Hi all, don't know if this is the correct newsgroup, sorry if it's not; at least the problem occurs in a MFC MDI application. I tracked the problem down to the following: In a (huge) MFC MDI app I do LoadLibrary("rsaenh.dll") somewhere (doesn't matter where) in MyApp::InitInstance(). This works on WinXP, but on Win2003 Server SE I have the following effects: 1. When using the call within the target application (huge MFC MDI application with ComServer etc., but started as normal EXE) and the rsaenh.dll shipped with Win2003 Server (version 5.2.3790.1830 (srv03_sp1_rtm...