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.

195 lines
4.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999.
  5. //
  6. // File: S T A B L E . H
  7. //
  8. // Contents: Defines the datatypes to represent stack entries and stack
  9. // tables.
  10. //
  11. // Notes:
  12. //
  13. // Author: shaunco 15 Jan 1999
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include "bindings.h"
  18. #include "comp.h"
  19. class CStackEntry
  20. {
  21. public:
  22. const CComponent* pUpper;
  23. const CComponent* pLower;
  24. public:
  25. BOOL
  26. operator== (
  27. const CStackEntry& Other) const
  28. {
  29. return (pUpper == Other.pUpper) && (pLower == Other.pLower);
  30. }
  31. };
  32. class CModifyContext;
  33. enum MOVE_FLAG
  34. {
  35. MOVE_BEFORE = 1,
  36. MOVE_AFTER = 2,
  37. };
  38. class CStackTable : public vector<CStackEntry>
  39. {
  40. public:
  41. // This flag indicates how WAN adapters are inserted into the stack
  42. // table. If TRUE, they are inserted before any LAN adapters. If
  43. // FALSE, they are inserted after any LAN adapters.
  44. //
  45. BOOL m_fWanAdaptersFirst;
  46. public:
  47. VOID
  48. Clear ()
  49. {
  50. clear ();
  51. }
  52. UINT
  53. CountEntries ()
  54. {
  55. return size();
  56. }
  57. BOOL
  58. FIsEmpty () const
  59. {
  60. return empty();
  61. }
  62. BOOL
  63. FStackEntryInTable (
  64. IN const CComponent* pUpper,
  65. IN const CComponent* pLower) const;
  66. HRESULT
  67. HrCopyStackTable (
  68. IN const CStackTable* pSourceTable);
  69. HRESULT
  70. HrInsertStackEntriesForComponent (
  71. IN const CComponent* pComponent,
  72. IN const CComponentList* pComponents,
  73. IN DWORD dwFlags /* INS_FLAGS */);
  74. HRESULT
  75. HrUpdateEntriesForComponent (
  76. IN const CComponent* pComponent,
  77. IN const CComponentList* pComponents,
  78. IN DWORD dwFlags /* INS_FLAGS */);
  79. HRESULT
  80. HrInsertStackEntry (
  81. IN const CStackEntry* pStackEntry,
  82. IN DWORD dwFlags /* INS_FLAGS */);
  83. HRESULT
  84. HrMoveStackEntries (
  85. IN const CStackEntry* pSrc,
  86. IN const CStackEntry* pDst,
  87. IN MOVE_FLAG Flag,
  88. IN CModifyContext* pModifyCtx);
  89. HRESULT
  90. HrReserveRoomForEntries (
  91. IN UINT cEntries);
  92. VOID
  93. RemoveEntriesWithComponent (
  94. IN const CComponent* pComponent);
  95. VOID
  96. SetWanAdapterOrder (
  97. IN BOOL fWanAdaptersFirst);
  98. VOID
  99. RemoveStackEntry(
  100. IN const CComponent* pUpper,
  101. IN const CComponent* pLower);
  102. };
  103. class CNetConfigCore;
  104. // Context structure for recursive function GetBindingsBelowComponent.
  105. //
  106. struct GBCONTEXT
  107. {
  108. // The core to reference for generating the binding set.
  109. //
  110. IN const CNetConfigCore* pCore;
  111. // The binding set to generate based on pSourceComponent.
  112. //
  113. IN OUT CBindingSet* pBindSet;
  114. // The component to start with when generating the binding set.
  115. //
  116. IN const CComponent* pSourceComponent;
  117. // If TRUE, do not add those bindpaths to pBindSet that exist in
  118. // pCore->DisabledBindings. This feature is used when we generate the
  119. // bindings that get written to the registry.
  120. //
  121. IN BOOL fPruneDisabledBindings;
  122. // Special case: NCF_DONTEXPOSELOWER
  123. //
  124. IN DWORD dwAddBindPathFlags;
  125. // The result of the operation.
  126. //
  127. OUT HRESULT hr;
  128. // This is the bindpath that is built up via recursion. It is
  129. // added to the binding set when recursion finishes.
  130. //
  131. OUT CBindPath BindPath;
  132. };
  133. // Context structure for recursive functions:
  134. // GetComponentsAboveComponent
  135. //
  136. struct GCCONTEXT
  137. {
  138. // The stack table to reference for generating the component list.
  139. //
  140. IN const CStackTable* pStackTable;
  141. // The component list to generate.
  142. //
  143. IN OUT CComponentList* pComponents;
  144. // If TRUE, don't stop recursing at NCF_DONTEXPOSELOWER components.
  145. //
  146. IN BOOL fIgnoreDontExposeLower;
  147. // The result of the operation.
  148. //
  149. OUT HRESULT hr;
  150. };
  151. VOID
  152. GetComponentsAboveComponent (
  153. IN const CComponent* pComponent,
  154. IN OUT GCCONTEXT* pCtx);
  155. VOID
  156. GetBindingsBelowComponent (
  157. IN const CComponent* pComponent,
  158. IN OUT GBCONTEXT* pCtx);