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.

174 lines
3.7 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. PSZ
  99. DumpName(
  100. )
  101. {
  102. return(DbgUnicode2Sz(GetFriendlyName()));
  103. };
  104. #endif
  105. private:
  106. NTSTATUS
  107. AddLogicalFilterNode(
  108. PFILTER_NODE pFilterNode
  109. );
  110. public:
  111. PFILTER_NODE pFilterNode;
  112. LIST_GRAPH_NODE lstGraphNode;
  113. PSHINGLE_INSTANCE pShingleInstance;
  114. LIST_FILTER_INSTANCE lstFilterInstance;
  115. LIST_MULTI_LOGICAL_FILTER_NODE lstLogicalFilterNode;
  116. PFILTER_NODE pFilterNodeVirtual;
  117. // Index by virtual source index
  118. PVIRTUAL_SOURCE_DATA *papVirtualSourceData;
  119. ULONG cVirtualSourceData;
  120. DefineSignature(0x20204E4e); // DN
  121. } DEVICE_NODE, *PDEVICE_NODE;
  122. //---------------------------------------------------------------------------
  123. typedef ListDoubleDestroy<DEVICE_NODE> LIST_DEVICE_NODE, *PLIST_DEVICE_NODE;
  124. //---------------------------------------------------------------------------
  125. // Globals
  126. //---------------------------------------------------------------------------
  127. extern ALLOC_PAGEABLE_DATA PLIST_DEVICE_NODE gplstDeviceNode;
  128. //---------------------------------------------------------------------------
  129. // Local prototypes
  130. //---------------------------------------------------------------------------
  131. #if defined(_M_IA64)
  132. extern "C"
  133. #endif
  134. NTSTATUS
  135. InitializeDeviceNode(
  136. );
  137. VOID
  138. UninitializeDeviceNode(
  139. );
  140. NTSTATUS
  141. GetDeviceByIndex(
  142. IN UINT Index,
  143. OUT PDEVICE_NODE *ppDeviceNode
  144. );
  145. VOID
  146. DestroyAllGraphs(
  147. );