Source code of Windows XP (NT5)
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.

81 lines
2.6 KiB

  1. #ifndef __NmChannelData_h__
  2. #define __NmChannelData_h__
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CNmChannelDataObj
  5. class ATL_NO_VTABLE CNmChannelDataObj :
  6. public CComObjectRootEx<CComSingleThreadModel>,
  7. public IConnectionPointContainerImpl<CNmChannelDataObj>,
  8. public IConnectionPointImpl<CNmChannelDataObj, &IID_INmChannelNotify, CComDynamicUnkArray>,
  9. public IConnectionPointImpl<CNmChannelDataObj, &IID_INmChannelDataNotify, CComDynamicUnkArray>,
  10. public INmChannelData2,
  11. public INmChannelDataNotify2,
  12. public IInternalChannelObj
  13. {
  14. protected:
  15. CComPtr<INmChannelData> m_spInternalINmChannelData;
  16. DWORD m_dwInternalAdviseCookie;
  17. public:
  18. DECLARE_NO_REGISTRY()
  19. DECLARE_NOT_AGGREGATABLE(CNmChannelDataObj)
  20. BEGIN_COM_MAP(CNmChannelDataObj)
  21. COM_INTERFACE_ENTRY(INmChannel)
  22. COM_INTERFACE_ENTRY(INmChannelData)
  23. COM_INTERFACE_ENTRY(INmChannelData2)
  24. COM_INTERFACE_ENTRY(INmChannelNotify)
  25. COM_INTERFACE_ENTRY(INmChannelDataNotify)
  26. COM_INTERFACE_ENTRY(INmChannelDataNotify2)
  27. COM_INTERFACE_ENTRY(IInternalChannelObj)
  28. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  29. END_COM_MAP()
  30. BEGIN_CONNECTION_POINT_MAP(CNmChannelDataObj)
  31. CONNECTION_POINT_ENTRY(IID_INmChannelNotify)
  32. CONNECTION_POINT_ENTRY(IID_INmChannelDataNotify)
  33. END_CONNECTION_POINT_MAP()
  34. // Construction and destruection
  35. CNmChannelDataObj();
  36. ~CNmChannelDataObj();
  37. HRESULT FinalConstruct();
  38. ULONG InternalRelease();
  39. static HRESULT CreateInstance(CNmConferenceObj* pConfObj, INmChannel* pInternalINmChannel, INmChannel** ppChannel);
  40. // INmChannelData methods
  41. STDMETHOD(GetGuid)(GUID *pguid);
  42. STDMETHOD(SendData)(INmMember *pMember, ULONG uSize, byte *pvBuffer, ULONG uOptions);
  43. // INmChannelData2 methods
  44. STDMETHOD(RegistryAllocateHandle)(ULONG numberOfHandlesRequested);
  45. //INmChannelDataNotify
  46. STDMETHOD(DataSent)(INmMember *pMember, ULONG uSize,byte *pvBuffer);
  47. STDMETHOD(DataReceived)(INmMember *pInternalMember,ULONG uSize,byte *pvBuffer, ULONG dwFlags);
  48. STDMETHOD(AllocateHandleConfirm)(ULONG handle_value, ULONG chandles);
  49. // IInternalChannelObj methods
  50. STDMETHOD(GetInternalINmChannel)(INmChannel** ppChannel);
  51. STDMETHOD(ChannelRemoved)();
  52. // Helpers
  53. HRESULT Fire_MemberChanged(NM_MEMBER_NOTIFY uNotify, INmMember *pMember);
  54. HRESULT Fire_DataSent(INmMember *pSDKMember, ULONG uSize,byte *pvBuffer);
  55. HRESULT Fire_DataReceived(INmMember *pSDKMember, ULONG uSize, byte *pvBuffer, ULONG dwFlags);
  56. void _OnActivate(bool bActive) {;}
  57. virtual CNmConferenceObj* GetConfObj() = 0;
  58. virtual void RemoveMembers() = 0;
  59. virtual BOOL GetbActive() = 0;
  60. HRESULT _IsActive();
  61. HRESULT _SetActive(BOOL bActive);
  62. };
  63. #endif // __NmChannelData_h__