title: Indirectly calling CoInitializeSecurity from a .NET application
body: <p>I have the following code in a pure C project:</p>
  
  <pre><code>void Foo()
  {
      HRESULT hres =  CoInitializeEx(0, COINIT_MULTITHREADED); 
  
      hres =  CoInitializeSecurity(
          NULL, 
          -1,                          // COM authentication
          NULL,                        // Authentication services
          NULL,                        // Reserved
          RPC_C_AUTHN_LEVEL_DEFAULT,   // Default authentication 
          RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation  
          NULL,                        // Authentication info
          EOAC_NONE,                   // Additional capabilities 
          NULL                         // Reserved
      );
  }
  </code></pre>
  
  <p>If I build the project as an Application (.exe) and invoke this method, everything works fine.</p>
  
  <p>If I build the project as a Static Library (.lib), use it in a .NET application and invoke the method, CoInitializeSecurity returns a error 1008: An attempt was made to reference a token that does not exist.</p>