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.

203 lines
7.0 KiB

  1. #ifndef _IMANAGER_H_
  2. #define _IMANAGER_H_
  3. #include "confqos.h"
  4. #include <ias.h>
  5. #include "SDKInternal.h"
  6. extern GUID g_csguidSecurity;
  7. extern GUID g_csguidUserString;
  8. extern GUID g_csguidNodeIdTag;
  9. extern GUID g_guidLocalNodeId;
  10. class COutgoingCall;
  11. class COutgoingCallManager;
  12. class CIncomingCallManager;
  13. class CConfObject;
  14. class CRosterInfo;
  15. class CQoS;
  16. class CNmSysInfo;
  17. class COprahNCUI : public RefCount, public INodeControllerEvents, public CH323ConnEvent,
  18. public INmManager2, public CConnectionPointContainer,
  19. public IH323ConfAdvise
  20. {
  21. friend CNmSysInfo;
  22. protected:
  23. static COprahNCUI *m_pOprahNCUI;
  24. COutgoingCallManager* m_pOutgoingCallManager;
  25. CIncomingCallManager* m_pIncomingCallManager;
  26. CNmSysInfo* m_pSysInfo;
  27. CConfObject* m_pConfObject;
  28. HWND m_hwnd;
  29. UINT m_uCaps;
  30. CQoS * m_pQoS; // The quality of service object
  31. INmChannelVideo * m_pPreviewChannel;
  32. static VOID CALLBACK AudioConnectResponse( LPVOID pContext1,
  33. LPVOID pContext2,
  34. DWORD dwFlags);
  35. static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg,
  36. WPARAM wParam, LPARAM lParam);
  37. BOOL m_fAllowAV;
  38. IH323Endpoint* m_pAVConnection;
  39. public:
  40. COprahNCUI(OBJECTDESTROYEDPROC ObjectDestroyed);
  41. ~COprahNCUI();
  42. BSTR GetUserName();
  43. UINT GetOutgoingCallCount();
  44. BOOL GetULSName(CRosterInfo *pri);
  45. VOID GetRosterInfo(CRosterInfo *pri);
  46. ULONG GetRosterCaps();
  47. ULONG GetAuthenticatedName(PBYTE * ppb);
  48. VOID OnOutgoingCallCreated(INmCall* pCall);
  49. VOID OnOutgoingCallCanceled(COutgoingCall* pCall);
  50. VOID OnIncomingCallAccepted();
  51. VOID OnIncomingCallCreated(INmCall* pCall);
  52. BOOL AcquireAV(IH323Endpoint* pConnection);
  53. BOOL ReleaseAV(IH323Endpoint* pConnection);
  54. BOOL IsOwnerOfAV(IH323Endpoint* pConnection) { return m_pAVConnection == pConnection; }
  55. VOID CancelCalls();
  56. BOOL IsAudioAllowed() { return m_fAllowAV && (m_uCaps & (CAPFLAG_SEND_AUDIO | CAPFLAG_RECV_AUDIO)); }
  57. BOOL IsReceiveVideoAllowed() { return m_fAllowAV && (m_uCaps & CAPFLAG_RECV_VIDEO); }
  58. BOOL IsSendVideoAllowed() { return m_fAllowAV && (m_uCaps & CAPFLAG_SEND_VIDEO); }
  59. BOOL IsH323Enabled() { return m_uCaps & CAPFLAG_H323_CC; }
  60. CREQ_RESPONSETYPE OnH323IncomingCall(IH323Endpoint* pConn, P_APP_CALL_SETUP_DATA lpvMNMData);
  61. //
  62. // IH323ConfAdvise methods
  63. //
  64. STDMETHODIMP CallEvent (IH323Endpoint * lpConnection, DWORD dwStatus);
  65. STDMETHODIMP ChannelEvent (ICommChannel *pIChannel,
  66. IH323Endpoint * lpConnection, DWORD dwStatus );
  67. STDMETHODIMP GetMediaChannel (GUID *pmediaID,
  68. BOOL bSendDirection, IMediaChannel **ppI);
  69. VOID _ChannelEvent ( ICommChannel *pIChannel,
  70. IH323Endpoint * lpConnection,
  71. DWORD dwStatus);
  72. // H323 Connection events from H323UI:
  73. VOID OnH323Connected(IH323Endpoint * lpConnection);
  74. VOID OnH323Disconnected(IH323Endpoint * lpConnection);
  75. // Audio Conferencing events from H323UI:
  76. VOID OnAudioChannelStatus(ICommChannel *pIChannel,
  77. IH323Endpoint * lpConnection, DWORD dwStatus);
  78. // Video Conferencing events from H323UI:
  79. VOID OnVideoChannelStatus(ICommChannel *pIChannel,
  80. IH323Endpoint * lpConnection, DWORD dwStatus);
  81. // T.120 events from H323UI
  82. VOID OnT120ChannelOpen(ICommChannel *pIChannel, IH323Endpoint * lpConnection, DWORD dwStatus);
  83. static COprahNCUI *GetInstance() { return m_pOprahNCUI; }
  84. CConfObject *GetConfObject() { return m_pConfObject; }
  85. VOID SetBandwidth(UINT uBandwidth) { if (NULL != m_pQoS) m_pQoS->SetBandwidth(uBandwidth); }
  86. HRESULT AbortResolve(UINT uAsyncRequest);
  87. //
  88. // INodeControllerEvents methods:
  89. //
  90. STDMETHODIMP OnConferenceStarted( CONF_HANDLE hConference,
  91. HRESULT hResult);
  92. STDMETHODIMP OnConferenceEnded( CONF_HANDLE hConference);
  93. STDMETHODIMP OnRosterChanged( CONF_HANDLE hConference,
  94. PNC_ROSTER pRoster);
  95. STDMETHODIMP OnIncomingInviteRequest( CONF_HANDLE hConference,
  96. PCWSTR pcwszNodeName,
  97. PT120PRODUCTVERSION pRequestorVersion,
  98. PUSERDATAINFO pUserDataInfoEntries,
  99. UINT cUserDataEntries,
  100. BOOL fSecure);
  101. STDMETHODIMP OnIncomingJoinRequest( CONF_HANDLE hConference,
  102. PCWSTR pcwszNodeName,
  103. PT120PRODUCTVERSION pRequestorVersion,
  104. PUSERDATAINFO pUserDataInfoEntries,
  105. UINT cUserDataEntries);
  106. STDMETHODIMP OnQueryRemoteResult( PVOID pvCallerContext,
  107. HRESULT hResult,
  108. BOOL fMCU,
  109. PWSTR* ppwszConferenceNames,
  110. PT120PRODUCTVERSION pVersion,
  111. PWSTR* ppwszConfDescriptors);
  112. STDMETHODIMP OnInviteResult( CONF_HANDLE hConference,
  113. REQUEST_HANDLE hRequest,
  114. UINT uNodeID,
  115. HRESULT hResult,
  116. PT120PRODUCTVERSION pVersion);
  117. STDMETHODIMP OnUpdateUserData( CONF_HANDLE hConference);
  118. //
  119. // INmManager methods
  120. //
  121. STDMETHODIMP_(ULONG) AddRef(void);
  122. STDMETHODIMP_(ULONG) Release(void);
  123. STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppvObj);
  124. STDMETHODIMP Initialize(ULONG *puOptions, ULONG *puchCaps);
  125. STDMETHODIMP GetSysInfo(INmSysInfo **ppSysInfo);
  126. STDMETHODIMP EnumConference(IEnumNmConference **ppEnum);
  127. STDMETHODIMP CreateConference(INmConference **ppConference,
  128. BSTR bstrName,
  129. BSTR bstrPassword,
  130. ULONG uchCaps);
  131. STDMETHODIMP EnumCall(IEnumNmCall **ppEnum);
  132. STDMETHODIMP CreateCall(INmCall **ppCall,
  133. NM_CALL_TYPE callType,
  134. NM_ADDR_TYPE addrType,
  135. BSTR bstrAddr,
  136. INmConference *pConference);
  137. STDMETHODIMP CallConference(INmCall **ppCall,
  138. NM_CALL_TYPE callType,
  139. NM_ADDR_TYPE addrType,
  140. BSTR bstrAddr,
  141. BSTR bstrName,
  142. BSTR bstrPassword);
  143. //
  144. // INmManager2 methods
  145. //
  146. STDMETHODIMP GetPreviewChannel(INmChannelVideo **ppChannelVideo);
  147. STDMETHODIMP CreateASObject(IUnknown * pNotify, ULONG flags, IUnknown ** ppAS);
  148. STDMETHODIMP AllowH323(BOOL fAllow);
  149. STDMETHODIMP CallEx(INmCall **ppCall,
  150. DWORD dwFlags,
  151. NM_ADDR_TYPE addrType,
  152. BSTR bstrName,
  153. BSTR bstrSetup,
  154. BSTR bstrDest,
  155. BSTR bstrAlias,
  156. BSTR bstrURL,
  157. BSTR userData,
  158. BSTR bstrConference,
  159. BSTR bstrPassword);
  160. STDMETHODIMP CreateConferenceEx(INmConference **ppConference,
  161. BSTR bstrName,
  162. BSTR bstrPassword,
  163. DWORD dwTypeFlags,
  164. DWORD attendeePermissions,
  165. DWORD maxParticipants);
  166. };
  167. // The global instance that is declared in conf.cpp:
  168. extern INodeController* g_pNodeController;
  169. // The GUID is declared in opncui.cpp:
  170. extern GUID g_csguidRosterCaps;
  171. extern SOCKADDR_IN g_sinGateKeeper;
  172. HRESULT OnNotifyCallStateChanged(IUnknown *pCallNotify, PVOID pv, REFIID riid);
  173. typedef BOOL (WINAPI * PFNGETUSERSECURITYINFO) (DWORD dwGCCID, PBYTE pInfo, PDWORD pcbInfo);
  174. typedef DWORD (WINAPI * PFNPROCESSSECURITYDATA) ( DWORD dwCode, DWORD dwParam1, DWORD dwParam2 );
  175. #endif // _IMANAGER_H_