CpEpEngine.h
branchsync
changeset 304 00916b0afaac
parent 297 a48f0545e221
child 307 eb5012d87405
     1.1 --- a/CpEpEngine.h	Sun Oct 21 22:50:54 2018 +0200
     1.2 +++ b/CpEpEngine.h	Mon Oct 22 10:14:50 2018 +0200
     1.3 @@ -87,7 +87,7 @@
     1.4          ::register_examine_function(session(), CpEpEngine::examine_identity, (void *)this);
     1.5          ::log_event(session(), "Startup", "pEp COM Adapter", NULL, NULL);
     1.6  
     1.7 -        startup<CpEpEngine>(messageToSend, notifyHandshake, messageToSend_sync, notifyHandshake_sync, this);
     1.8 +        startup<CpEpEngine>(messageToSend, notifyHandshake, messageToSend_sync, notifyHandshake_sync, this, &CpEpEngine::Startup_sync);
     1.9  
    1.10          return S_OK;
    1.11      }
    1.12 @@ -130,6 +130,13 @@
    1.13  
    1.14      static pEp::pc_container< MarshaledCallbacks, IpEpEngineCallbacks > sync_callbacks;
    1.15  
    1.16 +    void Startup_sync()
    1.17 +    {
    1.18 +        HRESULT r = CoInitializeEx(NULL, COINIT_MULTITHREADED);
    1.19 +        if (!SUCCEEDED(r))
    1.20 +            throw runtime_error("CoInitializeEx() failed on sync thread");
    1.21 +    }
    1.22 +
    1.23      atomic< identity_queue_t * > identity_queue;
    1.24      thread *keymanagement_thread;
    1.25      bool verbose_mode;