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.

392 lines
6.9 KiB

  1. #ifndef _HPFUNC_H
  2. #define _HPFUNC_H
  3. //
  4. // Shared function declarations
  5. //
  6. //
  7. // dispatch.c
  8. //
  9. // all other dispatch.c function declarations are in dispatch.c
  10. // since functions are private to that file
  11. NTSTATUS
  12. HpsPassIrp(
  13. IN PIRP Irp,
  14. IN PHPS_COMMON_EXTENSION Common,
  15. IN PIO_STACK_LOCATION IrpStack
  16. );
  17. NTSTATUS
  18. HpsSendPnpIrp(
  19. IN PDEVICE_OBJECT DeviceObject,
  20. IN PIO_STACK_LOCATION Location,
  21. OUT PULONG_PTR Information OPTIONAL
  22. );
  23. NTSTATUS
  24. HpsDeferProcessing(
  25. IN PHPS_COMMON_EXTENSION DeviceExtension,
  26. IN PIRP Irp
  27. );
  28. NTSTATUS
  29. HpsRemoveCommon(
  30. IN PIRP Irp,
  31. IN PHPS_COMMON_EXTENSION Common,
  32. IN PIO_STACK_LOCATION IrpStack
  33. );
  34. NTSTATUS
  35. HpsCompletionRoutine(
  36. IN PDEVICE_OBJECT DeviceObject,
  37. IN PIRP Irp,
  38. IN PVOID Context
  39. );
  40. //
  41. // lower.c
  42. //
  43. NTSTATUS
  44. HpsStartLower(
  45. IN PIRP Irp,
  46. IN PHPS_DEVICE_EXTENSION Extension,
  47. IN PIO_STACK_LOCATION IrpStack
  48. );
  49. NTSTATUS
  50. HpsRemoveLower(
  51. IN PIRP Irp,
  52. IN PHPS_DEVICE_EXTENSION Extension,
  53. IN PIO_STACK_LOCATION IrpStack
  54. );
  55. NTSTATUS
  56. HpsStopLower(
  57. IN PIRP Irp,
  58. IN PHPS_DEVICE_EXTENSION Extension,
  59. IN PIO_STACK_LOCATION IrpStack
  60. );
  61. NTSTATUS
  62. HpsQueryInterfaceLower(
  63. IN PIRP Irp,
  64. IN PHPS_DEVICE_EXTENSION Extension,
  65. IN PIO_STACK_LOCATION IrpStack
  66. );
  67. NTSTATUS
  68. HpsWriteConfigLower(
  69. IN PIRP Irp,
  70. IN PHPS_DEVICE_EXTENSION Extension,
  71. IN PIO_STACK_LOCATION IrpStack
  72. );
  73. NTSTATUS
  74. HpsDeviceControlLower(
  75. PIRP Irp,
  76. PHPS_DEVICE_EXTENSION Common,
  77. PIO_STACK_LOCATION IrpStack
  78. );
  79. //
  80. // intrface.c
  81. //
  82. NTSTATUS
  83. HpsGetBusInterface(
  84. PHPS_DEVICE_EXTENSION DeviceExtension
  85. );
  86. NTSTATUS
  87. HpsTrapBusInterface (
  88. IN PHPS_DEVICE_EXTENSION DeviceExtension,
  89. IN OUT PIO_STACK_LOCATION IrpStack
  90. );
  91. NTSTATUS
  92. HpsGetLowerFilter (
  93. IN PDEVICE_OBJECT DeviceObject,
  94. OUT PDEVICE_OBJECT *LowerDeviceObject
  95. );
  96. VOID
  97. HpsGenericInterfaceReference (
  98. PVOID Context
  99. );
  100. VOID
  101. HpsGenericInterfaceDereference (
  102. PVOID Context
  103. );
  104. VOID
  105. HpsBusInterfaceReference (
  106. PVOID Context
  107. );
  108. VOID
  109. HpsBusInterfaceDereference (
  110. PVOID Context
  111. );
  112. //
  113. // interrupt.c
  114. //
  115. VOID
  116. HpsInterruptExecution(
  117. IN PHPS_DEVICE_EXTENSION Extension
  118. );
  119. NTSTATUS
  120. HpsConnectInterrupt(
  121. IN PVOID Context,
  122. IN PKSERVICE_ROUTINE ServiceRoutine,
  123. IN PVOID ServiceContext
  124. );
  125. VOID
  126. HpsDisconnectInterrupt(
  127. IN PVOID Context
  128. );
  129. BOOLEAN
  130. HpsSynchronizeExecution(
  131. IN PVOID Context,
  132. IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
  133. IN PVOID SynchronizeContext
  134. );
  135. //
  136. // config.c
  137. //
  138. NTSTATUS
  139. HpsInitConfigSpace(
  140. IN OUT PHPS_DEVICE_EXTENSION DeviceExtension
  141. );
  142. ULONG
  143. HpsHandleDirectReadConfig(
  144. IN PVOID Context,
  145. IN ULONG DataType,
  146. IN PVOID Buffer,
  147. IN ULONG Offset,
  148. IN ULONG Length
  149. );
  150. ULONG
  151. HpsHandleDirectWriteConfig(
  152. IN PVOID Context,
  153. IN ULONG DataType,
  154. IN PVOID Buffer,
  155. IN ULONG Offset,
  156. IN ULONG Length
  157. );
  158. VOID
  159. HpsResync(
  160. IN PHPS_DEVICE_EXTENSION DeviceExtension
  161. );
  162. VOID
  163. HpsWriteConfig(
  164. IN PHPS_DEVICE_EXTENSION DeviceExtension,
  165. IN PVOID Buffer,
  166. IN ULONG Offset,
  167. IN ULONG Length
  168. );
  169. NTSTATUS
  170. HpsGetCapabilityOffset(
  171. PHPS_DEVICE_EXTENSION Extension,
  172. UCHAR CapabilityID,
  173. PUCHAR Offset
  174. );
  175. NTSTATUS
  176. HpsWriteWithMask(
  177. OUT PVOID Destination,
  178. IN PVOID BitMask,
  179. IN PVOID Source,
  180. IN ULONG Length
  181. );
  182. VOID
  183. HpsMaskConfig(
  184. OUT PUCHAR Destination,
  185. IN PUCHAR Source,
  186. IN ULONG InternalOffset,
  187. IN ULONG Length
  188. );
  189. VOID
  190. HpsGetBridgeInfo(
  191. PHPS_DEVICE_EXTENSION Extension,
  192. PHPTEST_BRIDGE_INFO BridgeInfo
  193. );
  194. VOID
  195. HpsLockRegisterSet(
  196. IN PHPS_DEVICE_EXTENSION Extension,
  197. OUT PKIRQL OldIrql
  198. );
  199. VOID
  200. HpsUnlockRegisterSet(
  201. IN PHPS_DEVICE_EXTENSION Extension,
  202. IN KIRQL NewIrql
  203. );
  204. //
  205. // memory.c
  206. //
  207. NTSTATUS
  208. HpsInitHBRB(
  209. IN PHPS_DEVICE_EXTENSION Extension
  210. );
  211. NTSTATUS
  212. HpsGetHBRBHwInit(
  213. IN PHPS_DEVICE_EXTENSION Extension
  214. );
  215. NTSTATUS
  216. HpsSendIoctl(
  217. IN PDEVICE_OBJECT Device,
  218. IN ULONG IoctlCode,
  219. IN PVOID InputBuffer OPTIONAL,
  220. IN ULONG InputBufferLength,
  221. IN PVOID OutputBuffer OPTIONAL,
  222. IN ULONG OutputBufferLength
  223. );
  224. VOID
  225. HpsMemoryInterfaceReference(
  226. IN PVOID Context
  227. );
  228. VOID
  229. HpsMemoryInterfaceDereference(
  230. IN PVOID Context
  231. );
  232. VOID
  233. HpsReadRegister(
  234. IN PUCHAR Register,
  235. IN PUCHAR Buffer,
  236. IN ULONG Length
  237. );
  238. VOID
  239. HpsWriteRegister(
  240. IN PUCHAR Register,
  241. IN PUCHAR Buffer,
  242. IN ULONG Length
  243. );
  244. PHPS_DEVICE_EXTENSION
  245. HpsFindExtensionForHbrb(
  246. IN PUCHAR Register,
  247. IN ULONG Length
  248. );
  249. //
  250. // register.c
  251. //
  252. NTSTATUS
  253. HpsInitRegisters(
  254. IN OUT PHPS_DEVICE_EXTENSION DeviceExtension
  255. );
  256. VOID
  257. HpsHandleSlotEvent (
  258. IN OUT PHPS_DEVICE_EXTENSION DeviceExtension,
  259. IN PHPS_SLOT_EVENT SlotEvent
  260. );
  261. VOID
  262. HpsPerformControllerCommand (
  263. IN OUT PHPS_DEVICE_EXTENSION DeviceExtension
  264. );
  265. VOID
  266. HpsEventDpc(
  267. IN PKDPC Dpc,
  268. IN PVOID DeferredContext,
  269. IN PVOID SystemArgument1,
  270. IN PVOID SystemArgument2
  271. );
  272. VOID
  273. HpsSendEventToWmi(
  274. IN PHPS_DEVICE_EXTENSION Extension,
  275. IN PHPS_CONTROLLER_EVENT Event
  276. );
  277. VOID
  278. HpsCommandCompleted(
  279. IN OUT PHPS_DEVICE_EXTENSION DeviceExtension
  280. );
  281. //
  282. // wmi.c
  283. //
  284. NTSTATUS
  285. HpsWmiRegInfo(
  286. IN PDEVICE_OBJECT DeviceObject,
  287. OUT PULONG RegFlags,
  288. OUT PUNICODE_STRING InstanceName,
  289. OUT PUNICODE_STRING *RegistryPath,
  290. OUT PUNICODE_STRING MofResourceName,
  291. OUT PDEVICE_OBJECT *Pdo
  292. );
  293. NTSTATUS
  294. HpsWmiQueryDataBlock(
  295. IN PDEVICE_OBJECT DeviceObject,
  296. IN PIRP Irp,
  297. IN ULONG GuidIndex,
  298. IN ULONG InstanceIndex,
  299. IN ULONG InstanceCount,
  300. IN OUT PULONG InstanceLengthArray,
  301. IN ULONG BufferAvail,
  302. OUT PUCHAR Buffer
  303. );
  304. NTSTATUS
  305. HpsWmiSetDataBlock(
  306. IN PDEVICE_OBJECT DeviceObject,
  307. IN PIRP Irp,
  308. IN ULONG GuidIndex,
  309. IN ULONG InstanceIndex,
  310. IN ULONG BufferSize,
  311. IN PUCHAR Buffer
  312. );
  313. NTSTATUS
  314. HpsWmiExecuteMethod(
  315. IN PDEVICE_OBJECT DeviceObject,
  316. IN PIRP Irp,
  317. IN ULONG GuidIndex,
  318. IN ULONG InstanceIndex,
  319. IN ULONG MethodId,
  320. IN ULONG InBufferSize,
  321. IN ULONG OutBufferSize,
  322. IN OUT PUCHAR Buffer
  323. );
  324. NTSTATUS
  325. HpsWmiFunctionControl(
  326. IN PDEVICE_OBJECT DeviceObject,
  327. IN PIRP Irp,
  328. IN ULONG GuidIndex,
  329. IN WMIENABLEDISABLECONTROL Function,
  330. IN BOOLEAN Enable
  331. );
  332. #endif