salsita/passthruapp — pull request #7 by patwonder (2013-12-31 10:35:50+00:00)
Title: Suppress assertion failure when using CComMultiThreadModel.

Using CComMultiThreadModel for the sink and protocol objects resolves a random crash problem in higher versions of IE(IE10 & 11). See http://social.msdn.microsoft.com/Forums/ie/en-US/f2a63a7e-dcd0-4d76-9824-94c8b81a3e9c/app-sdk-crash-in-iinternetprotocolimplunlockrequest?forum=ieextensiondevelopment for the detailed discussion.

Unfortunately, this version of PassthroughAPP generates a runtime assertion failure when using CComMultiThreadModel for the sink and protocol objects:
```C++
In ATL::CComSafeDeleteCriticalSection::Lock()
HRESULT Lock()
{
// CComSafeDeleteCriticalSection::Init or CComAutoDeleteCriticalSection::Init
// not called or failed.
// m_critsec member of CComObjectRootEx is now of type
// CComAutoDeleteCriticalSection. It has to be initialized
// by calling CComObjectRootEx::_AtlInitialConstruct
ATLASSUME(m_bInitialized);
return CComCriticalSection::Lock();
}
```
The reason is that calling _AtlInitialConstruct is needed in ATL version 8 (or higher) but is not called in the FinalConstruct function of the protocol and sink objects. This patch adds these calls.