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