On Thu, 8 Mar 2007, Alexandre Julliard wrote: [...]
Sure, it's best to avoid closing an invalid handle. We don't throw an exception but we do set last error, and this could conceivably break something. But the NULL check is not going to cause us to forget to close a valid handle, which would be a much worse problem.
Oh, sure.
The exception being RPCRT4_RPCSSOnDemandCall() (and similar code in rpcss) which was so confused it did not call CloseHandle() at all (as far as I could see).