Add a test case for scroll APIs, fix a few bugs spotted by it.
[wine.git] / include / dinput.h
blob468b5d2a4dabd313a150d36ed2a270874fb4a74f
1 /*
2 * Copyright (C) the Wine project
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.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_DINPUT_H
20 #define __WINE_DINPUT_H
22 #include <objbase.h>
24 #ifndef DIRECTINPUT_VERSION
25 #define DIRECTINPUT_VERSION 0x0800
26 #endif
28 /* Classes */
29 DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
30 DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
32 DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
33 DEFINE_GUID(CLSID_DirectInputDevice8, 0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35 /* Interfaces */
36 DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
37 DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
38 DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
39 DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
40 DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
41 DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
42 DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
43 DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00);
44 DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
45 DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
46 DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
47 DEFINE_GUID(IID_IDirectInputDevice2W, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
48 DEFINE_GUID(IID_IDirectInputDevice7A, 0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
49 DEFINE_GUID(IID_IDirectInputDevice7W, 0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
50 DEFINE_GUID(IID_IDirectInputDevice8A, 0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
51 DEFINE_GUID(IID_IDirectInputDevice8W, 0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79);
52 DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
54 /* Predefined object types */
55 DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
56 DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
57 DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
58 DEFINE_GUID(GUID_RxAxis,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
59 DEFINE_GUID(GUID_RyAxis,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
60 DEFINE_GUID(GUID_RzAxis,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
61 DEFINE_GUID(GUID_Slider,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
62 DEFINE_GUID(GUID_Button,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
63 DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
64 DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
65 DEFINE_GUID(GUID_Unknown,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
67 /* Predefined product GUIDs */
68 DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
69 DEFINE_GUID(GUID_SysKeyboard, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
70 DEFINE_GUID(GUID_Joystick, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
72 /* predefined forcefeedback effects */
73 DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
74 DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
75 DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
76 DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
77 DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
78 DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
79 DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
80 DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
81 DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
82 DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
83 DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
84 DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
86 typedef struct IDirectInputA IDirectInputA,*LPDIRECTINPUTA;
87 typedef struct IDirectInputW IDirectInputW,*LPDIRECTINPUTW;
88 typedef struct IDirectInput2A IDirectInput2A,*LPDIRECTINPUT2A;
89 typedef struct IDirectInput2W IDirectInput2W,*LPDIRECTINPUT2W;
90 typedef struct IDirectInput7A IDirectInput7A,*LPDIRECTINPUT7A;
91 typedef struct IDirectInput7W IDirectInput7W,*LPDIRECTINPUT7W;
92 typedef struct IDirectInput8A IDirectInput8A,*LPDIRECTINPUT8A;
93 typedef struct IDirectInput8W IDirectInput8W,*LPDIRECTINPUT8W;
94 typedef struct IDirectInputDeviceA IDirectInputDeviceA,*LPDIRECTINPUTDEVICEA;
95 typedef struct IDirectInputDeviceW IDirectInputDeviceW,*LPDIRECTINPUTDEVICEW;
96 typedef struct IDirectInputDevice2A IDirectInputDevice2A,*LPDIRECTINPUTDEVICE2A;
97 typedef struct IDirectInputDevice2W IDirectInputDevice2W,*LPDIRECTINPUTDEVICE2W;
98 typedef struct IDirectInputDevice7A IDirectInputDevice7A,*LPDIRECTINPUTDEVICE7A;
99 typedef struct IDirectInputDevice7W IDirectInputDevice7W,*LPDIRECTINPUTDEVICE7W;
100 typedef struct IDirectInputDevice8A IDirectInputDevice8A,*LPDIRECTINPUTDEVICE8A;
101 typedef struct IDirectInputDevice8W IDirectInputDevice8W,*LPDIRECTINPUTDEVICE8W;
102 typedef struct IDirectInputEffect IDirectInputEffect,*LPDIRECTINPUTEFFECT;
103 typedef struct SysKeyboardA SysKeyboardA,*LPSYSKEYBOARDA;
104 typedef struct SysMouseA SysMouseA,*LPSYSMOUSEA;
106 #define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput)
107 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT)
108 #define IID_IDirectInput2 WINELIB_NAME_AW(IID_IDirectInput2)
109 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT2)
110 #define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7)
111 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7)
112 #define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice)
113 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE)
114 #define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2)
115 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2)
116 #define IID_IDirectInputDevice7 WINELIB_NAME_AW(IID_IDirectInputDevice7)
117 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE7)
118 #define IID_IDirectInputDevice8 WINELIB_NAME_AW(IID_IDirectInputDevice8)
119 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8)
121 #define DI_OK S_OK
122 #define DI_NOTATTACHED S_FALSE
123 #define DI_BUFFEROVERFLOW S_FALSE
124 #define DI_PROPNOEFFECT S_FALSE
125 #define DI_NOEFFECT S_FALSE
126 #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
127 #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
128 #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
129 #define DI_TRUNCATED ((HRESULT)0x00000008L)
130 #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
132 #define DIERR_OLDDIRECTINPUTVERSION \
133 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
134 #define DIERR_BETADIRECTINPUTVERSION \
135 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
136 #define DIERR_BADDRIVERVER \
137 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
138 #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
139 #define DIERR_NOTFOUND \
140 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
141 #define DIERR_OBJECTNOTFOUND \
142 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
143 #define DIERR_INVALIDPARAM E_INVALIDARG
144 #define DIERR_NOINTERFACE E_NOINTERFACE
145 #define DIERR_GENERIC E_FAIL
146 #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
147 #define DIERR_UNSUPPORTED E_NOTIMPL
148 #define DIERR_NOTINITIALIZED \
149 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
150 #define DIERR_ALREADYINITIALIZED \
151 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
152 #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
153 #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
154 #define DIERR_INPUTLOST \
155 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
156 #define DIERR_ACQUIRED \
157 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
158 #define DIERR_NOTACQUIRED \
159 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
160 #define DIERR_READONLY E_ACCESSDENIED
161 #define DIERR_HANDLEEXISTS E_ACCESSDENIED
162 #ifndef E_PENDING
163 #define E_PENDING 0x8000000AL
164 #endif
165 #define DIERR_INSUFFICIENTPRIVS 0x80040200L
166 #define DIERR_DEVICEFULL 0x80040201L
167 #define DIERR_MOREDATA 0x80040202L
168 #define DIERR_NOTDOWNLOADED 0x80040203L
169 #define DIERR_HASEFFECTS 0x80040204L
170 #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
171 #define DIERR_INCOMPLETEEFFECT 0x80040206L
172 #define DIERR_NOTBUFFERED 0x80040207L
173 #define DIERR_EFFECTPLAYING 0x80040208L
174 #define DIERR_UNPLUGGED 0x80040209L
175 #define DIERR_REPORTFULL 0x8004020AL
177 #define DIENUM_STOP 0
178 #define DIENUM_CONTINUE 1
180 #define DIEDFL_ALLDEVICES 0x00000000
181 #define DIEDFL_ATTACHEDONLY 0x00000000
182 #define DIEDFL_FORCEFEEDBACK 0x00000100
183 #define DIEDFL_INCLUDEALIASES 0x00010000
184 #define DIEDFL_INCLUDEPHANTOMS 0x00020000
185 #define DIEDFL_INCLUDEHIDDEN 0x00040000
187 #define DIDEVTYPE_DEVICE 1
188 #define DIDEVTYPE_MOUSE 2
189 #define DIDEVTYPE_KEYBOARD 3
190 #define DIDEVTYPE_JOYSTICK 4
191 #define DIDEVTYPE_HID 0x00010000
193 #define DI8DEVCLASS_ALL 0
194 #define DI8DEVCLASS_DEVICE 1
195 #define DI8DEVCLASS_POINTER 2
196 #define DI8DEVCLASS_KEYBOARD 3
197 #define DI8DEVCLASS_GAMECTRL 4
199 #define DI8DEVTYPE_DEVICE 0x11
200 #define DI8DEVTYPE_MOUSE 0x12
201 #define DI8DEVTYPE_KEYBOARD 0x13
202 #define DI8DEVTYPE_JOYSTICK 0x14
203 #define DI8DEVTYPE_GAMEPAD 0x15
204 #define DI8DEVTYPE_DRIVING 0x16
205 #define DI8DEVTYPE_FLIGHT 0x17
206 #define DI8DEVTYPE_1STPERSON 0x18
207 #define DI8DEVTYPE_DEVICECTRL 0x19
208 #define DI8DEVTYPE_SCREENPOINTER 0x1A
209 #define DI8DEVTYPE_REMOTE 0x1B
210 #define DI8DEVTYPE_SUPPLEMENTAL 0x1C
212 #define DIDEVTYPEMOUSE_UNKNOWN 1
213 #define DIDEVTYPEMOUSE_TRADITIONAL 2
214 #define DIDEVTYPEMOUSE_FINGERSTICK 3
215 #define DIDEVTYPEMOUSE_TOUCHPAD 4
216 #define DIDEVTYPEMOUSE_TRACKBALL 5
218 #define DIDEVTYPEKEYBOARD_UNKNOWN 0
219 #define DIDEVTYPEKEYBOARD_PCXT 1
220 #define DIDEVTYPEKEYBOARD_OLIVETTI 2
221 #define DIDEVTYPEKEYBOARD_PCAT 3
222 #define DIDEVTYPEKEYBOARD_PCENH 4
223 #define DIDEVTYPEKEYBOARD_NOKIA1050 5
224 #define DIDEVTYPEKEYBOARD_NOKIA9140 6
225 #define DIDEVTYPEKEYBOARD_NEC98 7
226 #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
227 #define DIDEVTYPEKEYBOARD_NEC98106 9
228 #define DIDEVTYPEKEYBOARD_JAPAN106 10
229 #define DIDEVTYPEKEYBOARD_JAPANAX 11
230 #define DIDEVTYPEKEYBOARD_J3100 12
232 #define DIDEVTYPEJOYSTICK_UNKNOWN 1
233 #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
234 #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
235 #define DIDEVTYPEJOYSTICK_GAMEPAD 4
236 #define DIDEVTYPEJOYSTICK_RUDDER 5
237 #define DIDEVTYPEJOYSTICK_WHEEL 6
238 #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
240 #define DI8DEVTYPEMOUSE_UNKNOWN 1
241 #define DI8DEVTYPEMOUSE_TRADITIONAL 2
242 #define DI8DEVTYPEMOUSE_FINGERSTICK 3
243 #define DI8DEVTYPEMOUSE_TOUCHPAD 4
244 #define DI8DEVTYPEMOUSE_TRACKBALL 5
245 #define DI8DEVTYPEMOUSE_ABSOLUTE 6
247 #define DI8DEVTYPEKEYBOARD_UNKNOWN 0
248 #define DI8DEVTYPEKEYBOARD_PCXT 1
249 #define DI8DEVTYPEKEYBOARD_OLIVETTI 2
250 #define DI8DEVTYPEKEYBOARD_PCAT 3
251 #define DI8DEVTYPEKEYBOARD_PCENH 4
252 #define DI8DEVTYPEKEYBOARD_NOKIA1050 5
253 #define DI8DEVTYPEKEYBOARD_NOKIA9140 6
254 #define DI8DEVTYPEKEYBOARD_NEC98 7
255 #define DI8DEVTYPEKEYBOARD_NEC98LAPTOP 8
256 #define DI8DEVTYPEKEYBOARD_NEC98106 9
257 #define DI8DEVTYPEKEYBOARD_JAPAN106 10
258 #define DI8DEVTYPEKEYBOARD_JAPANAX 11
259 #define DI8DEVTYPEKEYBOARD_J3100 12
261 #define DI8DEVTYPE_LIMITEDGAMESUBTYPE 1
263 #define DI8DEVTYPEJOYSTICK_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
264 #define DI8DEVTYPEJOYSTICK_STANDARD 2
266 #define DI8DEVTYPEGAMEPAD_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
267 #define DI8DEVTYPEGAMEPAD_STANDARD 2
268 #define DI8DEVTYPEGAMEPAD_TILT 3
270 #define DI8DEVTYPEDRIVING_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
271 #define DI8DEVTYPEDRIVING_COMBINEDPEDALS 2
272 #define DI8DEVTYPEDRIVING_DUALPEDALS 3
273 #define DI8DEVTYPEDRIVING_THREEPEDALS 4
274 #define DI8DEVTYPEDRIVING_HANDHELD 5
276 #define DI8DEVTYPEFLIGHT_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
277 #define DI8DEVTYPEFLIGHT_STICK 2
278 #define DI8DEVTYPEFLIGHT_YOKE 3
279 #define DI8DEVTYPEFLIGHT_RC 4
281 #define DI8DEVTYPE1STPERSON_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE
282 #define DI8DEVTYPE1STPERSON_UNKNOWN 2
283 #define DI8DEVTYPE1STPERSON_SIXDOF 3
284 #define DI8DEVTYPE1STPERSON_SHOOTER 4
286 #define DI8DEVTYPESCREENPTR_UNKNOWN 2
287 #define DI8DEVTYPESCREENPTR_LIGHTGUN 3
288 #define DI8DEVTYPESCREENPTR_LIGHTPEN 4
289 #define DI8DEVTYPESCREENPTR_TOUCH 5
291 #define DI8DEVTYPEREMOTE_UNKNOWN 2
293 #define DI8DEVTYPEDEVICECTRL_UNKNOWN 2
294 #define DI8DEVTYPEDEVICECTRL_COMMSSELECTION 3
295 #define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4
297 #define DI8DEVTYPESUPPLEMENTAL_UNKNOWN 2
298 #define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER 3
299 #define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER 4
300 #define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER 5
301 #define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE 6
302 #define DI8DEVTYPESUPPLEMENTAL_SHIFTER 7
303 #define DI8DEVTYPESUPPLEMENTAL_THROTTLE 8
304 #define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE 9
305 #define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS 10
306 #define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11
307 #define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12
308 #define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13
310 #define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType)
311 #define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType)
313 typedef struct {
314 DWORD dwSize;
315 GUID guidType;
316 DWORD dwOfs;
317 DWORD dwType;
318 DWORD dwFlags;
319 CHAR tszName[MAX_PATH];
320 #if(DIRECTINPUT_VERSION >= 0x0500)
321 DWORD dwFFMaxForce;
322 DWORD dwFFForceResolution;
323 WORD wCollectionNumber;
324 WORD wDesignatorIndex;
325 WORD wUsagePage;
326 WORD wUsage;
327 DWORD dwDimension;
328 WORD wExponent;
329 WORD wReserved;
330 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
331 } DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA;
332 typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
334 typedef struct {
335 DWORD dwSize;
336 GUID guidType;
337 DWORD dwOfs;
338 DWORD dwType;
339 DWORD dwFlags;
340 WCHAR tszName[MAX_PATH];
341 #if(DIRECTINPUT_VERSION >= 0x0500)
342 DWORD dwFFMaxForce;
343 DWORD dwFFForceResolution;
344 WORD wCollectionNumber;
345 WORD wDesignatorIndex;
346 WORD wUsagePage;
347 WORD wUsage;
348 DWORD dwDimension;
349 WORD wExponent;
350 WORD wReserved;
351 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
352 } DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW;
353 typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
355 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE)
356 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE)
357 DECL_WINELIB_TYPE_AW(LPCDIDEVICEOBJECTINSTANCE)
360 typedef struct {
361 DWORD dwSize;
362 GUID guidInstance;
363 GUID guidProduct;
364 DWORD dwDevType;
365 CHAR tszInstanceName[MAX_PATH];
366 CHAR tszProductName[MAX_PATH];
367 #if(DIRECTINPUT_VERSION >= 0x0500)
368 GUID guidFFDriver;
369 WORD wUsagePage;
370 WORD wUsage;
371 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
372 } DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA;
373 typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA;
375 typedef struct {
376 DWORD dwSize;
377 GUID guidInstance;
378 GUID guidProduct;
379 DWORD dwDevType;
380 WCHAR tszInstanceName[MAX_PATH];
381 WCHAR tszProductName[MAX_PATH];
382 #if(DIRECTINPUT_VERSION >= 0x0500)
383 GUID guidFFDriver;
384 WORD wUsagePage;
385 WORD wUsage;
386 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
387 } DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW;
388 typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW;
390 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE)
391 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE)
392 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE)
394 typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA,LPVOID);
395 typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW,LPVOID);
396 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK)
398 #if DIRECTINPUT_VERSION >= 0x0800
399 typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTANCEA,LPDIRECTINPUTDEVICE8A,DWORD,DWORD,LPVOID);
400 typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTANCEW,LPDIRECTINPUTDEVICE8W,DWORD,DWORD,LPVOID);
401 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESBYSEMANTICSCB)
402 #endif
404 typedef BOOL (CALLBACK *LPDICONFIGUREDEVICESCALLBACK)(LPUNKNOWN,LPVOID);
406 typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA,LPVOID);
407 typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW,LPVOID);
408 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK)
410 typedef BOOL (CALLBACK *LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
412 #define DIK_ESCAPE 0x01
413 #define DIK_1 0x02
414 #define DIK_2 0x03
415 #define DIK_3 0x04
416 #define DIK_4 0x05
417 #define DIK_5 0x06
418 #define DIK_6 0x07
419 #define DIK_7 0x08
420 #define DIK_8 0x09
421 #define DIK_9 0x0A
422 #define DIK_0 0x0B
423 #define DIK_MINUS 0x0C /* - on main keyboard */
424 #define DIK_EQUALS 0x0D
425 #define DIK_BACK 0x0E /* backspace */
426 #define DIK_TAB 0x0F
427 #define DIK_Q 0x10
428 #define DIK_W 0x11
429 #define DIK_E 0x12
430 #define DIK_R 0x13
431 #define DIK_T 0x14
432 #define DIK_Y 0x15
433 #define DIK_U 0x16
434 #define DIK_I 0x17
435 #define DIK_O 0x18
436 #define DIK_P 0x19
437 #define DIK_LBRACKET 0x1A
438 #define DIK_RBRACKET 0x1B
439 #define DIK_RETURN 0x1C /* Enter on main keyboard */
440 #define DIK_LCONTROL 0x1D
441 #define DIK_A 0x1E
442 #define DIK_S 0x1F
443 #define DIK_D 0x20
444 #define DIK_F 0x21
445 #define DIK_G 0x22
446 #define DIK_H 0x23
447 #define DIK_J 0x24
448 #define DIK_K 0x25
449 #define DIK_L 0x26
450 #define DIK_SEMICOLON 0x27
451 #define DIK_APOSTROPHE 0x28
452 #define DIK_GRAVE 0x29 /* accent grave */
453 #define DIK_LSHIFT 0x2A
454 #define DIK_BACKSLASH 0x2B
455 #define DIK_Z 0x2C
456 #define DIK_X 0x2D
457 #define DIK_C 0x2E
458 #define DIK_V 0x2F
459 #define DIK_B 0x30
460 #define DIK_N 0x31
461 #define DIK_M 0x32
462 #define DIK_COMMA 0x33
463 #define DIK_PERIOD 0x34 /* . on main keyboard */
464 #define DIK_SLASH 0x35 /* / on main keyboard */
465 #define DIK_RSHIFT 0x36
466 #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
467 #define DIK_LMENU 0x38 /* left Alt */
468 #define DIK_SPACE 0x39
469 #define DIK_CAPITAL 0x3A
470 #define DIK_F1 0x3B
471 #define DIK_F2 0x3C
472 #define DIK_F3 0x3D
473 #define DIK_F4 0x3E
474 #define DIK_F5 0x3F
475 #define DIK_F6 0x40
476 #define DIK_F7 0x41
477 #define DIK_F8 0x42
478 #define DIK_F9 0x43
479 #define DIK_F10 0x44
480 #define DIK_NUMLOCK 0x45
481 #define DIK_SCROLL 0x46 /* Scroll Lock */
482 #define DIK_NUMPAD7 0x47
483 #define DIK_NUMPAD8 0x48
484 #define DIK_NUMPAD9 0x49
485 #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
486 #define DIK_NUMPAD4 0x4B
487 #define DIK_NUMPAD5 0x4C
488 #define DIK_NUMPAD6 0x4D
489 #define DIK_ADD 0x4E /* + on numeric keypad */
490 #define DIK_NUMPAD1 0x4F
491 #define DIK_NUMPAD2 0x50
492 #define DIK_NUMPAD3 0x51
493 #define DIK_NUMPAD0 0x52
494 #define DIK_DECIMAL 0x53 /* . on numeric keypad */
495 #define DIK_F11 0x57
496 #define DIK_F12 0x58
497 #define DIK_F13 0x64 /* (NEC PC98) */
498 #define DIK_F14 0x65 /* (NEC PC98) */
499 #define DIK_F15 0x66 /* (NEC PC98) */
500 #define DIK_KANA 0x70 /* (Japanese keyboard) */
501 #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
502 #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
503 #define DIK_YEN 0x7D /* (Japanese keyboard) */
504 #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
505 #define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
506 #define DIK_AT 0x91 /* (NEC PC98) */
507 #define DIK_COLON 0x92 /* (NEC PC98) */
508 #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
509 #define DIK_KANJI 0x94 /* (Japanese keyboard) */
510 #define DIK_STOP 0x95 /* (NEC PC98) */
511 #define DIK_AX 0x96 /* (Japan AX) */
512 #define DIK_UNLABELED 0x97 /* (J3100) */
513 #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
514 #define DIK_RCONTROL 0x9D
515 #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
516 #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
517 #define DIK_SYSRQ 0xB7
518 #define DIK_RMENU 0xB8 /* right Alt */
519 #define DIK_PAUSE 0xC5 /* Pause */
520 #define DIK_HOME 0xC7 /* Home on arrow keypad */
521 #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
522 #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
523 #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
524 #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
525 #define DIK_END 0xCF /* End on arrow keypad */
526 #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
527 #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
528 #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
529 #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
530 #define DIK_LWIN 0xDB /* Left Windows key */
531 #define DIK_RWIN 0xDC /* Right Windows key */
532 #define DIK_APPS 0xDD /* AppMenu key */
533 #define DIK_POWER 0xDE
534 #define DIK_SLEEP 0xDF
535 #define DIK_BACKSPACE DIK_BACK /* backspace */
536 #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
537 #define DIK_LALT DIK_LMENU /* left Alt */
538 #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
539 #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
540 #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
541 #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
542 #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
543 #define DIK_RALT DIK_RMENU /* right Alt */
544 #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
545 #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
546 #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
547 #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
548 #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
549 #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
551 #define DIDFT_ALL 0x00000000
552 #define DIDFT_RELAXIS 0x00000001
553 #define DIDFT_ABSAXIS 0x00000002
554 #define DIDFT_AXIS 0x00000003
555 #define DIDFT_PSHBUTTON 0x00000004
556 #define DIDFT_TGLBUTTON 0x00000008
557 #define DIDFT_BUTTON 0x0000000C
558 #define DIDFT_POV 0x00000010
559 #define DIDFT_COLLECTION 0x00000040
560 #define DIDFT_NODATA 0x00000080
561 #define DIDFT_ANYINSTANCE 0x00FFFF00
562 #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
563 #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
564 #define DIDFT_GETTYPE(n) LOBYTE(n)
565 #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
566 #define DIDFT_FFACTUATOR 0x01000000
567 #define DIDFT_FFEFFECTTRIGGER 0x02000000
568 #define DIDFT_OUTPUT 0x10000000
569 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
570 #define DIDFT_NOCOLLECTION 0x00FFFF00
571 #define DIDF_ABSAXIS 0x00000001
572 #define DIDF_RELAXIS 0x00000002
574 #define DIGDD_PEEK 0x00000001
576 typedef struct DIDEVICEOBJECTDATA {
577 DWORD dwOfs;
578 DWORD dwData;
579 DWORD dwTimeStamp;
580 DWORD dwSequence;
581 } DIDEVICEOBJECTDATA,*LPDIDEVICEOBJECTDATA;
582 typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
584 typedef struct _DIOBJECTDATAFORMAT {
585 const GUID *pguid;
586 DWORD dwOfs;
587 DWORD dwType;
588 DWORD dwFlags;
589 } DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
591 typedef struct {
592 DWORD dwSize;
593 DWORD dwObjSize;
594 DWORD dwFlags;
595 DWORD dwDataSize;
596 DWORD dwNumObjs;
597 LPDIOBJECTDATAFORMAT rgodf;
598 } DIDATAFORMAT, *LPDIDATAFORMAT;
599 typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
601 typedef struct {
602 DWORD dwSize;
603 DWORD dwHeaderSize;
604 DWORD dwObj;
605 DWORD dwHow;
606 } DIPROPHEADER,*LPDIPROPHEADER;
607 typedef const DIPROPHEADER *LPCDIPROPHEADER;
609 #define DIPH_DEVICE 0
610 #define DIPH_BYOFFSET 1
611 #define DIPH_BYID 2
612 #define DIPH_BYUSAGE 3
614 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
616 typedef struct DIPROPDWORD {
617 DIPROPHEADER diph;
618 DWORD dwData;
619 } DIPROPDWORD, *LPDIPROPDWORD;
620 typedef const DIPROPDWORD *LPCDIPROPDWORD;
622 typedef struct DIPROPRANGE {
623 DIPROPHEADER diph;
624 LONG lMin;
625 LONG lMax;
626 } DIPROPRANGE, *LPDIPROPRANGE;
627 typedef const DIPROPRANGE *LPCDIPROPRANGE;
629 #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
630 #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
632 typedef struct DIPROPCAL {
633 DIPROPHEADER diph;
634 LONG lMin;
635 LONG lCenter;
636 LONG lMax;
637 } DIPROPCAL, *LPDIPROPCAL;
638 typedef const DIPROPCAL *LPCDIPROPCAL;
640 typedef struct DIPROPGUIDANDPATH {
641 DIPROPHEADER diph;
642 GUID guidClass;
643 WCHAR wszPath[MAX_PATH];
644 } DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH;
645 typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH;
647 /* special property GUIDs */
648 #ifdef __cplusplus
649 #define MAKEDIPROP(prop) (*(const GUID *)(prop))
650 #else
651 #define MAKEDIPROP(prop) ((REFGUID)(prop))
652 #endif
653 #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
654 #define DIPROP_AXISMODE MAKEDIPROP(2)
656 #define DIPROPAXISMODE_ABS 0
657 #define DIPROPAXISMODE_REL 1
659 #define DIPROP_GRANULARITY MAKEDIPROP(3)
660 #define DIPROP_RANGE MAKEDIPROP(4)
661 #define DIPROP_DEADZONE MAKEDIPROP(5)
662 #define DIPROP_SATURATION MAKEDIPROP(6)
663 #define DIPROP_FFGAIN MAKEDIPROP(7)
664 #define DIPROP_FFLOAD MAKEDIPROP(8)
665 #define DIPROP_AUTOCENTER MAKEDIPROP(9)
667 #define DIPROPAUTOCENTER_OFF 0
668 #define DIPROPAUTOCENTER_ON 1
670 #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
672 #define DIPROPCALIBRATIONMODE_COOKED 0
673 #define DIPROPCALIBRATIONMODE_RAW 1
675 #define DIPROP_CALIBRATION MAKEDIPROP(11)
676 #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
679 typedef struct DIDEVCAPS {
680 DWORD dwSize;
681 DWORD dwFlags;
682 DWORD dwDevType;
683 DWORD dwAxes;
684 DWORD dwButtons;
685 DWORD dwPOVs;
686 #if(DIRECTINPUT_VERSION >= 0x0500)
687 DWORD dwFFSamplePeriod;
688 DWORD dwFFMinTimeResolution;
689 DWORD dwFirmwareRevision;
690 DWORD dwHardwareRevision;
691 DWORD dwFFDriverVersion;
692 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
693 } DIDEVCAPS,*LPDIDEVCAPS;
695 #define DIDC_ATTACHED 0x00000001
696 #define DIDC_POLLEDDEVICE 0x00000002
697 #define DIDC_EMULATED 0x00000004
698 #define DIDC_POLLEDDATAFORMAT 0x00000008
699 #define DIDC_FORCEFEEDBACK 0x00000100
700 #define DIDC_FFATTACK 0x00000200
701 #define DIDC_FFFADE 0x00000400
702 #define DIDC_SATURATION 0x00000800
703 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
704 #define DIDC_POSNEGSATURATION 0x00002000
705 #define DIDC_DEADBAND 0x00004000
707 /* SetCooperativeLevel dwFlags */
708 #define DISCL_EXCLUSIVE 0x00000001
709 #define DISCL_NONEXCLUSIVE 0x00000002
710 #define DISCL_FOREGROUND 0x00000004
711 #define DISCL_BACKGROUND 0x00000008
713 typedef struct DICONSTANTFORCE {
714 LONG lMagnitude;
715 } DICONSTANTFORCE, *LPDICONSTANTFORCE;
716 typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
718 typedef struct DIRAMPFORCE {
719 LONG lStart;
720 LONG lEnd;
721 } DIRAMPFORCE, *LPDIRAMPFORCE;
722 typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
724 typedef struct DIPERIODIC {
725 DWORD dwMagnitude;
726 LONG lOffset;
727 DWORD dwPhase;
728 DWORD dwPeriod;
729 } DIPERIODIC, *LPDIPERIODIC;
730 typedef const DIPERIODIC *LPCDIPERIODIC;
732 typedef struct DICONDITION {
733 LONG lOffset;
734 LONG lPositiveCoefficient;
735 LONG lNegativeCoefficient;
736 DWORD dwPositiveSaturation;
737 DWORD dwNegativeSaturation;
738 LONG lDeadBand;
739 } DICONDITION, *LPDICONDITION;
740 typedef const DICONDITION *LPCDICONDITION;
742 typedef struct DICUSTOMFORCE {
743 DWORD cChannels;
744 DWORD dwSamplePeriod;
745 DWORD cSamples;
746 LPLONG rglForceData;
747 } DICUSTOMFORCE, *LPDICUSTOMFORCE;
748 typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
750 typedef struct DIENVELOPE {
751 DWORD dwSize;
752 DWORD dwAttackLevel;
753 DWORD dwAttackTime;
754 DWORD dwFadeLevel;
755 DWORD dwFadeTime;
756 } DIENVELOPE, *LPDIENVELOPE;
757 typedef const DIENVELOPE *LPCDIENVELOPE;
759 typedef struct DIEFFECT {
760 DWORD dwSize;
761 DWORD dwFlags;
762 DWORD dwDuration;
763 DWORD dwSamplePeriod;
764 DWORD dwGain;
765 DWORD dwTriggerButton;
766 DWORD dwTriggerRepeatInterval;
767 DWORD cAxes;
768 LPDWORD rgdwAxes;
769 LPLONG rglDirection;
770 LPDIENVELOPE lpEnvelope;
771 DWORD cbTypeSpecificParams;
772 LPVOID lpvTypeSpecificParams;
773 } DIEFFECT, *LPDIEFFECT;
774 typedef const DIEFFECT *LPCDIEFFECT;
776 typedef struct DIEFFECTINFOA {
777 DWORD dwSize;
778 GUID guid;
779 DWORD dwEffType;
780 DWORD dwStaticParams;
781 DWORD dwDynamicParams;
782 CHAR tszName[MAX_PATH];
783 } DIEFFECTINFOA, *LPDIEFFECTINFOA;
784 typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
786 typedef struct DIEFFECTINFOW {
787 DWORD dwSize;
788 GUID guid;
789 DWORD dwEffType;
790 DWORD dwStaticParams;
791 DWORD dwDynamicParams;
792 WCHAR tszName[MAX_PATH];
793 } DIEFFECTINFOW, *LPDIEFFECTINFOW;
794 typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
796 DECL_WINELIB_TYPE_AW(DIEFFECTINFO)
797 DECL_WINELIB_TYPE_AW(LPDIEFFECTINFO)
798 DECL_WINELIB_TYPE_AW(LPCDIEFFECTINFO)
800 typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
801 typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
803 typedef struct DIEFFESCAPE {
804 DWORD dwSize;
805 DWORD dwCommand;
806 LPVOID lpvInBuffer;
807 DWORD cbInBuffer;
808 LPVOID lpvOutBuffer;
809 DWORD cbOutBuffer;
810 } DIEFFESCAPE, *LPDIEFFESCAPE;
812 typedef struct DIJOYSTATE {
813 LONG lX;
814 LONG lY;
815 LONG lZ;
816 LONG lRx;
817 LONG lRy;
818 LONG lRz;
819 LONG rglSlider[2];
820 DWORD rgdwPOV[4];
821 BYTE rgbButtons[32];
822 } DIJOYSTATE, *LPDIJOYSTATE;
824 typedef struct DIJOYSTATE2 {
825 LONG lX;
826 LONG lY;
827 LONG lZ;
828 LONG lRx;
829 LONG lRy;
830 LONG lRz;
831 LONG rglSlider[2];
832 DWORD rgdwPOV[4];
833 BYTE rgbButtons[128];
834 LONG lVX; /* 'v' as in velocity */
835 LONG lVY;
836 LONG lVZ;
837 LONG lVRx;
838 LONG lVRy;
839 LONG lVRz;
840 LONG rglVSlider[2];
841 LONG lAX; /* 'a' as in acceleration */
842 LONG lAY;
843 LONG lAZ;
844 LONG lARx;
845 LONG lARy;
846 LONG lARz;
847 LONG rglASlider[2];
848 LONG lFX; /* 'f' as in force */
849 LONG lFY;
850 LONG lFZ;
851 LONG lFRx; /* 'fr' as in rotational force aka torque */
852 LONG lFRy;
853 LONG lFRz;
854 LONG rglFSlider[2];
855 } DIJOYSTATE2, *LPDIJOYSTATE2;
857 #define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
858 #define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
859 #define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
860 #define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
861 #define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
862 #define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
863 #define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
864 (n) * sizeof(LONG))
865 #define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
866 (n) * sizeof(DWORD))
867 #define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
868 #define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
869 #define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
870 #define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
871 #define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
872 #define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
873 #define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
874 #define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
875 #define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
876 #define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
877 #define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
878 #define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
879 #define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
880 #define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
881 #define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
882 #define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
883 #define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
884 #define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
885 #define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
886 #define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
887 #define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
888 #define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
889 #define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
890 #define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
891 #define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
892 #define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
893 #define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
894 #define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
895 #define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
896 #define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
897 #define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
898 #define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
899 #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
901 /* DInput 7 structures, types */
902 typedef struct DIFILEEFFECT {
903 DWORD dwSize;
904 GUID GuidEffect;
905 LPCDIEFFECT lpDiEffect;
906 CHAR szFriendlyName[MAX_PATH];
907 } DIFILEEFFECT, *LPDIFILEEFFECT;
909 typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
910 typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID);
912 /* DInput 8 structures and types */
913 #if DIRECTINPUT_VERSION >= 0x0800
914 typedef struct _DIACTIONA {
915 UINT_PTR uAppData;
916 DWORD dwSemantics;
917 DWORD dwFlags;
918 union {
919 LPCSTR lptszActionName;
920 UINT uResIdString;
921 } DUMMYUNIONNAME;
922 GUID guidInstance;
923 DWORD dwObjID;
924 DWORD dwHow;
925 } DIACTIONA, *LPDIACTIONA;
926 typedef const DIACTIONA *LPCDIACTIONA;
928 typedef struct _DIACTIONW {
929 UINT_PTR uAppData;
930 DWORD dwSemantics;
931 DWORD dwFlags;
932 union {
933 LPCWSTR lptszActionName;
934 UINT uResIdString;
935 } DUMMYUNIONNAME;
936 GUID guidInstance;
937 DWORD dwObjID;
938 DWORD dwHow;
939 } DIACTIONW, *LPDIACTIONW;
940 typedef const DIACTIONW *LPCDIACTIONW;
942 DECL_WINELIB_TYPE_AW(DIACTION)
943 DECL_WINELIB_TYPE_AW(LPDIACTION)
944 DECL_WINELIB_TYPE_AW(LPCDIACTION)
946 #define DIA_FORCEFEEDBACK 0x00000001
947 #define DIA_APPMAPPED 0x00000002
948 #define DIA_APPNOMAP 0x00000004
949 #define DIA_NORANGE 0x00000008
950 #define DIA_APPFIXED 0x00000010
952 #define DIAH_UNMAPPED 0x00000000
953 #define DIAH_USERCONFIG 0x00000001
954 #define DIAH_APPREQUESTED 0x00000002
955 #define DIAH_HWAPP 0x00000004
956 #define DIAH_HWDEFAULT 0x00000008
957 #define DIAH_DEFAULT 0x00000020
958 #define DIAH_ERROR 0x80000000
960 typedef struct _DIACTIONFORMATA {
961 DWORD dwSize;
962 DWORD dwActionSize;
963 DWORD dwDataSize;
964 DWORD dwNumActions;
965 LPDIACTIONA rgoAction;
966 GUID guidActionMap;
967 DWORD dwGenre;
968 DWORD dwBufferSize;
969 LONG lAxisMin;
970 LONG lAxisMax;
971 HINSTANCE hInstString;
972 FILETIME ftTimeStamp;
973 DWORD dwCRC;
974 CHAR tszActionMap[MAX_PATH];
975 } DIACTIONFORMATA, *LPDIACTIONFORMATA;
976 typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA;
978 typedef struct _DIACTIONFORMATW {
979 DWORD dwSize;
980 DWORD dwActionSize;
981 DWORD dwDataSize;
982 DWORD dwNumActions;
983 LPDIACTIONW rgoAction;
984 GUID guidActionMap;
985 DWORD dwGenre;
986 DWORD dwBufferSize;
987 LONG lAxisMin;
988 LONG lAxisMax;
989 HINSTANCE hInstString;
990 FILETIME ftTimeStamp;
991 DWORD dwCRC;
992 WCHAR tszActionMap[MAX_PATH];
993 } DIACTIONFORMATW, *LPDIACTIONFORMATW;
994 typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW;
996 DECL_WINELIB_TYPE_AW(DIACTIONFORMAT)
997 DECL_WINELIB_TYPE_AW(LPDIACTIONFORMAT)
998 DECL_WINELIB_TYPE_AW(LPCDIACTIONFORMAT)
1000 #define DIAFTS_NEWDEVICELOW 0xFFFFFFFF
1001 #define DIAFTS_NEWDEVICEHIGH 0xFFFFFFFF
1002 #define DIAFTS_UNUSEDDEVICELOW 0x00000000
1003 #define DIAFTS_UNUSEDDEVICEHIGH 0x00000000
1005 #define DIDBAM_DEFAULT 0x00000000
1006 #define DIDBAM_PRESERVE 0x00000001
1007 #define DIDBAM_INITIALIZE 0x00000002
1008 #define DIDBAM_HWDEFAULTS 0x00000004
1010 #define DIDSAM_DEFAULT 0x00000000
1011 #define DIDSAM_NOUSER 0x00000001
1012 #define DIDSAM_FORCESAVE 0x00000002
1014 #define DICD_DEFAULT 0x00000000
1015 #define DICD_EDIT 0x00000001
1017 #ifndef D3DCOLOR_DEFINED
1018 typedef DWORD D3DCOLOR;
1019 #define D3DCOLOR_DEFINED
1020 #endif
1022 typedef struct _DICOLORSET {
1023 DWORD dwSize;
1024 D3DCOLOR cTextFore;
1025 D3DCOLOR cTextHighlight;
1026 D3DCOLOR cCalloutLine;
1027 D3DCOLOR cCalloutHighlight;
1028 D3DCOLOR cBorder;
1029 D3DCOLOR cControlFill;
1030 D3DCOLOR cHighlightFill;
1031 D3DCOLOR cAreaFill;
1032 } DICOLORSET, *LPDICOLORSET;
1033 typedef const DICOLORSET *LPCDICOLORSET;
1035 typedef struct _DICONFIGUREDEVICESPARAMSA {
1036 DWORD dwSize;
1037 DWORD dwcUsers;
1038 LPSTR lptszUserNames;
1039 DWORD dwcFormats;
1040 LPDIACTIONFORMATA lprgFormats;
1041 HWND hwnd;
1042 DICOLORSET dics;
1043 LPUNKNOWN lpUnkDDSTarget;
1044 } DICONFIGUREDEVICESPARAMSA, *LPDICONFIGUREDEVICESPARAMSA;
1045 typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA;
1047 typedef struct _DICONFIGUREDEVICESPARAMSW {
1048 DWORD dwSize;
1049 DWORD dwcUsers;
1050 LPWSTR lptszUserNames;
1051 DWORD dwcFormats;
1052 LPDIACTIONFORMATW lprgFormats;
1053 HWND hwnd;
1054 DICOLORSET dics;
1055 LPUNKNOWN lpUnkDDSTarget;
1056 } DICONFIGUREDEVICESPARAMSW, *LPDICONFIGUREDEVICESPARAMSW;
1057 typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW;
1059 DECL_WINELIB_TYPE_AW(DICONFIGUREDEVICESPARAMS)
1060 DECL_WINELIB_TYPE_AW(LPDICONFIGUREDEVICESPARAMS)
1061 DECL_WINELIB_TYPE_AW(LPCDICONFIGUREDEVICESPARAMS)
1063 #define DIDIFT_CONFIGURATION 0x00000001
1064 #define DIDIFT_OVERLAY 0x00000002
1066 #define DIDAL_CENTERED 0x00000000
1067 #define DIDAL_LEFTALIGNED 0x00000001
1068 #define DIDAL_RIGHTALIGNED 0x00000002
1069 #define DIDAL_MIDDLE 0x00000000
1070 #define DIDAL_TOPALIGNED 0x00000004
1071 #define DIDAL_BOTTOMALIGNED 0x00000008
1073 typedef struct _DIDEVICEIMAGEINFOA {
1074 CHAR tszImagePath[MAX_PATH];
1075 DWORD dwFlags;
1076 DWORD dwViewID;
1077 RECT rcOverlay;
1078 DWORD dwObjID;
1079 DWORD dwcValidPts;
1080 POINT rgptCalloutLine[5];
1081 RECT rcCalloutRect;
1082 DWORD dwTextAlign;
1083 } DIDEVICEIMAGEINFOA, *LPDIDEVICEIMAGEINFOA;
1084 typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA;
1086 typedef struct _DIDEVICEIMAGEINFOW {
1087 WCHAR tszImagePath[MAX_PATH];
1088 DWORD dwFlags;
1089 DWORD dwViewID;
1090 RECT rcOverlay;
1091 DWORD dwObjID;
1092 DWORD dwcValidPts;
1093 POINT rgptCalloutLine[5];
1094 RECT rcCalloutRect;
1095 DWORD dwTextAlign;
1096 } DIDEVICEIMAGEINFOW, *LPDIDEVICEIMAGEINFOW;
1097 typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW;
1099 DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFO)
1100 DECL_WINELIB_TYPE_AW(LPDIDEVICEIMAGEINFO)
1101 DECL_WINELIB_TYPE_AW(LPCDIDEVICEIMAGEINFO)
1103 typedef struct _DIDEVICEIMAGEINFOHEADERA {
1104 DWORD dwSize;
1105 DWORD dwSizeImageInfo;
1106 DWORD dwcViews;
1107 DWORD dwcButtons;
1108 DWORD dwcAxes;
1109 DWORD dwcPOVs;
1110 DWORD dwBufferSize;
1111 DWORD dwBufferUsed;
1112 LPDIDEVICEIMAGEINFOA lprgImageInfoArray;
1113 } DIDEVICEIMAGEINFOHEADERA, *LPDIDEVICEIMAGEINFOHEADERA;
1114 typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA;
1116 typedef struct _DIDEVICEIMAGEINFOHEADERW {
1117 DWORD dwSize;
1118 DWORD dwSizeImageInfo;
1119 DWORD dwcViews;
1120 DWORD dwcButtons;
1121 DWORD dwcAxes;
1122 DWORD dwcPOVs;
1123 DWORD dwBufferSize;
1124 DWORD dwBufferUsed;
1125 LPDIDEVICEIMAGEINFOW lprgImageInfoArray;
1126 } DIDEVICEIMAGEINFOHEADERW, *LPDIDEVICEIMAGEINFOHEADERW;
1127 typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW;
1129 DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFOHEADER)
1130 DECL_WINELIB_TYPE_AW(LPDIDEVICEIMAGEINFOHEADER)
1131 DECL_WINELIB_TYPE_AW(LPCDIDEVICEIMAGEINFOHEADER)
1133 #endif /* DI8 */
1136 /*****************************************************************************
1137 * IDirectInputEffect interface
1139 #define INTERFACE IDirectInputEffect
1140 #define IDirectInputEffect_METHODS \
1141 IUnknown_METHODS \
1142 STDMETHOD(Initialize)(THIS_ HINSTANCE, DWORD, REFGUID) PURE; \
1143 STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE; \
1144 STDMETHOD(GetParameters)(THIS_ LPDIEFFECT, DWORD) PURE; \
1145 STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT, DWORD) PURE; \
1146 STDMETHOD(Start)(THIS_ DWORD, DWORD) PURE; \
1147 STDMETHOD(Stop)(THIS) PURE; \
1148 STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE; \
1149 STDMETHOD(Download)(THIS) PURE; \
1150 STDMETHOD(Unload)(THIS) PURE; \
1151 STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE;
1152 ICOM_DEFINE(IDirectInputEffect,IUnknown)
1153 #undef INTERFACE
1155 #ifdef COBJMACROS
1156 /*** IUnknown methods ***/
1157 #define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1158 #define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p)
1159 #define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p)
1160 /*** IDirectInputEffect methods ***/
1161 #define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
1162 #define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a)
1163 #define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b)
1164 #define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b)
1165 #define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b)
1166 #define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p)
1167 #define IDirectInputEffect_GetEffectStatus(p,a,b) (p)->lpVtbl->GetEffectStatus(p,a)
1168 #define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p)
1169 #define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p)
1170 #define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a)
1171 #endif
1174 /*****************************************************************************
1175 * IDirectInputDeviceA interface
1177 #define INTERFACE IDirectInputDeviceA
1178 #define IDirectInputDeviceA_METHODS \
1179 IUnknown_METHODS \
1180 STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; \
1181 STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1182 STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; \
1183 STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; \
1184 STDMETHOD(Acquire)(THIS) PURE; \
1185 STDMETHOD(Unacquire)(THIS) PURE; \
1186 STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; \
1187 STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; \
1188 STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; \
1189 STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; \
1190 STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; \
1191 STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE; \
1192 STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE; \
1193 STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; \
1194 STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1195 ICOM_DEFINE(IDirectInputDeviceA,IUnknown)
1196 #undef INTERFACE
1198 /*****************************************************************************
1199 * IDirectInputDeviceW interface
1201 #define INTERFACE IDirectInputDeviceW
1202 #define IDirectInputDeviceW_METHODS \
1203 IUnknown_METHODS \
1204 STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; \
1205 STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1206 STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; \
1207 STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; \
1208 STDMETHOD(Acquire)(THIS) PURE; \
1209 STDMETHOD(Unacquire)(THIS) PURE; \
1210 STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; \
1211 STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; \
1212 STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; \
1213 STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; \
1214 STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; \
1215 STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE; \
1216 STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE; \
1217 STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; \
1218 STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE;
1219 ICOM_DEFINE(IDirectInputDeviceW,IUnknown)
1220 #undef INTERFACE
1222 #ifdef COBJMACROS
1223 /*** IUnknown methods ***/
1224 #define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1225 #define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
1226 #define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p)
1227 /*** IDirectInputDevice methods ***/
1228 #define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
1229 #define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
1230 #define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
1231 #define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
1232 #define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p)
1233 #define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p)
1234 #define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
1235 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1236 #define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
1237 #define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
1238 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1239 #define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1240 #define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
1241 #define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1242 #define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
1243 #endif
1246 /*****************************************************************************
1247 * IDirectInputDevice2A interface
1249 #define INTERFACE IDirectInputDevice2A
1250 #define IDirectInputDevice2A_METHODS \
1251 IDirectInputDeviceA_METHODS \
1252 STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; \
1253 STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; \
1254 STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE; \
1255 STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; \
1256 STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; \
1257 STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; \
1258 STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; \
1259 STDMETHOD(Poll)(THIS) PURE; \
1260 STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1261 ICOM_DEFINE(IDirectInputDevice2A,IDirectInputDeviceA)
1262 #undef INTERFACE
1264 /*****************************************************************************
1265 * IDirectInputDevice2W interface
1267 #define INTERFACE IDirectInputDevice2W
1268 #define IDirectInputDevice2W_METHODS \
1269 IDirectInputDeviceW_METHODS \
1270 STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; \
1271 STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; \
1272 STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE; \
1273 STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; \
1274 STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; \
1275 STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; \
1276 STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; \
1277 STDMETHOD(Poll)(THIS) PURE; \
1278 STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE;
1279 ICOM_DEFINE(IDirectInputDevice2W,IDirectInputDeviceW)
1280 #undef INTERFACE
1282 #ifdef COBJMACROS
1283 /*** IUnknown methods ***/
1284 #define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1285 #define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
1286 #define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p)
1287 /*** IDirectInputDevice methods ***/
1288 #define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
1289 #define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
1290 #define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
1291 #define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
1292 #define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p)
1293 #define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p)
1294 #define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
1295 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1296 #define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
1297 #define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
1298 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1299 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1300 #define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
1301 #define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1302 #define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
1303 /*** IDirectInputDevice2 methods ***/
1304 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
1305 #define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
1306 #define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
1307 #define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
1308 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
1309 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
1310 #define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a)
1311 #define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p)
1312 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
1313 #endif
1315 #if DIRECTINPUT_VERSION >= 0x0700
1316 /*****************************************************************************
1317 * IDirectInputDevice7A interface
1319 #define INTERFACE IDirectInputDevice7A
1320 #define IDirectInputDevice7A_METHODS \
1321 IDirectInputDevice2A_METHODS \
1322 STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE; \
1323 STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE;
1324 ICOM_DEFINE(IDirectInputDevice7A,IDirectInputDevice2A)
1325 #undef INTERFACE
1327 /*****************************************************************************
1328 * IDirectInputDevice7W interface
1330 #define INTERFACE IDirectInputDevice7W
1331 #define IDirectInputDevice7W_METHODS \
1332 IDirectInputDevice2W_METHODS \
1333 STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE; \
1334 STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE;
1335 ICOM_DEFINE(IDirectInputDevice7W,IDirectInputDevice2W)
1336 #undef INTERFACE
1338 #ifdef COBJMACROS
1339 /*** IUnknown methods ***/
1340 #define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1341 #define IDirectInputDevice7_AddRef(p) (p)->lpVtbl->AddRef(p)
1342 #define IDirectInputDevice7_Release(p) (p)->lpVtbl->Release(p)
1343 /*** IDirectInputDevice methods ***/
1344 #define IDirectInputDevice7_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
1345 #define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
1346 #define IDirectInputDevice7_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
1347 #define IDirectInputDevice7_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
1348 #define IDirectInputDevice7_Acquire(p) (p)->lpVtbl->Acquire(p)
1349 #define IDirectInputDevice7_Unacquire(p) (p)->lpVtbl->Unacquire(p)
1350 #define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
1351 #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1352 #define IDirectInputDevice7_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
1353 #define IDirectInputDevice7_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
1354 #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1355 #define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1356 #define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
1357 #define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1358 #define IDirectInputDevice7_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
1359 /*** IDirectInputDevice2 methods ***/
1360 #define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
1361 #define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
1362 #define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
1363 #define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
1364 #define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
1365 #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
1366 #define IDirectInputDevice7_Escape(p,a) (p)->lpVtbl->Escape(p,a)
1367 #define IDirectInputDevice7_Poll(p) (p)->lpVtbl->Poll(p)
1368 #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
1369 /*** IDirectInputDevice7 methods ***/
1370 #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
1371 #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
1372 #endif
1374 #endif /* DI7 */
1376 #if DIRECTINPUT_VERSION >= 0x0800
1377 /*****************************************************************************
1378 * IDirectInputDevice8A interface
1380 #define INTERFACE IDirectInputDevice8A
1381 #define IDirectInputDevice8A_METHODS \
1382 IDirectInputDevice7A_METHODS \
1383 STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) PURE; \
1384 STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) PURE; \
1385 STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader) PURE;
1386 ICOM_DEFINE(IDirectInputDevice8A,IDirectInputDevice7A)
1387 #undef INTERFACE
1389 /*****************************************************************************
1390 * IDirectInputDevice8W interface
1392 #define INTERFACE IDirectInputDevice8W
1393 #define IDirectInputDevice8W_METHODS \
1394 IDirectInputDevice7W_METHODS \
1395 STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE; \
1396 STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE; \
1397 STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader) PURE;
1398 ICOM_DEFINE(IDirectInputDevice8W,IDirectInputDevice7W)
1399 #undef INTERFACE
1401 #ifdef COBJMACROS
1402 /*** IUnknown methods ***/
1403 #define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1404 #define IDirectInputDevice8_AddRef(p) (p)->lpVtbl->AddRef(p)
1405 #define IDirectInputDevice8_Release(p) (p)->lpVtbl->Release(p)
1406 /*** IDirectInputDevice methods ***/
1407 #define IDirectInputDevice8_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
1408 #define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c)
1409 #define IDirectInputDevice8_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b)
1410 #define IDirectInputDevice8_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b)
1411 #define IDirectInputDevice8_Acquire(p) (p)->lpVtbl->Acquire(p)
1412 #define IDirectInputDevice8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
1413 #define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
1414 #define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
1415 #define IDirectInputDevice8_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a)
1416 #define IDirectInputDevice8_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a)
1417 #define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
1418 #define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c)
1419 #define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a)
1420 #define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1421 #define IDirectInputDevice8_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
1422 /*** IDirectInputDevice2 methods ***/
1423 #define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d)
1424 #define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c)
1425 #define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b)
1426 #define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a)
1427 #define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a)
1428 #define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
1429 #define IDirectInputDevice8_Escape(p,a) (p)->lpVtbl->Escape(p,a)
1430 #define IDirectInputDevice8_Poll(p) (p)->lpVtbl->Poll(p)
1431 #define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
1432 /*** IDirectInputDevice7 methods ***/
1433 #define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
1434 #define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
1435 /*** IDirectInputDevice8 methods ***/
1436 #define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c)
1437 #define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->lpVtbl->SetActionMap(p,a,b,c)
1438 #define IDirectInputDevice8_GetImageInfo(p,a) (p)->lpVtbl->GetImageInfo(p,a)
1439 #endif
1441 #endif /* DI8 */
1443 /* "Standard" Mouse report... */
1444 typedef struct DIMOUSESTATE {
1445 LONG lX;
1446 LONG lY;
1447 LONG lZ;
1448 BYTE rgbButtons[4];
1449 } DIMOUSESTATE;
1451 /* "Standard" Mouse report for DInput 7... */
1452 typedef struct DIMOUSESTATE2 {
1453 LONG lX;
1454 LONG lY;
1455 LONG lZ;
1456 BYTE rgbButtons[8];
1457 } DIMOUSESTATE2;
1459 #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
1460 #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
1461 #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
1462 #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
1463 #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
1464 #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
1465 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
1467 #ifdef __cplusplus
1468 extern "C" {
1469 #endif
1470 extern const DIDATAFORMAT c_dfDIMouse;
1471 extern const DIDATAFORMAT c_dfDIMouse2; /* DX 7 */
1472 extern const DIDATAFORMAT c_dfDIKeyboard;
1473 extern const DIDATAFORMAT c_dfDIJoystick;
1474 extern const DIDATAFORMAT c_dfDIJoystick2;
1475 #ifdef __cplusplus
1477 #endif
1479 /*****************************************************************************
1480 * IDirectInputA interface
1482 #define INTERFACE IDirectInputA
1483 #define IDirectInputA_METHODS \
1484 IUnknown_METHODS \
1485 STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; \
1486 STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1487 STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; \
1488 STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; \
1489 STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
1490 ICOM_DEFINE(IDirectInputA,IUnknown)
1491 #undef INTERFACE
1493 /*****************************************************************************
1494 * IDirectInputW interface
1496 #define INTERFACE IDirectInputW
1497 #define IDirectInputW_METHODS \
1498 IUnknown_METHODS \
1499 STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; \
1500 STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1501 STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; \
1502 STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; \
1503 STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE;
1504 ICOM_DEFINE(IDirectInputW,IUnknown)
1505 #undef INTERFACE
1507 #ifdef COBJMACROS
1508 /*** IUnknown methods ***/
1509 #define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1510 #define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p)
1511 #define IDirectInput_Release(p) (p)->lpVtbl->Release(p)
1512 /*** IDirectInput methods ***/
1513 #define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
1514 #define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
1515 #define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
1516 #define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1517 #define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
1518 #endif
1520 /*****************************************************************************
1521 * IDirectInput2A interface
1523 #define INTERFACE IDirectInput2A
1524 #define IDirectInput2A_METHODS \
1525 IDirectInputA_METHODS \
1526 STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE;
1527 ICOM_DEFINE(IDirectInput2A,IDirectInputA)
1528 #undef INTERFACE
1530 /*****************************************************************************
1531 * IDirectInput2W interface
1533 #define INTERFACE IDirectInput2W
1534 #define IDirectInput2W_METHODS \
1535 IDirectInputW_METHODS \
1536 STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE;
1537 ICOM_DEFINE(IDirectInput2W,IDirectInputW)
1538 #undef INTERFACE
1540 #ifdef COBJMACROS
1541 /*** IUnknown methods ***/
1542 #define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1543 #define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p)
1544 #define IDirectInput2_Release(p) (p)->lpVtbl->Release(p)
1545 /*** IDirectInput methods ***/
1546 #define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
1547 #define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
1548 #define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
1549 #define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1550 #define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
1551 /*** IDirectInput2 methods ***/
1552 #define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
1553 #endif
1555 #if DIRECTINPUT_VERSION >= 0x0700
1556 /*****************************************************************************
1557 * IDirectInput7A interface
1559 #define INTERFACE IDirectInput7A
1560 #define IDirectInput7A_METHODS \
1561 IDirectInput2A_METHODS \
1562 STDMETHOD(CreateDeviceEx)(THIS_ REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter) PURE;
1563 ICOM_DEFINE(IDirectInput7A,IDirectInput2A)
1564 #undef INTERFACE
1566 /*****************************************************************************
1567 * IDirectInput7W interface
1569 #define INTERFACE IDirectInput7W
1570 #define IDirectInput7W_METHODS \
1571 IDirectInput2W_METHODS \
1572 STDMETHOD(CreateDeviceEx)(THIS_ REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter) PURE;
1573 ICOM_DEFINE(IDirectInput7W,IDirectInput2W)
1574 #undef INTERFACE
1576 #ifdef COBJMACROS
1577 /*** IUnknown methods ***/
1578 #define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1579 #define IDirectInput7_AddRef(p) (p)->lpVtbl->AddRef(p)
1580 #define IDirectInput7_Release(p) (p)->lpVtbl->Release(p)
1581 /*** IDirectInput methods ***/
1582 #define IDirectInput7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
1583 #define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
1584 #define IDirectInput7_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
1585 #define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1586 #define IDirectInput7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
1587 /*** IDirectInput2 methods ***/
1588 #define IDirectInput7_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
1589 /*** IDirectInput7 methods ***/
1590 #define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d)
1591 #endif
1593 #endif /* DI7 */
1595 #if DIRECTINPUT_VERSION >= 0x0800
1596 /*****************************************************************************
1597 * IDirectInput8A interface
1599 #define INTERFACE IDirectInput8A
1600 #define IDirectInput8A_METHODS \
1601 IUnknown_METHODS \
1602 STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICE8A *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; \
1603 STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1604 STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; \
1605 STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; \
1606 STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; \
1607 STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE; \
1608 STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCSTR ptszUserName, LPDIACTIONFORMATA lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1609 STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSA lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) PURE;
1610 ICOM_DEFINE(IDirectInput8A,IUnknown)
1611 #undef INTERFACE
1613 /*****************************************************************************
1614 * IDirectInput8W interface
1616 #define INTERFACE IDirectInput8W
1617 #define IDirectInput8W_METHODS \
1618 IUnknown_METHODS \
1619 STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICE8W *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; \
1620 STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1621 STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; \
1622 STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; \
1623 STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; \
1624 STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE; \
1625 STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCWSTR ptszUserName, LPDIACTIONFORMATW lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; \
1626 STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) PURE;
1627 ICOM_DEFINE(IDirectInput8W,IUnknown)
1628 #undef INTERFACE
1630 #ifdef COBJMACROS
1631 /*** IUnknown methods ***/
1632 #define IDirectInput8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1633 #define IDirectInput8_AddRef(p) (p)->lpVtbl->AddRef(p)
1634 #define IDirectInput8_Release(p) (p)->lpVtbl->Release(p)
1635 /*** IDirectInput8 methods ***/
1636 #define IDirectInput8_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
1637 #define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d)
1638 #define IDirectInput8_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a)
1639 #define IDirectInput8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b)
1640 #define IDirectInput8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
1641 #define IDirectInput8_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c)
1642 #define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->lpVtbl->EnumDevicesBySemantics(p,a,b,c,d,e)
1643 #define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d)
1644 #endif
1646 #endif /* DI8 */
1648 /* Export functions */
1650 #ifdef __cplusplus
1651 extern "C" {
1652 #endif
1654 #if DIRECTINPUT_VERSION >= 0x0800
1655 HRESULT WINAPI DirectInput8Create(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN);
1656 #endif
1658 HRESULT WINAPI DirectInputCreateA(HINSTANCE,DWORD,LPDIRECTINPUTA *,LPUNKNOWN);
1659 HRESULT WINAPI DirectInputCreateW(HINSTANCE,DWORD,LPDIRECTINPUTW *,LPUNKNOWN);
1660 #define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate)
1662 HRESULT WINAPI DirectInputCreateEx(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN);
1664 #ifdef __cplusplus
1666 #endif
1668 #endif /* __WINE_DINPUT_H */