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.

317 lines
5.5 KiB

  1. /*************************************************************************
  2. *
  3. * icap.h
  4. *
  5. * This module contains routine prototypes for the ICA driver.
  6. *
  7. * Copyright 1998, Microsoft.
  8. *
  9. *************************************************************************/
  10. NTSTATUS
  11. DriverEntry (
  12. IN PDRIVER_OBJECT DriverObject,
  13. IN PUNICODE_STRING RegistryPath
  14. );
  15. BOOLEAN
  16. IcaInitializeData (
  17. VOID
  18. );
  19. VOID _cdecl
  20. IcaTrace(
  21. IN ULONG TraceClass,
  22. IN ULONG TraceEnable,
  23. IN CHAR * Format,
  24. IN ... );
  25. VOID
  26. IcaTraceBuffer(
  27. IN ULONG TraceClass,
  28. IN ULONG TraceEnable,
  29. IN PVOID pBuffer,
  30. IN ULONG ByteCount );
  31. VOID
  32. IcaTraceFormat(
  33. IN PICA_TRACE_INFO pTraceInfo,
  34. IN ULONG TraceClass,
  35. IN ULONG TraceEnable,
  36. IN PCHAR pData );
  37. NTSTATUS
  38. IcaDispatch (
  39. IN PDEVICE_OBJECT DeviceObject,
  40. IN PIRP Irp
  41. );
  42. NTSTATUS
  43. IcaCreateConnection (
  44. IN PIRP Irp,
  45. IN PIO_STACK_LOCATION IrpSp
  46. );
  47. NTSTATUS
  48. IcaCreateStack (
  49. IN PICA_CONNECTION pConnect,
  50. IN PICA_OPEN_PACKET openPacket,
  51. IN PIRP Irp,
  52. IN PIO_STACK_LOCATION IrpSp
  53. );
  54. NTSTATUS
  55. IcaCreateChannel (
  56. IN PICA_CONNECTION pConnect,
  57. IN PICA_OPEN_PACKET openPacket,
  58. IN PIRP Irp,
  59. IN PIO_STACK_LOCATION IrpSp
  60. );
  61. /*
  62. * Channel IO dispatch routines
  63. */
  64. NTSTATUS
  65. IcaDeviceControlKeyboard (
  66. IN PICA_CHANNEL pChannel,
  67. IN PIRP Irp,
  68. IN PIO_STACK_LOCATION IrpSp
  69. );
  70. NTSTATUS
  71. IcaDeviceControlMouse (
  72. IN PICA_CHANNEL pChannel,
  73. IN PIRP Irp,
  74. IN PIO_STACK_LOCATION IrpSp
  75. );
  76. NTSTATUS
  77. IcaDeviceControlVideo (
  78. IN PICA_CHANNEL pChannel,
  79. IN PIRP Irp,
  80. IN PIO_STACK_LOCATION IrpSp
  81. );
  82. NTSTATUS
  83. IcaDeviceControlBeep (
  84. IN PICA_CHANNEL pChannel,
  85. IN PIRP Irp,
  86. IN PIO_STACK_LOCATION IrpSp
  87. );
  88. NTSTATUS
  89. IcaDeviceControlConsole (
  90. IN PICA_CHANNEL pChannel,
  91. IN PIRP Irp,
  92. IN PIO_STACK_LOCATION IrpSp
  93. );
  94. NTSTATUS
  95. IcaDeviceControlVirtual (
  96. IN PICA_CHANNEL pChannel,
  97. IN PIRP Irp,
  98. IN PIO_STACK_LOCATION IrpSp
  99. );
  100. /*
  101. * Stack Driver (SD) call routine
  102. */
  103. NTSTATUS
  104. IcaCallDriver(
  105. IN PICA_CHANNEL pChannel,
  106. IN ULONG ProcIndex,
  107. IN PVOID pParms
  108. );
  109. /*
  110. * Miscellaneous worker routines
  111. */
  112. VOID
  113. IcaReferenceConnection(
  114. IN PICA_CONNECTION pConnect
  115. );
  116. VOID
  117. IcaDereferenceConnection(
  118. IN PICA_CONNECTION pConnect
  119. );
  120. PICA_CHANNEL
  121. IcaFindChannelByName(
  122. IN PICA_CONNECTION pConnect,
  123. IN CHANNELCLASS ChannelClass,
  124. IN PVIRTUALCHANNELNAME pVirtualName
  125. );
  126. PICA_CHANNEL
  127. IcaFindChannel(
  128. IN PICA_CONNECTION pConnect,
  129. IN CHANNELCLASS ChannelClass,
  130. IN VIRTUALCHANNELCLASS VirtualClass
  131. );
  132. VOID
  133. IcaReferenceChannel(
  134. IN PICA_CHANNEL pChannel
  135. );
  136. VOID IcaDereferenceChannel(IN PICA_CHANNEL);
  137. BOOLEAN IcaLockChannelTable(
  138. PERESOURCE pResource);
  139. void IcaUnlockChannelTable(
  140. PERESOURCE pResource);
  141. VOID
  142. IcaReferenceStack(
  143. IN PICA_STACK pStack
  144. );
  145. VOID
  146. IcaDereferenceStack(
  147. IN PICA_STACK pStack
  148. );
  149. VOID
  150. IcaReferenceSdLink(
  151. IN PSDLINK pSdLink
  152. );
  153. VOID
  154. IcaDereferenceSdLink(
  155. IN PSDLINK pSdLink
  156. );
  157. PSDLINK
  158. IcaGetNextSdLink(
  159. IN PSDLINK pSdLink
  160. );
  161. PSDLINK
  162. IcaGetPreviousSdLink(
  163. IN PSDLINK pSdLink
  164. );
  165. VOID
  166. IcaKeepAliveThread(
  167. IN PVOID pData
  168. );
  169. NTSTATUS
  170. CaptureUsermodeBuffer (
  171. IN PIRP Irp,
  172. IN PIO_STACK_LOCATION IrpSp,
  173. OUT PVOID *pInBuffer,
  174. IN ULONG InBufferSize,
  175. OUT PVOID *pOutBuffer,
  176. IN ULONG OutBufferSize,
  177. IN BOOLEAN MethodBuffered,
  178. OUT PVOID *pAllocatedTemporaryBuffer
  179. );
  180. /*
  181. * Internal versions of Stack Driver helper routines
  182. */
  183. NTSTATUS
  184. IcaBufferAllocInternal(
  185. IN PSDCONTEXT pContext,
  186. IN BOOLEAN bWait,
  187. IN BOOLEAN bControl,
  188. IN ULONG ByteCount,
  189. IN POUTBUF pOutBufOrig,
  190. OUT POUTBUF *ppOutBuf
  191. );
  192. VOID
  193. IcaBufferFreeInternal(
  194. IN PSDCONTEXT pContext,
  195. IN POUTBUF pOutBuf
  196. );
  197. NTSTATUS
  198. IcaRawInputInternal(
  199. IN PICA_STACK pStack,
  200. IN PINBUF pInBuf OPTIONAL,
  201. IN PCHAR pBuffer OPTIONAL,
  202. IN ULONG ByteCount
  203. );
  204. NTSTATUS
  205. IcaChannelInputInternal(
  206. IN PICA_STACK pStack,
  207. IN CHANNELCLASS ChannelClass,
  208. IN VIRTUALCHANNELCLASS VirtualClass,
  209. IN PINBUF pInBuf OPTIONAL,
  210. IN PCHAR pBuffer OPTIONAL,
  211. IN ULONG ByteCount
  212. );
  213. void
  214. IcaInitializeHandleTable(
  215. void
  216. );
  217. void
  218. IcaCleanupHandleTable(
  219. void
  220. );
  221. /*
  222. * Routines to handle fast IO.
  223. */
  224. #ifdef notdef
  225. BOOLEAN
  226. IcaFastIoRead (
  227. IN struct _FILE_OBJECT *FileObject,
  228. IN PLARGE_INTEGER FileOffset,
  229. IN ULONG Length,
  230. IN BOOLEAN Wait,
  231. IN ULONG LockKey,
  232. OUT PVOID Buffer,
  233. OUT PIO_STATUS_BLOCK IoStatus,
  234. IN struct _DEVICE_OBJECT *DeviceObject
  235. );
  236. BOOLEAN
  237. IcaFastIoWrite (
  238. IN struct _FILE_OBJECT *FileObject,
  239. IN PLARGE_INTEGER FileOffset,
  240. IN ULONG Length,
  241. IN BOOLEAN Wait,
  242. IN ULONG LockKey,
  243. IN PVOID Buffer,
  244. OUT PIO_STATUS_BLOCK IoStatus,
  245. IN struct _DEVICE_OBJECT *DeviceObject
  246. );
  247. BOOLEAN
  248. IcaFastIoDeviceControl (
  249. IN struct _FILE_OBJECT *FileObject,
  250. IN BOOLEAN Wait,
  251. IN PVOID InputBuffer OPTIONAL,
  252. IN ULONG InputBufferLength,
  253. OUT PVOID OutputBuffer OPTIONAL,
  254. IN ULONG OutputBufferLength,
  255. IN ULONG IoControlCode,
  256. OUT PIO_STATUS_BLOCK IoStatus,
  257. IN struct _DEVICE_OBJECT *DeviceObject
  258. );
  259. #endif