3 Copyright (c) 1996 Microsoft Corporation
11 This module contains the PUBLIC definitions for the
12 code that implements the HID dll.
30 //#include <basetyps.h>
32 typedef LONG NTSTATUS
;
36 typedef struct _HIDD_CONFIGURATION
{
40 } HIDD_CONFIGURATION
, *PHIDD_CONFIGURATION
;
42 typedef struct _HIDD_ATTRIBUTES
{
43 ULONG Size
; // = sizeof (struct _HIDD_ATTRIBUTES)
46 // Vendor ids of this hid device
53 // Additional fields will be added to the end of this structure.
55 } HIDD_ATTRIBUTES
, *PHIDD_ATTRIBUTES
;
60 IN HANDLE HidDeviceObject
,
61 OUT PHIDD_ATTRIBUTES Attributes
65 Fill in the given HIDD_ATTRIBUTES structure with the attributes of the
77 HidD_GetPreparsedData (
78 IN HANDLE HidDeviceObject
,
79 OUT PHIDP_PREPARSED_DATA
* PreparsedData
83 Given a handle to a valid Hid Class Device Object, retrieve the preparsed
84 data for the device. This routine will allocate the appropriately
85 sized buffer to hold this preparsed data. It is up to client to call
86 HidP_FreePreparsedData to free the memory allocated to this structure when
87 it is no longer needed.
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.
94 PreparsedData An opaque data structure used by other functions in this
95 library to retrieve information about a given device.
99 FALSE otherwise -- Use GetLastError() to get extended error information
103 HidD_FreePreparsedData (
104 IN PHIDP_PREPARSED_DATA PreparsedData
109 IN HANDLE HidDeviceObject
113 Flush the input queue for the given HID device.
116 HidDeviceObject A handle to a Hid Device that the client obtains using
117 a call to CreateFile on a valid Hid device string name.
118 The string name can be obtained using standard PnP calls.
122 FALSE otherwise -- Use GetLastError() to get extended error information
126 HidD_GetConfiguration (
127 IN HANDLE HidDeviceObject
,
128 OUT PHIDD_CONFIGURATION Configuration
,
129 IN ULONG ConfigurationLength
133 Get the configuration information for this Hid device
136 HidDeviceObject A handle to a Hid Device Object.
138 Configuration A configuration structure. HidD_GetConfiguration MUST
139 be called before the configuration can be modified and
140 set using HidD_SetConfiguration
142 ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this
143 parameter, we can later increase the length of the
144 configuration array and not break older apps.
148 FALSE otherwise -- Use GetLastError() to get extended error information
152 HidD_SetConfiguration (
153 IN HANDLE HidDeviceObject
,
154 IN PHIDD_CONFIGURATION Configuration
,
155 IN ULONG ConfigurationLength
159 Set the configuration information for this Hid device...
161 NOTE: HidD_GetConfiguration must be called to retrieve the current
162 configuration information before this information can be modified
166 HidDeviceObject A handle to a Hid Device Object.
168 Configuration A configuration structure. HidD_GetConfiguration MUST
169 be called before the configuration can be modified and
170 set using HidD_SetConfiguration
172 ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this
173 parameter, we can later increase the length of the
174 configuration array and not break older apps.
178 FALSE otherwise -- Use GetLastError() to get extended error information
183 IN HANDLE HidDeviceObject
,
184 OUT PVOID ReportBuffer
,
185 IN ULONG ReportBufferLength
189 Retrieve a feature report from a HID device.
192 HidDeviceObject A handle to a Hid Device Object.
194 ReportBuffer The buffer that the feature report should be placed
195 into. The first byte of the buffer should be set to
196 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 FeatureReportByteLength field as specified in the
201 HIDP_CAPS structure for the device
204 FALSE otherwise -- Use GetLastError() to get extended error information
209 IN HANDLE HidDeviceObject
,
210 IN PVOID ReportBuffer
,
211 IN ULONG ReportBufferLength
215 Send a feature report to a HID device.
218 HidDeviceObject A handle to a Hid Device Object.
220 ReportBuffer The buffer of the feature report to send to the device
222 ReportBufferLength The size (in bytes) of ReportBuffer. This value
223 should be greater than or equal to the
224 FeatureReportByteLength field as specified in the
225 HIDP_CAPS structure for the device
228 FALSE otherwise -- Use GetLastError() to get extended error information
232 HidD_GetNumInputBuffers (
233 IN HANDLE HidDeviceObject
,
234 OUT PULONG NumberBuffers
238 This function returns the number of input buffers used by the specified
239 file handle to the Hid device. Each file object has a number of buffers
240 associated with it to queue reports read from the device but which have
241 not yet been read by the user-mode app with a handle to that device.
244 HidDeviceObject A handle to a Hid Device Object.
246 NumberBuffers Number of buffers currently being used for this file
247 handle to the Hid device
251 FALSE otherwise -- Use GetLastError() to get extended error information
255 HidD_SetNumInputBuffers (
256 IN HANDLE HidDeviceObject
,
257 OUT ULONG NumberBuffers
262 This function sets the number of input buffers used by the specified
263 file handle to the Hid device. Each file object has a number of buffers
264 associated with it to queue reports read from the device but which have
265 not yet been read by the user-mode app with a handle to that device.
268 HidDeviceObject A handle to a Hid Device Object.
270 NumberBuffers New number of buffers to use for this file handle to
275 FALSE otherwise -- Use GetLastError() to get extended error information
279 HidD_GetPhysicalDescriptor (
280 IN HANDLE HidDeviceObject
,
282 IN ULONG BufferLength
286 This function retrieves the raw physical descriptor for the specified
290 HidDeviceObject A handle to a Hid Device Object.
292 Buffer Buffer which on return will contain the physical
293 descriptor if one exists for the specified device
296 BufferLength Length of buffer (in bytes)
301 FALSE otherwise -- Use GetLastError() to get extended error information
305 HidD_GetManufacturerString (
306 IN HANDLE HidDeviceObject
,
308 IN ULONG BufferLength
312 This function retrieves the manufacturer string from the specified
316 HidDeviceObject A handle to a Hid Device Object.
318 Buffer Buffer which on return will contain the manufacturer
319 string returned from the device. This string is a
320 wide-character string
322 BufferLength Length of Buffer (in bytes)
327 FALSE otherwise -- Use GetLastError() to get extended error information
331 HidD_GetProductString (
332 IN HANDLE HidDeviceObject
,
334 IN ULONG BufferLength
338 This function retrieves the product string from the specified
342 HidDeviceObject A handle to a Hid Device Object.
344 Buffer Buffer which on return will contain the product
345 string returned from the device. This string is a
346 wide-character string
348 BufferLength Length of Buffer (in bytes)
353 FALSE otherwise -- Use GetLastError() to get extended error information
357 HidD_GetIndexedString (
358 IN HANDLE HidDeviceObject
,
359 IN ULONG StringIndex
,
361 IN ULONG BufferLength
365 This function retrieves a string from the specified Hid device that is
366 specified with a certain string index.
369 HidDeviceObject A handle to a Hid Device Object.
371 StringIndex Index of the string to retrieve
373 Buffer Buffer which on return will contain the product
374 string returned from the device. This string is a
375 wide-character string
377 BufferLength Length of Buffer (in bytes)
381 FALSE otherwise -- Use GetLastError() to get extended error information
385 HidD_GetSerialNumberString (
386 IN HANDLE HidDeviceObject
,
388 IN ULONG BufferLength
392 This function retrieves the serial number string from the specified
396 HidDeviceObject A handle to a Hid Device Object.
398 Buffer Buffer which on return will contain the serial number
399 string returned from the device. This string is a
400 wide-character string
402 BufferLength Length of Buffer (in bytes)
406 FALSE otherwise -- Use GetLastError() to get extended error information