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.

154 lines
4.8 KiB

  1. /*
  2. * File: connobj.h
  3. *
  4. * implementation of Connection Object
  5. *
  6. * Revision History:
  7. *
  8. * 05/08/96 mikev created
  9. */
  10. #ifndef _CONNOBJ_H
  11. #define _CONNOBJ_H
  12. /*
  13. * Class definitions
  14. */
  15. class ImpIConnection : public IH323Endpoint
  16. {
  17. friend class CH323CallControl;
  18. public:
  19. STDMETHOD(QueryInterface(REFIID riid, LPVOID FAR * ppvObj));
  20. STDMETHOD_(ULONG,AddRef());
  21. STDMETHOD_(ULONG,Release());
  22. STDMETHOD( SetAdviseInterface(IH323ConfAdvise *pH323ConfAdvise));
  23. STDMETHOD( ClearAdviseInterface());
  24. STDMETHOD(PlaceCall(BOOL bUseGKResolution, PSOCKADDR_IN pCallAddr,
  25. P_H323ALIASLIST pDestinationAliases, P_H323ALIASLIST pExtraAliases,
  26. LPCWSTR pCalledPartyNumber, P_APP_CALL_SETUP_DATA pAppData));
  27. STDMETHOD( Disconnect());
  28. STDMETHOD( GetState(ConnectStateType *pState));
  29. STDMETHOD( GetRemoteUserName(LPWSTR lpwszName, UINT uSize));
  30. STDMETHOD( GetRemoteUserAddr(PSOCKADDR_IN psinUser));
  31. STDMETHOD( AcceptRejectConnection(THIS_ CREQ_RESPONSETYPE RejectReason));
  32. STDMETHOD_(HRESULT, GetSummaryCode());
  33. STDMETHOD( CreateCommChannel(THIS_ LPGUID pMediaGuid, ICommChannel **ppICommChannel,
  34. BOOL fSend));
  35. STDMETHOD ( ResolveFormats (LPGUID pMediaGuidArray, UINT uNumMedia,
  36. PRES_PAIR pResOutput));
  37. STDMETHOD(GetVersionInfo(
  38. PCC_VENDORINFO *ppLocalVendorInfo, PCC_VENDORINFO *ppRemoteVendorInfo));
  39. ImpIConnection();
  40. ~ImpIConnection(){};
  41. void Init(class CConnection FAR * pCon) {m_pConnection = pCon;};
  42. protected:
  43. CConnection *m_pConnection;
  44. };
  45. class CConnection :
  46. public IH323Endpoint,
  47. public IConfAdvise
  48. {
  49. friend class CH323CallControl;
  50. private:
  51. ImpIConnection m_ImpConnection;
  52. CH323CallControl *m_pH323CallControl;
  53. LPIH323PubCap m_pCapObject;
  54. protected:
  55. COBLIST m_ChannelList;
  56. COBLIST m_MemberList;
  57. UINT uRef;
  58. HRESULT hrLast;
  59. CConnection *next;
  60. BOOL m_fCapsReady;
  61. IH323ConfAdvise *m_pH323ConfAdvise;
  62. LPCTRL_USER_INFO m_pUserInfo;
  63. LPIControlChannel m_pControlChannel;
  64. HRESULT m_hSummaryCode; // best known reason for disconnect or reject
  65. public:
  66. virtual HRESULT Init(class CH323CallControl *pH323CallControl, GUID PIDofProtocolType);
  67. void DeInit(VOID) {m_pH323CallControl = NULL;};
  68. CConnection();
  69. ~CConnection();
  70. protected:
  71. ConnectStateType m_ConnectionState;
  72. VOID DoControlNotification(DWORD dwStatus);
  73. public:
  74. BOOL ListenOn(PORT Port);
  75. VOID Disconnect(DWORD dwResponse);
  76. HRESULT CloseAllChannels();
  77. VOID NewUserInfo(LPCTRL_USER_INFO lpNewUserInfo);
  78. public:
  79. LPIControlChannel GetControlChannel( ){return m_pControlChannel;};
  80. VOID ReleaseAllChannels();
  81. STDMETHOD(GetLocalPort(PORT *lpPort));
  82. STDMETHOD (OnCallIncomplete (
  83. LPIControlChannel lpControlObject,
  84. HRESULT hIncompleteCode));
  85. VOID SummaryCode(HRESULT hCode);
  86. // IConfAdvise interface methods
  87. //
  88. STDMETHOD(OnControlEvent(DWORD dwEvent, LPVOID lpvData, LPIControlChannel lpControlObject));
  89. STDMETHOD(GetCapResolver(LPVOID *lplpCapObject, GUID CapType));
  90. STDMETHOD_(LPWSTR, GetUserDisplayName());
  91. STDMETHOD_(PCC_ALIASITEM, GetUserDisplayAlias());
  92. STDMETHOD_(PCC_ALIASNAMES, GetUserAliases());
  93. STDMETHOD_( CREQ_RESPONSETYPE, FilterConnectionRequest(
  94. LPIControlChannel lpControlChannel, P_APP_CALL_SETUP_DATA pAppData));
  95. STDMETHOD(GetAcceptingObject(LPIControlChannel *lplpAcceptingObject,
  96. LPGUID pPID));
  97. STDMETHOD(FindAcceptingObject(LPIControlChannel *lplpAcceptingObject,
  98. LPVOID lpvConfID));
  99. STDMETHOD_(IH323Endpoint *, GetIConnIF()) {return &m_ImpConnection;};
  100. STDMETHOD (AddCommChannel (ICtrlCommChan *pChan));
  101. // Shared IIntConn/IConnection interface methods
  102. STDMETHOD( Disconnect());
  103. // IConnection interface methods
  104. STDMETHOD(QueryInterface(REFIID riid, LPVOID FAR * ppvObj));
  105. STDMETHOD_(ULONG, AddRef());
  106. STDMETHOD_(ULONG, Release());
  107. STDMETHOD( SetAdviseInterface(IH323ConfAdvise *pH323ConfAdvise));
  108. STDMETHOD( ClearAdviseInterface());
  109. STDMETHOD(PlaceCall(BOOL bUseGKResolution, PSOCKADDR_IN pCallAddr,
  110. P_H323ALIASLIST pDestinationAliases, P_H323ALIASLIST pExtraAliases,
  111. LPCWSTR pCalledPartyNumber, P_APP_CALL_SETUP_DATA pAppData));
  112. STDMETHOD( GetState(ConnectStateType *pState));
  113. STDMETHOD( GetRemoteUserName(LPWSTR lpwszName, UINT uSize));
  114. STDMETHOD( GetRemoteUserAddr(THIS_ PSOCKADDR_IN psinUser));
  115. STDMETHOD( AcceptRejectConnection(THIS_ CREQ_RESPONSETYPE RejectReason));
  116. STDMETHOD( GetSummaryCode());
  117. STDMETHOD( CreateCommChannel(THIS_ LPGUID pMediaGuid, ICommChannel **ppICommChannel,
  118. BOOL fSend));
  119. STDMETHOD ( ResolveFormats (LPGUID pMediaGuidArray, UINT uNumMedia,
  120. PRES_PAIR pResOutput));
  121. STDMETHOD(GetVersionInfo(
  122. PCC_VENDORINFO *ppLocalVendorInfo, PCC_VENDORINFO *ppRemoteVendorInfo));
  123. };
  124. #endif // _CONNOBJ_H