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