title: How to tell if CoInitializeSecurity has already been called for a process?
body: <p>Is there an easy way to tell if CoInitializeSecurity has already been called for a process?</p>
  
  <p>I need to call CoInitializeEx and make use of a COM interface, but sometimes the calling code (which I have no control over) is calling me first, before it gets to CoInitializeSecurity, during its startup sequence, and then it falls over with E_RPC_TOO_LATE.</p>
  
  <p>What I want to do is detect that CoInitializeSecurity has not been called yet, and delay for some small amount of time (on the order of ten seconds or so) until the caller has managed to make it to CoInitializeSecurity, before I continue on to CoInitializeEx.</p>
  
  <p>Adding this delay solves the problem just fine, except, I don't like to have that delay on every single call -- just the very first one during startup. Hence, the desire to detect whether or not CoInitializeSecurity has been called yet.</p>