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.

212 lines
5.2 KiB

  1. /***************************************************************************
  2. *
  3. * Copyright (C) 2000-2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: kshlp.h
  6. * Content: WDM/CSA helper functions.
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 05/16/2000 jstokes Created.
  11. *
  12. ***************************************************************************/
  13. #ifndef __KSHLP_H__
  14. #define __KSHLP_H__
  15. #include <windows.h>
  16. #include <ks.h>
  17. #include <ksmedia.h>
  18. #define KSPIN_DATAFLOW_CAPTURE KSPIN_DATAFLOW_OUT
  19. #define KSPIN_DATAFLOW_RENDER KSPIN_DATAFLOW_IN
  20. // Device-specific DirectSound property sets
  21. typedef struct tagKSDSPROPERTY
  22. {
  23. GUID PropertySet;
  24. ULONG PropertyId;
  25. ULONG NodeId;
  26. ULONG AccessFlags;
  27. } KSDSPROPERTY, *PKSDSPROPERTY;
  28. // KS stream data
  29. typedef struct tagKSSTREAMIO
  30. {
  31. KSSTREAM_HEADER Header;
  32. OVERLAPPED Overlapped;
  33. BOOL fPendingIrp;
  34. } KSSTREAMIO, *PKSSTREAMIO;
  35. // System audio device properties
  36. typedef struct tagKSSADPROPERTY
  37. {
  38. KSPROPERTY Property;
  39. ULONG DeviceId;
  40. ULONG Reserved;
  41. } KSSADPROPERTY, *PKSSADPROPERTY;
  42. // Topology node information
  43. typedef struct tagKSNODE
  44. {
  45. ULONG NodeId;
  46. ULONG CpuResources;
  47. } KSNODE, *PKSNODE;
  48. typedef struct tagKSVOLUMENODE
  49. {
  50. KSNODE Node;
  51. KSPROPERTY_STEPPING_LONG VolumeRange;
  52. } KSVOLUMENODE, *PKSVOLUMENODE;
  53. // Our own version of NTSTATUS
  54. typedef LONG NTSTATUS;
  55. #define NT_SUCCESS(s) ((NTSTATUS)(s) >= 0)
  56. #define NT_INFORMATION(s) ((ULONG)(s) >> 30 == 1)
  57. #define NT_WARNING(s) ((ULONG)(s) >> 30 == 2)
  58. #define NT_ERROR(s) ((ULONG)(s) >> 30 == 3)
  59. // Reserved node identifiers
  60. #define NODE_UNINITIALIZED 0xFFFFFFFF
  61. #define NODE_WILDCARD 0xFFFFFFFE
  62. #define NODE_PIN_UNINITIALIZED 0xFFFFFFFF
  63. #define IS_VALID_NODE(nodeid) \
  64. (NODE_UNINITIALIZED != (nodeid))
  65. // Node implementation
  66. #define KSAUDIO_CPU_RESOURCES_UNINITIALIZED 'ENON'
  67. #define IS_HARDWARE_NODE(impl) \
  68. (KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU == (impl))
  69. #define IS_SOFTWARE_NODE(impl) \
  70. (KSAUDIO_CPU_RESOURCES_HOST_CPU == (impl))
  71. #ifdef __cplusplus
  72. HRESULT
  73. PostDevIoctl
  74. (
  75. HANDLE hDevice,
  76. DWORD dwControlCode,
  77. LPVOID pvIn = NULL,
  78. DWORD cbIn = 0,
  79. LPVOID pvOut = NULL,
  80. DWORD cbOut = 0,
  81. LPDWORD pcbReturned = NULL,
  82. LPOVERLAPPED pOverlapped = NULL
  83. );
  84. HRESULT
  85. KsGetProperty
  86. (
  87. HANDLE hDevice,
  88. REFGUID guidPropertySet,
  89. ULONG ulPropertyId,
  90. LPVOID pvData,
  91. ULONG cbData,
  92. PULONG pcbDataReturned = NULL
  93. );
  94. HRESULT
  95. KsSetProperty
  96. (
  97. HANDLE hDevice,
  98. REFGUID guidPropertySet,
  99. ULONG ulPropertyId,
  100. LPVOID pvData,
  101. ULONG cbData
  102. );
  103. HRESULT
  104. KsGetPinProperty
  105. (
  106. HANDLE hDevice,
  107. ULONG ulPropertyId,
  108. ULONG ulPinId,
  109. LPVOID pvData,
  110. ULONG cbData,
  111. PULONG pcbDataReturned = NULL
  112. );
  113. HRESULT
  114. KsSetPinProperty
  115. (
  116. HANDLE hDevice,
  117. ULONG ulPropertyId,
  118. ULONG ulPinId,
  119. LPVOID pvData,
  120. ULONG cbData
  121. );
  122. HRESULT
  123. KsGetNodeProperty
  124. (
  125. HANDLE hDevice,
  126. REFGUID guidPropertySet,
  127. ULONG ulPropertyId,
  128. ULONG ulNodeId,
  129. LPVOID pvData,
  130. ULONG cbData,
  131. PULONG pcbDataReturned = NULL
  132. );
  133. HRESULT
  134. KsSetNodeProperty
  135. (
  136. HANDLE hDevice,
  137. REFGUID guidPropertySet,
  138. ULONG ulPropertyId,
  139. ULONG ulNodeId,
  140. LPVOID pvData,
  141. ULONG cbData
  142. );
  143. HRESULT
  144. KsGetMultiplePinProperties
  145. (
  146. HANDLE hDevice,
  147. ULONG ulPropertyId,
  148. ULONG ulPinId,
  149. PKSMULTIPLE_ITEM * ppKsMultipleItem
  150. );
  151. HRESULT
  152. KsGetMultipleTopologyProperties
  153. (
  154. HANDLE hDevice,
  155. ULONG ulPropertyId,
  156. PKSMULTIPLE_ITEM * ppKsMultipleItem
  157. );
  158. HRESULT
  159. KsSetTopologyNodeEnable
  160. (
  161. HANDLE hDevice,
  162. ULONG ulNodeId,
  163. BOOL fEnable
  164. );
  165. HRESULT
  166. KsGetTopologyNodeEnable
  167. (
  168. HANDLE hDevice,
  169. ULONG ulNodeId,
  170. PBOOL pfEnable
  171. );
  172. HRESULT
  173. KsTopologyNodeReset
  174. (
  175. HANDLE hDevice,
  176. ULONG ulNodeId,
  177. BOOL fReset
  178. );
  179. #endif // __cplusplus
  180. #endif // __KSHLP_H__