Import w32api version 2.5 include files
[reactos.git] / reactos / w32api / include / ddk / hidclass.h
1 /*
2 * hidclass.h
3 *
4 * HID class driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23 #ifndef __HIDCLASS_H
24 #define __HIDCLASS_H
25
26 #if __GNUC__ >=3
27 #pragma GCC system_header
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #pragma pack(push,4)
35
36 #include "ntddk.h"
37 #include "hidpi.h"
38
39 #define HID_REVISION 0x00000001
40
41 DEFINE_GUID (GUID_DEVINTERFACE_HID, \
42 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30);
43 DEFINE_GUID (GUID_HID_INTERFACE_NOTIFY, \
44 0x2c4e2e88L, 0x25e6, 0x4c33, 0x88, 0x2f, 0x3d, 0x82, 0xe6, 0x07, 0x36, 0x81);
45 DEFINE_GUID (GUID_HID_INTERFACE_HIDPARSE, \
46 0xf5c315a5, 0x69ac, 0x4bc2, 0x92, 0x79, 0xd0, 0xb6, 0x45, 0x76, 0xf4, 0x4b);
47
48 #define GUID_CLASS_INPUT GUID_DEVINTERFACE_HID
49
50 #define GUID_CLASS_INPUT_STR "4D1E55B2-F16F-11CF-88CB-001111000030"
51
52
53 #define HID_CTL_CODE(id) \
54 CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS)
55 #define HID_BUFFER_CTL_CODE(id) \
56 CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_BUFFERED, FILE_ANY_ACCESS)
57 #define HID_IN_CTL_CODE(id) \
58 CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS)
59 #define HID_OUT_CTL_CODE(id) \
60 CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
61
62
63 #define IOCTL_GET_PHYSICAL_DESCRIPTOR HID_OUT_CTL_CODE(102)
64 #define IOCTL_HID_FLUSH_QUEUE HID_CTL_CODE(101)
65 #define IOCTL_HID_GET_COLLECTION_DESCRIPTOR HID_CTL_CODE(100)
66 #define IOCTL_HID_GET_COLLECTION_INFORMATION HID_BUFFER_CTL_CODE(106)
67 #define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100)
68 #define IOCTL_HID_GET_HARDWARE_ID HID_OUT_CTL_CODE(103)
69 #define IOCTL_HID_GET_INDEXED_STRING HID_OUT_CTL_CODE(120)
70 #define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104)
71 #define IOCTL_HID_GET_MANUFACTURER_STRING HID_OUT_CTL_CODE(110)
72 #define IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(104)
73 #define IOCTL_HID_GET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(102)
74 #define IOCTL_HID_GET_PRODUCT_STRING HID_OUT_CTL_CODE(111)
75 #define IOCTL_HID_GET_SERIALNUMBER_STRING HID_OUT_CTL_CODE(112)
76 #define IOCTL_HID_SET_FEATURE HID_IN_CTL_CODE(100)
77 #define IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(105)
78 #define IOCTL_HID_SET_OUTPUT_REPORT HID_IN_CTL_CODE(101)
79 #define IOCTL_HID_SET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(103)
80
81 #define IOCTL_HID_GET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(100)
82 #define IOCTL_HID_SET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(101)
83 #define IOCTL_HID_GET_MS_GENRE_DESCRIPTOR HID_OUT_CTL_CODE(121)
84
85
86 enum DeviceObjectState {
87 DeviceObjectStarted = 0,
88 DeviceObjectStopped,
89 DeviceObjectRemoved
90 };
91
92 typedef VOID DDKAPI (*PHID_STATUS_CHANGE)(
93 PVOID Context,
94 enum DeviceObjectState State);
95
96 typedef NTSTATUS DDKAPI (*PHIDP_GETCAPS)(
97 IN PHIDP_PREPARSED_DATA PreparsedData,
98 OUT PHIDP_CAPS Capabilities);
99
100 typedef struct _HID_COLLECTION_INFORMATION {
101 ULONG DescriptorSize;
102 BOOLEAN Polled;
103 UCHAR Reserved1[1];
104 USHORT VendorID;
105 USHORT ProductID;
106 USHORT VersionNumber;
107 } HID_COLLECTION_INFORMATION, *PHID_COLLECTION_INFORMATION;
108
109 typedef struct _HID_DRIVER_CONFIG {
110 ULONG Size;
111 ULONG RingBufferSize;
112 } HID_DRIVER_CONFIG, *PHID_DRIVER_CONFIG;
113
114 typedef struct _HID_INTERFACE_HIDPARSE {
115 #if 0
116 /* FIXME: COM stuff */
117 #ifdef __cplusplus
118 INTERFACE i;
119 #else
120 INTERFACE;
121 #endif
122 #endif
123 PHIDP_GETCAPS HidpGetCaps;
124 } HID_INTERFACE_HIDPARSE, *PHID_INTERFACE_HIDPARSE;
125
126 typedef struct _HID_INTERFACE_NOTIFY_PNP {
127 #if 0
128 /* FIXME: COM stuff */
129 #ifdef __cplusplus
130 INTERFACE i;
131 #else
132 INTERFACE;
133 #endif
134 #endif
135 PHID_STATUS_CHANGE StatusChangeFn;
136 PVOID CallbackContext;
137 } HID_INTERFACE_NOTIFY_PNP, *PHID_INTERFACE_NOTIFY_PNP;
138
139 typedef struct _HID_XFER_PACKET {
140 PUCHAR reportBuffer;
141 ULONG reportBufferLen;
142 UCHAR reportId;
143 } HID_XFER_PACKET, *PHID_XFER_PACKET;
144
145 #pragma pack(pop)
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif /* __HIDCLASS_H */