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