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.

223 lines
4.6 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: ci.h
  4. //
  5. // Description: Connect Info Class
  6. //
  7. //
  8. //@@BEGIN_MSINTERNAL
  9. // Development Team:
  10. // Mike McLaughlin
  11. //
  12. // History: Date Author Comment
  13. //
  14. //@@END_MSINTERNAL
  15. //---------------------------------------------------------------------------
  16. //
  17. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  18. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  19. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  20. // PURPOSE.
  21. //
  22. // Copyright (c) 1996-1999 Microsoft Corporation. All Rights Reserved.
  23. //
  24. //---------------------------------------------------------------------------
  25. //---------------------------------------------------------------------------
  26. // Constants and Macros
  27. //---------------------------------------------------------------------------
  28. #define CI_FLAGS_CONNECT_TOP_DOWN 0x00000001
  29. #define CI_FLAGS_LIMIT_FORMAT 0x00000002
  30. #define CI_FLAGS_REUSE_FILTER_INSTANCE 0x00000004
  31. //---------------------------------------------------------------------------
  32. // Class
  33. //---------------------------------------------------------------------------
  34. typedef class CConnectInfo : public CListDoubleItem
  35. {
  36. friend class CConnectNode;
  37. private:
  38. CConnectInfo(
  39. PCONNECT_NODE pConnectNode,
  40. PCONNECT_INFO pConnectInfoNext,
  41. PGRAPH_PIN_INFO pGraphPinInfo,
  42. PGRAPH_NODE pGraphNode
  43. );
  44. ~CConnectInfo(
  45. );
  46. public:
  47. static NTSTATUS
  48. Create(
  49. PCONNECT_NODE pConnectNode,
  50. PLOGICAL_FILTER_NODE pLogicalFilterNode,
  51. PCONNECT_INFO pConnectInfoNext,
  52. PGRAPH_PIN_INFO pGraphPinInfo,
  53. ULONG ulFlagsCurrent,
  54. PGRAPH_NODE pGraphNode
  55. );
  56. ENUMFUNC
  57. Destroy(
  58. )
  59. {
  60. if(this != NULL) {
  61. Assert(this);
  62. ASSERT(cReference > 0);
  63. if(--cReference == 0) {
  64. delete this;
  65. }
  66. }
  67. return(STATUS_CONTINUE);
  68. };
  69. VOID
  70. AddRef(
  71. )
  72. {
  73. if(this != NULL) {
  74. Assert(this);
  75. ++cReference;
  76. }
  77. };
  78. PKSPIN_CINSTANCES
  79. GetPinInstances(
  80. )
  81. {
  82. Assert(this);
  83. return(pGraphPinInfo->GetPinInstances());
  84. };
  85. BOOL
  86. IsPinInstances(
  87. )
  88. {
  89. Assert(this);
  90. return(pGraphPinInfo->IsPinInstances());
  91. };
  92. VOID
  93. AddPinInstance(
  94. )
  95. {
  96. Assert(this);
  97. if(pPinInfoSink == pGraphPinInfo->GetPinInfo()) {
  98. pGraphPinInfo->AddPinInstance();
  99. }
  100. };
  101. VOID
  102. RemovePinInstance(
  103. )
  104. {
  105. Assert(this);
  106. if(pPinInfoSink == pGraphPinInfo->GetPinInfo()) {
  107. pGraphPinInfo->RemovePinInstance();
  108. }
  109. };
  110. NTSTATUS
  111. ReservePinInstance(
  112. PGRAPH_NODE pGraphNode
  113. )
  114. {
  115. Assert(this);
  116. ASSERT(pPinInfoSink == pGraphPinInfo->pPinInfo);
  117. pGraphPinInfo->ReservePinInstance();
  118. pGraphPinInfo->Destroy();
  119. return(CGraphPinInfo::Create(
  120. &pGraphPinInfo,
  121. pPinInfoSink,
  122. GPI_FLAGS_RESERVE_PIN_INSTANCE,
  123. pGraphNode));
  124. };
  125. PCONNECT_INFO
  126. GetNextConnectInfo(
  127. )
  128. {
  129. Assert(this);
  130. return(pConnectInfoNext);
  131. };
  132. BOOL
  133. IsSameGraph(
  134. PCONNECT_INFO pConnectInfo
  135. )
  136. {
  137. PCONNECT_INFO pConnectInfo1, pConnectInfo2;
  138. BOOL fSameGraph;
  139. for(pConnectInfo1 = this, pConnectInfo2 = pConnectInfo;
  140. (fSameGraph = (pConnectInfo1 == pConnectInfo2)) &&
  141. pConnectInfo1 != NULL && pConnectInfo2 != NULL;
  142. pConnectInfo1 = pConnectInfo1->GetNextConnectInfo(),
  143. pConnectInfo2 = pConnectInfo2->GetNextConnectInfo()) {
  144. Assert(pConnectInfo1);
  145. Assert(pConnectInfo2);
  146. }
  147. return(fSameGraph);
  148. };
  149. BOOL
  150. IsTopDown(
  151. )
  152. {
  153. Assert(this);
  154. return(ulFlags & CI_FLAGS_CONNECT_TOP_DOWN);
  155. };
  156. BOOL
  157. IsLimitFormat(
  158. )
  159. {
  160. Assert(this);
  161. return(ulFlags & CI_FLAGS_LIMIT_FORMAT);
  162. };
  163. BOOL
  164. IsReuseFilterInstance(
  165. )
  166. {
  167. Assert(this);
  168. return(ulFlags & CI_FLAGS_REUSE_FILTER_INSTANCE);
  169. };
  170. BOOL
  171. IsPinInstanceReserved(
  172. )
  173. {
  174. Assert(this);
  175. Assert(pGraphPinInfo);
  176. return(pGraphPinInfo->ulFlags & GPI_FLAGS_RESERVE_PIN_INSTANCE);
  177. };
  178. private:
  179. LONG cReference;
  180. ULONG ulFlags;
  181. PCONNECT_INFO pConnectInfoNext;
  182. PCONNECT_NODE_INSTANCE pConnectNodeInstance;
  183. PGRAPH_PIN_INFO pGraphPinInfo;
  184. public:
  185. PPIN_INFO pPinInfoSource;
  186. PPIN_INFO pPinInfoSink;
  187. DefineSignature(0x20204943); // CI
  188. } CONNECT_INFO, *PCONNECT_INFO;
  189. //---------------------------------------------------------------------------
  190. typedef ListDouble<CONNECT_INFO> LIST_CONNECT_INFO;
  191. //---------------------------------------------------------------------------