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