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.

132 lines
2.9 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 = 40;
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CIPConfMSP
  20. /////////////////////////////////////////////////////////////////////////////
  21. class ATL_NO_VTABLE CIPConfMSP :
  22. public CMSPAddress,
  23. public CComCoClass<CIPConfMSP, &CLSID_IPConfMSP>,
  24. public CMSPObjectSafetyImpl
  25. {
  26. public:
  27. DECLARE_REGISTRY_RESOURCEID(IDR_IPCONFMSP)
  28. DECLARE_POLY_AGGREGATABLE(CIPConfMSP)
  29. public:
  30. BEGIN_COM_MAP(CIPConfMSP)
  31. COM_INTERFACE_ENTRY(IObjectSafety)
  32. COM_INTERFACE_ENTRY_CHAIN(CMSPAddress)
  33. END_COM_MAP()
  34. CIPConfMSP()
  35. : m_dwIPInterface(INADDR_ANY),
  36. m_hSocket(NULL)
  37. {}
  38. HRESULT FinalConstruct();
  39. void FinalRelease();
  40. DWORD FindLocalInterface(DWORD dwIP);
  41. STDMETHOD (CreateTerminal) (
  42. IN BSTR pTerminalClass,
  43. IN long lMediaType,
  44. IN TERMINAL_DIRECTION Direction,
  45. OUT ITTerminal ** ppTerminal
  46. );
  47. STDMETHOD (CreateMSPCall) (
  48. IN MSP_HANDLE htCall,
  49. IN DWORD dwReserved,
  50. IN DWORD dwMediaType,
  51. IN IUnknown * pOuterUnknown,
  52. OUT IUnknown ** ppMSPCall
  53. );
  54. STDMETHOD (ShutdownMSPCall) (
  55. IN IUnknown * pMSPCall
  56. );
  57. ULONG MSPAddressAddRef(void);
  58. ULONG MSPAddressRelease(void);
  59. #ifdef USEIPADDRTABLE
  60. STDMETHOD (get_DefaultIPInterface) (
  61. OUT BSTR * ppIPAddress
  62. );
  63. STDMETHOD (put_DefaultIPInterface) (
  64. IN BSTR pIPAddress
  65. );
  66. STDMETHOD (get_IPInterfaces) (
  67. OUT VARIANT * pVariant
  68. );
  69. STDMETHOD (EnumerateIPInterfaces) (
  70. OUT IEnumBstr ** ppIEnumBstr
  71. );
  72. #endif
  73. protected:
  74. DWORD GetCallMediaTypes(void);
  75. protected:
  76. // the default interface to join the conference.
  77. DWORD m_dwIPInterface;
  78. // the critical section to protect the local data.
  79. CMSPCritSection m_Lock;
  80. SOCKET m_hSocket;
  81. };
  82. #ifdef USEIPADDRTABLE
  83. /////////////////////////////////////////////////////////////////////////////
  84. // _CopyBSTR is used in creating BSTR enumerators.
  85. /////////////////////////////////////////////////////////////////////////////
  86. class _CopyBSTR
  87. {
  88. public:
  89. static void copy(BSTR *p1, BSTR *p2)
  90. {
  91. (*p1) = SysAllocString(*p2);
  92. }
  93. static void init(BSTR* p) {*p = NULL;}
  94. static void destroy(BSTR* p) { SysFreeString(*p);}
  95. };
  96. #endif
  97. #endif //__CONFADDR_H_