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.

183 lines
4.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999.
  5. //
  6. // File: I C O M P . H
  7. //
  8. // Contents: Implements the INetCfgComponent COM interface.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 15 Jan 1999
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "comp.h"
  17. #include "iatl.h"
  18. #include "inetcfg.h"
  19. #include "netcfgx.h"
  20. #include "stable.h"
  21. HRESULT
  22. HrIsValidINetCfgComponent (
  23. IN INetCfgComponent* pICompInterface);
  24. CComponent*
  25. PComponentFromComInterface (
  26. IN INetCfgComponent* pICompInterface);
  27. //+---------------------------------------------------------------------------
  28. // INetCfgComponent -
  29. //
  30. class ATL_NO_VTABLE CImplINetCfgComponent :
  31. public CImplINetCfgHolder,
  32. public INetCfgComponent,
  33. public INetCfgComponentBindings,
  34. public INetCfgComponentPrivate
  35. {
  36. friend class CImplINetCfg;
  37. friend class CImplINetCfgClass;
  38. friend class CImplINetCfgBindingInterface;
  39. friend class CImplINetCfgBindingPath;
  40. friend class CComponent;
  41. friend CComponent* PComponentFromComInterface (
  42. IN INetCfgComponent* pICompInterface);
  43. friend HRESULT HrIsValidINetCfgComponent (
  44. IN INetCfgComponent* pICompInterface);
  45. private:
  46. // Pointer to the component this object represents. This points directly
  47. // into CNetConfig.Components. When NULL, it means that someone
  48. // is still holding a reference to this object, but the underlying
  49. // CComponent has been removed from CNetConfig.
  50. //
  51. CComponent* m_pComponent;
  52. protected:
  53. HRESULT
  54. HrIsValidInterface (
  55. IN DWORD dwFlags);
  56. HRESULT
  57. HrLockAndTestForValidInterface (
  58. IN DWORD dwFlags,
  59. IN INetCfgComponent* pIOtherComp, OPTIONAL
  60. OUT CComponent** ppOtherComp OPTIONAL);
  61. HRESULT
  62. HrAccessExternalStringAtOffsetAndCopy (
  63. IN UINT unOffset,
  64. OUT PWSTR* ppszDst);
  65. HRESULT
  66. HrBindToOrUnbindFrom (
  67. IN INetCfgComponent* pIOtherComp,
  68. IN DWORD dwChangeFlag);
  69. HRESULT
  70. HrMoveBindPath (
  71. IN INetCfgBindingPath* pIPathSrc,
  72. IN INetCfgBindingPath* pIPathDst,
  73. IN MOVE_FLAG Flag);
  74. public:
  75. CImplINetCfgComponent ()
  76. {
  77. m_pComponent = NULL;
  78. }
  79. BEGIN_COM_MAP(CImplINetCfgComponent)
  80. COM_INTERFACE_ENTRY(INetCfgComponent)
  81. COM_INTERFACE_ENTRY(INetCfgComponentBindings)
  82. COM_INTERFACE_ENTRY(INetCfgComponentPrivate)
  83. END_COM_MAP()
  84. // INetCfgComponent
  85. //
  86. STDMETHOD (GetDisplayName) (
  87. OUT PWSTR* ppszDisplayName);
  88. STDMETHOD (SetDisplayName) (
  89. IN PCWSTR pszDisplayName);
  90. STDMETHOD (GetHelpText) (
  91. OUT PWSTR* pszHelpText);
  92. STDMETHOD (GetId) (
  93. OUT PWSTR* ppszId);
  94. STDMETHOD (GetCharacteristics) (
  95. OUT LPDWORD pdwCharacteristics);
  96. STDMETHOD (GetInstanceGuid) (
  97. OUT GUID* pInstanceGuid);
  98. STDMETHOD (GetPnpDevNodeId) (
  99. OUT PWSTR* ppszDevNodeId);
  100. STDMETHOD (GetClassGuid) (
  101. OUT GUID* pguidClass);
  102. STDMETHOD (GetBindName) (
  103. OUT PWSTR* ppszBindName);
  104. STDMETHOD (GetDeviceStatus) (
  105. OUT ULONG* pulStatus);
  106. STDMETHOD (OpenParamKey) (
  107. OUT HKEY* phkey);
  108. STDMETHOD (RaisePropertyUi) (
  109. IN HWND hwndParent,
  110. IN DWORD dwFlags, /* NCRP_FLAGS */
  111. IN IUnknown* punkContext OPTIONAL);
  112. // INetCfgComponentBindings
  113. //
  114. STDMETHOD (BindTo) (
  115. IN INetCfgComponent* pIOtherComp);
  116. STDMETHOD (UnbindFrom) (
  117. IN INetCfgComponent* pIOtherComp);
  118. STDMETHOD (SupportsBindingInterface) (
  119. IN DWORD dwFlags,
  120. IN PCWSTR pszInterfaceName);
  121. STDMETHOD (IsBoundTo) (
  122. IN INetCfgComponent* pIOtherComp);
  123. STDMETHOD (IsBindableTo) (
  124. IN INetCfgComponent* pIOtherComp);
  125. STDMETHOD (EnumBindingPaths) (
  126. IN DWORD dwFlags,
  127. OUT IEnumNetCfgBindingPath** ppIEnum);
  128. STDMETHOD (MoveBefore) (
  129. IN INetCfgBindingPath* pIPathSrc,
  130. IN INetCfgBindingPath* pIPathDst);
  131. STDMETHOD (MoveAfter) (
  132. IN INetCfgBindingPath* pIPathSrc,
  133. IN INetCfgBindingPath* pIPathDst);
  134. // INetCfgComponentPrivate
  135. //
  136. STDMETHOD (QueryNotifyObject) (
  137. IN REFIID riid,
  138. OUT VOID** ppvObject);
  139. STDMETHOD (SetDirty) ();
  140. STDMETHOD (NotifyUpperEdgeConfigChange) ();
  141. public:
  142. static HRESULT HrCreateInstance (
  143. IN CImplINetCfg* pINetCfg,
  144. IN CComponent* pComponent,
  145. OUT CImplINetCfgComponent** ppIComp);
  146. };