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.

493 lines
14 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. HIDSDI.H
  5. Abstract:
  6. This module contains the PUBLIC definitions for the
  7. code that implements the HID dll.
  8. Environment:
  9. Kernel & user mode
  10. @@BEGIN_DDKSPLIT
  11. Revision History:
  12. Aug-96 : created by Kenneth Ray
  13. @@END_DDKSPLIT
  14. --*/
  15. #ifndef _HIDSDI_H
  16. #define _HIDSDI_H
  17. #include <pshpack4.h>
  18. //#include "wtypes.h"
  19. //#include <windef.h>
  20. //#include <win32.h>
  21. //#include <basetyps.h>
  22. typedef LONG NTSTATUS;
  23. #include "hidusage.h"
  24. #include "hidpi.h"
  25. typedef struct _HIDD_CONFIGURATION {
  26. PVOID cookie;
  27. ULONG size;
  28. ULONG RingBufferSize;
  29. } HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;
  30. typedef struct _HIDD_ATTRIBUTES {
  31. ULONG Size; // = sizeof (struct _HIDD_ATTRIBUTES)
  32. //
  33. // Vendor ids of this hid device
  34. //
  35. USHORT VendorID;
  36. USHORT ProductID;
  37. USHORT VersionNumber;
  38. //
  39. // Additional fields will be added to the end of this structure.
  40. //
  41. } HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
  42. BOOLEAN __stdcall
  43. HidD_GetAttributes (
  44. IN HANDLE HidDeviceObject,
  45. OUT PHIDD_ATTRIBUTES Attributes
  46. );
  47. /*++
  48. Routine Description:
  49. Fill in the given HIDD_ATTRIBUTES structure with the attributes of the
  50. given hid device.
  51. --*/
  52. void __stdcall
  53. HidD_GetHidGuid (
  54. OUT LPGUID HidGuid
  55. );
  56. BOOLEAN __stdcall
  57. HidD_GetPreparsedData (
  58. IN HANDLE HidDeviceObject,
  59. OUT PHIDP_PREPARSED_DATA * PreparsedData
  60. );
  61. /*++
  62. Routine Description:
  63. Given a handle to a valid Hid Class Device Object, retrieve the preparsed
  64. data for the device. This routine will allocate the appropriately
  65. sized buffer to hold this preparsed data. It is up to client to call
  66. HidP_FreePreparsedData to free the memory allocated to this structure when
  67. it is no longer needed.
  68. Arguments:
  69. HidDeviceObject A handle to a Hid Device that the client obtains using
  70. a call to CreateFile on a valid Hid device string name.
  71. The string name can be obtained using standard PnP calls.
  72. PreparsedData An opaque data structure used by other functions in this
  73. library to retrieve information about a given device.
  74. Return Value:
  75. TRUE if successful.
  76. FALSE otherwise -- Use GetLastError() to get extended error information
  77. --*/
  78. BOOLEAN __stdcall
  79. HidD_FreePreparsedData (
  80. IN PHIDP_PREPARSED_DATA PreparsedData
  81. );
  82. BOOLEAN __stdcall
  83. HidD_FlushQueue (
  84. IN HANDLE HidDeviceObject
  85. );
  86. /*++
  87. Routine Description:
  88. Flush the input queue for the given HID device.
  89. Arguments:
  90. HidDeviceObject A handle to a Hid Device that the client obtains using
  91. a call to CreateFile on a valid Hid device string name.
  92. The string name can be obtained using standard PnP calls.
  93. Return Value:
  94. TRUE if successful
  95. FALSE otherwise -- Use GetLastError() to get extended error information
  96. --*/
  97. BOOLEAN __stdcall
  98. HidD_GetConfiguration (
  99. IN HANDLE HidDeviceObject,
  100. OUT PHIDD_CONFIGURATION Configuration,
  101. IN ULONG ConfigurationLength
  102. );
  103. /*++
  104. Routine Description:
  105. Get the configuration information for this Hid device
  106. Arguments:
  107. HidDeviceObject A handle to a Hid Device Object.
  108. Configuration A configuration structure. HidD_GetConfiguration MUST
  109. be called before the configuration can be modified and
  110. set using HidD_SetConfiguration
  111. ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this
  112. parameter, we can later increase the length of the
  113. configuration array and not break older apps.
  114. Return Value:
  115. TRUE if successful
  116. FALSE otherwise -- Use GetLastError() to get extended error information
  117. --*/
  118. BOOLEAN __stdcall
  119. HidD_SetConfiguration (
  120. IN HANDLE HidDeviceObject,
  121. IN PHIDD_CONFIGURATION Configuration,
  122. IN ULONG ConfigurationLength
  123. );
  124. /*++
  125. Routine Description:
  126. Set the configuration information for this Hid device...
  127. NOTE: HidD_GetConfiguration must be called to retrieve the current
  128. configuration information before this information can be modified
  129. and set.
  130. Arguments:
  131. HidDeviceObject A handle to a Hid Device Object.
  132. Configuration A configuration structure. HidD_GetConfiguration MUST
  133. be called before the configuration can be modified and
  134. set using HidD_SetConfiguration
  135. ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this
  136. parameter, we can later increase the length of the
  137. configuration array and not break older apps.
  138. Return Value:
  139. TRUE if successful
  140. FALSE otherwise -- Use GetLastError() to get extended error information
  141. --*/
  142. BOOLEAN __stdcall
  143. HidD_GetFeature (
  144. IN HANDLE HidDeviceObject,
  145. OUT PVOID ReportBuffer,
  146. IN ULONG ReportBufferLength
  147. );
  148. /*++
  149. Routine Description:
  150. Retrieve a feature report from a HID device.
  151. Arguments:
  152. HidDeviceObject A handle to a Hid Device Object.
  153. ReportBuffer The buffer that the feature report should be placed
  154. into. The first byte of the buffer should be set to
  155. the report ID of the desired report
  156. ReportBufferLength The size (in bytes) of ReportBuffer. This value
  157. should be greater than or equal to the
  158. FeatureReportByteLength field as specified in the
  159. HIDP_CAPS structure for the device
  160. Return Value:
  161. TRUE if successful
  162. FALSE otherwise -- Use GetLastError() to get extended error information
  163. --*/
  164. BOOLEAN __stdcall
  165. HidD_SetFeature (
  166. IN HANDLE HidDeviceObject,
  167. IN PVOID ReportBuffer,
  168. IN ULONG ReportBufferLength
  169. );
  170. /*++
  171. Routine Description:
  172. Send a feature report to a HID device.
  173. Arguments:
  174. HidDeviceObject A handle to a Hid Device Object.
  175. ReportBuffer The buffer of the feature report to send to the device
  176. ReportBufferLength The size (in bytes) of ReportBuffer. This value
  177. should be greater than or equal to the
  178. FeatureReportByteLength field as specified in the
  179. HIDP_CAPS structure for the device
  180. Return Value:
  181. TRUE if successful
  182. FALSE otherwise -- Use GetLastError() to get extended error information
  183. --*/
  184. BOOLEAN __stdcall
  185. HidD_GetInputReport (
  186. IN HANDLE HidDeviceObject,
  187. OUT PVOID ReportBuffer,
  188. IN ULONG ReportBufferLength
  189. );
  190. /*++
  191. Routine Description:
  192. Retrieve an input report from a HID device.
  193. Arguments:
  194. HidDeviceObject A handle to a Hid Device Object.
  195. ReportBuffer The buffer that the input report should be placed
  196. into. The first byte of the buffer should be set to
  197. the report ID of the desired report
  198. ReportBufferLength The size (in bytes) of ReportBuffer. This value
  199. should be greater than or equal to the
  200. InputReportByteLength field as specified in the
  201. HIDP_CAPS structure for the device
  202. Return Value:
  203. TRUE if successful
  204. FALSE otherwise -- Use GetLastError() to get extended error information
  205. --*/
  206. BOOLEAN __stdcall
  207. HidD_SetOutputReport (
  208. IN HANDLE HidDeviceObject,
  209. IN PVOID ReportBuffer,
  210. IN ULONG ReportBufferLength
  211. );
  212. /*++
  213. Routine Description:
  214. Send an output report to a HID device.
  215. Arguments:
  216. HidDeviceObject A handle to a Hid Device Object.
  217. ReportBuffer The buffer of the output report to send to the device
  218. ReportBufferLength The size (in bytes) of ReportBuffer. This value
  219. should be greater than or equal to the
  220. OutputReportByteLength field as specified in the
  221. HIDP_CAPS structure for the device
  222. Return Value:
  223. TRUE if successful
  224. FALSE otherwise -- Use GetLastError() to get extended error information
  225. --*/
  226. BOOLEAN __stdcall
  227. HidD_GetNumInputBuffers (
  228. IN HANDLE HidDeviceObject,
  229. OUT PULONG NumberBuffers
  230. );
  231. /*++
  232. Routine Description:
  233. This function returns the number of input buffers used by the specified
  234. file handle to the Hid device. Each file object has a number of buffers
  235. associated with it to queue reports read from the device but which have
  236. not yet been read by the user-mode app with a handle to that device.
  237. Arguments:
  238. HidDeviceObject A handle to a Hid Device Object.
  239. NumberBuffers Number of buffers currently being used for this file
  240. handle to the Hid device
  241. Return Value:
  242. TRUE if successful
  243. FALSE otherwise -- Use GetLastError() to get extended error information
  244. --*/
  245. BOOLEAN __stdcall
  246. HidD_SetNumInputBuffers (
  247. IN HANDLE HidDeviceObject,
  248. OUT ULONG NumberBuffers
  249. );
  250. /*++
  251. Routine Description:
  252. This function sets the number of input buffers used by the specified
  253. file handle to the Hid device. Each file object has a number of buffers
  254. associated with it to queue reports read from the device but which have
  255. not yet been read by the user-mode app with a handle to that device.
  256. Arguments:
  257. HidDeviceObject A handle to a Hid Device Object.
  258. NumberBuffers New number of buffers to use for this file handle to
  259. the Hid device
  260. Return Value:
  261. TRUE if successful
  262. FALSE otherwise -- Use GetLastError() to get extended error information
  263. --*/
  264. BOOLEAN __stdcall
  265. HidD_GetPhysicalDescriptor (
  266. IN HANDLE HidDeviceObject,
  267. OUT PVOID Buffer,
  268. IN ULONG BufferLength
  269. );
  270. /*++
  271. Routine Description:
  272. This function retrieves the raw physical descriptor for the specified
  273. Hid device.
  274. Arguments:
  275. HidDeviceObject A handle to a Hid Device Object.
  276. Buffer Buffer which on return will contain the physical
  277. descriptor if one exists for the specified device
  278. handle
  279. BufferLength Length of buffer (in bytes)
  280. Return Value:
  281. TRUE if successful
  282. FALSE otherwise -- Use GetLastError() to get extended error information
  283. --*/
  284. BOOLEAN __stdcall
  285. HidD_GetManufacturerString (
  286. IN HANDLE HidDeviceObject,
  287. OUT PVOID Buffer,
  288. IN ULONG BufferLength
  289. );
  290. /*++
  291. Routine Description:
  292. This function retrieves the manufacturer string from the specified
  293. Hid device.
  294. Arguments:
  295. HidDeviceObject A handle to a Hid Device Object.
  296. Buffer Buffer which on return will contain the manufacturer
  297. string returned from the device. This string is a
  298. wide-character string
  299. BufferLength Length of Buffer (in bytes)
  300. Return Value:
  301. TRUE if successful
  302. FALSE otherwise -- Use GetLastError() to get extended error information
  303. --*/
  304. BOOLEAN __stdcall
  305. HidD_GetProductString (
  306. IN HANDLE HidDeviceObject,
  307. OUT PVOID Buffer,
  308. IN ULONG BufferLength
  309. );
  310. /*++
  311. Routine Description:
  312. This function retrieves the product string from the specified
  313. Hid device.
  314. Arguments:
  315. HidDeviceObject A handle to a Hid Device Object.
  316. Buffer Buffer which on return will contain the product
  317. string returned from the device. This string is a
  318. wide-character string
  319. BufferLength Length of Buffer (in bytes)
  320. Return Value:
  321. TRUE if successful
  322. FALSE otherwise -- Use GetLastError() to get extended error information
  323. --*/
  324. BOOLEAN __stdcall
  325. HidD_GetIndexedString (
  326. IN HANDLE HidDeviceObject,
  327. IN ULONG StringIndex,
  328. OUT PVOID Buffer,
  329. IN ULONG BufferLength
  330. );
  331. /*++
  332. Routine Description:
  333. This function retrieves a string from the specified Hid device that is
  334. specified with a certain string index.
  335. Arguments:
  336. HidDeviceObject A handle to a Hid Device Object.
  337. StringIndex Index of the string to retrieve
  338. Buffer Buffer which on return will contain the product
  339. string returned from the device. This string is a
  340. wide-character string
  341. BufferLength Length of Buffer (in bytes)
  342. Return Value:
  343. TRUE if successful
  344. FALSE otherwise -- Use GetLastError() to get extended error information
  345. --*/
  346. BOOLEAN __stdcall
  347. HidD_GetSerialNumberString (
  348. IN HANDLE HidDeviceObject,
  349. OUT PVOID Buffer,
  350. IN ULONG BufferLength
  351. );
  352. /*++
  353. Routine Description:
  354. This function retrieves the serial number string from the specified
  355. Hid device.
  356. Arguments:
  357. HidDeviceObject A handle to a Hid Device Object.
  358. Buffer Buffer which on return will contain the serial number
  359. string returned from the device. This string is a
  360. wide-character string
  361. BufferLength Length of Buffer (in bytes)
  362. Return Value:
  363. TRUE if successful
  364. FALSE otherwise -- Use GetLastError() to get extended error information
  365. --*/
  366. BOOLEAN __stdcall
  367. HidD_GetMsGenreDescriptor (
  368. IN HANDLE HidDeviceObject,
  369. OUT PVOID Buffer,
  370. IN ULONG BufferLength
  371. );
  372. /*++
  373. Routine Description:
  374. This function retrieves the Microsoft Genre descriptor from the specified
  375. Hid device.
  376. Arguments:
  377. HidDeviceObject A handle to a Hid Device Object.
  378. Buffer Buffer which on return will contain the descriptor
  379. returned from the device.
  380. BufferLength Length of Buffer (in bytes)
  381. Return Value:
  382. TRUE if successful
  383. FALSE otherwise -- Use GetLastError() to get extended error information
  384. --*/
  385. #include <poppack.h>
  386. #endif