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.

167 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. LIST_DATA_TOPOLOGY_NODE lstTopologyNodeGlobalSelect;
  93. LIST_START_NODE_INSTANCE lstStartNodeInstance;
  94. PFILTER_INSTANCE pFilterInstance;
  95. PGRAPH_NODE pGraphNode;
  96. KSTOPOLOGY Topology;
  97. ULONG cPins;
  98. // Index by pin number
  99. PKSPIN_CINSTANCES pacPinInstances;
  100. PULONG pulPinFlags;
  101. PKSPIN_DESCRIPTOR paPinDescriptors;
  102. PLIST_DATA_START_NODE *aplstStartNode;
  103. PLIST_DATA_TOPOLOGY_NODE palstTopologyNodeSelect;
  104. PLIST_DATA_TOPOLOGY_NODE palstTopologyNodeNotSelect;
  105. // Index by node number
  106. PTOPOLOGY_NODE *papTopologyNode;
  107. PFILTER_NODE_INSTANCE *papFilterNodeInstanceTopologyTable;
  108. // Index by virtual source index
  109. ULONG *paulNodeNumber;
  110. private:
  111. ULONG ulFlags;
  112. public:
  113. DefineSignature(0x20494E47); // GNI
  114. } GRAPH_NODE_INSTANCE, *PGRAPH_NODE_INSTANCE;
  115. //---------------------------------------------------------------------------
  116. typedef ListDoubleDestroy<GRAPH_NODE_INSTANCE> LIST_GRAPH_NODE_INSTANCE;
  117. //---------------------------------------------------------------------------
  118. // Local prototypes
  119. //---------------------------------------------------------------------------
  120. extern "C" {
  121. NTSTATUS
  122. CreateIdentifierArray(
  123. PLIST_DATA_START_NODE pldhStartNode,
  124. PULONG pulCount,
  125. PKSIDENTIFIER *ppIdentifier,
  126. PKSIDENTIFIER (*GetFunction)(
  127. PSTART_NODE pStartNode
  128. )
  129. );
  130. PKSDATARANGE
  131. GetStartNodeDataRange(
  132. PSTART_NODE pStartNode
  133. );
  134. PKSIDENTIFIER
  135. GetStartNodeInterface(
  136. PSTART_NODE pStartNode
  137. );
  138. PKSIDENTIFIER
  139. GetStartNodeMedium(
  140. PSTART_NODE pStartNode
  141. );
  142. ENUMFUNC
  143. FindTopologyNode(
  144. IN PTOPOLOGY_CONNECTION pTopologyConnection,
  145. IN BOOL fToDirection,
  146. IN PTOPOLOGY_NODE pTopologyNode
  147. );
  148. } // extern "C"