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);
   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
bstrZEPHYRInfoURL << L"http://" << zephyrSiteTokenized->get_URL() << L"/pav/";
bstrZEPHYRInfoURL << zephyrSiteTokenized->get_VersionMajor() << L"." << zephyrSiteTokenized->get_VersionMinor() << L"/";
bstrZEPHYRInfoURL << L"siteinfo.xml";
variant_t doc = bstrZEPHYRInfoURL.str().c_str();
vBool = plZEPHYRInfoDomDocument->load(doc);

Open in new window

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.

This could have to do with a certain bugfix, published by Microsoft.
Here's the link for a fix for Vista based computers:

This might be the cause for your crash:
After installing 936181 (MS07-042) on Vista, leaked DomDocument objects
cause AV

Can you check, if you've got 936181 installed?
Can you tell a little more about the crash?
Is there a call stack?
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.
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?
still crashing?
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.

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.