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.

144 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. confaddr.h
  5. Abstract:
  6. Declaration of the CIPConfMSP
  7. Author:
  8. Mu Han (muhan) 1-November-1997
  9. --*/
  10. #ifndef __CONFADDR_H_
  11. #define __CONFADDR_H_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #include "resource.h"
  16. const DWORD IPCONFCALLMEDIATYPES = (TAPIMEDIATYPE_AUDIO | TAPIMEDIATYPE_VIDEO);
  17. const DWORD MAXIPADDRLEN = 255;
  18. extern const GUID CLSID_IPConfMSP;
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CIPConfMSP
  21. /////////////////////////////////////////////////////////////////////////////
  22. class ATL_NO_VTABLE CIPConfMSP :
  23. public CMSPAddress,
  24. public CComCoClass<CIPConfMSP, &CLSID_IPConfMSP>,
  25. public CMSPObjectSafetyImpl
  26. {
  27. public:
  28. DECLARE_REGISTRY_RESOURCEID(IDR_IPCONFMSP)
  29. DECLARE_POLY_AGGREGATABLE(CIPConfMSP)
  30. public:
  31. BEGIN_COM_MAP(CIPConfMSP)
  32. COM_INTERFACE_ENTRY(IObjectSafety)
  33. COM_INTERFACE_ENTRY_CHAIN(CMSPAddress)
  34. END_COM_MAP()
  35. CIPConfMSP()
  36. : m_dwIPInterface(INADDR_ANY),
  37. m_hSocket(NULL),
  38. m_hDxmrtp(NULL)
  39. {}
  40. HRESULT FinalConstruct();
  41. void FinalRelease();
  42. DWORD FindLocalInterface(DWORD dwIP);
  43. STDMETHOD (CreateTerminal) (
  44. IN BSTR pTerminalClass,
  45. IN long lMediaType,
  46. IN TERMINAL_DIRECTION Direction,
  47. OUT ITTerminal ** ppTerminal
  48. );
  49. STDMETHOD (CreateMSPCall) (
  50. IN MSP_HANDLE htCall,
  51. IN DWORD dwReserved,
  52. IN DWORD dwMediaType,
  53. IN IUnknown * pOuterUnknown,
  54. OUT IUnknown ** ppMSPCall
  55. );
  56. STDMETHOD (ShutdownMSPCall) (
  57. IN IUnknown * pMSPCall
  58. );
  59. ULONG MSPAddressAddRef(void);
  60. ULONG MSPAddressRelease(void);
  61. #ifdef USEIPADDRTABLE
  62. STDMETHOD (get_DefaultIPInterface) (
  63. OUT BSTR * ppIPAddress
  64. );
  65. STDMETHOD (put_DefaultIPInterface) (
  66. IN BSTR pIPAddress
  67. );
  68. STDMETHOD (get_IPInterfaces) (
  69. OUT VARIANT * pVariant
  70. );
  71. STDMETHOD (EnumerateIPInterfaces) (
  72. OUT IEnumBstr ** ppIEnumBstr
  73. );
  74. #endif
  75. protected:
  76. DWORD GetCallMediaTypes(void);
  77. HRESULT CreateAudioCaptureTerminals();
  78. HRESULT CreateAudioRenderTerminals();
  79. HRESULT CreateVideoCaptureTerminals();
  80. HRESULT UpdateTerminalList(void);
  81. HRESULT UpdateTerminalListForPnp(IN BOOL bDeviceArrival);
  82. protected:
  83. // the default interface to join the conference.
  84. DWORD m_dwIPInterface;
  85. // the critical section to protect the local data.
  86. CMSPCritSection m_Lock;
  87. SOCKET m_hSocket;
  88. HMODULE m_hDxmrtp;
  89. };
  90. #ifdef USEIPADDRTABLE
  91. /////////////////////////////////////////////////////////////////////////////
  92. // _CopyBSTR is used in creating BSTR enumerators.
  93. /////////////////////////////////////////////////////////////////////////////
  94. class _CopyBSTR
  95. {
  96. public:
  97. static void copy(BSTR *p1, BSTR *p2)
  98. {
  99. (*p1) = SysAllocString(*p2);
  100. }
  101. static void init(BSTR* p) {*p = NULL;}
  102. static void destroy(BSTR* p) { SysFreeString(*p);}
  103. };
  104. #endif
  105. #endif //__CONFADDR_H_