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