Better implementation of GetShortPathNameA/W.
[wine/multimedia.git] / include / dinput.h
blobebfb4708194354e2fc353b4f2d03a1c6aa294806
1 #ifndef _WINE_DINPUT_H
2 #define _WINE_DINPUT_H
4 #include "windef.h" /* for MAX_PATH */
5 #include "wintypes.h"
6 #include "unknwn.h"
7 #include "mouse.h"
9 #define DIRECTINPUT_VERSION 0x0500
11 /* Classes */
12 DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
13 DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
15 /* Interfaces */
16 DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
17 DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
18 DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
19 DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
20 DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
21 DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
22 DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
23 DEFINE_GUID(IID_IDirectInputDevice2W, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
24 DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
26 /* Predefined object types */
27 DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
28 DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
29 DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
30 DEFINE_GUID(GUID_RxAxis,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 DEFINE_GUID(GUID_RyAxis,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
32 DEFINE_GUID(GUID_RzAxis,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
33 DEFINE_GUID(GUID_Slider,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
34 DEFINE_GUID(GUID_Button,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35 DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
36 DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
37 DEFINE_GUID(GUID_Unknown,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
39 /* Predefined product GUIDs */
40 DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
41 DEFINE_GUID(GUID_SysKeyboard, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
42 DEFINE_GUID(GUID_Joystick, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
44 /* predefined forcefeedback effects */
45 DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
46 DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
47 DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
48 DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
49 DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
50 DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
51 DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
52 DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
53 DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
54 DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
55 DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
56 DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
58 typedef struct IDirectInputA IDirectInputA,*LPDIRECTINPUTA;
59 typedef struct IDirectInputDeviceA IDirectInputDeviceA,*LPDIRECTINPUTDEVICEA;
60 typedef struct IDirectInputDevice2A IDirectInputDevice2A,*LPDIRECTINPUTDEVICE2A;
61 typedef struct IDirectInputEffect IDirectInputEffect,*LPDIRECTINPUTEFFECT;
62 typedef struct SysKeyboardA SysKeyboardA,*LPSYSKEYBOARDA;
63 typedef struct SysMouseA SysMouseA,*LPSYSMOUSEA;
65 #define DI_OK S_OK
66 #define DI_NOTATTACHED S_FALSE
67 #define DI_BUFFEROVERFLOW S_FALSE
68 #define DI_PROPNOEFFECT S_FALSE
69 #define DI_NOEFFECT S_FALSE
70 #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
71 #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
72 #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
73 #define DI_TRUNCATED ((HRESULT)0x00000008L)
74 #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
76 #define DIERR_OLDDIRECTINPUTVERSION \
77 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
78 #define DIERR_BETADIRECTINPUTVERSION \
79 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
80 #define DIERR_BADDRIVERVER \
81 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
82 #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
83 #define DIERR_NOTFOUND \
84 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
85 #define DIERR_OBJECTNOTFOUND \
86 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
87 #define DIERR_INVALIDPARAM E_INVALIDARG
88 #define DIERR_NOINTERFACE E_NOINTERFACE
89 #define DIERR_GENERIC E_FAIL
90 #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
91 #define DIERR_UNSUPPORTED E_NOTIMPL
92 #define DIERR_NOTINITIALIZED \
93 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
94 #define DIERR_ALREADYINITIALIZED \
95 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
96 #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
97 #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
98 #define DIERR_INPUTLOST \
99 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
100 #define DIERR_ACQUIRED \
101 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
102 #define DIERR_NOTACQUIRED \
103 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
104 #define DIERR_READONLY E_ACCESSDENIED
105 #define DIERR_HANDLEEXISTS E_ACCESSDENIED
106 #ifndef E_PENDING
107 #define E_PENDING 0x8000000AL
108 #endif
109 #define DIERR_INSUFFICIENTPRIVS 0x80040200L
110 #define DIERR_DEVICEFULL 0x80040201L
111 #define DIERR_MOREDATA 0x80040202L
112 #define DIERR_NOTDOWNLOADED 0x80040203L
113 #define DIERR_HASEFFECTS 0x80040204L
114 #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
115 #define DIERR_INCOMPLETEEFFECT 0x80040206L
116 #define DIERR_NOTBUFFERED 0x80040207L
117 #define DIERR_EFFECTPLAYING 0x80040208L
118 #define DIERR_UNPLUGGED 0x80040209L
119 #define DIERR_REPORTFULL 0x8004020AL
121 #define DIENUM_STOP 0
122 #define DIENUM_CONTINUE 1
124 #define DIDEVTYPE_DEVICE 1
125 #define DIDEVTYPE_MOUSE 2
126 #define DIDEVTYPE_KEYBOARD 3
127 #define DIDEVTYPE_JOYSTICK 4
128 #define DIDEVTYPE_HID 0x00010000
130 #define DIDEVTYPEMOUSE_UNKNOWN 1
131 #define DIDEVTYPEMOUSE_TRADITIONAL 2
132 #define DIDEVTYPEMOUSE_FINGERSTICK 3
133 #define DIDEVTYPEMOUSE_TOUCHPAD 4
134 #define DIDEVTYPEMOUSE_TRACKBALL 5
136 #define DIDEVTYPEKEYBOARD_UNKNOWN 0
137 #define DIDEVTYPEKEYBOARD_PCXT 1
138 #define DIDEVTYPEKEYBOARD_OLIVETTI 2
139 #define DIDEVTYPEKEYBOARD_PCAT 3
140 #define DIDEVTYPEKEYBOARD_PCENH 4
141 #define DIDEVTYPEKEYBOARD_NOKIA1050 5
142 #define DIDEVTYPEKEYBOARD_NOKIA9140 6
143 #define DIDEVTYPEKEYBOARD_NEC98 7
144 #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
145 #define DIDEVTYPEKEYBOARD_NEC98106 9
146 #define DIDEVTYPEKEYBOARD_JAPAN106 10
147 #define DIDEVTYPEKEYBOARD_JAPANAX 11
148 #define DIDEVTYPEKEYBOARD_J3100 12
150 #define DIDEVTYPEJOYSTICK_UNKNOWN 1
151 #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
152 #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
153 #define DIDEVTYPEJOYSTICK_GAMEPAD 4
154 #define DIDEVTYPEJOYSTICK_RUDDER 5
155 #define DIDEVTYPEJOYSTICK_WHEEL 6
156 #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
158 typedef struct {
159 DWORD dwSize;
160 GUID guidType;
161 DWORD dwOfs;
162 DWORD dwType;
163 DWORD dwFlags;
164 CHAR tszName[MAX_PATH];
165 #if(DIRECTINPUT_VERSION >= 0x0500)
166 DWORD dwFFMaxForce;
167 DWORD dwFFForceResolution;
168 WORD wCollectionNumber;
169 WORD wDesignatorIndex;
170 WORD wUsagePage;
171 WORD wUsage;
172 DWORD dwDimension;
173 WORD wExponent;
174 WORD wReserved;
175 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
176 } DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA,*LPCDIDEVICEOBJECTINSTANCEA;
178 typedef struct {
179 DWORD dwSize;
180 GUID guidType;
181 DWORD dwOfs;
182 DWORD dwType;
183 DWORD dwFlags;
184 WCHAR tszName[MAX_PATH];
185 #if(DIRECTINPUT_VERSION >= 0x0500)
186 DWORD dwFFMaxForce;
187 DWORD dwFFForceResolution;
188 WORD wCollectionNumber;
189 WORD wDesignatorIndex;
190 WORD wUsagePage;
191 WORD wUsage;
192 DWORD dwDimension;
193 WORD wExponent;
194 WORD wReserved;
195 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
196 } DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW,*LPCDIDEVICEOBJECTINSTANCEW;
197 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE)
198 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE)
201 typedef struct {
202 DWORD dwSize;
203 GUID guidInstance;
204 GUID guidProduct;
205 DWORD dwDevType;
206 CHAR tszInstanceName[MAX_PATH];
207 CHAR tszProductName[MAX_PATH];
208 #if(DIRECTINPUT_VERSION >= 0x0500)
209 GUID guidFFDriver;
210 WORD wUsagePage;
211 WORD wUsage;
212 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
213 } DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA, *LPCDIDEVICEINSTANCEA;
215 typedef struct {
216 DWORD dwSize;
217 GUID guidInstance;
218 GUID guidProduct;
219 DWORD dwDevType;
220 WCHAR tszInstanceName[MAX_PATH];
221 WCHAR tszProductName[MAX_PATH];
222 #if(DIRECTINPUT_VERSION >= 0x0500)
223 GUID guidFFDriver;
224 WORD wUsagePage;
225 WORD wUsage;
226 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
227 } DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW, *LPCDIDEVICEINSTANCEW;
228 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE)
229 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE)
230 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE)
232 typedef BOOL (CALLBACK * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA,LPVOID);
233 typedef BOOL (CALLBACK * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW,LPVOID);
234 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK)
236 typedef BOOL (CALLBACK * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
237 typedef BOOL (CALLBACK * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW,LPVOID);
238 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK)
240 typedef BOOL (CALLBACK * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
242 #define DIK_ESCAPE 0x01
243 #define DIK_1 0x02
244 #define DIK_2 0x03
245 #define DIK_3 0x04
246 #define DIK_4 0x05
247 #define DIK_5 0x06
248 #define DIK_6 0x07
249 #define DIK_7 0x08
250 #define DIK_8 0x09
251 #define DIK_9 0x0A
252 #define DIK_0 0x0B
253 #define DIK_MINUS 0x0C /* - on main keyboard */
254 #define DIK_EQUALS 0x0D
255 #define DIK_BACK 0x0E /* backspace */
256 #define DIK_TAB 0x0F
257 #define DIK_Q 0x10
258 #define DIK_W 0x11
259 #define DIK_E 0x12
260 #define DIK_R 0x13
261 #define DIK_T 0x14
262 #define DIK_Y 0x15
263 #define DIK_U 0x16
264 #define DIK_I 0x17
265 #define DIK_O 0x18
266 #define DIK_P 0x19
267 #define DIK_LBRACKET 0x1A
268 #define DIK_RBRACKET 0x1B
269 #define DIK_RETURN 0x1C /* Enter on main keyboard */
270 #define DIK_LCONTROL 0x1D
271 #define DIK_A 0x1E
272 #define DIK_S 0x1F
273 #define DIK_D 0x20
274 #define DIK_F 0x21
275 #define DIK_G 0x22
276 #define DIK_H 0x23
277 #define DIK_J 0x24
278 #define DIK_K 0x25
279 #define DIK_L 0x26
280 #define DIK_SEMICOLON 0x27
281 #define DIK_APOSTROPHE 0x28
282 #define DIK_GRAVE 0x29 /* accent grave */
283 #define DIK_LSHIFT 0x2A
284 #define DIK_BACKSLASH 0x2B
285 #define DIK_Z 0x2C
286 #define DIK_X 0x2D
287 #define DIK_C 0x2E
288 #define DIK_V 0x2F
289 #define DIK_B 0x30
290 #define DIK_N 0x31
291 #define DIK_M 0x32
292 #define DIK_COMMA 0x33
293 #define DIK_PERIOD 0x34 /* . on main keyboard */
294 #define DIK_SLASH 0x35 /* / on main keyboard */
295 #define DIK_RSHIFT 0x36
296 #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
297 #define DIK_LMENU 0x38 /* left Alt */
298 #define DIK_SPACE 0x39
299 #define DIK_CAPITAL 0x3A
300 #define DIK_F1 0x3B
301 #define DIK_F2 0x3C
302 #define DIK_F3 0x3D
303 #define DIK_F4 0x3E
304 #define DIK_F5 0x3F
305 #define DIK_F6 0x40
306 #define DIK_F7 0x41
307 #define DIK_F8 0x42
308 #define DIK_F9 0x43
309 #define DIK_F10 0x44
310 #define DIK_NUMLOCK 0x45
311 #define DIK_SCROLL 0x46 /* Scroll Lock */
312 #define DIK_NUMPAD7 0x47
313 #define DIK_NUMPAD8 0x48
314 #define DIK_NUMPAD9 0x49
315 #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
316 #define DIK_NUMPAD4 0x4B
317 #define DIK_NUMPAD5 0x4C
318 #define DIK_NUMPAD6 0x4D
319 #define DIK_ADD 0x4E /* + on numeric keypad */
320 #define DIK_NUMPAD1 0x4F
321 #define DIK_NUMPAD2 0x50
322 #define DIK_NUMPAD3 0x51
323 #define DIK_NUMPAD0 0x52
324 #define DIK_DECIMAL 0x53 /* . on numeric keypad */
325 #define DIK_F11 0x57
326 #define DIK_F12 0x58
327 #define DIK_F13 0x64 /* (NEC PC98) */
328 #define DIK_F14 0x65 /* (NEC PC98) */
329 #define DIK_F15 0x66 /* (NEC PC98) */
330 #define DIK_KANA 0x70 /* (Japanese keyboard) */
331 #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
332 #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
333 #define DIK_YEN 0x7D /* (Japanese keyboard) */
334 #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
335 #define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
336 #define DIK_AT 0x91 /* (NEC PC98) */
337 #define DIK_COLON 0x92 /* (NEC PC98) */
338 #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
339 #define DIK_KANJI 0x94 /* (Japanese keyboard) */
340 #define DIK_STOP 0x95 /* (NEC PC98) */
341 #define DIK_AX 0x96 /* (Japan AX) */
342 #define DIK_UNLABELED 0x97 /* (J3100) */
343 #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
344 #define DIK_RCONTROL 0x9D
345 #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
346 #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
347 #define DIK_SYSRQ 0xB7
348 #define DIK_RMENU 0xB8 /* right Alt */
349 #define DIK_PAUSE 0xC5 /* Pause */
350 #define DIK_HOME 0xC7 /* Home on arrow keypad */
351 #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
352 #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
353 #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
354 #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
355 #define DIK_END 0xCF /* End on arrow keypad */
356 #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
357 #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
358 #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
359 #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
360 #define DIK_LWIN 0xDB /* Left Windows key */
361 #define DIK_RWIN 0xDC /* Right Windows key */
362 #define DIK_APPS 0xDD /* AppMenu key */
363 #define DIK_POWER 0xDE
364 #define DIK_SLEEP 0xDF
365 #define DIK_BACKSPACE DIK_BACK /* backspace */
366 #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
367 #define DIK_LALT DIK_LMENU /* left Alt */
368 #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
369 #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
370 #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
371 #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
372 #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
373 #define DIK_RALT DIK_RMENU /* right Alt */
374 #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
375 #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
376 #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
377 #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
378 #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
379 #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
381 #define DIDFT_ALL 0x00000000
382 #define DIDFT_RELAXIS 0x00000001
383 #define DIDFT_ABSAXIS 0x00000002
384 #define DIDFT_AXIS 0x00000003
385 #define DIDFT_PSHBUTTON 0x00000004
386 #define DIDFT_TGLBUTTON 0x00000008
387 #define DIDFT_BUTTON 0x0000000C
388 #define DIDFT_POV 0x00000010
389 #define DIDFT_COLLECTION 0x00000040
390 #define DIDFT_NODATA 0x00000080
391 #define DIDFT_ANYINSTANCE 0x00FFFF00
392 #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
393 #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
394 #define DIDFT_GETTYPE(n) LOBYTE(n)
395 #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
396 #define DIDFT_FFACTUATOR 0x01000000
397 #define DIDFT_FFEFFECTTRIGGER 0x02000000
398 #define DIDFT_OUTPUT 0x10000000
399 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
400 #define DIDFT_NOCOLLECTION 0x00FFFF00
401 #define DIDF_ABSAXIS 0x00000001
402 #define DIDF_RELAXIS 0x00000002
404 #define DIGDD_PEEK 0x00000001
406 typedef struct {
407 DWORD dwOfs;
408 DWORD dwData;
409 DWORD dwTimeStamp;
410 DWORD dwSequence;
411 } DIDEVICEOBJECTDATA,*LPDIDEVICEOBJECTDATA,*LPCDIDEVICEOBJECTDATA;
413 typedef struct _DIOBJECTDATAFORMAT {
414 const GUID *pguid;
415 DWORD dwOfs;
416 DWORD dwType;
417 DWORD dwFlags;
418 } DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
420 typedef struct {
421 DWORD dwSize;
422 DWORD dwObjSize;
423 DWORD dwFlags;
424 DWORD dwDataSize;
425 DWORD dwNumObjs;
426 LPDIOBJECTDATAFORMAT rgodf;
427 } DIDATAFORMAT, *LPDIDATAFORMAT,*LPCDIDATAFORMAT;
429 typedef struct {
430 DWORD dwSize;
431 DWORD dwHeaderSize;
432 DWORD dwObj;
433 DWORD dwHow;
434 } DIPROPHEADER,*LPDIPROPHEADER,*LPCDIPROPHEADER;
436 #define DIPH_DEVICE 0
437 #define DIPH_BYOFFSET 1
438 #define DIPH_BYID 2
439 #define DIPH_BYUSAGE 3
441 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
443 typedef struct DIPROPDWORD {
444 DIPROPHEADER diph;
445 DWORD dwData;
446 } DIPROPDWORD, *LPDIPROPDWORD;
447 typedef const DIPROPDWORD *LPCDIPROPDWORD;
449 typedef struct DIPROPRANGE {
450 DIPROPHEADER diph;
451 LONG lMin;
452 LONG lMax;
453 } DIPROPRANGE, *LPDIPROPRANGE;
454 typedef const DIPROPRANGE *LPCDIPROPRANGE;
456 #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
457 #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
459 typedef struct DIPROPCAL {
460 DIPROPHEADER diph;
461 LONG lMin;
462 LONG lCenter;
463 LONG lMax;
464 } DIPROPCAL, *LPDIPROPCAL;
465 typedef const DIPROPCAL *LPCDIPROPCAL;
467 typedef struct DIPROPGUIDANDPATH {
468 DIPROPHEADER diph;
469 GUID guidClass;
470 WCHAR wszPath[MAX_PATH];
471 } DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH,*LPCDIPROPGUIDANDPATH;
473 /* special property GUIDs */
474 #define MAKEDIPROP(prop) ((REFGUID)(prop))
475 #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
476 #define DIPROP_AXISMODE MAKEDIPROP(2)
478 #define DIPROPAXISMODE_ABS 0
479 #define DIPROPAXISMODE_REL 1
481 #define DIPROP_GRANULARITY MAKEDIPROP(3)
482 #define DIPROP_RANGE MAKEDIPROP(4)
483 #define DIPROP_DEADZONE MAKEDIPROP(5)
484 #define DIPROP_SATURATION MAKEDIPROP(6)
485 #define DIPROP_FFGAIN MAKEDIPROP(7)
486 #define DIPROP_FFLOAD MAKEDIPROP(8)
487 #define DIPROP_AUTOCENTER MAKEDIPROP(9)
489 #define DIPROPAUTOCENTER_OFF 0
490 #define DIPROPAUTOCENTER_ON 1
492 #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
494 #define DIPROPCALIBRATIONMODE_COOKED 0
495 #define DIPROPCALIBRATIONMODE_RAW 1
497 #define DIPROP_CALIBRATION MAKEDIPROP(11)
498 #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
501 typedef struct DIDEVCAPS {
502 DWORD dwSize;
503 DWORD dwFlags;
504 DWORD dwDevType;
505 DWORD dwAxes;
506 DWORD dwButtons;
507 DWORD dwPOVs;
508 #if(DIRECTINPUT_VERSION >= 0x0500)
509 DWORD dwFFSamplePeriod;
510 DWORD dwFFMinTimeResolution;
511 DWORD dwFirmwareRevision;
512 DWORD dwHardwareRevision;
513 DWORD dwFFDriverVersion;
514 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
515 } DIDEVCAPS,*LPDIDEVCAPS;
517 #define DIDC_ATTACHED 0x00000001
518 #define DIDC_POLLEDDEVICE 0x00000002
519 #define DIDC_EMULATED 0x00000004
520 #define DIDC_POLLEDDATAFORMAT 0x00000008
521 #define DIDC_FORCEFEEDBACK 0x00000100
522 #define DIDC_FFATTACK 0x00000200
523 #define DIDC_FFFADE 0x00000400
524 #define DIDC_SATURATION 0x00000800
525 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
526 #define DIDC_POSNEGSATURATION 0x00002000
527 #define DIDC_DEADBAND 0x00004000
529 /* SetCooperativeLevel dwFlags */
530 #define DISCL_EXCLUSIVE 0x00000001
531 #define DISCL_NONEXCLUSIVE 0x00000002
532 #define DISCL_FOREGROUND 0x00000004
533 #define DISCL_BACKGROUND 0x00000008
535 typedef struct DICONSTANTFORCE {
536 LONG lMagnitude;
537 } DICONSTANTFORCE, *LPDICONSTANTFORCE;
539 typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
541 typedef struct DIRAMPFORCE {
542 LONG lStart;
543 LONG lEnd;
544 } DIRAMPFORCE, *LPDIRAMPFORCE;
546 typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
548 typedef struct DIPERIODIC {
549 DWORD dwMagnitude;
550 LONG lOffset;
551 DWORD dwPhase;
552 DWORD dwPeriod;
553 } DIPERIODIC, *LPDIPERIODIC;
555 typedef const DIPERIODIC *LPCDIPERIODIC;
557 typedef struct DICONDITION {
558 LONG lOffset;
559 LONG lPositiveCoefficient;
560 LONG lNegativeCoefficient;
561 DWORD dwPositiveSaturation;
562 DWORD dwNegativeSaturation;
563 LONG lDeadBand;
564 } DICONDITION, *LPDICONDITION;
566 typedef const DICONDITION *LPCDICONDITION;
568 typedef struct DICUSTOMFORCE {
569 DWORD cChannels;
570 DWORD dwSamplePeriod;
571 DWORD cSamples;
572 LPLONG rglForceData;
573 } DICUSTOMFORCE, *LPDICUSTOMFORCE;
575 typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
577 typedef struct DIENVELOPE {
578 DWORD dwSize;
579 DWORD dwAttackLevel;
580 DWORD dwAttackTime;
581 DWORD dwFadeLevel;
582 DWORD dwFadeTime;
583 } DIENVELOPE, *LPDIENVELOPE;
585 typedef const DIENVELOPE *LPCDIENVELOPE;
587 typedef struct DIEFFECT {
588 DWORD dwSize;
589 DWORD dwFlags;
590 DWORD dwDuration;
591 DWORD dwSamplePeriod;
592 DWORD dwGain;
593 DWORD dwTriggerButton;
594 DWORD dwTriggerRepeatInterval;
595 DWORD cAxes;
596 LPDWORD rgdwAxes;
597 LPLONG rglDirection;
598 LPDIENVELOPE lpEnvelope;
599 DWORD cbTypeSpecificParams;
600 LPVOID lpvTypeSpecificParams;
601 } DIEFFECT, *LPDIEFFECT;
603 typedef const DIEFFECT *LPCDIEFFECT;
605 typedef struct DIEFFECTINFOA {
606 DWORD dwSize;
607 GUID guid;
608 DWORD dwEffType;
609 DWORD dwStaticParams;
610 DWORD dwDynamicParams;
611 CHAR tszName[MAX_PATH];
612 } DIEFFECTINFOA, *LPDIEFFECTINFOA;
614 typedef struct DIEFFECTINFOW {
615 DWORD dwSize;
616 GUID guid;
617 DWORD dwEffType;
618 DWORD dwStaticParams;
619 DWORD dwDynamicParams;
620 WCHAR tszName[MAX_PATH];
621 } DIEFFECTINFOW, *LPDIEFFECTINFOW;
623 #ifdef UNICODE
624 typedef DIEFFECTINFOW DIEFFECTINFO;
625 typedef LPDIEFFECTINFOW LPDIEFFECTINFO;
626 #else
627 typedef DIEFFECTINFOA DIEFFECTINFO;
628 typedef LPDIEFFECTINFOA LPDIEFFECTINFO;
629 #endif
631 typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
632 typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
633 typedef const DIEFFECTINFO *LPCDIEFFECTINFO;
635 typedef BOOL (CALLBACK * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
636 typedef BOOL (CALLBACK * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
638 typedef struct DIEFFESCAPE {
639 DWORD dwSize;
640 DWORD dwCommand;
641 LPVOID lpvInBuffer;
642 DWORD cbInBuffer;
643 LPVOID lpvOutBuffer;
644 DWORD cbOutBuffer;
645 } DIEFFESCAPE, *LPDIEFFESCAPE;
647 /*****************************************************************************
648 * IDirectInputEffect interface
650 #define ICOM_INTERFACE IDirectInputEffect
651 #define IDirectInputEffect_METHODS \
652 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,, DWORD,, REFGUID,) \
653 ICOM_METHOD1(HRESULT,GetEffectGuid, LPGUID,) \
654 ICOM_METHOD2(HRESULT,GetParameters, LPDIEFFECT,, DWORD,) \
655 ICOM_METHOD2(HRESULT,SetParameters, LPCDIEFFECT,, DWORD,) \
656 ICOM_METHOD2(HRESULT,Start, DWORD,, DWORD,) \
657 ICOM_METHOD (HRESULT,Stop) \
658 ICOM_METHOD1(HRESULT,GetEffectStatus, LPDWORD,) \
659 ICOM_METHOD (HRESULT,Download) \
660 ICOM_METHOD (HRESULT,Unload) \
661 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,)
662 #define IDirectInputEffect_IMETHODS \
663 IUnknown_IMETHODS \
664 IDirectInputEffect_METHODS
665 ICOM_DEFINE(IDirectInputEffect,IUnknown)
666 #undef ICOM_INTERFACE
668 #ifdef ICOM_CINTERFACE
669 /*** IUnknown methods ***/
670 #define IDirectInputEffect_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
671 #define IDirectInputEffect_AddRef(p) ICOM_CALL (AddRef,p)
672 #define IDirectInputEffect_Release(p) ICOM_CALL (Release,p)
673 /*** IDirectInputEffect methods ***/
674 #define IDirectInputEffect_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
675 #define IDirectInputEffect_GetEffectGuid(p,a) ICOM_CALL1(GetEffectGuid,p,a)
676 #define IDirectInputEffect_GetParameters(p,a,b) ICOM_CALL2(GetParameters,p,a,b)
677 #define IDirectInputEffect_SetParameters(p,a,b) ICOM_CALL2(SetParameters,p,a,b)
678 #define IDirectInputEffect_Start(p,a,b) ICOM_CALL2(Start,p,a,b)
679 #define IDirectInputEffect_Stop(p) ICOM_CALL (Stop,p)
680 #define IDirectInputEffect_GetEffectStatus(p,a,b) ICOM_CALL1(GetEffectStatus,p,a)
681 #define IDirectInputEffect_Download(p) ICOM_CALL (Download,p)
682 #define IDirectInputEffect_Unload(p) ICOM_CALL (Unload,p)
683 #define IDirectInputEffect_Escape(p,a) ICOM_CALL1(Escape,p,a)
684 #endif
687 /*****************************************************************************
688 * IDirectInputDeviceA interface
690 #define ICOM_INTERFACE IDirectInputDeviceA
691 #define IDirectInputDeviceA_METHODS \
692 ICOM_METHOD1(HRESULT,GetCapabilities, LPDIDEVCAPS,lpDIDevCaps) \
693 ICOM_METHOD3(HRESULT,EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
694 ICOM_METHOD2(HRESULT,GetProperty, REFGUID,rguidProp, LPDIPROPHEADER,pdiph) \
695 ICOM_METHOD2(HRESULT,SetProperty, REFGUID,rguidProp, LPCDIPROPHEADER,pdiph) \
696 ICOM_METHOD (HRESULT,Acquire) \
697 ICOM_METHOD (HRESULT,Unacquire) \
698 ICOM_METHOD2(HRESULT,GetDeviceState, DWORD,cbData, LPVOID,lpvData) \
699 ICOM_METHOD4(HRESULT,GetDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,dwFlags) \
700 ICOM_METHOD1(HRESULT,SetDataFormat, LPCDIDATAFORMAT,lpdf) \
701 ICOM_METHOD1(HRESULT,SetEventNotification, HANDLE,hEvent) \
702 ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hwnd, DWORD,dwFlags) \
703 ICOM_METHOD3(HRESULT,GetObjectInfo, LPDIDEVICEOBJECTINSTANCEA,pdidoi, DWORD,dwObj, DWORD,dwHow) \
704 ICOM_METHOD1(HRESULT,GetDeviceInfo, LPDIDEVICEINSTANCEA,pdidi) \
705 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
706 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion, REFGUID,rguid)
707 #define IDirectInputDeviceA_IMETHODS \
708 IUnknown_IMETHODS \
709 IDirectInputDeviceA_METHODS
710 ICOM_DEFINE(IDirectInputDeviceA,IUnknown)
711 #undef ICOM_INTERFACE
713 #ifdef ICOM_CINTERFACE
714 /*** IUnknown methods ***/
715 #define IDirectInputDevice_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
716 #define IDirectInputDevice_AddRef(p) ICOM_CALL (AddRef,p)
717 #define IDirectInputDevice_Release(p) ICOM_CALL (Release,p)
718 /*** IDirectInputDevice methods ***/
719 #define IDirectInputDevice_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
720 #define IDirectInputDevice_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
721 #define IDirectInputDevice_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
722 #define IDirectInputDevice_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
723 #define IDirectInputDevice_Acquire(p) ICOM_CALL (Acquire,p)
724 #define IDirectInputDevice_Unacquire(p) ICOM_CALL (Unacquire,p)
725 #define IDirectInputDevice_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
726 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
727 #define IDirectInputDevice_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
728 #define IDirectInputDevice_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
729 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
730 #define IDirectInputDevice_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
731 #define IDirectInputDevice_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
732 #define IDirectInputDevice_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
733 #define IDirectInputDevice_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
734 #endif
737 /*****************************************************************************
738 * IDirectInputDevice2A interface
740 #define ICOM_INTERFACE IDirectInputDevice2A
741 #define IDirectInputDevice2A_METHODS \
742 ICOM_METHOD4(HRESULT,CreateEffect, REFGUID,rguid, LPCDIEFFECT,lpeff, LPDIRECTINPUTEFFECT*,ppdeff, LPUNKNOWN,punkOuter) \
743 ICOM_METHOD3(HRESULT,EnumEffects, LPDIENUMEFFECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwEffType) \
744 ICOM_METHOD2(HRESULT,GetEffectInfo, LPDIEFFECTINFOA,pdei, REFGUID,rguid) \
745 ICOM_METHOD1(HRESULT,GetForceFeedbackState, LPDWORD,pdwOut) \
746 ICOM_METHOD1(HRESULT,SendForceFeedbackCommand, DWORD,dwFlags) \
747 ICOM_METHOD3(HRESULT,EnumCreatedEffectObjects, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,lpCallback, LPVOID,pvRef, DWORD,fl) \
748 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,pesc) \
749 ICOM_METHOD (HRESULT,Poll) \
750 ICOM_METHOD4(HRESULT,SendDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,fl)
751 #define IDirectInputDevice2A_IMETHODS \
752 IDirectInputDeviceA_IMETHODS \
753 IDirectInputDevice2A_METHODS
754 ICOM_DEFINE(IDirectInputDevice2A,IDirectInputDeviceA)
755 #undef ICOM_INTERFACE
757 #ifdef ICOM_CINTERFACE
758 /*** IUnknown methods ***/
759 #define IDirectInputDevice2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
760 #define IDirectInputDevice2_AddRef(p) ICOM_CALL (AddRef,p)
761 #define IDirectInputDevice2_Release(p) ICOM_CALL (Release,p)
762 /*** IDirectInputDevice methods ***/
763 #define IDirectInputDevice2_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
764 #define IDirectInputDevice2_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
765 #define IDirectInputDevice2_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
766 #define IDirectInputDevice2_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
767 #define IDirectInputDevice2_Acquire(p) ICOM_CALL (Acquire,p)
768 #define IDirectInputDevice2_Unacquire(p) ICOM_CALL (Unacquire,p)
769 #define IDirectInputDevice2_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
770 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
771 #define IDirectInputDevice2_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
772 #define IDirectInputDevice2_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
773 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
774 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
775 #define IDirectInputDevice2_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
776 #define IDirectInputDevice2_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
777 #define IDirectInputDevice2_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
778 /*** IDirectInputDevice2 methods ***/
779 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) ICOM_CALL4(CreateEffect,p,a,b,c,d)
780 #define IDirectInputDevice2_EnumEffects(p,a,b,c) ICOM_CALL3(EnumEffects,p,a,b,c)
781 #define IDirectInputDevice2_GetEffectInfo(p,a,b) ICOM_CALL2(GetEffectInfo,p,a,b)
782 #define IDirectInputDevice2_GetForceFeedbackState(p,a) ICOM_CALL1(GetForceFeedbackState,p,a)
783 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) ICOM_CALL1(SendForceFeedbackCommand,p,a)
784 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) ICOM_CALL3(EnumCreatedEffectObjects,p,a,b,c)
785 #define IDirectInputDevice2_Escape(p,a) ICOM_CALL1(Escape,p,a)
786 #define IDirectInputDevice2_Poll(p) ICOM_CALL (Poll,p)
787 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d)
788 #endif
790 /* "Standard" Mouse report... */
791 typedef struct DIMOUSESTATE {
792 LONG lX;
793 LONG lY;
794 LONG lZ;
795 BYTE rgbButtons[4];
796 } DIMOUSESTATE;
798 #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
799 #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
800 #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
801 #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
802 #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
803 #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
804 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
807 /*****************************************************************************
808 * IDirectInputA interface
810 #define ICOM_INTERFACE IDirectInputA
811 #define IDirectInputA_METHODS \
812 ICOM_METHOD3(HRESULT,CreateDevice, REFGUID,rguid, LPDIRECTINPUTDEVICEA*,lplpDirectInputDevice, LPUNKNOWN,pUnkOuter) \
813 ICOM_METHOD4(HRESULT,EnumDevices, DWORD,dwDevType, LPDIENUMDEVICESCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
814 ICOM_METHOD1(HRESULT,GetDeviceStatus, REFGUID,rguidInstance) \
815 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
816 ICOM_METHOD2(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion)
817 #define IDirectInputA_IMETHODS \
818 IUnknown_IMETHODS \
819 IDirectInputA_METHODS
820 ICOM_DEFINE(IDirectInputA,IUnknown)
821 #undef ICOM_INTERFACE
823 #ifdef ICOM_CINTERFACE
824 /*** IUnknown methods ***/
825 #define IDirectInputA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
826 #define IDirectInputA_AddRef(p) ICOM_CALL (AddRef,p)
827 #define IDirectInputA_Release(p) ICOM_CALL (Release,p)
828 /*** IDirectInputA methods ***/
829 #define IDirectInputA_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
830 #define IDirectInputA_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
831 #define IDirectInputA_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
832 #define IDirectInputA_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
833 #define IDirectInputA_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
834 #endif
837 #endif /* __WINE_DINPUT_H */