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

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 586715 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 8/16/2010 1:16:32 PM
Access Restriction Public


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.
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)