Startup of the dynamic part of the engine sync
authorThomas
Thu, 08 Nov 2018 12:21:49 +0100
branchsync
changeset 322a0d12fc1ca68
parent 321 44315f9c6e4f
child 326 83b46d64c11d
Startup of the dynamic part of the engine
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Tue Oct 23 16:09:57 2018 +0200
     1.2 +++ b/CpEpEngine.cpp	Thu Nov 08 12:21:49 2018 +0100
     1.3 @@ -1469,3 +1469,19 @@
     1.4  
     1.5  	return S_OK;
     1.6  }
     1.7 +
     1.8 +STDMETHODIMP CpEpEngine::Startup()
     1.9 +{
    1.10 +	try
    1.11 +	{
    1.12 +		startup<CpEpEngine>(messageToSend, notifyHandshake, this, &CpEpEngine::Startup_sync, &CpEpEngine::Shutdown_sync);
    1.13 +	}
    1.14 +	catch (bad_alloc&) {
    1.15 +		return E_OUTOFMEMORY;
    1.16 +	}
    1.17 +	catch (exception& ex) {
    1.18 +		return FAIL(ex.what());
    1.19 +	}
    1.20 +
    1.21 +	return S_OK;
    1.22 +}
     2.1 --- a/CpEpEngine.h	Tue Oct 23 16:09:57 2018 +0200
     2.2 +++ b/CpEpEngine.h	Thu Nov 08 12:21:49 2018 +0100
     2.3 @@ -92,12 +92,10 @@
     2.4          catch (pEp::RuntimeError& e) {
     2.5              HRESULT res = MAKE_HRESULT(1, FACILITY_ITF, (0xFFFF & e.status));
     2.6              return res;
     2.7 -        }
     2.8 -
     2.9 -        startup<CpEpEngine>(messageToSend, notifyHandshake, this, &CpEpEngine::Startup_sync, &CpEpEngine::Shutdown_sync);
    2.10 +        }       
    2.11  
    2.12          ::register_examine_function(session(), CpEpEngine::examine_identity, (void *)this);
    2.13 -        ::log_event(session(), "Startup", "pEp COM Adapter", NULL, NULL);
    2.14 +        ::log_event(session(), "FinalConstruct", "pEp COM Adapter", NULL, NULL);
    2.15  
    2.16          return S_OK;
    2.17      }
    2.18 @@ -262,6 +260,8 @@
    2.19  
    2.20      // Trigger an immediate update
    2.21      STDMETHOD(UpdateNow)();
    2.22 +
    2.23 +	STDMETHOD(Startup)();
    2.24  };
    2.25  
    2.26  OBJECT_ENTRY_AUTO(__uuidof(pEpEngine), CpEpEngine)
     3.1 --- a/pEpCOMServerAdapter.idl	Tue Oct 23 16:09:57 2018 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Thu Nov 08 12:21:49 2018 +0100
     3.3 @@ -440,6 +440,9 @@
     3.4  
     3.5  	// Get a preview of the outgoint message rating
     3.6  	[id(41)] HRESULT OutgoingMessageRatingPreview([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
     3.7 +
     3.8 +	// Engine startup and shutdown
     3.9 +	[id(42)] HRESULT Startup();
    3.10  };
    3.11  
    3.12  [