/vc6/include/wnet/hidsdi.h

https://github.com/weolar/miniblink49 · C Header · 487 lines · 124 code · 35 blank · 328 comment · 0 complexity · 8f83a82394c8aab4a50311026bac7568 MD5 · raw file

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