Debug / test code for events and callbacks. Experimental_Callback_Events
authorMarkus Schaber <markus@pep-security.net>
Sat, 28 May 2016 21:02:06 +0200
branchExperimental_Callback_Events
changeset 858939007c795b
parent 84 ec2e6174b307
child 95 b924fbb97a9e
Debug / test code for events and callbacks.
CpEpEngine.cpp
_IpEpEngineEvents_CP.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Thu May 26 00:11:36 2016 +0200
     1.2 +++ b/CpEpEngine.cpp	Sat May 28 21:02:06 2016 +0200
     1.3 @@ -812,9 +812,11 @@
     1.4          return E_OUTOFMEMORY;
     1.5  
     1.6  	// DEBUG CODE - REMOVE BEFORE RELEASE!
     1.7 -	//sync_handshake_result_s handshakeResult;
     1.8 +	// sync_handshake_result_s handshakeResult;
     1.9  	//
    1.10 -	//HRESULT res = Fire_ShowHandshake(ident, result, &handshakeResult);
    1.11 +	// HRESULT res = Fire_ShowHandshake(ident, result, &handshakeResult);
    1.12 +	// 
    1.13 +	// HRESULT res2 = Fire_TestEvent(15, _bstr_t( "hallo"));
    1.14  
    1.15      PEP_STATUS status = ::myself(get_session(), _ident);
    1.16  
     2.1 --- a/_IpEpEngineEvents_CP.h	Thu May 26 00:11:36 2016 +0200
     2.2 +++ b/_IpEpEngineEvents_CP.h	Sat May 28 21:02:06 2016 +0200
     2.3 @@ -5,5 +5,36 @@
     2.4  	public ATL::IConnectionPointImpl<T, &__uuidof(_IpEpEngineEvents)>
     2.5  {
     2.6  public:
     2.7 +
     2.8 +	/* Test code - remove before shipping 
     2.9 +	HRESULT Fire_TestEvent(LONG test, BSTR testtest)
    2.10 +	{
    2.11 +		HRESULT hr = S_OK;
    2.12 +		T * pThis = static_cast<T *>(this);
    2.13 +		int cConnections = m_vec.GetSize();
    2.14 +
    2.15 +		for (int iConnection = 0; iConnection < cConnections; iConnection++)
    2.16 +		{
    2.17 +			pThis->Lock();
    2.18 +			CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
    2.19 +			pThis->Unlock();
    2.20 +
    2.21 +			IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
    2.22 +
    2.23 +			if (pConnection)
    2.24 +			{
    2.25 +				CComVariant avarParams[2];
    2.26 +				avarParams[1] = test;
    2.27 +				avarParams[1].vt = VT_I4;
    2.28 +				avarParams[0] = testtest;
    2.29 +				avarParams[0].vt = VT_BSTR;
    2.30 +				CComVariant varResult;
    2.31 +
    2.32 +				DISPPARAMS params = { avarParams, NULL, 2, 0 };
    2.33 +				hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, &varResult, NULL, NULL);
    2.34 +			}
    2.35 +		}
    2.36 +		return hr;
    2.37 +	}*/
    2.38  };
    2.39  
     3.1 --- a/pEpCOMServerAdapter.idl	Thu May 26 00:11:36 2016 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Sat May 28 21:02:06 2016 +0200
     3.3 @@ -302,7 +302,9 @@
     3.4      {
     3.5      properties:
     3.6      methods:
     3.7 -    };
     3.8 +		// test code - remove before shipping
     3.9 +		// [id(1)] HRESULT TestEvent([in] LONG test,[in] BSTR testtest);
    3.10 +	};
    3.11      [
    3.12          uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
    3.13      ]