Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.6 KiB

  1. // SAFIntercomServer.h : Declaration of the CSAFIntercomServer
  2. #ifndef __SAFIntercomServer_H_
  3. #define __SAFIntercomServer_H_
  4. //JP:not in connectivitylib.h//#include "resource.h" // main symbols
  5. #include <MPC_COM.h>
  6. #include <MPC_Utils.h>
  7. #include <rtccore.h>
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CSAFIntercomServer
  10. class ATL_NO_VTABLE CSAFIntercomServer : // Hungarian safi
  11. public IDispatchImpl < ISAFIntercomServer, &IID_ISAFIntercomServer, &LIBID_HelpCenterTypeLib >,
  12. public MPC::ConnectionPointImpl< CSAFIntercomServer, &DIID_DSAFIntercomServerEvents, MPC::CComSafeMultiThreadModel >,
  13. public IRTCEventNotification
  14. {
  15. private:
  16. CComPtr<IRTCClient> m_pRTCClient;
  17. CComPtr<IRTCSession> m_pRTCSession;
  18. DWORD m_dwSinkCookie;
  19. BOOL m_bInit;
  20. BOOL m_bRTCInit;
  21. BOOL m_bAdvised;
  22. BOOL m_bOnCall;
  23. CComBSTR m_bstrKey;
  24. int m_iSamplingRate;
  25. CComPtr<IDispatch> m_sink_onVoiceConnected;
  26. CComPtr<IDispatch> m_sink_onVoiceDisconnected;
  27. CComPtr<IDispatch> m_sink_onVoiceDisabled;
  28. HRESULT Fire_onVoiceConnected (ISAFIntercomServer * safe);
  29. HRESULT Fire_onVoiceDisconnected (ISAFIntercomServer * safe);
  30. HRESULT Fire_onVoiceDisabled (ISAFIntercomServer * safe);
  31. // Worker functions
  32. HRESULT Init();
  33. HRESULT Cleanup();
  34. DWORD GenerateRandomString(DWORD dwSizeRandomSeed, BSTR *pBstr);
  35. DWORD GenerateRandomBytes(DWORD dwSize, LPBYTE pbBuffer);
  36. public:
  37. CSAFIntercomServer();
  38. ~CSAFIntercomServer();
  39. //DECLARE_PROTECT_FINAL_CONSTRUCT() // TODO: JP: Do we need this here?
  40. BEGIN_COM_MAP(CSAFIntercomServer)
  41. COM_INTERFACE_ENTRY(ISAFIntercomServer)
  42. COM_INTERFACE_ENTRY(IDispatch)
  43. COM_INTERFACE_ENTRY(IRTCEventNotification)
  44. END_COM_MAP()
  45. // ISAFIntercomServer
  46. public:
  47. STDMETHOD(Listen)(/* out, retval */ BSTR * pVal);
  48. STDMETHOD(Disconnect)();
  49. STDMETHOD(RunSetupWizard)();
  50. STDMETHOD(Exit)();
  51. STDMETHOD(put_onVoiceConnected) (/* in */ IDispatch * function);
  52. STDMETHOD(put_onVoiceDisconnected) (/* in */ IDispatch * function);
  53. STDMETHOD(put_onVoiceDisabled) (/* in */ IDispatch * function);
  54. STDMETHOD(put_SamplingRate) (/* in */ LONG newVal);
  55. STDMETHOD(get_SamplingRate) (/* out, retval */ LONG * pVal);
  56. // IRTCEventNotification
  57. STDMETHOD(Event)( RTC_EVENT RTCEvent, IDispatch * pEvent );
  58. HRESULT OnSessionChange(IRTCSession *pSession,
  59. RTC_SESSION_STATE nState,
  60. HRESULT ResCode);
  61. HRESULT onMediaEvent(IRTCMediaEvent * pMedEvent);
  62. };
  63. #endif //__SAFINTERCOMCLIENT_H_