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