• Advertisement
Sign in to follow this  

Another CoUninitialize() Question

This topic is 4879 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi - I've seen other references to this problem but no definitive resolution, so I hope someone can shed some light. I have an isolated LAN with 10 systems running WinXP Pro SP1 and DX9 (a mix of b and c releases). I have a full-screen Peer-to-Peer application using DirectPlay8 interfaces, written in C using VC++ 6.0. Except for the host CPU, all the systems run identical software. When shutting down the application, on one of the systems DP hangs in CoUninitialize(). (It happens to be a 9.0c machine, but another 9.0c system works OK.) I have done enough experimenting to demonstrate that on this machine CoUninitialize() will complete OK until I've done some other DP-related post-initialization operation such as EnumHosts() or Connect(). It doesn't seem to matter whether I run single- or multi-threaded, debug or release. I can provide more detail if necessary, but I'm hoping someone can help me figure out how to fix this. As an aside, what is the impact if I simply skip CoUninitialize()? Many thanks!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Brian Perry
I can provide more detail if necessary, but I'm hoping someone can help me figure out how to fix this. As an aside, what is the impact if I simply skip CoUninitialize()?

Yet another reason why MS finally abandoned DP [wink].
Actually it seems to be a problem with DP itself. According to MSDN the call is necessary to close all RPC connections and process pending messages from the COM server. Due to the fact that it's a modal loop, I can image some kind of deadlock situation if incompatible libraries (e.g. b and c sub version) are trying to agree on shutting down. I'd check for time-outs on pending messages in your protocol. Try using a network sniffer to find out if there're any communication attempts.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement