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.

170 lines
4.5 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: gni.h
  4. //
  5. // Description: Graph Node Instance 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 cTopologyNodes Topology.TopologyNodesCount
  29. #define cTopologyConnections Topology.TopologyConnectionsCount
  30. //---------------------------------------------------------------------------
  31. // Classes
  32. //---------------------------------------------------------------------------
  33. typedef class CGraphNodeInstance : public CListDoubleItem
  34. {
  35. public:
  36. CGraphNodeInstance(
  37. PGRAPH_NODE pGraphNode,
  38. PFILTER_INSTANCE pFilterInstance
  39. );
  40. CGraphNodeInstance(
  41. PGRAPH_NODE pGraphNode
  42. );
  43. ~CGraphNodeInstance();
  44. NTSTATUS Create();
  45. ENUMFUNC Destroy()
  46. {
  47. Assert(this);
  48. delete this;
  49. return(STATUS_CONTINUE);
  50. };
  51. NTSTATUS GetTopologyNodeFileObject(
  52. OUT PFILE_OBJECT *ppFileObject,
  53. IN ULONG NodeId
  54. );
  55. BOOL IsGraphValid(
  56. PSTART_NODE pStartNode,
  57. ULONG PinId
  58. );
  59. VOID AddTopologyConnection(
  60. ULONG ulFromNode,
  61. ULONG ulFromPin,
  62. ULONG ulToNode,
  63. ULONG ulToPin
  64. );
  65. NTSTATUS GetPinInstances(
  66. PIRP pIrp,
  67. PKSP_PIN pPin,
  68. PKSPIN_CINSTANCES pcInstances
  69. );
  70. BOOL IsPinInstances(
  71. ULONG ulPinId
  72. );
  73. private:
  74. NTSTATUS CreatePinDescriptors();
  75. VOID DestroyPinDescriptors();
  76. NTSTATUS CreateSysAudioTopology();
  77. VOID DestroySysAudioTopology();
  78. VOID CreateTopologyTables();
  79. VOID ProcessLogicalFilterNodeTopologyNode(
  80. PLIST_MULTI_LOGICAL_FILTER_NODE plstLogicalFilterNode,
  81. NTSTATUS (CTopologyNode::*Function)(
  82. PVOID pGraphNodeInstance
  83. )
  84. );
  85. VOID ProcessLogicalFilterNodeTopologyConnection(
  86. PLIST_MULTI_LOGICAL_FILTER_NODE plstLogicalFilterNode,
  87. NTSTATUS (CTopologyConnection::*Function)(
  88. PVOID pGraphNodeInstance
  89. )
  90. );
  91. public:
  92. #ifdef DEBUG
  93. ENUMFUNC Dump();
  94. VOID DumpPinDescriptors();
  95. #endif
  96. LIST_DATA_TOPOLOGY_NODE lstTopologyNodeGlobalSelect;
  97. LIST_START_NODE_INSTANCE lstStartNodeInstance;
  98. PFILTER_INSTANCE pFilterInstance;
  99. PGRAPH_NODE pGraphNode;
  100. KSTOPOLOGY Topology;
  101. ULONG cPins;
  102. // Index by pin number
  103. PKSPIN_CINSTANCES pacPinInstances;
  104. PULONG pulPinFlags;
  105. PKSPIN_DESCRIPTOR paPinDescriptors;
  106. PLIST_DATA_START_NODE *aplstStartNode;
  107. PLIST_DATA_TOPOLOGY_NODE palstTopologyNodeSelect;
  108. PLIST_DATA_TOPOLOGY_NODE palstTopologyNodeNotSelect;
  109. // Index by node number
  110. PTOPOLOGY_NODE *papTopologyNode;
  111. PFILTER_NODE_INSTANCE *papFilterNodeInstanceTopologyTable;
  112. // Index by virtual source index
  113. ULONG *paulNodeNumber;
  114. private:
  115. ULONG ulFlags;
  116. public:
  117. DefineSignature(0x20494E47); // GNI
  118. } GRAPH_NODE_INSTANCE, *PGRAPH_NODE_INSTANCE;
  119. //---------------------------------------------------------------------------
  120. typedef ListDoubleDestroy<GRAPH_NODE_INSTANCE> LIST_GRAPH_NODE_INSTANCE;
  121. //---------------------------------------------------------------------------
  122. // Local prototypes
  123. //---------------------------------------------------------------------------
  124. extern "C" {
  125. NTSTATUS
  126. CreateIdentifierArray(
  127. PLIST_DATA_START_NODE pldhStartNode,
  128. PULONG pulCount,
  129. PKSIDENTIFIER *ppIdentifier,
  130. PKSIDENTIFIER (*GetFunction)(
  131. PSTART_NODE pStartNode
  132. )
  133. );
  134. PKSDATARANGE
  135. GetStartNodeDataRange(
  136. PSTART_NODE pStartNode
  137. );
  138. PKSIDENTIFIER
  139. GetStartNodeInterface(
  140. PSTART_NODE pStartNode
  141. );
  142. PKSIDENTIFIER
  143. GetStartNodeMedium(
  144. PSTART_NODE pStartNode
  145. );
  146. ENUMFUNC
  147. FindTopologyNode(
  148. IN PTOPOLOGY_CONNECTION pTopologyConnection,
  149. IN BOOL fToDirection,
  150. IN PTOPOLOGY_NODE pTopologyNode
  151. );
  152. } // extern "C"