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.

181 lines
3.6 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Module: dn.h
  4. //
  5. // Description: Device Node 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. //---------------------------------------------------------------------------
  29. // Classes
  30. //---------------------------------------------------------------------------
  31. typedef class CDeviceNode: public CListDoubleItem
  32. {
  33. public:
  34. CDeviceNode(
  35. );
  36. ~CDeviceNode(
  37. );
  38. NTSTATUS
  39. Create(
  40. PFILTER_NODE pFilterNode
  41. );
  42. NTSTATUS
  43. Update(
  44. );
  45. NTSTATUS
  46. CreateGraphNodes(
  47. );
  48. ENUMFUNC
  49. Destroy()
  50. {
  51. Assert(this);
  52. delete this;
  53. return(STATUS_CONTINUE);
  54. };
  55. NTSTATUS
  56. GetIndexByDevice(
  57. OUT PULONG pIndex
  58. );
  59. PKSCOMPONENTID
  60. GetComponentId(
  61. )
  62. {
  63. if (pFilterNode) {
  64. return(pFilterNode->GetComponentId());
  65. }
  66. else {
  67. return(NULL);
  68. }
  69. };
  70. PWSTR
  71. GetFriendlyName(
  72. )
  73. {
  74. if (pFilterNode) {
  75. return(pFilterNode->GetFriendlyName());
  76. }
  77. else {
  78. return(NULL);
  79. }
  80. };
  81. PWSTR
  82. GetDeviceInterface(
  83. )
  84. {
  85. if (pFilterNode) {
  86. return(pFilterNode->GetDeviceInterface());
  87. }
  88. else {
  89. return(NULL);
  90. }
  91. };
  92. VOID
  93. SetPreferredStatus(
  94. KSPROPERTY_SYSAUDIO_DEFAULT_TYPE DeviceType,
  95. BOOL Enable
  96. );
  97. #ifdef DEBUG
  98. ENUMFUNC
  99. Dump(
  100. );
  101. PSZ
  102. DumpName(
  103. )
  104. {
  105. return(DbgUnicode2Sz(GetFriendlyName()));
  106. };
  107. PSZ
  108. DumpDeviceInterface(
  109. )
  110. {
  111. return(DbgUnicode2Sz(GetDeviceInterface()));
  112. };
  113. #endif
  114. private:
  115. NTSTATUS
  116. AddLogicalFilterNode(
  117. PFILTER_NODE pFilterNode
  118. );
  119. public:
  120. PFILTER_NODE pFilterNode;
  121. LIST_GRAPH_NODE lstGraphNode;
  122. PSHINGLE_INSTANCE pShingleInstance;
  123. LIST_FILTER_INSTANCE lstFilterInstance;
  124. LIST_MULTI_LOGICAL_FILTER_NODE lstLogicalFilterNode;
  125. PFILTER_NODE pFilterNodeVirtual;
  126. // Index by virtual source index
  127. PVIRTUAL_SOURCE_DATA *papVirtualSourceData;
  128. ULONG cVirtualSourceData;
  129. DefineSignature(0x20204E4e); // DN
  130. } DEVICE_NODE, *PDEVICE_NODE;
  131. //---------------------------------------------------------------------------
  132. typedef ListDoubleDestroy<DEVICE_NODE> LIST_DEVICE_NODE, *PLIST_DEVICE_NODE;
  133. //---------------------------------------------------------------------------
  134. // Globals
  135. //---------------------------------------------------------------------------
  136. extern PLIST_DEVICE_NODE gplstDeviceNode;
  137. //---------------------------------------------------------------------------
  138. // Local prototypes
  139. //---------------------------------------------------------------------------
  140. NTSTATUS
  141. InitializeDeviceNode(
  142. );
  143. VOID
  144. UninitializeDeviceNode(
  145. );
  146. NTSTATUS
  147. GetDeviceByIndex(
  148. IN UINT Index,
  149. OUT PDEVICE_NODE *ppDeviceNode
  150. );
  151. VOID
  152. DestroyAllGraphs(
  153. );