IXMLDOMDocument2::load crashes when source is from http

The attached code works reliably on XP SP2, but fails on Vista. Furthermore, when I attempt to load local xml, it works on both platforms

MSXML::IXMLDOMDocument2Ptr plZEPHYRInfoDomDocument;
HRESULT hr = plZEPHYRInfoDomDocument.CreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER);
 
if(FAILED(hr))
   throw ZephyrException::Create(__LINE__, __FILE__, "Couldn't create IXMLDOMDocument2");
 
wostringstream bstrZEPHYRInfoURL;
#if 0
bstrZEPHYRInfoURL << L"file://C:\\dev\\MySpace\\ParentCare\\"; // test MSXML by loading a local file
#else
bstrZEPHYRInfoURL << L"http://" << zephyrSiteTokenized->get_URL() << L"/pav/";
bstrZEPHYRInfoURL << zephyrSiteTokenized->get_VersionMajor() << L"." << zephyrSiteTokenized->get_VersionMinor() << L"/";
#endif
bstrZEPHYRInfoURL << L"siteinfo.xml";
 
plZEPHYRInfoDomDocument->put_async(VARIANT_FALSE);
 
variant_t doc = bstrZEPHYRInfoURL.str().c_str();
 
VARIANT_BOOL vBool = VARIANT_FALSE;
vBool = plZEPHYRInfoDomDocument->load(doc);

Open in new window

larry-allenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

primeMover2004Commented:
This could have to do with a certain bugfix, published by Microsoft.
Here's the link for a fix for Vista based computers:
http://support.microsoft.com/?scid=kb%3Ben-us%3B941833&x=13&y=17

This might be the cause for your crash:
After installing 936181 (MS07-042) on Vista, leaked DomDocument objects
cause AV
http://support.microsoft.com/?scid=kb%3Ben-us%3B936227&x=17&y=11

Can you check, if you've got 936181 installed?
Can you tell a little more about the crash?
Is there a call stack?
0
larry-allenAuthor Commented:
Thanks to primeMover2004 for interesting comments. Re your first suggestion, it applies to MSXML4. I'm using MSXML3 because its gauranteed to be installed on the systems we're running on.

I'm not sure its specific to a particulate MSXML version, because I built a MSXML6 version that had identical behavior.

I'm still considering the MS07-042 issue, thanks for the suggestion.

I realize I didn't say enough about the nature of the crash (it was the end of a frustrating day).

Referring to the code snippet, the crash occurs at the call to plZEPHYRInfoDomDocument->load at line #21. Other observations:

1. The production code has a try/catch around the load, so I know its not an exception.
2. The load() call terminates the EXE, which happens to be a windows service.
3. There is no exception dialog, AV dialog, blue screen, event log entry, or any other indication. The executable just shuts down.
4. I tested loading the same xml from disk by changing the #define at line 8, it works fine.
5. It works fine on XP SP2. Its has also worked on Vista machines, I'm beginning to suspect the configuration of my test machine.
6. I was testing in a corporate network environment that is locked down pretty tight. I'll be testing in a more open environment today.
0
primeMover2004Commented:
This sounds like ExitProcess is called. And you cannot catch ExitProcess :)
Just to be sure:
Can you reproduce the crash with the codesnippet from http://www.hostingforum.ca/715642-problem-latest-ms-patches-msxml4-vista.html?
0
primeMover2004Commented:
still crashing?
0
larry-allenAuthor Commented:
Thanks to everyone who responded, I've figured it out. It's kinda complicated:

1. Opening the http document invokes a TCP/IP stack
2. The TCP/IP stack loads a Layered Service Provider (part of my app)
3. The LSP communicates to another thread in the same EXE.
4. -That- thread is the one that was crashing.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.