Assorted header comment cleanup.
[wine] / include / dinput.h
1 /*
2  * Copyright (C) the Wine project
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef __DINPUT_INCLUDED__
20 #define __DINPUT_INCLUDED__
21
22 #define COM_NO_WINDOWS_H
23 #include <objbase.h>
24
25 #ifndef DIRECTINPUT_VERSION
26 #define DIRECTINPUT_VERSION     0x0800
27 #endif
28
29 /* Classes */
30 DEFINE_GUID(CLSID_DirectInput,          0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 DEFINE_GUID(CLSID_DirectInputDevice,    0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
32
33 DEFINE_GUID(CLSID_DirectInput8,         0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
34 DEFINE_GUID(CLSID_DirectInputDevice8,   0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35
36 /* Interfaces */
37 DEFINE_GUID(IID_IDirectInputA,          0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
38 DEFINE_GUID(IID_IDirectInputW,          0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
39 DEFINE_GUID(IID_IDirectInput2A,         0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
40 DEFINE_GUID(IID_IDirectInput2W,         0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
41 DEFINE_GUID(IID_IDirectInput7A,         0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
42 DEFINE_GUID(IID_IDirectInput7W,         0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
43 DEFINE_GUID(IID_IDirectInput8A,         0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
44 DEFINE_GUID(IID_IDirectInput8W,         0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
45 DEFINE_GUID(IID_IDirectInputDeviceA,    0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
46 DEFINE_GUID(IID_IDirectInputDeviceW,    0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
47 DEFINE_GUID(IID_IDirectInputDevice2A,   0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
48 DEFINE_GUID(IID_IDirectInputDevice2W,   0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
49 DEFINE_GUID(IID_IDirectInputDevice7A,   0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
50 DEFINE_GUID(IID_IDirectInputDevice7W,   0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
51 DEFINE_GUID(IID_IDirectInputDevice8A,   0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
52 DEFINE_GUID(IID_IDirectInputDevice8W,   0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
53 DEFINE_GUID(IID_IDirectInputEffect,     0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
54
55 /* Predefined object types */
56 DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
57 DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
58 DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
59 DEFINE_GUID(GUID_RxAxis,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
60 DEFINE_GUID(GUID_RyAxis,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
61 DEFINE_GUID(GUID_RzAxis,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
62 DEFINE_GUID(GUID_Slider,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
63 DEFINE_GUID(GUID_Button,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
64 DEFINE_GUID(GUID_Key,   0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
65 DEFINE_GUID(GUID_POV,   0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
66 DEFINE_GUID(GUID_Unknown,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
67
68 /* Predefined product GUIDs */
69 DEFINE_GUID(GUID_SysMouse,      0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
70 DEFINE_GUID(GUID_SysKeyboard,   0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
71 DEFINE_GUID(GUID_Joystick,      0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
72 DEFINE_GUID(GUID_SysMouseEm,    0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
73 DEFINE_GUID(GUID_SysMouseEm2,   0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
74 DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
75 DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
76
77 /* predefined forcefeedback effects */
78 DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
79 DEFINE_GUID(GUID_RampForce,     0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
80 DEFINE_GUID(GUID_Square,        0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
81 DEFINE_GUID(GUID_Sine,          0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
82 DEFINE_GUID(GUID_Triangle,      0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
83 DEFINE_GUID(GUID_SawtoothUp,    0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
84 DEFINE_GUID(GUID_SawtoothDown,  0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
85 DEFINE_GUID(GUID_Spring,        0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
86 DEFINE_GUID(GUID_Damper,        0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
87 DEFINE_GUID(GUID_Inertia,       0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
88 DEFINE_GUID(GUID_Friction,      0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
89 DEFINE_GUID(GUID_CustomForce,   0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
90
91 typedef struct IDirectInputA *LPDIRECTINPUTA;
92 typedef struct IDirectInputW *LPDIRECTINPUTW;
93 typedef struct IDirectInput2A *LPDIRECTINPUT2A;
94 typedef struct IDirectInput2W *LPDIRECTINPUT2W;
95 typedef struct IDirectInput7A *LPDIRECTINPUT7A;
96 typedef struct IDirectInput7W *LPDIRECTINPUT7W;
97 typedef struct IDirectInput8A *LPDIRECTINPUT8A;
98 typedef struct IDirectInput8W *LPDIRECTINPUT8W;
99 typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA;
100 typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW;
101 typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A;
102 typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W;
103 typedef struct IDirectInputDevice7A *LPDIRECTINPUTDEVICE7A;
104 typedef struct IDirectInputDevice7W *LPDIRECTINPUTDEVICE7W;
105 typedef struct IDirectInputDevice8A *LPDIRECTINPUTDEVICE8A;
106 typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W;
107 typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT;
108 typedef struct SysKeyboardA *LPSYSKEYBOARDA;
109 typedef struct SysMouseA *LPSYSMOUSEA;
110
111 #define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput)
112 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT)
113 #define IID_IDirectInput2 WINELIB_NAME_AW(IID_IDirectInput2)
114 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT2)
115 #define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7)
116 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7)
117 #define IID_IDirectInput8 WINELIB_NAME_AW(IID_IDirectInput8)
118 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT8)
119 #define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice)
120 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE)
121 #define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2)
122 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2)
123 #define IID_IDirectInputDevice7 WINELIB_NAME_AW(IID_IDirectInputDevice7)
124 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE7)
125 #define IID_IDirectInputDevice8 WINELIB_NAME_AW(IID_IDirectInputDevice8)
126 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8)
127
128 #define DI_OK                           S_OK
129 #define DI_NOTATTACHED                  S_FALSE
130 #define DI_BUFFEROVERFLOW               S_FALSE
131 #define DI_PROPNOEFFECT                 S_FALSE
132 #define DI_NOEFFECT                     S_FALSE
133 #define DI_POLLEDDEVICE                 ((HRESULT)0x00000002)
134 #define DI_DOWNLOADSKIPPED              ((HRESULT)0x00000003)
135 #define DI_EFFECTRESTARTED              ((HRESULT)0x00000004)
136 #define DI_TRUNCATED                    ((HRESULT)0x00000008)
137 #define DI_TRUNCATEDANDRESTARTED        ((HRESULT)0x0000000C)
138
139 #define DIERR_OLDDIRECTINPUTVERSION     \
140     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
141 #define DIERR_BETADIRECTINPUTVERSION    \
142     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
143 #define DIERR_BADDRIVERVER              \
144     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
145 #define DIERR_DEVICENOTREG              REGDB_E_CLASSNOTREG
146 #define DIERR_NOTFOUND                  \
147     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
148 #define DIERR_OBJECTNOTFOUND            \
149     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
150 #define DIERR_INVALIDPARAM              E_INVALIDARG
151 #define DIERR_NOINTERFACE               E_NOINTERFACE
152 #define DIERR_GENERIC                   E_FAIL
153 #define DIERR_OUTOFMEMORY               E_OUTOFMEMORY
154 #define DIERR_UNSUPPORTED               E_NOTIMPL
155 #define DIERR_NOTINITIALIZED            \
156     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
157 #define DIERR_ALREADYINITIALIZED        \
158     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
159 #define DIERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
160 #define DIERR_OTHERAPPHASPRIO           E_ACCESSDENIED
161 #define DIERR_INPUTLOST                 \
162     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
163 #define DIERR_ACQUIRED                  \
164     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
165 #define DIERR_NOTACQUIRED               \
166     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
167 #define DIERR_READONLY                  E_ACCESSDENIED
168 #define DIERR_HANDLEEXISTS              E_ACCESSDENIED
169 #ifndef E_PENDING
170 #define E_PENDING                       __MSABI_LONG(0x8000000A)
171 #endif
172 #define DIERR_INSUFFICIENTPRIVS         __MSABI_LONG(0x80040200)
173 #define DIERR_DEVICEFULL                __MSABI_LONG(0x80040201)
174 #define DIERR_MOREDATA                  __MSABI_LONG(0x80040202)
175 #define DIERR_NOTDOWNLOADED             __MSABI_LONG(0x80040203)
176 #define DIERR_HASEFFECTS                __MSABI_LONG(0x80040204)
177 #define DIERR_NOTEXCLUSIVEACQUIRED      __MSABI_LONG(0x80040205)
178 #define DIERR_INCOMPLETEEFFECT          __MSABI_LONG(0x80040206)
179 #define DIERR_NOTBUFFERED               __MSABI_LONG(0x80040207)
180 #define DIERR_EFFECTPLAYING             __MSABI_LONG(0x80040208)
181 #define DIERR_UNPLUGGED                 __MSABI_LONG(0x80040209)
182 #define DIERR_REPORTFULL                __MSABI_LONG(0x8004020A)
183 #define DIERR_MAPFILEFAIL               __MSABI_LONG(0x8004020B)
184
185 #define DIENUM_STOP                     0
186 #define DIENUM_CONTINUE                 1
187
188 #define DIEDFL_ALLDEVICES               0x00000000
189 #define DIEDFL_ATTACHEDONLY             0x00000001
190 #define DIEDFL_FORCEFEEDBACK            0x00000100
191 #define DIEDFL_INCLUDEALIASES           0x00010000
192 #define DIEDFL_INCLUDEPHANTOMS          0x00020000
193 #define DIEDFL_INCLUDEHIDDEN            0x00040000
194
195 #define DIDEVTYPE_DEVICE                1
196 #define DIDEVTYPE_MOUSE                 2
197 #define DIDEVTYPE_KEYBOARD              3
198 #define DIDEVTYPE_JOYSTICK              4
199 #define DIDEVTYPE_HID                   0x00010000
200
201 #define DI8DEVCLASS_ALL             0
202 #define DI8DEVCLASS_DEVICE          1
203 #define DI8DEVCLASS_POINTER         2
204 #define DI8DEVCLASS_KEYBOARD        3
205 #define DI8DEVCLASS_GAMECTRL        4
206
207 #define DI8DEVTYPE_DEVICE           0x11
208 #define DI8DEVTYPE_MOUSE            0x12
209 #define DI8DEVTYPE_KEYBOARD         0x13
210 #define DI8DEVTYPE_JOYSTICK         0x14
211 #define DI8DEVTYPE_GAMEPAD          0x15
212 #define DI8DEVTYPE_DRIVING          0x16
213 #define DI8DEVTYPE_FLIGHT           0x17
214 #define DI8DEVTYPE_1STPERSON        0x18
215 #define DI8DEVTYPE_DEVICECTRL       0x19
216 #define DI8DEVTYPE_SCREENPOINTER    0x1A
217 #define DI8DEVTYPE_REMOTE           0x1B
218 #define DI8DEVTYPE_SUPPLEMENTAL     0x1C
219         
220 #define DIDEVTYPEMOUSE_UNKNOWN          1
221 #define DIDEVTYPEMOUSE_TRADITIONAL      2
222 #define DIDEVTYPEMOUSE_FINGERSTICK      3
223 #define DIDEVTYPEMOUSE_TOUCHPAD         4
224 #define DIDEVTYPEMOUSE_TRACKBALL        5
225
226 #define DIDEVTYPEKEYBOARD_UNKNOWN       0
227 #define DIDEVTYPEKEYBOARD_PCXT          1
228 #define DIDEVTYPEKEYBOARD_OLIVETTI      2
229 #define DIDEVTYPEKEYBOARD_PCAT          3
230 #define DIDEVTYPEKEYBOARD_PCENH         4
231 #define DIDEVTYPEKEYBOARD_NOKIA1050     5
232 #define DIDEVTYPEKEYBOARD_NOKIA9140     6
233 #define DIDEVTYPEKEYBOARD_NEC98         7
234 #define DIDEVTYPEKEYBOARD_NEC98LAPTOP   8
235 #define DIDEVTYPEKEYBOARD_NEC98106      9
236 #define DIDEVTYPEKEYBOARD_JAPAN106     10
237 #define DIDEVTYPEKEYBOARD_JAPANAX      11
238 #define DIDEVTYPEKEYBOARD_J3100        12
239
240 #define DIDEVTYPEJOYSTICK_UNKNOWN       1
241 #define DIDEVTYPEJOYSTICK_TRADITIONAL   2
242 #define DIDEVTYPEJOYSTICK_FLIGHTSTICK   3
243 #define DIDEVTYPEJOYSTICK_GAMEPAD       4
244 #define DIDEVTYPEJOYSTICK_RUDDER        5
245 #define DIDEVTYPEJOYSTICK_WHEEL         6
246 #define DIDEVTYPEJOYSTICK_HEADTRACKER   7
247
248 #define DI8DEVTYPEMOUSE_UNKNOWN                     1
249 #define DI8DEVTYPEMOUSE_TRADITIONAL                 2
250 #define DI8DEVTYPEMOUSE_FINGERSTICK                 3
251 #define DI8DEVTYPEMOUSE_TOUCHPAD                    4
252 #define DI8DEVTYPEMOUSE_TRACKBALL                   5
253 #define DI8DEVTYPEMOUSE_ABSOLUTE                    6
254
255 #define DI8DEVTYPEKEYBOARD_UNKNOWN                  0
256 #define DI8DEVTYPEKEYBOARD_PCXT                     1
257 #define DI8DEVTYPEKEYBOARD_OLIVETTI                 2
258 #define DI8DEVTYPEKEYBOARD_PCAT                     3
259 #define DI8DEVTYPEKEYBOARD_PCENH                    4
260 #define DI8DEVTYPEKEYBOARD_NOKIA1050                5
261 #define DI8DEVTYPEKEYBOARD_NOKIA9140                6
262 #define DI8DEVTYPEKEYBOARD_NEC98                    7
263 #define DI8DEVTYPEKEYBOARD_NEC98LAPTOP              8
264 #define DI8DEVTYPEKEYBOARD_NEC98106                 9
265 #define DI8DEVTYPEKEYBOARD_JAPAN106                10
266 #define DI8DEVTYPEKEYBOARD_JAPANAX                 11
267 #define DI8DEVTYPEKEYBOARD_J3100                   12
268
269 #define DI8DEVTYPE_LIMITEDGAMESUBTYPE               1
270
271 #define DI8DEVTYPEJOYSTICK_LIMITED                  DI8DEVTYPE_LIMITEDGAMESUBTYPE
272 #define DI8DEVTYPEJOYSTICK_STANDARD                 2
273
274 #define DI8DEVTYPEGAMEPAD_LIMITED                   DI8DEVTYPE_LIMITEDGAMESUBTYPE
275 #define DI8DEVTYPEGAMEPAD_STANDARD                  2
276 #define DI8DEVTYPEGAMEPAD_TILT                      3
277
278 #define DI8DEVTYPEDRIVING_LIMITED                   DI8DEVTYPE_LIMITEDGAMESUBTYPE
279 #define DI8DEVTYPEDRIVING_COMBINEDPEDALS            2
280 #define DI8DEVTYPEDRIVING_DUALPEDALS                3
281 #define DI8DEVTYPEDRIVING_THREEPEDALS               4
282 #define DI8DEVTYPEDRIVING_HANDHELD                  5
283
284 #define DI8DEVTYPEFLIGHT_LIMITED                    DI8DEVTYPE_LIMITEDGAMESUBTYPE
285 #define DI8DEVTYPEFLIGHT_STICK                      2
286 #define DI8DEVTYPEFLIGHT_YOKE                       3
287 #define DI8DEVTYPEFLIGHT_RC                         4
288
289 #define DI8DEVTYPE1STPERSON_LIMITED                 DI8DEVTYPE_LIMITEDGAMESUBTYPE
290 #define DI8DEVTYPE1STPERSON_UNKNOWN                 2
291 #define DI8DEVTYPE1STPERSON_SIXDOF                  3
292 #define DI8DEVTYPE1STPERSON_SHOOTER                 4
293
294 #define DI8DEVTYPESCREENPTR_UNKNOWN                 2
295 #define DI8DEVTYPESCREENPTR_LIGHTGUN                3
296 #define DI8DEVTYPESCREENPTR_LIGHTPEN                4
297 #define DI8DEVTYPESCREENPTR_TOUCH                   5
298
299 #define DI8DEVTYPEREMOTE_UNKNOWN                    2
300
301 #define DI8DEVTYPEDEVICECTRL_UNKNOWN                2
302 #define DI8DEVTYPEDEVICECTRL_COMMSSELECTION         3
303 #define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4
304
305 #define DI8DEVTYPESUPPLEMENTAL_UNKNOWN              2
306 #define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER    3
307 #define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER          4
308 #define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER          5
309 #define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE       6
310 #define DI8DEVTYPESUPPLEMENTAL_SHIFTER              7
311 #define DI8DEVTYPESUPPLEMENTAL_THROTTLE             8
312 #define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE        9
313 #define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS      10
314 #define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS          11
315 #define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS         12
316 #define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS        13
317         
318 #define GET_DIDEVICE_TYPE(dwDevType)     LOBYTE(dwDevType)
319 #define GET_DIDEVICE_SUBTYPE(dwDevType)  HIBYTE(dwDevType)
320
321 typedef struct DIDEVICEOBJECTINSTANCE_DX3A {
322     DWORD   dwSize;
323     GUID    guidType;
324     DWORD   dwOfs;
325     DWORD   dwType;
326     DWORD   dwFlags;
327     CHAR    tszName[MAX_PATH];
328 } DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A;
329 typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A;
330 typedef struct DIDEVICEOBJECTINSTANCE_DX3W {
331     DWORD   dwSize;
332     GUID    guidType;
333     DWORD   dwOfs;
334     DWORD   dwType;
335     DWORD   dwFlags;
336     WCHAR   tszName[MAX_PATH];
337 } DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W;
338 typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W;
339
340 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE_DX3)
341 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE_DX3)
342 DECL_WINELIB_TYPE_AW(LPCDIDEVICEOBJECTINSTANCE_DX3)
343
344 typedef struct DIDEVICEOBJECTINSTANCEA {
345     DWORD       dwSize;
346     GUID        guidType;
347     DWORD       dwOfs;
348     DWORD       dwType;
349     DWORD       dwFlags;
350     CHAR        tszName[MAX_PATH];
351     DWORD       dwFFMaxForce;
352     DWORD       dwFFForceResolution;
353     WORD        wCollectionNumber;
354     WORD        wDesignatorIndex;
355     WORD        wUsagePage;
356     WORD        wUsage;
357     DWORD       dwDimension;
358     WORD        wExponent;
359     WORD        wReserved;
360 } DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA;
361 typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
362
363 typedef struct DIDEVICEOBJECTINSTANCEW {
364     DWORD       dwSize;
365     GUID        guidType;
366     DWORD       dwOfs;
367     DWORD       dwType;
368     DWORD       dwFlags;
369     WCHAR       tszName[MAX_PATH];
370     DWORD       dwFFMaxForce;
371     DWORD       dwFFForceResolution;
372     WORD        wCollectionNumber;
373     WORD        wDesignatorIndex;
374     WORD        wUsagePage;
375     WORD        wUsage;
376     DWORD       dwDimension;
377     WORD        wExponent;
378     WORD        wReserved;
379 } DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW;
380 typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
381
382 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE)
383 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE)
384 DECL_WINELIB_TYPE_AW(LPCDIDEVICEOBJECTINSTANCE)
385
386 typedef struct DIDEVICEINSTANCE_DX3A {
387     DWORD   dwSize;
388     GUID    guidInstance;
389     GUID    guidProduct;
390     DWORD   dwDevType;
391     CHAR    tszInstanceName[MAX_PATH];
392     CHAR    tszProductName[MAX_PATH];
393 } DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A;
394 typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A;
395 typedef struct DIDEVICEINSTANCE_DX3W {
396     DWORD   dwSize;
397     GUID    guidInstance;
398     GUID    guidProduct;
399     DWORD   dwDevType;
400     WCHAR   tszInstanceName[MAX_PATH];
401     WCHAR   tszProductName[MAX_PATH];
402 } DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W;
403 typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W;
404
405 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE_DX3)
406 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE_DX3)
407 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE_DX3)
408
409 typedef struct DIDEVICEINSTANCEA {
410     DWORD       dwSize;
411     GUID        guidInstance;
412     GUID        guidProduct;
413     DWORD       dwDevType;
414     CHAR        tszInstanceName[MAX_PATH];
415     CHAR        tszProductName[MAX_PATH];
416     GUID        guidFFDriver;
417     WORD        wUsagePage;
418     WORD        wUsage;
419 } DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA;
420 typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA;
421
422 typedef struct DIDEVICEINSTANCEW {
423     DWORD       dwSize;
424     GUID        guidInstance;
425     GUID        guidProduct;
426     DWORD       dwDevType;
427     WCHAR       tszInstanceName[MAX_PATH];
428     WCHAR       tszProductName[MAX_PATH];
429     GUID        guidFFDriver;
430     WORD        wUsagePage;
431     WORD        wUsage;
432 } DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW;
433 typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW;
434
435 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE)
436 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE)
437 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE)
438
439 typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA,LPVOID);
440 typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW,LPVOID);
441 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK)
442
443 #define DIEDBS_MAPPEDPRI1               0x00000001
444 #define DIEDBS_MAPPEDPRI2               0x00000002
445 #define DIEDBS_RECENTDEVICE             0x00000010
446 #define DIEDBS_NEWDEVICE                0x00000020
447
448 #define DIEDBSFL_ATTACHEDONLY           0x00000000
449 #define DIEDBSFL_THISUSER               0x00000010
450 #define DIEDBSFL_FORCEFEEDBACK          DIEDFL_FORCEFEEDBACK
451 #define DIEDBSFL_AVAILABLEDEVICES       0x00001000
452 #define DIEDBSFL_MULTIMICEKEYBOARDS     0x00002000
453 #define DIEDBSFL_NONGAMINGDEVICES       0x00004000
454 #define DIEDBSFL_VALID                  0x00007110
455
456 typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTANCEA,LPDIRECTINPUTDEVICE8A,DWORD,DWORD,LPVOID);
457 typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTANCEW,LPDIRECTINPUTDEVICE8W,DWORD,DWORD,LPVOID);
458 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESBYSEMANTICSCB)
459
460 typedef BOOL (CALLBACK *LPDICONFIGUREDEVICESCALLBACK)(LPUNKNOWN,LPVOID);
461
462 typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA,LPVOID);
463 typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW,LPVOID);
464 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK)
465
466 typedef BOOL (CALLBACK *LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
467
468 #define DIK_ESCAPE          0x01
469 #define DIK_1               0x02
470 #define DIK_2               0x03
471 #define DIK_3               0x04
472 #define DIK_4               0x05
473 #define DIK_5               0x06
474 #define DIK_6               0x07
475 #define DIK_7               0x08
476 #define DIK_8               0x09
477 #define DIK_9               0x0A
478 #define DIK_0               0x0B
479 #define DIK_MINUS           0x0C    /* - on main keyboard */
480 #define DIK_EQUALS          0x0D
481 #define DIK_BACK            0x0E    /* backspace */
482 #define DIK_TAB             0x0F
483 #define DIK_Q               0x10
484 #define DIK_W               0x11
485 #define DIK_E               0x12
486 #define DIK_R               0x13
487 #define DIK_T               0x14
488 #define DIK_Y               0x15
489 #define DIK_U               0x16
490 #define DIK_I               0x17
491 #define DIK_O               0x18
492 #define DIK_P               0x19
493 #define DIK_LBRACKET        0x1A
494 #define DIK_RBRACKET        0x1B
495 #define DIK_RETURN          0x1C    /* Enter on main keyboard */
496 #define DIK_LCONTROL        0x1D
497 #define DIK_A               0x1E
498 #define DIK_S               0x1F
499 #define DIK_D               0x20
500 #define DIK_F               0x21
501 #define DIK_G               0x22
502 #define DIK_H               0x23
503 #define DIK_J               0x24
504 #define DIK_K               0x25
505 #define DIK_L               0x26
506 #define DIK_SEMICOLON       0x27
507 #define DIK_APOSTROPHE      0x28
508 #define DIK_GRAVE           0x29    /* accent grave */
509 #define DIK_LSHIFT          0x2A
510 #define DIK_BACKSLASH       0x2B
511 #define DIK_Z               0x2C
512 #define DIK_X               0x2D
513 #define DIK_C               0x2E
514 #define DIK_V               0x2F
515 #define DIK_B               0x30
516 #define DIK_N               0x31
517 #define DIK_M               0x32
518 #define DIK_COMMA           0x33
519 #define DIK_PERIOD          0x34    /* . on main keyboard */
520 #define DIK_SLASH           0x35    /* / on main keyboard */
521 #define DIK_RSHIFT          0x36
522 #define DIK_MULTIPLY        0x37    /* * on numeric keypad */
523 #define DIK_LMENU           0x38    /* left Alt */
524 #define DIK_SPACE           0x39
525 #define DIK_CAPITAL         0x3A
526 #define DIK_F1              0x3B
527 #define DIK_F2              0x3C
528 #define DIK_F3              0x3D
529 #define DIK_F4              0x3E
530 #define DIK_F5              0x3F
531 #define DIK_F6              0x40
532 #define DIK_F7              0x41
533 #define DIK_F8              0x42
534 #define DIK_F9              0x43
535 #define DIK_F10             0x44
536 #define DIK_NUMLOCK         0x45
537 #define DIK_SCROLL          0x46    /* Scroll Lock */
538 #define DIK_NUMPAD7         0x47
539 #define DIK_NUMPAD8         0x48
540 #define DIK_NUMPAD9         0x49
541 #define DIK_SUBTRACT        0x4A    /* - on numeric keypad */
542 #define DIK_NUMPAD4         0x4B
543 #define DIK_NUMPAD5         0x4C
544 #define DIK_NUMPAD6         0x4D
545 #define DIK_ADD             0x4E    /* + on numeric keypad */
546 #define DIK_NUMPAD1         0x4F
547 #define DIK_NUMPAD2         0x50
548 #define DIK_NUMPAD3         0x51
549 #define DIK_NUMPAD0         0x52
550 #define DIK_DECIMAL         0x53    /* . on numeric keypad */
551 #define DIK_F11             0x57
552 #define DIK_F12             0x58
553 #define DIK_F13             0x64    /*                     (NEC PC98) */
554 #define DIK_F14             0x65    /*                     (NEC PC98) */
555 #define DIK_F15             0x66    /*                     (NEC PC98) */
556 #define DIK_KANA            0x70    /* (Japanese keyboard)            */
557 #define DIK_CONVERT         0x79    /* (Japanese keyboard)            */
558 #define DIK_NOCONVERT       0x7B    /* (Japanese keyboard)            */
559 #define DIK_YEN             0x7D    /* (Japanese keyboard)            */
560 #define DIK_NUMPADEQUALS    0x8D    /* = on numeric keypad (NEC PC98) */
561 #define DIK_CIRCUMFLEX      0x90    /* (Japanese keyboard)            */
562 #define DIK_AT              0x91    /*                     (NEC PC98) */
563 #define DIK_COLON           0x92    /*                     (NEC PC98) */
564 #define DIK_UNDERLINE       0x93    /*                     (NEC PC98) */
565 #define DIK_KANJI           0x94    /* (Japanese keyboard)            */
566 #define DIK_STOP            0x95    /*                     (NEC PC98) */
567 #define DIK_AX              0x96    /*                     (Japan AX) */
568 #define DIK_UNLABELED       0x97    /*                        (J3100) */
569 #define DIK_NUMPADENTER     0x9C    /* Enter on numeric keypad */
570 #define DIK_RCONTROL        0x9D
571 #define DIK_NUMPADCOMMA     0xB3    /* , on numeric keypad (NEC PC98) */
572 #define DIK_DIVIDE          0xB5    /* / on numeric keypad */
573 #define DIK_SYSRQ           0xB7
574 #define DIK_RMENU           0xB8    /* right Alt */
575 #define DIK_PAUSE           0xC5    /* Pause */
576 #define DIK_HOME            0xC7    /* Home on arrow keypad */
577 #define DIK_UP              0xC8    /* UpArrow on arrow keypad */
578 #define DIK_PRIOR           0xC9    /* PgUp on arrow keypad */
579 #define DIK_LEFT            0xCB    /* LeftArrow on arrow keypad */
580 #define DIK_RIGHT           0xCD    /* RightArrow on arrow keypad */
581 #define DIK_END             0xCF    /* End on arrow keypad */
582 #define DIK_DOWN            0xD0    /* DownArrow on arrow keypad */
583 #define DIK_NEXT            0xD1    /* PgDn on arrow keypad */
584 #define DIK_INSERT          0xD2    /* Insert on arrow keypad */
585 #define DIK_DELETE          0xD3    /* Delete on arrow keypad */
586 #define DIK_LWIN            0xDB    /* Left Windows key */
587 #define DIK_RWIN            0xDC    /* Right Windows key */
588 #define DIK_APPS            0xDD    /* AppMenu key */
589 #define DIK_POWER           0xDE
590 #define DIK_SLEEP           0xDF
591 #define DIK_BACKSPACE       DIK_BACK            /* backspace */
592 #define DIK_NUMPADSTAR      DIK_MULTIPLY        /* * on numeric keypad */
593 #define DIK_LALT            DIK_LMENU           /* left Alt */
594 #define DIK_CAPSLOCK        DIK_CAPITAL         /* CapsLock */
595 #define DIK_NUMPADMINUS     DIK_SUBTRACT        /* - on numeric keypad */
596 #define DIK_NUMPADPLUS      DIK_ADD             /* + on numeric keypad */
597 #define DIK_NUMPADPERIOD    DIK_DECIMAL         /* . on numeric keypad */
598 #define DIK_NUMPADSLASH     DIK_DIVIDE          /* / on numeric keypad */
599 #define DIK_RALT            DIK_RMENU           /* right Alt */
600 #define DIK_UPARROW         DIK_UP              /* UpArrow on arrow keypad */
601 #define DIK_PGUP            DIK_PRIOR           /* PgUp on arrow keypad */
602 #define DIK_LEFTARROW       DIK_LEFT            /* LeftArrow on arrow keypad */
603 #define DIK_RIGHTARROW      DIK_RIGHT           /* RightArrow on arrow keypad */
604 #define DIK_DOWNARROW       DIK_DOWN            /* DownArrow on arrow keypad */
605 #define DIK_PGDN            DIK_NEXT            /* PgDn on arrow keypad */
606
607 /* New DirectInput8 style keyboard constants */
608
609 #define DIKEYBOARD_ESCAPE               (DIK_ESCAPE | 0x81000400)
610 #define DIKEYBOARD_1                    (DIK_1 | 0x81000400)
611 #define DIKEYBOARD_2                    (DIK_2 | 0x81000400)
612 #define DIKEYBOARD_3                    (DIK_3 | 0x81000400)
613 #define DIKEYBOARD_4                    (DIK_4 | 0x81000400)
614 #define DIKEYBOARD_5                    (DIK_5 | 0x81000400)
615 #define DIKEYBOARD_6                    (DIK_6 | 0x81000400)
616 #define DIKEYBOARD_7                    (DIK_7 | 0x81000400)
617 #define DIKEYBOARD_8                    (DIK_8 | 0x81000400)
618 #define DIKEYBOARD_9                    (DIK_9 | 0x81000400)
619 #define DIKEYBOARD_0                    (DIK_0 | 0x81000400)
620 #define DIKEYBOARD_MINUS                (DIK_MINUS | 0x81000400)
621 #define DIKEYBOARD_EQUALS               (DIK_EQUALS | 0x81000400)
622 #define DIKEYBOARD_BACK                 (DIK_BACK | 0x81000400)
623 #define DIKEYBOARD_TAB                  (DIK_TAB | 0x81000400)
624 #define DIKEYBOARD_Q                    (DIK_Q | 0x81000400)
625 #define DIKEYBOARD_W                    (DIK_W | 0x81000400)
626 #define DIKEYBOARD_E                    (DIK_E | 0x81000400)
627 #define DIKEYBOARD_R                    (DIK_R | 0x81000400)
628 #define DIKEYBOARD_T                    (DIK_T | 0x81000400)
629 #define DIKEYBOARD_Y                    (DIK_Y | 0x81000400)
630 #define DIKEYBOARD_U                    (DIK_U | 0x81000400)
631 #define DIKEYBOARD_I                    (DIK_I | 0x81000400)
632 #define DIKEYBOARD_O                    (DIK_O | 0x81000400)
633 #define DIKEYBOARD_P                    (DIK_P | 0x81000400)
634 #define DIKEYBOARD_LBRACKET             (DIK_LBRACKET | 0x81000400)
635 #define DIKEYBOARD_RBRACKET             (DIK_RBRACKET | 0x81000400)
636 #define DIKEYBOARD_RETURN               (DIK_RETURN | 0x81000400)
637 #define DIKEYBOARD_LCONTROL             (DIK_LCONTROL | 0x81000400)
638 #define DIKEYBOARD_A                    (DIK_A | 0x81000400)
639 #define DIKEYBOARD_S                    (DIK_S | 0x81000400)
640 #define DIKEYBOARD_D                    (DIK_D | 0x81000400)
641 #define DIKEYBOARD_F                    (DIK_F | 0x81000400)
642 #define DIKEYBOARD_G                    (DIK_G | 0x81000400)
643 #define DIKEYBOARD_H                    (DIK_H | 0x81000400)
644 #define DIKEYBOARD_J                    (DIK_J | 0x81000400)
645 #define DIKEYBOARD_K                    (DIK_K | 0x81000400)
646 #define DIKEYBOARD_L                    (DIK_L | 0x81000400)
647 #define DIKEYBOARD_SEMICOLON            (DIK_SEMICOLON | 0x81000400)
648 #define DIKEYBOARD_APOSTROPHE           (DIK_APOSTROPHE | 0x81000400)
649 #define DIKEYBOARD_GRAVE                (DIK_GRAVE | 0x81000400)
650 #define DIKEYBOARD_LSHIFT               (DIK_LSHIFT | 0x81000400)
651 #define DIKEYBOARD_BACKSLASH            (DIK_BACKSLASH | 0x81000400)
652 #define DIKEYBOARD_Z                    (DIK_Z | 0x81000400)
653 #define DIKEYBOARD_X                    (DIK_X | 0x81000400)
654 #define DIKEYBOARD_C                    (DIK_C | 0x81000400)
655 #define DIKEYBOARD_V                    (DIK_V | 0x81000400)
656 #define DIKEYBOARD_B                    (DIK_B | 0x81000400)
657 #define DIKEYBOARD_N                    (DIK_N | 0x81000400)
658 #define DIKEYBOARD_M                    (DIK_M | 0x81000400)
659 #define DIKEYBOARD_COMMA                (DIK_COMMA | 0x81000400)
660 #define DIKEYBOARD_PERIOD               (DIK_PERIOD | 0x81000400)
661 #define DIKEYBOARD_SLASH                (DIK_SLASH | 0x81000400)
662 #define DIKEYBOARD_RSHIFT               (DIK_RSHIFT | 0x81000400)
663 #define DIKEYBOARD_MULTIPLY             (DIK_MULTIPLY | 0x81000400)
664 #define DIKEYBOARD_LMENU                (DIK_LMENU | 0x81000400)
665 #define DIKEYBOARD_SPACE                (DIK_SPACE | 0x81000400)
666 #define DIKEYBOARD_CAPITAL              (DIK_CAPITAL | 0x81000400)
667 #define DIKEYBOARD_F1                   (DIK_F1 | 0x81000400)
668 #define DIKEYBOARD_F2                   (DIK_F2 | 0x81000400)
669 #define DIKEYBOARD_F3                   (DIK_F3 | 0x81000400)
670 #define DIKEYBOARD_F4                   (DIK_F4 | 0x81000400)
671 #define DIKEYBOARD_F5                   (DIK_F5 | 0x81000400)
672 #define DIKEYBOARD_F6                   (DIK_F6 | 0x81000400)
673 #define DIKEYBOARD_F7                   (DIK_F7 | 0x81000400)
674 #define DIKEYBOARD_F8                   (DIK_F8 | 0x81000400)
675 #define DIKEYBOARD_F9                   (DIK_F9 | 0x81000400)
676 #define DIKEYBOARD_F10                  (DIK_F10 | 0x81000400)
677 #define DIKEYBOARD_NUMLOCK              (DIK_NUMLOCK | 0x81000400)
678 #define DIKEYBOARD_SCROLL               (DIK_SCROLL | 0x81000400)
679 #define DIKEYBOARD_NUMPAD7              (DIK_NUMPAD7 | 0x81000400)
680 #define DIKEYBOARD_NUMPAD8              (DIK_NUMPAD8 | 0x81000400)
681 #define DIKEYBOARD_NUMPAD9              (DIK_NUMPAD9 | 0x81000400)
682 #define DIKEYBOARD_SUBTRACT             (DIK_SUBTRACT | 0x81000400)
683 #define DIKEYBOARD_NUMPAD4              (DIK_NUMPAD4 | 0x81000400)
684 #define DIKEYBOARD_NUMPAD5              (DIK_NUMPAD5 | 0x81000400)
685 #define DIKEYBOARD_NUMPAD6              (DIK_NUMPAD6 | 0x81000400)
686 #define DIKEYBOARD_ADD                  (DIK_ADD | 0x81000400)
687 #define DIKEYBOARD_NUMPAD1              (DIK_NUMPAD1 | 0x81000400)
688 #define DIKEYBOARD_NUMPAD2              (DIK_NUMPAD2 | 0x81000400)
689 #define DIKEYBOARD_NUMPAD3              (DIK_NUMPAD3 | 0x81000400)
690 #define DIKEYBOARD_NUMPAD0              (DIK_NUMPAD0 | 0x81000400)
691 #define DIKEYBOARD_DECIMAL              (DIK_DECIMAL | 0x81000400)
692 #define DIKEYBOARD_F11                  (DIK_F11 | 0x81000400)
693 #define DIKEYBOARD_F12                  (DIK_F12 | 0x81000400)
694 #define DIKEYBOARD_F13                  (DIK_F13 | 0x81000400)
695 #define DIKEYBOARD_F14                  (DIK_F14 | 0x81000400)
696 #define DIKEYBOARD_F15                  (DIK_F15 | 0x81000400)
697 #define DIKEYBOARD_KANA                 (DIK_KANA | 0x81000400)
698 #define DIKEYBOARD_CONVERT              (DIK_CONVERT | 0x81000400)
699 #define DIKEYBOARD_NOCONVERT            (DIK_NOCONVERT | 0x81000400)
700 #define DIKEYBOARD_YEN                  (DIK_YEN | 0x81000400)
701 #define DIKEYBOARD_NUMPADEQUALS         (DIK_NUMPADEQUALS | 0x81000400)
702 #define DIKEYBOARD_CIRCUMFLEX           (DIK_CIRCUMFLEX | 0x81000400)
703 #define DIKEYBOARD_AT                   (DIK_AT | 0x81000400)
704 #define DIKEYBOARD_COLON                (DIK_COLON | 0x81000400)
705 #define DIKEYBOARD_UNDERLINE            (DIK_UNDERLINE | 0x81000400)
706 #define DIKEYBOARD_KANJI                (DIK_KANJI | 0x81000400)
707 #define DIKEYBOARD_STOP                 (DIK_STOP | 0x81000400)
708 #define DIKEYBOARD_AX                   (DIK_AX | 0x81000400)
709 #define DIKEYBOARD_UNLABELED            (DIK_UNLABELED | 0x81000400)
710 #define DIKEYBOARD_NUMPADENTER          (DIK_NUMPADENTER | 0x81000400)
711 #define DIKEYBOARD_RCONTROL             (DIK_RCONTROL | 0x81000400)
712 #define DIKEYBOARD_NUMPADCOMMA          (DIK_NUMPADCOMMA | 0x81000400)
713 #define DIKEYBOARD_DIVIDE               (DIK_DIVIDE | 0x81000400)
714 #define DIKEYBOARD_SYSRQ                (DIK_SYSRQ | 0x81000400)
715 #define DIKEYBOARD_RMENU                (DIK_RMENU | 0x81000400)
716 #define DIKEYBOARD_PAUSE                (DIK_PAUSE | 0x81000400)
717 #define DIKEYBOARD_HOME                 (DIK_HOME | 0x81000400)
718 #define DIKEYBOARD_UP                   (DIK_UP | 0x81000400)
719 #define DIKEYBOARD_PRIOR                (DIK_PRIOR | 0x81000400)
720 #define DIKEYBOARD_LEFT                 (DIK_LEFT | 0x81000400)
721 #define DIKEYBOARD_RIGHT                (DIK_RIGHT | 0x81000400)
722 #define DIKEYBOARD_END                  (DIK_END | 0x81000400)
723 #define DIKEYBOARD_DOWN                 (DIK_DOWN | 0x81000400)
724 #define DIKEYBOARD_NEXT                 (DIK_NEXT | 0x81000400)
725 #define DIKEYBOARD_INSERT               (DIK_INSERT | 0x81000400)
726 #define DIKEYBOARD_DELETE               (DIK_DELETE | 0x81000400)
727 #define DIKEYBOARD_LWIN                 (DIK_LWIN | 0x81000400)
728 #define DIKEYBOARD_RWIN                 (DIK_RWIN | 0x81000400)
729 #define DIKEYBOARD_APPS                 (DIK_APPS | 0x81000400)
730 #define DIKEYBOARD_POWER                (DIK_POWER | 0x81000400)
731 #define DIKEYBOARD_SLEEP                (DIK_SLEEP | 0x81000400)
732 #define DIKEYBOARD_BACKSPACE            (DIK_BACKSPACE | 0x81000400)
733 #define DIKEYBOARD_NUMPADSTAR           (DIK_NUMPADSTAR | 0x81000400)
734 #define DIKEYBOARD_LALT                 (DIK_LALT | 0x81000400)
735 #define DIKEYBOARD_CAPSLOCK             (DIK_CAPSLOCK | 0x81000400)
736 #define DIKEYBOARD_NUMPADMINUS          (DIK_NUMPADMINUS | 0x81000400)
737 #define DIKEYBOARD_NUMPADPLUS           (DIK_NUMPADPLUS | 0x81000400)
738 #define DIKEYBOARD_NUMPADPERIOD         (DIK_NUMPADPERIOD | 0x81000400)
739 #define DIKEYBOARD_NUMPADSLASH          (DIK_NUMPADSLASH | 0x81000400)
740 #define DIKEYBOARD_RALT                 (DIK_RALT | 0x81000400)
741 #define DIKEYBOARD_UPARROW              (DIK_UPARROW | 0x81000400)
742 #define DIKEYBOARD_PGUP                 (DIK_PGUP | 0x81000400)
743 #define DIKEYBOARD_LEFTARROW            (DIK_LEFTARROW | 0x81000400)
744 #define DIKEYBOARD_RIGHTARROW           (DIK_RIGHTARROW | 0x81000400)
745 #define DIKEYBOARD_DOWNARROW            (DIK_DOWNARROW | 0x81000400)
746 #define DIKEYBOARD_PGDN                 (DIK_PGDN | 0x81000400)
747
748 #define DIDFT_ALL               0x00000000
749 #define DIDFT_RELAXIS           0x00000001
750 #define DIDFT_ABSAXIS           0x00000002
751 #define DIDFT_AXIS              0x00000003
752 #define DIDFT_PSHBUTTON         0x00000004
753 #define DIDFT_TGLBUTTON         0x00000008
754 #define DIDFT_BUTTON            0x0000000C
755 #define DIDFT_POV               0x00000010
756 #define DIDFT_COLLECTION        0x00000040
757 #define DIDFT_NODATA            0x00000080
758 #define DIDFT_ANYINSTANCE       0x00FFFF00
759 #define DIDFT_INSTANCEMASK      DIDFT_ANYINSTANCE
760 #define DIDFT_MAKEINSTANCE(n)   ((WORD)(n) << 8)
761 #define DIDFT_GETTYPE(n)        LOBYTE(n)
762 #define DIDFT_GETINSTANCE(n)    LOWORD((n) >> 8)
763 #define DIDFT_FFACTUATOR        0x01000000
764 #define DIDFT_FFEFFECTTRIGGER   0x02000000
765 #define DIDFT_OUTPUT            0x10000000
766 #define DIDFT_VENDORDEFINED     0x04000000
767 #define DIDFT_ALIAS             0x08000000
768 #ifndef DIDFT_OPTIONAL
769 #define DIDFT_OPTIONAL          0x80000000
770 #endif
771 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
772 #define DIDFT_NOCOLLECTION      0x00FFFF00
773 #define DIDF_ABSAXIS            0x00000001
774 #define DIDF_RELAXIS            0x00000002
775
776 #define DIGDD_PEEK              0x00000001
777
778 #define DISEQUENCE_COMPARE(dwSq1,cmp,dwSq2) ((int)((dwSq1) - (dwSq2)) cmp 0)
779
780 typedef struct DIDEVICEOBJECTDATA_DX3 {
781     DWORD       dwOfs;
782     DWORD       dwData;
783     DWORD       dwTimeStamp;
784     DWORD       dwSequence;
785 } DIDEVICEOBJECTDATA_DX3,*LPDIDEVICEOBJECTDATA_DX3;
786 typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX3;
787
788 typedef struct DIDEVICEOBJECTDATA {
789     DWORD       dwOfs;
790     DWORD       dwData;
791     DWORD       dwTimeStamp;
792     DWORD       dwSequence;
793     UINT_PTR    uAppData;
794 } DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA;
795 typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
796
797 typedef struct _DIOBJECTDATAFORMAT {
798     const GUID *pguid;
799     DWORD       dwOfs;
800     DWORD       dwType;
801     DWORD       dwFlags;
802 } DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
803 typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT;
804
805 typedef struct _DIDATAFORMAT {
806     DWORD                       dwSize;
807     DWORD                       dwObjSize;
808     DWORD                       dwFlags;
809     DWORD                       dwDataSize;
810     DWORD                       dwNumObjs;
811     LPDIOBJECTDATAFORMAT        rgodf;
812 } DIDATAFORMAT, *LPDIDATAFORMAT;
813 typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
814
815 #define DIDOI_FFACTUATOR        0x00000001
816 #define DIDOI_FFEFFECTTRIGGER   0x00000002
817 #define DIDOI_POLLED            0x00008000
818 #define DIDOI_ASPECTPOSITION    0x00000100
819 #define DIDOI_ASPECTVELOCITY    0x00000200
820 #define DIDOI_ASPECTACCEL       0x00000300
821 #define DIDOI_ASPECTFORCE       0x00000400
822 #define DIDOI_ASPECTMASK        0x00000F00
823 #define DIDOI_GUIDISUSAGE       0x00010000
824
825 typedef struct DIPROPHEADER {
826     DWORD       dwSize;
827     DWORD       dwHeaderSize;
828     DWORD       dwObj;
829     DWORD       dwHow;
830 } DIPROPHEADER,*LPDIPROPHEADER;
831 typedef const DIPROPHEADER *LPCDIPROPHEADER;
832
833 #define DIPH_DEVICE     0
834 #define DIPH_BYOFFSET   1
835 #define DIPH_BYID       2
836 #define DIPH_BYUSAGE    3
837
838 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
839
840 typedef struct DIPROPDWORD {
841         DIPROPHEADER    diph;
842         DWORD           dwData;
843 } DIPROPDWORD, *LPDIPROPDWORD;
844 typedef const DIPROPDWORD *LPCDIPROPDWORD;
845
846 typedef struct DIPROPRANGE {
847         DIPROPHEADER    diph;
848         LONG            lMin;
849         LONG            lMax;
850 } DIPROPRANGE, *LPDIPROPRANGE;
851 typedef const DIPROPRANGE *LPCDIPROPRANGE;
852
853 #define DIPROPRANGE_NOMIN       ((LONG)0x80000000)
854 #define DIPROPRANGE_NOMAX       ((LONG)0x7FFFFFFF)
855
856 typedef struct DIPROPCAL {
857         DIPROPHEADER diph;
858         LONG    lMin;
859         LONG    lCenter;
860         LONG    lMax;
861 } DIPROPCAL, *LPDIPROPCAL;
862 typedef const DIPROPCAL *LPCDIPROPCAL;
863
864 typedef struct DIPROPGUIDANDPATH {
865         DIPROPHEADER diph;
866         GUID    guidClass;
867         WCHAR   wszPath[MAX_PATH];
868 } DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH;
869 typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH;
870
871 typedef struct DIPROPSTRING {
872         DIPROPHEADER diph;
873         WCHAR        wsz[MAX_PATH];
874 } DIPROPSTRING, *LPDIPROPSTRING;
875 typedef const DIPROPSTRING *LPCDIPROPSTRING;
876
877 /* special property GUIDs */
878 #ifdef __cplusplus
879 #define MAKEDIPROP(prop)        (*(const GUID *)(prop))
880 #else
881 #define MAKEDIPROP(prop)        ((REFGUID)(prop))
882 #endif
883 #define DIPROP_BUFFERSIZE       MAKEDIPROP(1)
884 #define DIPROP_AXISMODE         MAKEDIPROP(2)
885
886 #define DIPROPAXISMODE_ABS      0
887 #define DIPROPAXISMODE_REL      1
888
889 #define DIPROP_GRANULARITY      MAKEDIPROP(3)
890 #define DIPROP_RANGE            MAKEDIPROP(4)
891 #define DIPROP_DEADZONE         MAKEDIPROP(5)
892 #define DIPROP_SATURATION       MAKEDIPROP(6)
893 #define DIPROP_FFGAIN           MAKEDIPROP(7)
894 #define DIPROP_FFLOAD           MAKEDIPROP(8)
895 #define DIPROP_AUTOCENTER       MAKEDIPROP(9)
896
897 #define DIPROPAUTOCENTER_OFF    0
898 #define DIPROPAUTOCENTER_ON     1
899
900 #define DIPROP_CALIBRATIONMODE  MAKEDIPROP(10)
901
902 #define DIPROPCALIBRATIONMODE_COOKED    0
903 #define DIPROPCALIBRATIONMODE_RAW       1
904
905 #define DIPROP_CALIBRATION      MAKEDIPROP(11)
906 #define DIPROP_GUIDANDPATH      MAKEDIPROP(12)
907 #define DIPROP_KEYNAME          MAKEDIPROP(20)
908 #define DIPROP_VIDPID           MAKEDIPROP(24)
909
910 #define DIPROP_KEYNAME     MAKEDIPROP(20)
911 #define DIPROP_CPOINTS     MAKEDIPROP(21)
912 #define DIPROP_APPDATA     MAKEDIPROP(22)
913 #define DIPROP_SCANCODE    MAKEDIPROP(23)
914 #define DIPROP_VIDPID      MAKEDIPROP(24)
915 #define DIPROP_USERNAME    MAKEDIPROP(25)
916 #define DIPROP_TYPENAME    MAKEDIPROP(26)
917
918 typedef struct DIDEVCAPS_DX3 {
919     DWORD       dwSize;
920     DWORD       dwFlags;
921     DWORD       dwDevType;
922     DWORD       dwAxes;
923     DWORD       dwButtons;
924     DWORD       dwPOVs;
925 } DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3;
926
927 typedef struct DIDEVCAPS {
928     DWORD       dwSize;
929     DWORD       dwFlags;
930     DWORD       dwDevType;
931     DWORD       dwAxes;
932     DWORD       dwButtons;
933     DWORD       dwPOVs;
934     DWORD       dwFFSamplePeriod;
935     DWORD       dwFFMinTimeResolution;
936     DWORD       dwFirmwareRevision;
937     DWORD       dwHardwareRevision;
938     DWORD       dwFFDriverVersion;
939 } DIDEVCAPS,*LPDIDEVCAPS;
940
941 #define DIDC_ATTACHED           0x00000001
942 #define DIDC_POLLEDDEVICE       0x00000002
943 #define DIDC_EMULATED           0x00000004
944 #define DIDC_POLLEDDATAFORMAT   0x00000008
945 #define DIDC_FORCEFEEDBACK      0x00000100
946 #define DIDC_FFATTACK           0x00000200
947 #define DIDC_FFFADE             0x00000400
948 #define DIDC_SATURATION         0x00000800
949 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
950 #define DIDC_POSNEGSATURATION   0x00002000
951 #define DIDC_DEADBAND           0x00004000
952 #define DIDC_STARTDELAY         0x00008000
953 #define DIDC_ALIAS              0x00010000
954 #define DIDC_PHANTOM            0x00020000
955 #define DIDC_HIDDEN             0x00040000
956
957
958 /* SetCooperativeLevel dwFlags */
959 #define DISCL_EXCLUSIVE         0x00000001
960 #define DISCL_NONEXCLUSIVE      0x00000002
961 #define DISCL_FOREGROUND        0x00000004
962 #define DISCL_BACKGROUND        0x00000008
963 #define DISCL_NOWINKEY          0x00000010
964
965 /* Device FF flags */
966 #define DISFFC_RESET            0x00000001
967 #define DISFFC_STOPALL          0x00000002
968 #define DISFFC_PAUSE            0x00000004
969 #define DISFFC_CONTINUE         0x00000008
970 #define DISFFC_SETACTUATORSON   0x00000010
971 #define DISFFC_SETACTUATORSOFF  0x00000020
972   
973 #define DIGFFS_EMPTY            0x00000001
974 #define DIGFFS_STOPPED          0x00000002
975 #define DIGFFS_PAUSED           0x00000004
976 #define DIGFFS_ACTUATORSON      0x00000010
977 #define DIGFFS_ACTUATORSOFF     0x00000020
978 #define DIGFFS_POWERON          0x00000040
979 #define DIGFFS_POWEROFF         0x00000080
980 #define DIGFFS_SAFETYSWITCHON   0x00000100
981 #define DIGFFS_SAFETYSWITCHOFF  0x00000200
982 #define DIGFFS_USERFFSWITCHON   0x00000400
983 #define DIGFFS_USERFFSWITCHOFF  0x00000800
984 #define DIGFFS_DEVICELOST       0x80000000
985
986 /* Effect flags */
987 #define DIEFT_ALL               0x00000000
988                                                                                 
989 #define DIEFT_CONSTANTFORCE     0x00000001
990 #define DIEFT_RAMPFORCE         0x00000002
991 #define DIEFT_PERIODIC          0x00000003
992 #define DIEFT_CONDITION         0x00000004
993 #define DIEFT_CUSTOMFORCE       0x00000005
994 #define DIEFT_HARDWARE          0x000000FF
995 #define DIEFT_FFATTACK          0x00000200
996 #define DIEFT_FFFADE            0x00000400
997 #define DIEFT_SATURATION        0x00000800
998 #define DIEFT_POSNEGCOEFFICIENTS 0x00001000
999 #define DIEFT_POSNEGSATURATION  0x00002000
1000 #define DIEFT_DEADBAND          0x00004000
1001 #define DIEFT_STARTDELAY        0x00008000
1002 #define DIEFT_GETTYPE(n)        LOBYTE(n)
1003                                                                                 
1004 #define DIEFF_OBJECTIDS         0x00000001
1005 #define DIEFF_OBJECTOFFSETS     0x00000002
1006 #define DIEFF_CARTESIAN         0x00000010
1007 #define DIEFF_POLAR             0x00000020
1008 #define DIEFF_SPHERICAL         0x00000040
1009
1010 #define DIEP_DURATION           0x00000001
1011 #define DIEP_SAMPLEPERIOD       0x00000002
1012 #define DIEP_GAIN               0x00000004
1013 #define DIEP_TRIGGERBUTTON      0x00000008
1014 #define DIEP_TRIGGERREPEATINTERVAL 0x00000010
1015 #define DIEP_AXES               0x00000020
1016 #define DIEP_DIRECTION          0x00000040
1017 #define DIEP_ENVELOPE           0x00000080
1018 #define DIEP_TYPESPECIFICPARAMS 0x00000100
1019 #define DIEP_STARTDELAY         0x00000200
1020 #define DIEP_ALLPARAMS_DX5      0x000001FF
1021 #define DIEP_ALLPARAMS          0x000003FF
1022 #define DIEP_START              0x20000000
1023 #define DIEP_NORESTART          0x40000000
1024 #define DIEP_NODOWNLOAD         0x80000000
1025 #define DIEB_NOTRIGGER          0xFFFFFFFF
1026
1027 #define DIES_SOLO               0x00000001
1028 #define DIES_NODOWNLOAD         0x80000000
1029
1030 #define DIEGES_PLAYING          0x00000001
1031 #define DIEGES_EMULATED         0x00000002
1032
1033 #define DI_DEGREES              100
1034 #define DI_FFNOMINALMAX         10000
1035 #define DI_SECONDS              1000000
1036
1037 typedef struct DICONSTANTFORCE {
1038         LONG                    lMagnitude;
1039 } DICONSTANTFORCE, *LPDICONSTANTFORCE;
1040 typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
1041
1042 typedef struct DIRAMPFORCE {
1043         LONG                    lStart;
1044         LONG                    lEnd;
1045 } DIRAMPFORCE, *LPDIRAMPFORCE;
1046 typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
1047
1048 typedef struct DIPERIODIC {
1049         DWORD                   dwMagnitude;
1050         LONG                    lOffset;
1051         DWORD                   dwPhase;
1052         DWORD                   dwPeriod;
1053 } DIPERIODIC, *LPDIPERIODIC;
1054 typedef const DIPERIODIC *LPCDIPERIODIC;
1055
1056 typedef struct DICONDITION {
1057         LONG                    lOffset;
1058         LONG                    lPositiveCoefficient;
1059         LONG                    lNegativeCoefficient;
1060         DWORD                   dwPositiveSaturation;
1061         DWORD                   dwNegativeSaturation;
1062         LONG                    lDeadBand;
1063 } DICONDITION, *LPDICONDITION;
1064 typedef const DICONDITION *LPCDICONDITION;
1065
1066 typedef struct DICUSTOMFORCE {
1067         DWORD                   cChannels;
1068         DWORD                   dwSamplePeriod;
1069         DWORD                   cSamples;
1070         LPLONG                  rglForceData;
1071 } DICUSTOMFORCE, *LPDICUSTOMFORCE;
1072 typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
1073
1074 typedef struct DIENVELOPE {
1075         DWORD                   dwSize;
1076         DWORD                   dwAttackLevel;
1077         DWORD                   dwAttackTime;
1078         DWORD                   dwFadeLevel;
1079         DWORD                   dwFadeTime;
1080 } DIENVELOPE, *LPDIENVELOPE;
1081 typedef const DIENVELOPE *LPCDIENVELOPE;
1082
1083 typedef struct DIEFFECT_DX5 {
1084         DWORD                   dwSize;
1085         DWORD                   dwFlags;
1086         DWORD                   dwDuration;
1087         DWORD                   dwSamplePeriod;
1088         DWORD                   dwGain;
1089         DWORD                   dwTriggerButton;
1090         DWORD                   dwTriggerRepeatInterval;
1091         DWORD                   cAxes;
1092         LPDWORD                 rgdwAxes;
1093         LPLONG                  rglDirection;
1094         LPDIENVELOPE            lpEnvelope;
1095         DWORD                   cbTypeSpecificParams;
1096         LPVOID                  lpvTypeSpecificParams;
1097 } DIEFFECT_DX5, *LPDIEFFECT_DX5;
1098 typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5;
1099
1100 typedef struct DIEFFECT {
1101         DWORD                   dwSize;
1102         DWORD                   dwFlags;
1103         DWORD                   dwDuration;
1104         DWORD                   dwSamplePeriod;
1105         DWORD                   dwGain;
1106         DWORD                   dwTriggerButton;
1107         DWORD                   dwTriggerRepeatInterval;
1108         DWORD                   cAxes;
1109         LPDWORD                 rgdwAxes;
1110         LPLONG                  rglDirection;
1111         LPDIENVELOPE            lpEnvelope;
1112         DWORD                   cbTypeSpecificParams;
1113         LPVOID                  lpvTypeSpecificParams;
1114         DWORD                   dwStartDelay;
1115 } DIEFFECT, *LPDIEFFECT;
1116 typedef const DIEFFECT *LPCDIEFFECT;
1117 typedef DIEFFECT DIEFFECT_DX6;
1118 typedef LPDIEFFECT LPDIEFFECT_DX6;
1119
1120 typedef struct DIEFFECTINFOA {
1121         DWORD                   dwSize;
1122         GUID                    guid;
1123         DWORD                   dwEffType;
1124         DWORD                   dwStaticParams;
1125         DWORD                   dwDynamicParams;
1126         CHAR                    tszName[MAX_PATH];
1127 } DIEFFECTINFOA, *LPDIEFFECTINFOA;
1128 typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
1129
1130 typedef struct DIEFFECTINFOW {
1131         DWORD                   dwSize;
1132         GUID                    guid;
1133         DWORD                   dwEffType;
1134         DWORD                   dwStaticParams;
1135         DWORD                   dwDynamicParams;
1136         WCHAR                   tszName[MAX_PATH];
1137 } DIEFFECTINFOW, *LPDIEFFECTINFOW;
1138 typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
1139
1140 DECL_WINELIB_TYPE_AW(DIEFFECTINFO)
1141 DECL_WINELIB_TYPE_AW(LPDIEFFECTINFO)
1142 DECL_WINELIB_TYPE_AW(LPCDIEFFECTINFO)
1143
1144 typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
1145 typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
1146
1147 typedef struct DIEFFESCAPE {
1148         DWORD   dwSize;
1149         DWORD   dwCommand;
1150         LPVOID  lpvInBuffer;
1151         DWORD   cbInBuffer;
1152         LPVOID  lpvOutBuffer;
1153         DWORD   cbOutBuffer;
1154 } DIEFFESCAPE, *LPDIEFFESCAPE;
1155
1156 typedef struct DIJOYSTATE {
1157         LONG    lX;
1158         LONG    lY;
1159         LONG    lZ;
1160         LONG    lRx;
1161         LONG    lRy;
1162         LONG    lRz;
1163         LONG    rglSlider[2];
1164         DWORD   rgdwPOV[4];
1165         BYTE    rgbButtons[32];
1166 } DIJOYSTATE, *LPDIJOYSTATE;
1167
1168 typedef struct DIJOYSTATE2 {
1169         LONG    lX;
1170         LONG    lY;
1171         LONG    lZ;
1172         LONG    lRx;
1173         LONG    lRy;
1174         LONG    lRz;
1175         LONG    rglSlider[2];
1176         DWORD   rgdwPOV[4];
1177         BYTE    rgbButtons[128];
1178         LONG    lVX;            /* 'v' as in velocity */
1179         LONG    lVY;
1180         LONG    lVZ;
1181         LONG    lVRx;
1182         LONG    lVRy;
1183         LONG    lVRz;
1184         LONG    rglVSlider[2];
1185         LONG    lAX;            /* 'a' as in acceleration */
1186         LONG    lAY;
1187         LONG    lAZ;
1188         LONG    lARx;
1189         LONG    lARy;
1190         LONG    lARz;
1191         LONG    rglASlider[2];
1192         LONG    lFX;            /* 'f' as in force */
1193         LONG    lFY;
1194         LONG    lFZ;
1195         LONG    lFRx;           /* 'fr' as in rotational force aka torque */
1196         LONG    lFRy;
1197         LONG    lFRz;
1198         LONG    rglFSlider[2];
1199 } DIJOYSTATE2, *LPDIJOYSTATE2;
1200
1201 #define DIJOFS_X                FIELD_OFFSET(DIJOYSTATE, lX)
1202 #define DIJOFS_Y                FIELD_OFFSET(DIJOYSTATE, lY)
1203 #define DIJOFS_Z                FIELD_OFFSET(DIJOYSTATE, lZ)
1204 #define DIJOFS_RX               FIELD_OFFSET(DIJOYSTATE, lRx)
1205 #define DIJOFS_RY               FIELD_OFFSET(DIJOYSTATE, lRy)
1206 #define DIJOFS_RZ               FIELD_OFFSET(DIJOYSTATE, lRz)
1207 #define DIJOFS_SLIDER(n)        (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
1208                                                         (n) * sizeof(LONG))
1209 #define DIJOFS_POV(n)           (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
1210                                                         (n) * sizeof(DWORD))
1211 #define DIJOFS_BUTTON(n)        (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
1212 #define DIJOFS_BUTTON0          DIJOFS_BUTTON(0)
1213 #define DIJOFS_BUTTON1          DIJOFS_BUTTON(1)
1214 #define DIJOFS_BUTTON2          DIJOFS_BUTTON(2)
1215 #define DIJOFS_BUTTON3          DIJOFS_BUTTON(3)
1216 #define DIJOFS_BUTTON4          DIJOFS_BUTTON(4)
1217 #define DIJOFS_BUTTON5          DIJOFS_BUTTON(5)
1218 #define DIJOFS_BUTTON6          DIJOFS_BUTTON(6)
1219 #define DIJOFS_BUTTON7          DIJOFS_BUTTON(7)
1220 #define DIJOFS_BUTTON8          DIJOFS_BUTTON(8)
1221 #define DIJOFS_BUTTON9          DIJOFS_BUTTON(9)
1222 #define DIJOFS_BUTTON10         DIJOFS_BUTTON(10)
1223 #define DIJOFS_BUTTON11         DIJOFS_BUTTON(11)
1224 #define DIJOFS_BUTTON12         DIJOFS_BUTTON(12)
1225 #define DIJOFS_BUTTON13         DIJOFS_BUTTON(13)
1226 #define DIJOFS_BUTTON14         DIJOFS_BUTTON(14)
1227 #define DIJOFS_BUTTON15         DIJOFS_BUTTON(15)
1228 #define DIJOFS_BUTTON16         DIJOFS_BUTTON(16)
1229 #define DIJOFS_BUTTON17         DIJOFS_BUTTON(17)
1230 #define DIJOFS_BUTTON18         DIJOFS_BUTTON(18)
1231 #define DIJOFS_BUTTON19         DIJOFS_BUTTON(19)
1232 #define DIJOFS_BUTTON20         DIJOFS_BUTTON(20)
1233 #define DIJOFS_BUTTON21         DIJOFS_BUTTON(21)
1234 #define DIJOFS_BUTTON22         DIJOFS_BUTTON(22)
1235 #define DIJOFS_BUTTON23         DIJOFS_BUTTON(23)
1236 #define DIJOFS_BUTTON24         DIJOFS_BUTTON(24)
1237 #define DIJOFS_BUTTON25         DIJOFS_BUTTON(25)
1238 #define DIJOFS_BUTTON26         DIJOFS_BUTTON(26)
1239 #define DIJOFS_BUTTON27         DIJOFS_BUTTON(27)
1240 #define DIJOFS_BUTTON28         DIJOFS_BUTTON(28)
1241 #define DIJOFS_BUTTON29         DIJOFS_BUTTON(29)
1242 #define DIJOFS_BUTTON30         DIJOFS_BUTTON(30)
1243 #define DIJOFS_BUTTON31         DIJOFS_BUTTON(31)
1244
1245 /* DInput 7 structures, types */
1246 typedef struct DIFILEEFFECT {
1247   DWORD       dwSize;
1248   GUID        GuidEffect;
1249   LPCDIEFFECT lpDiEffect;
1250   CHAR        szFriendlyName[MAX_PATH];
1251 } DIFILEEFFECT, *LPDIFILEEFFECT;
1252
1253 typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
1254 typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID);
1255
1256 /* DInput 8 structures and types */
1257 typedef struct _DIACTIONA {
1258         UINT_PTR        uAppData;
1259         DWORD           dwSemantic;
1260         DWORD           dwFlags;
1261         union {
1262                 LPCSTR  lptszActionName;
1263                 UINT    uResIdString;
1264         } DUMMYUNIONNAME;
1265         GUID            guidInstance;
1266         DWORD           dwObjID;
1267         DWORD           dwHow;
1268 } DIACTIONA, *LPDIACTIONA;
1269 typedef const DIACTIONA *LPCDIACTIONA;
1270
1271 typedef struct _DIACTIONW {
1272         UINT_PTR        uAppData;
1273         DWORD           dwSemantic;
1274         DWORD           dwFlags;
1275         union {
1276                 LPCWSTR lptszActionName;
1277                 UINT    uResIdString;
1278         } DUMMYUNIONNAME;
1279         GUID            guidInstance;
1280         DWORD           dwObjID;
1281         DWORD           dwHow;
1282 } DIACTIONW, *LPDIACTIONW;
1283 typedef const DIACTIONW *LPCDIACTIONW;
1284
1285 DECL_WINELIB_TYPE_AW(DIACTION)
1286 DECL_WINELIB_TYPE_AW(LPDIACTION)
1287 DECL_WINELIB_TYPE_AW(LPCDIACTION)
1288
1289 #define DIA_FORCEFEEDBACK       0x00000001
1290 #define DIA_APPMAPPED           0x00000002
1291 #define DIA_APPNOMAP            0x00000004
1292 #define DIA_NORANGE             0x00000008
1293 #define DIA_APPFIXED            0x00000010
1294
1295 #define DIAH_UNMAPPED           0x00000000
1296 #define DIAH_USERCONFIG         0x00000001
1297 #define DIAH_APPREQUESTED       0x00000002
1298 #define DIAH_HWAPP              0x00000004
1299 #define DIAH_HWDEFAULT          0x00000008
1300 #define DIAH_DEFAULT            0x00000020
1301 #define DIAH_ERROR              0x80000000
1302
1303 typedef struct _DIACTIONFORMATA {
1304         DWORD           dwSize;
1305         DWORD           dwActionSize;
1306         DWORD           dwDataSize;
1307         DWORD           dwNumActions;
1308         LPDIACTIONA     rgoAction;
1309         GUID            guidActionMap;
1310         DWORD           dwGenre;
1311         DWORD           dwBufferSize;
1312         LONG            lAxisMin;
1313         LONG            lAxisMax;
1314         HINSTANCE       hInstString;
1315         FILETIME        ftTimeStamp;
1316         DWORD           dwCRC;
1317         CHAR            tszActionMap[MAX_PATH];
1318 } DIACTIONFORMATA, *LPDIACTIONFORMATA;
1319 typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA;
1320
1321 typedef struct _DIACTIONFORMATW {
1322         DWORD           dwSize;
1323         DWORD           dwActionSize;
1324         DWORD           dwDataSize;
1325         DWORD           dwNumActions;
1326         LPDIACTIONW     rgoAction;
1327         GUID            guidActionMap;
1328         DWORD           dwGenre;
1329         DWORD           dwBufferSize;
1330         LONG            lAxisMin;
1331         LONG            lAxisMax;
1332         HINSTANCE       hInstString;
1333         FILETIME        ftTimeStamp;
1334         DWORD           dwCRC;
1335         WCHAR           tszActionMap[MAX_PATH];
1336 } DIACTIONFORMATW, *LPDIACTIONFORMATW;
1337 typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW;
1338
1339 DECL_WINELIB_TYPE_AW(DIACTIONFORMAT)
1340 DECL_WINELIB_TYPE_AW(LPDIACTIONFORMAT)
1341 DECL_WINELIB_TYPE_AW(LPCDIACTIONFORMAT)
1342
1343 #define DIAFTS_NEWDEVICELOW     0xFFFFFFFF
1344 #define DIAFTS_NEWDEVICEHIGH    0xFFFFFFFF
1345 #define DIAFTS_UNUSEDDEVICELOW  0x00000000
1346 #define DIAFTS_UNUSEDDEVICEHIGH 0x00000000
1347
1348 #define DIDBAM_DEFAULT          0x00000000
1349 #define DIDBAM_PRESERVE         0x00000001
1350 #define DIDBAM_INITIALIZE       0x00000002
1351 #define DIDBAM_HWDEFAULTS       0x00000004
1352
1353 #define DIDSAM_DEFAULT          0x00000000
1354 #define DIDSAM_NOUSER           0x00000001
1355 #define DIDSAM_FORCESAVE        0x00000002
1356
1357 #define DICD_DEFAULT            0x00000000
1358 #define DICD_EDIT               0x00000001
1359
1360 #ifndef D3DCOLOR_DEFINED
1361 typedef DWORD D3DCOLOR;
1362 #define D3DCOLOR_DEFINED
1363 #endif
1364
1365 typedef struct _DICOLORSET {
1366         DWORD           dwSize;
1367         D3DCOLOR        cTextFore;
1368         D3DCOLOR        cTextHighlight;
1369         D3DCOLOR        cCalloutLine;
1370         D3DCOLOR        cCalloutHighlight;
1371         D3DCOLOR        cBorder;
1372         D3DCOLOR        cControlFill;
1373         D3DCOLOR        cHighlightFill;
1374         D3DCOLOR        cAreaFill;
1375 } DICOLORSET, *LPDICOLORSET;
1376 typedef const DICOLORSET *LPCDICOLORSET;
1377
1378 typedef struct _DICONFIGUREDEVICESPARAMSA {
1379         DWORD                   dwSize;
1380         DWORD                   dwcUsers;
1381         LPSTR                   lptszUserNames;
1382         DWORD                   dwcFormats;
1383         LPDIACTIONFORMATA       lprgFormats;
1384         HWND                    hwnd;
1385         DICOLORSET              dics;
1386         LPUNKNOWN               lpUnkDDSTarget;
1387 } DICONFIGUREDEVICESPARAMSA, *LPDICONFIGUREDEVICESPARAMSA;
1388 typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA;
1389
1390 typedef struct _DICONFIGUREDEVICESPARAMSW {
1391         DWORD                   dwSize;
1392         DWORD                   dwcUsers;
1393         LPWSTR                  lptszUserNames;
1394         DWORD                   dwcFormats;
1395         LPDIACTIONFORMATW       lprgFormats;
1396         HWND                    hwnd;
1397         DICOLORSET              dics;
1398         LPUNKNOWN               lpUnkDDSTarget;
1399 } DICONFIGUREDEVICESPARAMSW, *LPDICONFIGUREDEVICESPARAMSW;
1400 typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW;
1401
1402 DECL_WINELIB_TYPE_AW(DICONFIGUREDEVICESPARAMS)
1403 DECL_WINELIB_TYPE_AW(LPDICONFIGUREDEVICESPARAMS)
1404 DECL_WINELIB_TYPE_AW(LPCDICONFIGUREDEVICESPARAMS)
1405
1406 #define DIDIFT_CONFIGURATION    0x00000001
1407 #define DIDIFT_OVERLAY          0x00000002
1408
1409 #define DIDAL_CENTERED          0x00000000
1410 #define DIDAL_LEFTALIGNED       0x00000001
1411 #define DIDAL_RIGHTALIGNED      0x00000002
1412 #define DIDAL_MIDDLE            0x00000000
1413 #define DIDAL_TOPALIGNED        0x00000004
1414 #define DIDAL_BOTTOMALIGNED     0x00000008
1415
1416 typedef struct _DIDEVICEIMAGEINFOA {
1417         CHAR    tszImagePath[MAX_PATH];
1418         DWORD   dwFlags;
1419         DWORD   dwViewID;
1420         RECT    rcOverlay;
1421         DWORD   dwObjID;
1422         DWORD   dwcValidPts;
1423         POINT   rgptCalloutLine[5];
1424         RECT    rcCalloutRect;
1425         DWORD   dwTextAlign;
1426 } DIDEVICEIMAGEINFOA, *LPDIDEVICEIMAGEINFOA;
1427 typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA;
1428
1429 typedef struct _DIDEVICEIMAGEINFOW {
1430         WCHAR   tszImagePath[MAX_PATH];
1431         DWORD   dwFlags;
1432         DWORD   dwViewID;
1433         RECT    rcOverlay;
1434         DWORD   dwObjID;
1435         DWORD   dwcValidPts;
1436         POINT   rgptCalloutLine[5];
1437         RECT    rcCalloutRect;
1438         DWORD   dwTextAlign;
1439 } DIDEVICEIMAGEINFOW, *LPDIDEVICEIMAGEINFOW;
1440 typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW;
1441
1442 DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFO)
1443 DECL_WINELIB_TYPE_AW(LPDIDEVICEIMAGEINFO)
1444 DECL_WINELIB_TYPE_AW(LPCDIDEVICEIMAGEINFO)
1445
1446 typedef struct _DIDEVICEIMAGEINFOHEADERA {
1447         DWORD   dwSize;
1448         DWORD   dwSizeImageInfo;
1449         DWORD   dwcViews;
1450         DWORD   dwcButtons;
1451         DWORD   dwcAxes;
1452         DWORD   dwcPOVs;
1453         DWORD   dwBufferSize;
1454         DWORD   dwBufferUsed;
1455         LPDIDEVICEIMAGEINFOA    lprgImageInfoArray;
1456 } DIDEVICEIMAGEINFOHEADERA, *LPDIDEVICEIMAGEINFOHEADERA;
1457 typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA;
1458
1459 typedef struct _DIDEVICEIMAGEINFOHEADERW {
1460         DWORD   dwSize;
1461         DWORD   dwSizeImageInfo;
1462         DWORD   dwcViews;
1463         DWORD   dwcButtons;
1464         DWORD   dwcAxes;
1465         DWORD   dwcPOVs;
1466         DWORD   dwBufferSize;
1467         DWORD   dwBufferUsed;
1468         LPDIDEVICEIMAGEINFOW    lprgImageInfoArray;
1469 } DIDEVICEIMAGEINFOHEADERW, *LPDIDEVICEIMAGEINFOHEADERW;
1470 typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW;
1471
1472 DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFOHEADER)
1473 DECL_WINELIB_TYPE_AW(LPDIDEVICEIMAGEINFOHEADER)
1474 DECL_WINELIB_TYPE_AW(LPCDIDEVICEIMAGEINFOHEADER)
1475
1476
1477 /*****************************************************************************
1478  * IDirectInputEffect interface
1479  */
1480 #define INTERFACE IDirectInputEffect
1481 DECLARE_INTERFACE_(IDirectInputEffect,IUnknown)
1482 {
1483     /*** IUnknown methods ***/
1484     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1485     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1486     STDMETHOD_(ULONG,Release)(THIS) PURE;
1487     /*** IDirectInputEffect methods ***/
1488     STDMETHOD(Initialize)(THIS_ HINSTANCE, DWORD, REFGUID) PURE;
1489     STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE;
1490     STDMETHOD(GetParameters)(THIS_ LPDIEFFECT, DWORD) PURE;
1491     STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT, DWORD) PURE;
1492     STDMETHOD(Start)(THIS_ DWORD, DWORD) PURE;
1493     STDMETHOD(Stop)(THIS) PURE;
1494     STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE;
1495     STDMETHOD(Download)(THIS) PURE;
1496     STDMETHOD(Unload)(THIS) PURE;
1497     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
1498 };
1499 #undef INTERFACE
1500
1501 #if !defined(__cplusplus) || defined(CINTERFACE)
1502 /*** IUnknown methods ***/
1503 #define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1504 #define IDirectInputEffect_AddRef(p)             (p)->lpVtbl->AddRef(p)
1505 #define IDirectInputEffect_Release(p)            (p)->lpVtbl->Release(p)
1506 /*** IDirectInputEffect methods ***/
1507 #define IDirectInputEffect_Initialize(p,a,b,c)    (p)->lpVtbl->Initialize(p,a,b,c)
1508 #define IDirectInputEffect_GetEffectGuid(p,a)     (p)->lpVtbl->GetEffectGuid(p,a)
1509 #define IDirectInputEffect_GetParameters(p,a,b)   (p)->lpVtbl->GetParameters(p,a,b)
1510 #define IDirectInputEffect_SetParameters(p,a,b)   (p)->lpVtbl->SetParameters(p,a,b)
1511 #define IDirectInputEffect_Start(p,a,b)           (p)->lpVtbl->Start(p,a,b)
1512 #define IDirectInputEffect_Stop(p)                (p)->lpVtbl->Stop(p)
1513 #define IDirectInputEffect_GetEffectStatus(p,a)   (p)->lpVtbl->GetEffectStatus(p,a)
1514 #define IDirectInputEffect_Download(p)            (p)->lpVtbl->Download(p)
1515 #define IDirectInputEffect_Unload(p)              (p)->lpVtbl->Unload(p)
1516 #define IDirectInputEffect_Escape(p,a)            (p)->lpVtbl->Escape(p,a)
1517 #else
1518 /*** IUnknown methods ***/
1519 #define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
1520 #define IDirectInputEffect_AddRef(p)             (p)->AddRef()
1521 #define IDirectInputEffect_Release(p)            (p)->Release()
1522 /*** IDirectInputEffect methods ***/
1523 #define IDirectInputEffect_Initialize(p,a,b,c)    (p)->Initialize(a,b,c)
1524 #define IDirectInputEffect_GetEffectGuid(p,a)     (p)->GetEffectGuid(a)
1525 #define IDirectInputEffect_GetParameters(p,a,b)   (p)->GetParameters(a,b)
1526 #define IDirectInputEffect_SetParameters(p,a,b)   (p)->SetParameters(a,b)
1527 #define IDirectInputEffect_Start(p,a,b)           (p)->Start(a,b)
1528 #define IDirectInputEffect_Stop(p)                (p)->Stop()
1529 #define IDirectInputEffect_GetEffectStatus(p,a)   (p)->GetEffectStatus(a)
1530 #define IDirectInputEffect_Download(p)            (p)->Download()
1531 #define IDirectInputEffect_Unload(p)              (p)->Unload()
1532 #define IDirectInputEffect_Escape(p,a)            (p)->Escape(a)
1533 #endif
1534
1535
1536 /*****************************************************************************
1537  * IDirectInputDeviceA interface
1538  */
1539 #define INTERFACE IDirectInputDeviceA
1540 DECLARE_INTERFACE_(IDirectInputDeviceA,IUnknown)
1541 {
1542     /*** IUnknown methods ***/
1543     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1544     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1545     STDMETHOD_(ULONG,Release)(THIS) PURE;
1546     /*** IDirectInputDeviceA methods ***/
1547     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1548     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1549     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1550     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1551     STDMETHOD(Acquire)(THIS) PURE;
1552     STDMETHOD(Unacquire)(THIS) PURE;
1553     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1554     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1555     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1556     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1557     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1558     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1559     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE;
1560     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1561     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1562 };
1563 #undef INTERFACE
1564
1565 /*****************************************************************************
1566  * IDirectInputDeviceW interface
1567  */
1568 #define INTERFACE IDirectInputDeviceW
1569 DECLARE_INTERFACE_(IDirectInputDeviceW,IUnknown)
1570 {
1571     /*** IUnknown methods ***/
1572     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1573     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1574     STDMETHOD_(ULONG,Release)(THIS) PURE;
1575     /*** IDirectInputDeviceW methods ***/
1576     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1577     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1578     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1579     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1580     STDMETHOD(Acquire)(THIS) PURE;
1581     STDMETHOD(Unacquire)(THIS) PURE;
1582     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1583     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1584     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1585     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1586     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1587     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1588     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE;
1589     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1590     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1591 };
1592 #undef INTERFACE
1593
1594 #if !defined(__cplusplus) || defined(CINTERFACE)
1595 /*** IUnknown methods ***/
1596 #define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1597 #define IDirectInputDevice_AddRef(p)             (p)->lpVtbl->AddRef(p)
1598 #define IDirectInputDevice_Release(p)            (p)->lpVtbl->Release(p)
1599 /*** IDirectInputDevice methods ***/
1600 #define IDirectInputDevice_GetCapabilities(p,a)       (p)->lpVtbl->GetCapabilities(p,a)
1601 #define IDirectInputDevice_EnumObjects(p,a,b,c)       (p)->lpVtbl->EnumObjects(p,a,b,c)
1602 #define IDirectInputDevice_GetProperty(p,a,b)         (p)->lpVtbl->GetProperty(p,a,b)
1603 #define IDirectInputDevice_SetProperty(p,a,b)         (p)->lpVtbl->SetProperty(p,a,b)
1604 #define IDirectInputDevice_Acquire(p)                 (p)->lpVtbl->Acquire(p)
1605 #define IDirectInputDevice_Unacquire(p)               (p)->lpVtbl->Unacquire(p)
1606 #define IDirectInputDevice_GetDeviceState(p,a,b)      (p)->lpVtbl->GetDeviceState(p,a,b)
1607 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d)   (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1608 #define IDirectInputDevice_SetDataFormat(p,a)         (p)->lpVtbl->SetDataFormat(p,a)
1609 #define IDirectInputDevice_SetEventNotification(p,a)  (p)->lpVtbl->SetEventNotification(p,a)
1610 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1611 #define IDirectInputDevice_GetObjectInfo(p,a,b,c)     (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1612 #define IDirectInputDevice_GetDeviceInfo(p,a)         (p)->lpVtbl->GetDeviceInfo(p,a)
1613 #define IDirectInputDevice_RunControlPanel(p,a,b)     (p)->lpVtbl->RunControlPanel(p,a,b)
1614 #define IDirectInputDevice_Initialize(p,a,b,c)        (p)->lpVtbl->Initialize(p,a,b,c)
1615 #else
1616 /*** IUnknown methods ***/
1617 #define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
1618 #define IDirectInputDevice_AddRef(p)             (p)->AddRef()
1619 #define IDirectInputDevice_Release(p)            (p)->Release()
1620 /*** IDirectInputDevice methods ***/
1621 #define IDirectInputDevice_GetCapabilities(p,a)       (p)->GetCapabilities(a)
1622 #define IDirectInputDevice_EnumObjects(p,a,b,c)       (p)->EnumObjects(a,b,c)
1623 #define IDirectInputDevice_GetProperty(p,a,b)         (p)->GetProperty(a,b)
1624 #define IDirectInputDevice_SetProperty(p,a,b)         (p)->SetProperty(a,b)
1625 #define IDirectInputDevice_Acquire(p)                 (p)->Acquire()
1626 #define IDirectInputDevice_Unacquire(p)               (p)->Unacquire()
1627 #define IDirectInputDevice_GetDeviceState(p,a,b)      (p)->GetDeviceState(a,b)
1628 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d)   (p)->GetDeviceData(a,b,c,d)
1629 #define IDirectInputDevice_SetDataFormat(p,a)         (p)->SetDataFormat(a)
1630 #define IDirectInputDevice_SetEventNotification(p,a)  (p)->SetEventNotification(a)
1631 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
1632 #define IDirectInputDevice_GetObjectInfo(p,a,b,c)     (p)->GetObjectInfo(a,b,c)
1633 #define IDirectInputDevice_GetDeviceInfo(p,a)         (p)->GetDeviceInfo(a)
1634 #define IDirectInputDevice_RunControlPanel(p,a,b)     (p)->RunControlPanel(a,b)
1635 #define IDirectInputDevice_Initialize(p,a,b,c)        (p)->Initialize(a,b,c)
1636 #endif
1637
1638
1639 /*****************************************************************************
1640  * IDirectInputDevice2A interface
1641  */
1642 #define INTERFACE IDirectInputDevice2A
1643 DECLARE_INTERFACE_(IDirectInputDevice2A,IDirectInputDeviceA)
1644 {
1645     /*** IUnknown methods ***/
1646     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1647     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1648     STDMETHOD_(ULONG,Release)(THIS) PURE;
1649     /*** IDirectInputDeviceA methods ***/
1650     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1651     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1652     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1653     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1654     STDMETHOD(Acquire)(THIS) PURE;
1655     STDMETHOD(Unacquire)(THIS) PURE;
1656     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1657     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1658     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1659     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1660     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1661     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1662     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE;
1663     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1664     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1665     /*** IDirectInputDevice2A methods ***/
1666     STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE;
1667     STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE;
1668     STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE;
1669     STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE;
1670     STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE;
1671     STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE;
1672     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE;
1673     STDMETHOD(Poll)(THIS) PURE;
1674     STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1675 };
1676 #undef INTERFACE
1677
1678 /*****************************************************************************
1679  * IDirectInputDevice2W interface
1680  */
1681 #define INTERFACE IDirectInputDevice2W
1682 DECLARE_INTERFACE_(IDirectInputDevice2W,IDirectInputDeviceW)
1683 {
1684     /*** IUnknown methods ***/
1685     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1686     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1687     STDMETHOD_(ULONG,Release)(THIS) PURE;
1688     /*** IDirectInputDeviceW methods ***/
1689     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1690     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1691     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1692     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1693     STDMETHOD(Acquire)(THIS) PURE;
1694     STDMETHOD(Unacquire)(THIS) PURE;
1695     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1696     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1697     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1698     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1699     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1700     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1701     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE;
1702     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1703     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1704     /*** IDirectInputDevice2W methods ***/
1705     STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE;
1706     STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE;
1707     STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE;
1708     STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE;
1709     STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE;
1710     STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE;
1711     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE;
1712     STDMETHOD(Poll)(THIS) PURE;
1713     STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1714 };
1715 #undef INTERFACE
1716
1717 #if !defined(__cplusplus) || defined(CINTERFACE)
1718 /*** IUnknown methods ***/
1719 #define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1720 #define IDirectInputDevice2_AddRef(p)             (p)->lpVtbl->AddRef(p)
1721 #define IDirectInputDevice2_Release(p)            (p)->lpVtbl->Release(p)
1722 /*** IDirectInputDevice methods ***/
1723 #define IDirectInputDevice2_GetCapabilities(p,a)       (p)->lpVtbl->GetCapabilities(p,a)
1724 #define IDirectInputDevice2_EnumObjects(p,a,b,c)       (p)->lpVtbl->EnumObjects(p,a,b,c)
1725 #define IDirectInputDevice2_GetProperty(p,a,b)         (p)->lpVtbl->GetProperty(p,a,b)
1726 #define IDirectInputDevice2_SetProperty(p,a,b)         (p)->lpVtbl->SetProperty(p,a,b)
1727 #define IDirectInputDevice2_Acquire(p)                 (p)->lpVtbl->Acquire(p)
1728 #define IDirectInputDevice2_Unacquire(p)               (p)->lpVtbl->Unacquire(p)
1729 #define IDirectInputDevice2_GetDeviceState(p,a,b)      (p)->lpVtbl->GetDeviceState(p,a,b)
1730 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d)   (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1731 #define IDirectInputDevice2_SetDataFormat(p,a)         (p)->lpVtbl->SetDataFormat(p,a)
1732 #define IDirectInputDevice2_SetEventNotification(p,a)  (p)->lpVtbl->SetEventNotification(p,a)
1733 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1734 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c)     (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1735 #define IDirectInputDevice2_GetDeviceInfo(p,a)         (p)->lpVtbl->GetDeviceInfo(p,a)
1736 #define IDirectInputDevice2_RunControlPanel(p,a,b)     (p)->lpVtbl->RunControlPanel(p,a,b)
1737 #define IDirectInputDevice2_Initialize(p,a,b,c)        (p)->lpVtbl->Initialize(p,a,b,c)
1738 /*** IDirectInputDevice2 methods ***/
1739 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d)           (p)->lpVtbl->CreateEffect(p,a,b,c,d)
1740 #define IDirectInputDevice2_EnumEffects(p,a,b,c)              (p)->lpVtbl->EnumEffects(p,a,b,c)
1741 #define IDirectInputDevice2_GetEffectInfo(p,a,b)              (p)->lpVtbl->GetEffectInfo(p,a,b)
1742 #define IDirectInputDevice2_GetForceFeedbackState(p,a)        (p)->lpVtbl->GetForceFeedbackState(p,a)
1743 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a)     (p)->lpVtbl->SendForceFeedbackCommand(p,a)
1744 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
1745 #define IDirectInputDevice2_Escape(p,a)                       (p)->lpVtbl->Escape(p,a)
1746 #define IDirectInputDevice2_Poll(p)                           (p)->lpVtbl->Poll(p)
1747 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d)         (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
1748 #else
1749 /*** IUnknown methods ***/
1750 #define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
1751 #define IDirectInputDevice2_AddRef(p)             (p)->AddRef()
1752 #define IDirectInputDevice2_Release(p)            (p)->Release()
1753 /*** IDirectInputDevice methods ***/
1754 #define IDirectInputDevice2_GetCapabilities(p,a)       (p)->GetCapabilities(a)
1755 #define IDirectInputDevice2_EnumObjects(p,a,b,c)       (p)->EnumObjects(a,b,c)
1756 #define IDirectInputDevice2_GetProperty(p,a,b)         (p)->GetProperty(a,b)
1757 #define IDirectInputDevice2_SetProperty(p,a,b)         (p)->SetProperty(a,b)
1758 #define IDirectInputDevice2_Acquire(p)                 (p)->Acquire()
1759 #define IDirectInputDevice2_Unacquire(p)               (p)->Unacquire()
1760 #define IDirectInputDevice2_GetDeviceState(p,a,b)      (p)->GetDeviceState(a,b)
1761 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d)   (p)->GetDeviceData(a,b,c,d)
1762 #define IDirectInputDevice2_SetDataFormat(p,a)         (p)->SetDataFormat(a)
1763 #define IDirectInputDevice2_SetEventNotification(p,a)  (p)->SetEventNotification(a)
1764 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
1765 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c)     (p)->GetObjectInfo(a,b,c)
1766 #define IDirectInputDevice2_GetDeviceInfo(p,a)         (p)->GetDeviceInfo(a)
1767 #define IDirectInputDevice2_RunControlPanel(p,a,b)     (p)->RunControlPanel(a,b)
1768 #define IDirectInputDevice2_Initialize(p,a,b,c)        (p)->Initialize(a,b,c)
1769 /*** IDirectInputDevice2 methods ***/
1770 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d)           (p)->CreateEffect(a,b,c,d)
1771 #define IDirectInputDevice2_EnumEffects(p,a,b,c)              (p)->EnumEffects(a,b,c)
1772 #define IDirectInputDevice2_GetEffectInfo(p,a,b)              (p)->GetEffectInfo(a,b)
1773 #define IDirectInputDevice2_GetForceFeedbackState(p,a)        (p)->GetForceFeedbackState(a)
1774 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a)     (p)->SendForceFeedbackCommand(a)
1775 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
1776 #define IDirectInputDevice2_Escape(p,a)                       (p)->Escape(a)
1777 #define IDirectInputDevice2_Poll(p)                           (p)->Poll()
1778 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d)         (p)->SendDeviceData(a,b,c,d)
1779 #endif
1780
1781 /*****************************************************************************
1782  * IDirectInputDevice7A interface
1783  */
1784 #define INTERFACE IDirectInputDevice7A
1785 DECLARE_INTERFACE_(IDirectInputDevice7A,IDirectInputDevice2A)
1786 {
1787     /*** IUnknown methods ***/
1788     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1789     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1790     STDMETHOD_(ULONG,Release)(THIS) PURE;
1791     /*** IDirectInputDeviceA methods ***/
1792     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1793     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1794     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1795     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1796     STDMETHOD(Acquire)(THIS) PURE;
1797     STDMETHOD(Unacquire)(THIS) PURE;
1798     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1799     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1800     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1801     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1802     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1803     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1804     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE;
1805     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1806     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1807     /*** IDirectInputDevice2A methods ***/
1808     STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE;
1809     STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE;
1810     STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE;
1811     STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE;
1812     STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE;
1813     STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE;
1814     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE;
1815     STDMETHOD(Poll)(THIS) PURE;
1816     STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1817     /*** IDirectInputDevice7A methods ***/
1818     STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE;
1819     STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE;
1820 };
1821 #undef INTERFACE
1822
1823 /*****************************************************************************
1824  * IDirectInputDevice7W interface
1825  */
1826 #define INTERFACE IDirectInputDevice7W
1827 DECLARE_INTERFACE_(IDirectInputDevice7W,IDirectInputDevice2W)
1828 {
1829     /*** IUnknown methods ***/
1830     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1831     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1832     STDMETHOD_(ULONG,Release)(THIS) PURE;
1833     /*** IDirectInputDeviceW methods ***/
1834     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1835     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1836     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1837     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1838     STDMETHOD(Acquire)(THIS) PURE;
1839     STDMETHOD(Unacquire)(THIS) PURE;
1840     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1841     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1842     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1843     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1844     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1845     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1846     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE;
1847     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1848     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1849     /*** IDirectInputDevice2W methods ***/
1850     STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE;
1851     STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE;
1852     STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE;
1853     STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE;
1854     STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE;
1855     STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE;
1856     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE;
1857     STDMETHOD(Poll)(THIS) PURE;
1858     STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1859     /*** IDirectInputDevice7W methods ***/
1860     STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE;
1861     STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE;
1862 };
1863 #undef INTERFACE
1864
1865 #if !defined(__cplusplus) || defined(CINTERFACE)
1866 /*** IUnknown methods ***/
1867 #define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1868 #define IDirectInputDevice7_AddRef(p)             (p)->lpVtbl->AddRef(p)
1869 #define IDirectInputDevice7_Release(p)            (p)->lpVtbl->Release(p)
1870 /*** IDirectInputDevice methods ***/
1871 #define IDirectInputDevice7_GetCapabilities(p,a)       (p)->lpVtbl->GetCapabilities(p,a)
1872 #define IDirectInputDevice7_EnumObjects(p,a,b,c)       (p)->lpVtbl->EnumObjects(p,a,b,c)
1873 #define IDirectInputDevice7_GetProperty(p,a,b)         (p)->lpVtbl->GetProperty(p,a,b)
1874 #define IDirectInputDevice7_SetProperty(p,a,b)         (p)->lpVtbl->SetProperty(p,a,b)
1875 #define IDirectInputDevice7_Acquire(p)                 (p)->lpVtbl->Acquire(p)
1876 #define IDirectInputDevice7_Unacquire(p)               (p)->lpVtbl->Unacquire(p)
1877 #define IDirectInputDevice7_GetDeviceState(p,a,b)      (p)->lpVtbl->GetDeviceState(p,a,b)
1878 #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d)   (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1879 #define IDirectInputDevice7_SetDataFormat(p,a)         (p)->lpVtbl->SetDataFormat(p,a)
1880 #define IDirectInputDevice7_SetEventNotification(p,a)  (p)->lpVtbl->SetEventNotification(p,a)
1881 #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1882 #define IDirectInputDevice7_GetObjectInfo(p,a,b,c)     (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1883 #define IDirectInputDevice7_GetDeviceInfo(p,a)         (p)->lpVtbl->GetDeviceInfo(p,a)
1884 #define IDirectInputDevice7_RunControlPanel(p,a,b)     (p)->lpVtbl->RunControlPanel(p,a,b)
1885 #define IDirectInputDevice7_Initialize(p,a,b,c)        (p)->lpVtbl->Initialize(p,a,b,c)
1886 /*** IDirectInputDevice2 methods ***/
1887 #define IDirectInputDevice7_CreateEffect(p,a,b,c,d)           (p)->lpVtbl->CreateEffect(p,a,b,c,d)
1888 #define IDirectInputDevice7_EnumEffects(p,a,b,c)              (p)->lpVtbl->EnumEffects(p,a,b,c)
1889 #define IDirectInputDevice7_GetEffectInfo(p,a,b)              (p)->lpVtbl->GetEffectInfo(p,a,b)
1890 #define IDirectInputDevice7_GetForceFeedbackState(p,a)        (p)->lpVtbl->GetForceFeedbackState(p,a)
1891 #define IDirectInputDevice7_SendForceFeedbackCommand(p,a)     (p)->lpVtbl->SendForceFeedbackCommand(p,a)
1892 #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
1893 #define IDirectInputDevice7_Escape(p,a)                       (p)->lpVtbl->Escape(p,a)
1894 #define IDirectInputDevice7_Poll(p)                           (p)->lpVtbl->Poll(p)
1895 #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d)         (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
1896 /*** IDirectInputDevice7 methods ***/
1897 #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
1898 #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
1899 #else
1900 /*** IUnknown methods ***/
1901 #define IDirectInputDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
1902 #define IDirectInputDevice7_AddRef(p)             (p)->AddRef()
1903 #define IDirectInputDevice7_Release(p)            (p)->Release()
1904 /*** IDirectInputDevice methods ***/
1905 #define IDirectInputDevice7_GetCapabilities(p,a)       (p)->GetCapabilities(a)
1906 #define IDirectInputDevice7_EnumObjects(p,a,b,c)       (p)->EnumObjects(a,b,c)
1907 #define IDirectInputDevice7_GetProperty(p,a,b)         (p)->GetProperty(a,b)
1908 #define IDirectInputDevice7_SetProperty(p,a,b)         (p)->SetProperty(a,b)
1909 #define IDirectInputDevice7_Acquire(p)                 (p)->Acquire()
1910 #define IDirectInputDevice7_Unacquire(p)               (p)->Unacquire()
1911 #define IDirectInputDevice7_GetDeviceState(p,a,b)      (p)->GetDeviceState(a,b)
1912 #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d)   (p)->GetDeviceData(a,b,c,d)
1913 #define IDirectInputDevice7_SetDataFormat(p,a)         (p)->SetDataFormat(a)
1914 #define IDirectInputDevice7_SetEventNotification(p,a)  (p)->SetEventNotification(a)
1915 #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
1916 #define IDirectInputDevice7_GetObjectInfo(p,a,b,c)     (p)->GetObjectInfo(a,b,c)
1917 #define IDirectInputDevice7_GetDeviceInfo(p,a)         (p)->GetDeviceInfo(a)
1918 #define IDirectInputDevice7_RunControlPanel(p,a,b)     (p)->RunControlPanel(a,b)
1919 #define IDirectInputDevice7_Initialize(p,a,b,c)        (p)->Initialize(a,b,c)
1920 /*** IDirectInputDevice2 methods ***/
1921 #define IDirectInputDevice7_CreateEffect(p,a,b,c,d)           (p)->CreateEffect(a,b,c,d)
1922 #define IDirectInputDevice7_EnumEffects(p,a,b,c)              (p)->EnumEffects(a,b,c)
1923 #define IDirectInputDevice7_GetEffectInfo(p,a,b)              (p)->GetEffectInfo(a,b)
1924 #define IDirectInputDevice7_GetForceFeedbackState(p,a)        (p)->GetForceFeedbackState(a)
1925 #define IDirectInputDevice7_SendForceFeedbackCommand(p,a)     (p)->SendForceFeedbackCommand(a)
1926 #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
1927 #define IDirectInputDevice7_Escape(p,a)                       (p)->Escape(a)
1928 #define IDirectInputDevice7_Poll(p)                           (p)->Poll()
1929 #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d)         (p)->SendDeviceData(a,b,c,d)
1930 /*** IDirectInputDevice7 methods ***/
1931 #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d)
1932 #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d)
1933 #endif
1934
1935
1936 /*****************************************************************************
1937  * IDirectInputDevice8A interface
1938  */
1939 #define INTERFACE IDirectInputDevice8A
1940 DECLARE_INTERFACE_(IDirectInputDevice8A,IDirectInputDevice7A)
1941 {
1942     /*** IUnknown methods ***/
1943     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1944     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1945     STDMETHOD_(ULONG,Release)(THIS) PURE;
1946     /*** IDirectInputDeviceA methods ***/
1947     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1948     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1949     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1950     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1951     STDMETHOD(Acquire)(THIS) PURE;
1952     STDMETHOD(Unacquire)(THIS) PURE;
1953     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
1954     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
1955     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
1956     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
1957     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
1958     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE;
1959     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE;
1960     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
1961     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1962     /*** IDirectInputDevice2A methods ***/
1963     STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE;
1964     STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE;
1965     STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE;
1966     STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE;
1967     STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE;
1968     STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE;
1969     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE;
1970     STDMETHOD(Poll)(THIS) PURE;
1971     STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1972     /*** IDirectInputDevice7A methods ***/
1973     STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE;
1974     STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE;
1975     /*** IDirectInputDevice8A methods ***/
1976     STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) PURE;
1977     STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) PURE;
1978     STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader) PURE;
1979 };
1980 #undef INTERFACE
1981
1982 /*****************************************************************************
1983  * IDirectInputDevice8W interface
1984  */
1985 #define INTERFACE IDirectInputDevice8W
1986 DECLARE_INTERFACE_(IDirectInputDevice8W,IDirectInputDevice7W)
1987 {
1988     /*** IUnknown methods ***/
1989     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1990     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1991     STDMETHOD_(ULONG,Release)(THIS) PURE;
1992     /*** IDirectInputDeviceW methods ***/
1993     STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE;
1994     STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
1995     STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE;
1996     STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE;
1997     STDMETHOD(Acquire)(THIS) PURE;
1998     STDMETHOD(Unacquire)(THIS) PURE;
1999     STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE;
2000     STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE;
2001     STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE;
2002     STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE;
2003     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE;
2004     STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE;
2005     STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE;
2006     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2007     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
2008     /*** IDirectInputDevice2W methods ***/
2009     STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE;
2010     STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE;
2011     STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE;
2012     STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE;
2013     STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE;
2014     STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE;
2015     STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE;
2016     STDMETHOD(Poll)(THIS) PURE;
2017     STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
2018     /*** IDirectInputDevice7W methods ***/
2019     STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE;
2020     STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE;
2021     /*** IDirectInputDevice8W methods ***/
2022     STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE;
2023     STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE;
2024     STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader) PURE;
2025 };
2026 #undef INTERFACE
2027
2028 #if !defined(__cplusplus) || defined(CINTERFACE)
2029 /*** IUnknown methods ***/
2030 #define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
2031 #define IDirectInputDevice8_AddRef(p)             (p)->lpVtbl->AddRef(p)
2032 #define IDirectInputDevice8_Release(p)            (p)->lpVtbl->Release(p)
2033 /*** IDirectInputDevice methods ***/
2034 #define IDirectInputDevice8_GetCapabilities(p,a)       (p)->lpVtbl->GetCapabilities(p,a)
2035 #define IDirectInputDevice8_EnumObjects(p,a,b,c)       (p)->lpVtbl->EnumObjects(p,a,b,c)
2036 #define IDirectInputDevice8_GetProperty(p,a,b)         (p)->lpVtbl->GetProperty(p,a,b)
2037 #define IDirectInputDevice8_SetProperty(p,a,b)         (p)->lpVtbl->SetProperty(p,a,b)
2038 #define IDirectInputDevice8_Acquire(p)                 (p)->lpVtbl->Acquire(p)
2039 #define IDirectInputDevice8_Unacquire(p)               (p)->lpVtbl->Unacquire(p)
2040 #define IDirectInputDevice8_GetDeviceState(p,a,b)      (p)->lpVtbl->GetDeviceState(p,a,b)
2041 #define IDirectInputDevice8_GetDeviceData(p,a,b,c,d)   (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
2042 #define IDirectInputDevice8_SetDataFormat(p,a)         (p)->lpVtbl->SetDataFormat(p,a)
2043 #define IDirectInputDevice8_SetEventNotification(p,a)  (p)->lpVtbl->SetEventNotification(p,a)
2044 #define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
2045 #define IDirectInputDevice8_GetObjectInfo(p,a,b,c)     (p)->lpVtbl->GetObjectInfo(p,a,b,c)
2046 #define IDirectInputDevice8_GetDeviceInfo(p,a)         (p)->lpVtbl->GetDeviceInfo(p,a)
2047 #define IDirectInputDevice8_RunControlPanel(p,a,b)     (p)->lpVtbl->RunControlPanel(p,a,b)
2048 #define IDirectInputDevice8_Initialize(p,a,b,c)        (p)->lpVtbl->Initialize(p,a,b,c)
2049 /*** IDirectInputDevice2 methods ***/
2050 #define IDirectInputDevice8_CreateEffect(p,a,b,c,d)           (p)->lpVtbl->CreateEffect(p,a,b,c,d)
2051 #define IDirectInputDevice8_EnumEffects(p,a,b,c)              (p)->lpVtbl->EnumEffects(p,a,b,c)
2052 #define IDirectInputDevice8_GetEffectInfo(p,a,b)              (p)->lpVtbl->GetEffectInfo(p,a,b)
2053 #define IDirectInputDevice8_GetForceFeedbackState(p,a)        (p)->lpVtbl->GetForceFeedbackState(p,a)
2054 #define IDirectInputDevice8_SendForceFeedbackCommand(p,a)     (p)->lpVtbl->SendForceFeedbackCommand(p,a)
2055 #define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
2056 #define IDirectInputDevice8_Escape(p,a)                       (p)->lpVtbl->Escape(p,a)
2057 #define IDirectInputDevice8_Poll(p)                           (p)->lpVtbl->Poll(p)
2058 #define IDirectInputDevice8_SendDeviceData(p,a,b,c,d)         (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
2059 /*** IDirectInputDevice7 methods ***/
2060 #define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
2061 #define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
2062 /*** IDirectInputDevice8 methods ***/
2063 #define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c)
2064 #define IDirectInputDevice8_SetActionMap(p,a,b,c)   (p)->lpVtbl->SetActionMap(p,a,b,c)
2065 #define IDirectInputDevice8_GetImageInfo(p,a)       (p)->lpVtbl->GetImageInfo(p,a)
2066 #else
2067 /*** IUnknown methods ***/
2068 #define IDirectInputDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
2069 #define IDirectInputDevice8_AddRef(p)             (p)->AddRef()
2070 #define IDirectInputDevice8_Release(p)            (p)->Release()
2071 /*** IDirectInputDevice methods ***/
2072 #define IDirectInputDevice8_GetCapabilities(p,a)       (p)->GetCapabilities(a)
2073 #define IDirectInputDevice8_EnumObjects(p,a,b,c)       (p)->EnumObjects(a,b,c)
2074 #define IDirectInputDevice8_GetProperty(p,a,b)         (p)->GetProperty(a,b)
2075 #define IDirectInputDevice8_SetProperty(p,a,b)         (p)->SetProperty(a,b)
2076 #define IDirectInputDevice8_Acquire(p)                 (p)->Acquire()
2077 #define IDirectInputDevice8_Unacquire(p)               (p)->Unacquire()
2078 #define IDirectInputDevice8_GetDeviceState(p,a,b)      (p)->GetDeviceState(a,b)
2079 #define IDirectInputDevice8_GetDeviceData(p,a,b,c,d)   (p)->GetDeviceData(a,b,c,d)
2080 #define IDirectInputDevice8_SetDataFormat(p,a)         (p)->SetDataFormat(a)
2081 #define IDirectInputDevice8_SetEventNotification(p,a)  (p)->SetEventNotification(a)
2082 #define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
2083 #define IDirectInputDevice8_GetObjectInfo(p,a,b,c)     (p)->GetObjectInfo(a,b,c)
2084 #define IDirectInputDevice8_GetDeviceInfo(p,a)         (p)->GetDeviceInfo(a)
2085 #define IDirectInputDevice8_RunControlPanel(p,a,b)     (p)->RunControlPanel(a,b)
2086 #define IDirectInputDevice8_Initialize(p,a,b,c)        (p)->Initialize(a,b,c)
2087 /*** IDirectInputDevice2 methods ***/
2088 #define IDirectInputDevice8_CreateEffect(p,a,b,c,d)           (p)->CreateEffect(a,b,c,d)
2089 #define IDirectInputDevice8_EnumEffects(p,a,b,c)              (p)->EnumEffects(a,b,c)
2090 #define IDirectInputDevice8_GetEffectInfo(p,a,b)              (p)->GetEffectInfo(a,b)
2091 #define IDirectInputDevice8_GetForceFeedbackState(p,a)        (p)->GetForceFeedbackState(a)
2092 #define IDirectInputDevice8_SendForceFeedbackCommand(p,a)     (p)->SendForceFeedbackCommand(a)
2093 #define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c)
2094 #define IDirectInputDevice8_Escape(p,a)                       (p)->Escape(a)
2095 #define IDirectInputDevice8_Poll(p)                           (p)->Poll()
2096 #define IDirectInputDevice8_SendDeviceData(p,a,b,c,d)         (p)->SendDeviceData(a,b,c,d)
2097 /*** IDirectInputDevice7 methods ***/
2098 #define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d)
2099 #define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d)
2100 /*** IDirectInputDevice8 methods ***/
2101 #define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->BuildActionMap(a,b,c)
2102 #define IDirectInputDevice8_SetActionMap(p,a,b,c)   (p)->SetActionMap(a,b,c)
2103 #define IDirectInputDevice8_GetImageInfo(p,a)       (p)->GetImageInfo(a)
2104 #endif
2105
2106 /* "Standard" Mouse report... */
2107 typedef struct DIMOUSESTATE {
2108   LONG lX;
2109   LONG lY;
2110   LONG lZ;
2111   BYTE rgbButtons[4];
2112 } DIMOUSESTATE;
2113
2114 /* "Standard" Mouse report for DInput 7... */
2115 typedef struct DIMOUSESTATE2 {
2116   LONG lX;
2117   LONG lY;
2118   LONG lZ;
2119   BYTE rgbButtons[8];
2120 } DIMOUSESTATE2;
2121
2122 #define DIMOFS_X        FIELD_OFFSET(DIMOUSESTATE, lX)
2123 #define DIMOFS_Y        FIELD_OFFSET(DIMOUSESTATE, lY)
2124 #define DIMOFS_Z        FIELD_OFFSET(DIMOUSESTATE, lZ)
2125 #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
2126 #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
2127 #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
2128 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
2129 #define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4)
2130 #define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5)
2131 #define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6)
2132 #define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7)
2133
2134 /* New DirectInput8 mouse definitions */
2135
2136 #define DIMOUSE_XAXISAB            (0x82000200 | DIMOFS_X)
2137 #define DIMOUSE_YAXISAB            (0x82000200 | DIMOFS_Y)
2138 #define DIMOUSE_XAXIS              (0x82000300 | DIMOFS_X)
2139 #define DIMOUSE_YAXIS              (0x82000300 | DIMOFS_Y)
2140 #define DIMOUSE_WHEEL              (0x82000300 | DIMOFS_Z)
2141 #define DIMOUSE_BUTTON0            (0x82000400 | DIMOFS_BUTTON0)
2142 #define DIMOUSE_BUTTON1            (0x82000400 | DIMOFS_BUTTON1)
2143 #define DIMOUSE_BUTTON2            (0x82000400 | DIMOFS_BUTTON2)
2144 #define DIMOUSE_BUTTON3            (0x82000400 | DIMOFS_BUTTON3)
2145 #define DIMOUSE_BUTTON4            (0x82000400 | DIMOFS_BUTTON4)
2146 #define DIMOUSE_BUTTON5            (0x82000400 | DIMOFS_BUTTON5)
2147 #define DIMOUSE_BUTTON6            (0x82000400 | DIMOFS_BUTTON6)
2148 #define DIMOUSE_BUTTON7            (0x82000400 | DIMOFS_BUTTON7)
2149
2150 #ifdef __cplusplus
2151 extern "C" {
2152 #endif
2153 extern const DIDATAFORMAT c_dfDIMouse;
2154 extern const DIDATAFORMAT c_dfDIMouse2; /* DX 7 */
2155 extern const DIDATAFORMAT c_dfDIKeyboard;
2156 extern const DIDATAFORMAT c_dfDIJoystick;
2157 extern const DIDATAFORMAT c_dfDIJoystick2;
2158 #ifdef __cplusplus
2159 };
2160 #endif
2161
2162 #define DIAXIS_ANY_X_1             0xFF00C201
2163 #define DIAXIS_ANY_X_2             0xFF00C202
2164 #define DIAXIS_ANY_Y_1             0xFF014201
2165 #define DIAXIS_ANY_Y_2             0xFF014202
2166 #define DIAXIS_ANY_Z_1             0xFF01C201
2167 #define DIAXIS_ANY_Z_2             0xFF01C202
2168 #define DIAXIS_ANY_R_1             0xFF024201
2169 #define DIAXIS_ANY_R_2             0xFF024202
2170 #define DIAXIS_ANY_U_1             0xFF02C201
2171 #define DIAXIS_ANY_U_2             0xFF02C202
2172 #define DIAXIS_ANY_V_1             0xFF034201
2173 #define DIAXIS_ANY_V_2             0xFF034202
2174 #define DIAXIS_ANY_A_1             0xFF03C201
2175 #define DIAXIS_ANY_A_2             0xFF03C202
2176 #define DIAXIS_ANY_B_1             0xFF044201
2177 #define DIAXIS_ANY_B_2             0xFF044202
2178 #define DIAXIS_ANY_C_1             0xFF04C201
2179 #define DIAXIS_ANY_C_2             0xFF04C202
2180 #define DIAXIS_ANY_S_1             0xFF054201
2181 #define DIAXIS_ANY_S_2             0xFF054202
2182 #define DIAXIS_ANY_1               0xFF004201
2183 #define DIAXIS_ANY_2               0xFF004202
2184 #define DIAXIS_ANY_3               0xFF004203
2185 #define DIAXIS_ANY_4               0xFF004204
2186 #define DIPOV_ANY_1                0xFF004601
2187 #define DIPOV_ANY_2                0xFF004602
2188 #define DIPOV_ANY_3                0xFF004603
2189 #define DIPOV_ANY_4                0xFF004604
2190 #define DIBUTTON_ANY(instance)     (0xFF004400 | (instance))
2191
2192
2193 /*****************************************************************************
2194  * IDirectInputA interface
2195  */
2196 #define INTERFACE IDirectInputA
2197 DECLARE_INTERFACE_(IDirectInputA,IUnknown)
2198 {
2199     /*** IUnknown methods ***/
2200     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2201     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2202     STDMETHOD_(ULONG,Release)(THIS) PURE;
2203     /*** IDirectInputA methods ***/
2204     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2205     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2206     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2207     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2208     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2209 };
2210 #undef INTERFACE
2211
2212 /*****************************************************************************
2213  * IDirectInputW interface
2214  */
2215 #define INTERFACE IDirectInputW
2216 DECLARE_INTERFACE_(IDirectInputW,IUnknown)
2217 {
2218     /*** IUnknown methods ***/
2219     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2220     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2221     STDMETHOD_(ULONG,Release)(THIS) PURE;
2222     /*** IDirectInputW methods ***/
2223     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2224     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2225     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2226     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2227     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2228 };
2229 #undef INTERFACE
2230
2231 #if !defined(__cplusplus) || defined(CINTERFACE)
2232 /*** IUnknown methods ***/
2233 #define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
2234 #define IDirectInput_AddRef(p)             (p)->lpVtbl->AddRef(p)
2235 #define IDirectInput_Release(p)            (p)->lpVtbl->Release(p)
2236 /*** IDirectInput methods ***/
2237 #define IDirectInput_CreateDevice(p,a,b,c)  (p)->lpVtbl->CreateDevice(p,a,b,c)
2238 #define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
2239 #define IDirectInput_GetDeviceStatus(p,a)   (p)->lpVtbl->GetDeviceStatus(p,a)
2240 #define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
2241 #define IDirectInput_Initialize(p,a,b)      (p)->lpVtbl->Initialize(p,a,b)
2242 #else
2243 /*** IUnknown methods ***/
2244 #define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
2245 #define IDirectInput_AddRef(p)             (p)->AddRef()
2246 #define IDirectInput_Release(p)            (p)->Release()
2247 /*** IDirectInput methods ***/
2248 #define IDirectInput_CreateDevice(p,a,b,c)  (p)->CreateDevice(a,b,c)
2249 #define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
2250 #define IDirectInput_GetDeviceStatus(p,a)   (p)->GetDeviceStatus(a)
2251 #define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
2252 #define IDirectInput_Initialize(p,a,b)      (p)->Initialize(a,b)
2253 #endif
2254
2255 /*****************************************************************************
2256  * IDirectInput2A interface
2257  */
2258 #define INTERFACE IDirectInput2A
2259 DECLARE_INTERFACE_(IDirectInput2A,IDirectInputA)
2260 {
2261     /*** IUnknown methods ***/
2262     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2263     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2264     STDMETHOD_(ULONG,Release)(THIS) PURE;
2265     /*** IDirectInputA methods ***/
2266     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2267     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2268     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2269     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2270     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2271     /*** IDirectInput2A methods ***/
2272     STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE;
2273 };
2274 #undef INTERFACE
2275
2276 /*****************************************************************************
2277  * IDirectInput2W interface
2278  */
2279 #define INTERFACE IDirectInput2W
2280 DECLARE_INTERFACE_(IDirectInput2W,IDirectInputW)
2281 {
2282     /*** IUnknown methods ***/
2283     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2284     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2285     STDMETHOD_(ULONG,Release)(THIS) PURE;
2286     /*** IDirectInputW methods ***/
2287     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2288     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2289     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2290     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2291     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2292     /*** IDirectInput2W methods ***/
2293     STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE;
2294 };
2295 #undef INTERFACE
2296
2297 #if !defined(__cplusplus) || defined(CINTERFACE)
2298 /*** IUnknown methods ***/
2299 #define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
2300 #define IDirectInput2_AddRef(p)             (p)->lpVtbl->AddRef(p)
2301 #define IDirectInput2_Release(p)            (p)->lpVtbl->Release(p)
2302 /*** IDirectInput methods ***/
2303 #define IDirectInput2_CreateDevice(p,a,b,c)  (p)->lpVtbl->CreateDevice(p,a,b,c)
2304 #define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
2305 #define IDirectInput2_GetDeviceStatus(p,a)   (p)->lpVtbl->GetDeviceStatus(p,a)
2306 #define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
2307 #define IDirectInput2_Initialize(p,a,b)      (p)->lpVtbl->Initialize(p,a,b)
2308 /*** IDirectInput2 methods ***/
2309 #define IDirectInput2_FindDevice(p,a,b,c)    (p)->lpVtbl->FindDevice(p,a,b,c)
2310 #else
2311 /*** IUnknown methods ***/
2312 #define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
2313 #define IDirectInput2_AddRef(p)             (p)->AddRef()
2314 #define IDirectInput2_Release(p)            (p)->Release()
2315 /*** IDirectInput methods ***/
2316 #define IDirectInput2_CreateDevice(p,a,b,c)  (p)->CreateDevice(a,b,c)
2317 #define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
2318 #define IDirectInput2_GetDeviceStatus(p,a)   (p)->GetDeviceStatus(a)
2319 #define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
2320 #define IDirectInput2_Initialize(p,a,b)      (p)->Initialize(a,b)
2321 /*** IDirectInput2 methods ***/
2322 #define IDirectInput2_FindDevice(p,a,b,c)    (p)->FindDevice(a,b,c)
2323 #endif
2324
2325 /*****************************************************************************
2326  * IDirectInput7A interface
2327  */
2328 #define INTERFACE IDirectInput7A
2329 DECLARE_INTERFACE_(IDirectInput7A,IDirectInput2A)
2330 {
2331     /*** IUnknown methods ***/
2332     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2333     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2334     STDMETHOD_(ULONG,Release)(THIS) PURE;
2335     /*** IDirectInputA methods ***/
2336     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2337     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2338     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2339     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2340     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2341     /*** IDirectInput2A methods ***/
2342     STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE;
2343     /*** IDirectInput7A methods ***/
2344     STDMETHOD(CreateDeviceEx)(THIS_ REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter) PURE;
2345 };
2346 #undef INTERFACE
2347
2348 /*****************************************************************************
2349  * IDirectInput7W interface
2350  */
2351 #define INTERFACE IDirectInput7W
2352 DECLARE_INTERFACE_(IDirectInput7W,IDirectInput2W)
2353 {
2354     /*** IUnknown methods ***/
2355     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2356     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2357     STDMETHOD_(ULONG,Release)(THIS) PURE;
2358     /*** IDirectInputW methods ***/
2359     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2360     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2361     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2362     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2363     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2364     /*** IDirectInput2W methods ***/
2365     STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE;
2366     /*** IDirectInput7W methods ***/
2367     STDMETHOD(CreateDeviceEx)(THIS_ REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter) PURE;
2368 };
2369 #undef INTERFACE
2370
2371 #if !defined(__cplusplus) || defined(CINTERFACE)
2372 /*** IUnknown methods ***/
2373 #define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
2374 #define IDirectInput7_AddRef(p)             (p)->lpVtbl->AddRef(p)
2375 #define IDirectInput7_Release(p)            (p)->lpVtbl->Release(p)
2376 /*** IDirectInput methods ***/
2377 #define IDirectInput7_CreateDevice(p,a,b,c)  (p)->lpVtbl->CreateDevice(p,a,b,c)
2378 #define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
2379 #define IDirectInput7_GetDeviceStatus(p,a)   (p)->lpVtbl->GetDeviceStatus(p,a)
2380 #define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
2381 #define IDirectInput7_Initialize(p,a,b)      (p)->lpVtbl->Initialize(p,a,b)
2382 /*** IDirectInput2 methods ***/
2383 #define IDirectInput7_FindDevice(p,a,b,c)    (p)->lpVtbl->FindDevice(p,a,b,c)
2384 /*** IDirectInput7 methods ***/
2385 #define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d)
2386 #else
2387 /*** IUnknown methods ***/
2388 #define IDirectInput7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
2389 #define IDirectInput7_AddRef(p)             (p)->AddRef()
2390 #define IDirectInput7_Release(p)            (p)->Release()
2391 /*** IDirectInput methods ***/
2392 #define IDirectInput7_CreateDevice(p,a,b,c)  (p)->CreateDevice(a,b,c)
2393 #define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d)
2394 #define IDirectInput7_GetDeviceStatus(p,a)   (p)->GetDeviceStatus(a)
2395 #define IDirectInput7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b)
2396 #define IDirectInput7_Initialize(p,a,b)      (p)->Initialize(a,b)
2397 /*** IDirectInput2 methods ***/
2398 #define IDirectInput7_FindDevice(p,a,b,c)    (p)->FindDevice(a,b,c)
2399 /*** IDirectInput7 methods ***/
2400 #define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->CreateDeviceEx(a,b,c,d)
2401 #endif
2402
2403
2404 /*****************************************************************************
2405  * IDirectInput8A interface
2406  */
2407 #define INTERFACE IDirectInput8A
2408 DECLARE_INTERFACE_(IDirectInput8A,IUnknown)
2409 {
2410     /*** IUnknown methods ***/
2411     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2412     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2413     STDMETHOD_(ULONG,Release)(THIS) PURE;
2414     /*** IDirectInput8A methods ***/
2415     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICE8A *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2416     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2417     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2418     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2419     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2420     STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE;
2421     STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCSTR ptszUserName, LPDIACTIONFORMATA lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2422     STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSA lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) PURE;
2423 };
2424 #undef INTERFACE
2425
2426 /*****************************************************************************
2427  * IDirectInput8W interface
2428  */
2429 #define INTERFACE IDirectInput8W
2430 DECLARE_INTERFACE_(IDirectInput8W,IUnknown)
2431 {
2432     /*** IUnknown methods ***/
2433     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
2434     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
2435     STDMETHOD_(ULONG,Release)(THIS) PURE;
2436     /*** IDirectInput8W methods ***/
2437     STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICE8W *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE;
2438     STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2439     STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE;
2440     STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE;
2441     STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
2442     STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE;
2443     STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCWSTR ptszUserName, LPDIACTIONFORMATW lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE;
2444     STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) PURE;
2445 };
2446 #undef INTERFACE
2447
2448 #if !defined(__cplusplus) || defined(CINTERFACE)
2449 /*** IUnknown methods ***/
2450 #define IDirectInput8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
2451 #define IDirectInput8_AddRef(p)             (p)->lpVtbl->AddRef(p)
2452 #define IDirectInput8_Release(p)            (p)->lpVtbl->Release(p)
2453 /*** IDirectInput8 methods ***/
2454 #define IDirectInput8_CreateDevice(p,a,b,c)       (p)->lpVtbl->CreateDevice(p,a,b,c)
2455 #define IDirectInput8_EnumDevices(p,a,b,c,d)      (p)->lpVtbl->EnumDevices(p,a,b,c,d)
2456 #define IDirectInput8_GetDeviceStatus(p,a)        (p)->lpVtbl->GetDeviceStatus(p,a)
2457 #define IDirectInput8_RunControlPanel(p,a,b)      (p)->lpVtbl->RunControlPanel(p,a,b)
2458 #define IDirectInput8_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
2459 #define IDirectInput8_FindDevice(p,a,b,c)         (p)->lpVtbl->FindDevice(p,a,b,c)
2460 #define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->lpVtbl->EnumDevicesBySemantics(p,a,b,c,d,e)
2461 #define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d)
2462 #else
2463 /*** IUnknown methods ***/
2464 #define IDirectInput8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
2465 #define IDirectInput8_AddRef(p)             (p)->AddRef()
2466 #define IDirectInput8_Release(p)            (p)->Release()
2467 /*** IDirectInput8 methods ***/
2468 #define IDirectInput8_CreateDevice(p,a,b,c)       (p)->CreateDevice(a,b,c)
2469 #define IDirectInput8_EnumDevices(p,a,b,c,d)      (p)->EnumDevices(a,b,c,d)
2470 #define IDirectInput8_GetDeviceStatus(p,a)        (p)->GetDeviceStatus(a)
2471 #define IDirectInput8_RunControlPanel(p,a,b)      (p)->RunControlPanel(a,b)
2472 #define IDirectInput8_Initialize(p,a,b)           (p)->Initialize(a,b)
2473 #define IDirectInput8_FindDevice(p,a,b,c)         (p)->FindDevice(a,b,c)
2474 #define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->EnumDevicesBySemantics(a,b,c,d,e)
2475 #define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->ConfigureDevices(a,b,c,d)
2476 #endif
2477
2478
2479 /* Export functions */
2480
2481 #ifdef __cplusplus
2482 extern "C" {
2483 #endif
2484
2485 HRESULT WINAPI DirectInput8Create(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN);
2486
2487 HRESULT WINAPI DirectInputCreateA(HINSTANCE,DWORD,LPDIRECTINPUTA *,LPUNKNOWN);
2488 HRESULT WINAPI DirectInputCreateW(HINSTANCE,DWORD,LPDIRECTINPUTW *,LPUNKNOWN);
2489 #define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate)
2490
2491 HRESULT WINAPI DirectInputCreateEx(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN);
2492
2493 #ifdef __cplusplus
2494 };
2495 #endif
2496
2497 #endif /* __DINPUT_INCLUDED__ */