Sign in to follow this  
Brian Perry

Another CoUninitialize() Question

Recommended Posts

Brian Perry    122
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
darookie    1441
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this