Home Dashboard Directory Help
Search

Unmanaged exe linked to a mixed mode dll crashes at startup on some XP machines by bankoh


Status: 

Closed
 as Won't Fix Help for as Won't Fix


5
0
Sign in
to vote
Type: Bug
ID: 586715
Opened: 8/16/2010 1:16:32 PM
Access Restriction: Public
1
Workaround(s)
view
2
User(s) can reproduce this bug

Description

We have a legacy C++ app that we are extending to call web services written in C#. The app can't be compiled with /clr for various reasons , so we use a mixed mode DLL as a bridge.
Everything works under Windows 7, but under XP the application crashes with:
"The application failed to initialize properly ( 0xc0000005 ). Click OK to terminate application"
Furthermore, on *some* XP machines it works ok. We have been able to reproduce it also under XP mode in Windows 7.
Details
Sign in to post a comment.
Posted by Microsoft on 9/3/2010 at 6:49 PM
See comment about delayloading the IJW assembly.
Posted by Microsoft on 9/3/2010 at 6:48 PM
Thank you for reporting this issue. This is caused because ADVAPI32.dll is being used before it is fully initialized on Windows XP with a new version of mscoree.dll. To workaround the issue you can delayload the IJW assembly so that ADVAPI32 has a chance to fully initialize before the IJW assembly loaded. Add the name of the IJW assembly on the Linker-Inputs tab of the project. This should fix the issue on Windows XP. Other operating systems should not be affected by this issue.
Posted by Microsoft on 8/19/2010 at 9:41 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by bankoh on 8/16/2010 at 9:23 PM
I've attached the demo solution. It crashes every time in XP mode on my Win7 machine.
It also crashes on a slower single core XP desktop, but works on a relatively new core 2 duo XP laptop
(all XP machines are SP3). The impression is that it crashes on slower machines.
Posted by Microsoft on 8/16/2010 at 7:49 PM

Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Please give us a demo project to demonstrate this issue so that we can conduct further research.

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 7 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 8/16/2010 at 5:04 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Azarien on 3/12/2014 at 11:48 AM
Execute a meaningless call to a function exported by advapi32.dll e.g. CloseTrace(NULL) at the beginning of your native application.
File Name Submitted By Submitted On File Size  
MixedModeDll.zip 8/16/2010 72 KB