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.

163 lines
2.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997 - 2000
  5. //
  6. // File: H N A P P P R T . H
  7. //
  8. // Contents: CHNetAppProtocol declarations
  9. //
  10. // Notes:
  11. //
  12. // Author: jonburs 21 June 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. class ATL_NO_VTABLE CHNetAppProtocol :
  17. public CComObjectRootEx<CComMultiThreadModel>,
  18. public IHNetApplicationProtocol
  19. {
  20. private:
  21. //
  22. // IWbemServices for our namespace
  23. //
  24. IWbemServices *m_piwsHomenet;
  25. //
  26. // Path to WMI instance
  27. //
  28. BSTR m_bstrProtocol;
  29. //
  30. // True if this is a built-in protocol. We cache
  31. // this value as it will be used quite often, and
  32. // will never change for the instance.
  33. //
  34. BOOLEAN m_fBuiltIn;
  35. //
  36. // Obtains the protocol object from the stored path
  37. //
  38. HRESULT
  39. GetProtocolObject(
  40. IWbemClassObject **ppwcoInstance
  41. );
  42. public:
  43. BEGIN_COM_MAP(CHNetAppProtocol)
  44. COM_INTERFACE_ENTRY(IHNetApplicationProtocol)
  45. END_COM_MAP()
  46. DECLARE_PROTECT_FINAL_CONSTRUCT()
  47. //
  48. // Inline constructor.
  49. //
  50. CHNetAppProtocol()
  51. {
  52. m_piwsHomenet = NULL;
  53. m_bstrProtocol = NULL;
  54. m_fBuiltIn = FALSE;
  55. };
  56. //
  57. // Atl methods
  58. //
  59. HRESULT
  60. FinalRelease();
  61. //
  62. // Object initialization
  63. //
  64. HRESULT
  65. Initialize(
  66. IWbemServices *piwsNamespace,
  67. IWbemClassObject *pwcoInstance
  68. );
  69. //
  70. // IHNetApplicationProtocol methods
  71. //
  72. STDMETHODIMP
  73. GetName(
  74. OLECHAR **ppszwName
  75. );
  76. STDMETHODIMP
  77. SetName(
  78. OLECHAR *pszwName
  79. );
  80. STDMETHODIMP
  81. GetOutgoingIPProtocol(
  82. UCHAR *pucProtocol
  83. );
  84. STDMETHODIMP
  85. SetOutgoingIPProtocol(
  86. UCHAR ucProtocol
  87. );
  88. STDMETHODIMP
  89. GetOutgoingPort(
  90. USHORT *pusPort
  91. );
  92. STDMETHODIMP
  93. SetOutgoingPort(
  94. USHORT usPort
  95. );
  96. STDMETHODIMP
  97. GetResponseRanges(
  98. USHORT *puscResponses,
  99. HNET_RESPONSE_RANGE *prgResponseRange[]
  100. );
  101. STDMETHODIMP
  102. SetResponseRanges(
  103. USHORT uscResponses,
  104. HNET_RESPONSE_RANGE rgResponseRange[]
  105. );
  106. STDMETHODIMP
  107. GetBuiltIn(
  108. BOOLEAN *pfBuiltIn
  109. );
  110. STDMETHODIMP
  111. GetEnabled(
  112. BOOLEAN *pfEnabled
  113. );
  114. STDMETHODIMP
  115. SetEnabled(
  116. BOOLEAN fEnable
  117. );
  118. STDMETHODIMP
  119. Delete();
  120. };
  121. //
  122. // Type to use for our enumeration class
  123. //
  124. typedef CHNCEnum<
  125. IEnumHNetApplicationProtocols,
  126. IHNetApplicationProtocol,
  127. CHNetAppProtocol
  128. >
  129. CEnumHNetApplicationProtocols;