1 #ifndef __WINE_DINPUT_H
2 #define __WINE_DINPUT_H
4 #include "windef.h" /* for MAX_PATH */
8 #define DIRECTINPUT_VERSION 0x0500
11 DEFINE_GUID(CLSID_DirectInput
, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
12 DEFINE_GUID(CLSID_DirectInputDevice
, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
15 DEFINE_GUID(IID_IDirectInputA
, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
16 DEFINE_GUID(IID_IDirectInputW
, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
17 DEFINE_GUID(IID_IDirectInput2A
, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
18 DEFINE_GUID(IID_IDirectInput2W
, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
19 DEFINE_GUID(IID_IDirectInputDeviceA
, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
20 DEFINE_GUID(IID_IDirectInputDeviceW
, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
21 DEFINE_GUID(IID_IDirectInputDevice2A
, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
22 DEFINE_GUID(IID_IDirectInputDevice2W
, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
23 DEFINE_GUID(IID_IDirectInputEffect
, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
25 /* Predefined object types */
26 DEFINE_GUID(GUID_XAxis
, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
27 DEFINE_GUID(GUID_YAxis
, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
28 DEFINE_GUID(GUID_ZAxis
, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
29 DEFINE_GUID(GUID_RxAxis
,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
30 DEFINE_GUID(GUID_RyAxis
,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 DEFINE_GUID(GUID_RzAxis
,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
32 DEFINE_GUID(GUID_Slider
,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
33 DEFINE_GUID(GUID_Button
,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
34 DEFINE_GUID(GUID_Key
, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35 DEFINE_GUID(GUID_POV
, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
36 DEFINE_GUID(GUID_Unknown
,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
38 /* Predefined product GUIDs */
39 DEFINE_GUID(GUID_SysMouse
, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
40 DEFINE_GUID(GUID_SysKeyboard
, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
41 DEFINE_GUID(GUID_Joystick
, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
43 /* predefined forcefeedback effects */
44 DEFINE_GUID(GUID_ConstantForce
, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
45 DEFINE_GUID(GUID_RampForce
, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
46 DEFINE_GUID(GUID_Square
, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
47 DEFINE_GUID(GUID_Sine
, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
48 DEFINE_GUID(GUID_Triangle
, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
49 DEFINE_GUID(GUID_SawtoothUp
, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
50 DEFINE_GUID(GUID_SawtoothDown
, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
51 DEFINE_GUID(GUID_Spring
, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
52 DEFINE_GUID(GUID_Damper
, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
53 DEFINE_GUID(GUID_Inertia
, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
54 DEFINE_GUID(GUID_Friction
, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
55 DEFINE_GUID(GUID_CustomForce
, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
57 typedef struct IDirectInputA IDirectInputA
,*LPDIRECTINPUTA
;
58 typedef struct IDirectInputDeviceA IDirectInputDeviceA
,*LPDIRECTINPUTDEVICEA
;
59 typedef struct IDirectInputDevice2A IDirectInputDevice2A
,*LPDIRECTINPUTDEVICE2A
;
60 typedef struct IDirectInputEffect IDirectInputEffect
,*LPDIRECTINPUTEFFECT
;
61 typedef struct SysKeyboardA SysKeyboardA
,*LPSYSKEYBOARDA
;
62 typedef struct SysMouseA SysMouseA
,*LPSYSMOUSEA
;
65 #define DI_NOTATTACHED S_FALSE
66 #define DI_BUFFEROVERFLOW S_FALSE
67 #define DI_PROPNOEFFECT S_FALSE
68 #define DI_NOEFFECT S_FALSE
69 #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
70 #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
71 #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
72 #define DI_TRUNCATED ((HRESULT)0x00000008L)
73 #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
75 #define DIERR_OLDDIRECTINPUTVERSION \
76 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
77 #define DIERR_BETADIRECTINPUTVERSION \
78 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
79 #define DIERR_BADDRIVERVER \
80 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
81 #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
82 #define DIERR_NOTFOUND \
83 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
84 #define DIERR_OBJECTNOTFOUND \
85 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
86 #define DIERR_INVALIDPARAM E_INVALIDARG
87 #define DIERR_NOINTERFACE E_NOINTERFACE
88 #define DIERR_GENERIC E_FAIL
89 #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
90 #define DIERR_UNSUPPORTED E_NOTIMPL
91 #define DIERR_NOTINITIALIZED \
92 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
93 #define DIERR_ALREADYINITIALIZED \
94 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
95 #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
96 #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
97 #define DIERR_INPUTLOST \
98 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
99 #define DIERR_ACQUIRED \
100 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
101 #define DIERR_NOTACQUIRED \
102 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
103 #define DIERR_READONLY E_ACCESSDENIED
104 #define DIERR_HANDLEEXISTS E_ACCESSDENIED
106 #define E_PENDING 0x8000000AL
108 #define DIERR_INSUFFICIENTPRIVS 0x80040200L
109 #define DIERR_DEVICEFULL 0x80040201L
110 #define DIERR_MOREDATA 0x80040202L
111 #define DIERR_NOTDOWNLOADED 0x80040203L
112 #define DIERR_HASEFFECTS 0x80040204L
113 #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
114 #define DIERR_INCOMPLETEEFFECT 0x80040206L
115 #define DIERR_NOTBUFFERED 0x80040207L
116 #define DIERR_EFFECTPLAYING 0x80040208L
117 #define DIERR_UNPLUGGED 0x80040209L
118 #define DIERR_REPORTFULL 0x8004020AL
120 #define DIENUM_STOP 0
121 #define DIENUM_CONTINUE 1
123 #define DIDEVTYPE_DEVICE 1
124 #define DIDEVTYPE_MOUSE 2
125 #define DIDEVTYPE_KEYBOARD 3
126 #define DIDEVTYPE_JOYSTICK 4
127 #define DIDEVTYPE_HID 0x00010000
129 #define DIDEVTYPEMOUSE_UNKNOWN 1
130 #define DIDEVTYPEMOUSE_TRADITIONAL 2
131 #define DIDEVTYPEMOUSE_FINGERSTICK 3
132 #define DIDEVTYPEMOUSE_TOUCHPAD 4
133 #define DIDEVTYPEMOUSE_TRACKBALL 5
135 #define DIDEVTYPEKEYBOARD_UNKNOWN 0
136 #define DIDEVTYPEKEYBOARD_PCXT 1
137 #define DIDEVTYPEKEYBOARD_OLIVETTI 2
138 #define DIDEVTYPEKEYBOARD_PCAT 3
139 #define DIDEVTYPEKEYBOARD_PCENH 4
140 #define DIDEVTYPEKEYBOARD_NOKIA1050 5
141 #define DIDEVTYPEKEYBOARD_NOKIA9140 6
142 #define DIDEVTYPEKEYBOARD_NEC98 7
143 #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
144 #define DIDEVTYPEKEYBOARD_NEC98106 9
145 #define DIDEVTYPEKEYBOARD_JAPAN106 10
146 #define DIDEVTYPEKEYBOARD_JAPANAX 11
147 #define DIDEVTYPEKEYBOARD_J3100 12
149 #define DIDEVTYPEJOYSTICK_UNKNOWN 1
150 #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
151 #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
152 #define DIDEVTYPEJOYSTICK_GAMEPAD 4
153 #define DIDEVTYPEJOYSTICK_RUDDER 5
154 #define DIDEVTYPEJOYSTICK_WHEEL 6
155 #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
163 CHAR tszName
[MAX_PATH
];
164 #if(DIRECTINPUT_VERSION >= 0x0500)
166 DWORD dwFFForceResolution
;
167 WORD wCollectionNumber
;
168 WORD wDesignatorIndex
;
174 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
175 } DIDEVICEOBJECTINSTANCEA
, *LPDIDEVICEOBJECTINSTANCEA
,*LPCDIDEVICEOBJECTINSTANCEA
;
183 WCHAR tszName
[MAX_PATH
];
184 #if(DIRECTINPUT_VERSION >= 0x0500)
186 DWORD dwFFForceResolution
;
187 WORD wCollectionNumber
;
188 WORD wDesignatorIndex
;
194 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
195 } DIDEVICEOBJECTINSTANCEW
, *LPDIDEVICEOBJECTINSTANCEW
,*LPCDIDEVICEOBJECTINSTANCEW
;
196 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE
)
197 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE
)
205 CHAR tszInstanceName
[MAX_PATH
];
206 CHAR tszProductName
[MAX_PATH
];
207 #if(DIRECTINPUT_VERSION >= 0x0500)
211 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
212 } DIDEVICEINSTANCEA
, *LPDIDEVICEINSTANCEA
, *LPCDIDEVICEINSTANCEA
;
219 WCHAR tszInstanceName
[MAX_PATH
];
220 WCHAR tszProductName
[MAX_PATH
];
221 #if(DIRECTINPUT_VERSION >= 0x0500)
225 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
226 } DIDEVICEINSTANCEW
, *LPDIDEVICEINSTANCEW
, *LPCDIDEVICEINSTANCEW
;
227 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE
)
228 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE
)
229 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE
)
231 typedef BOOL
CALLBACK (*LPDIENUMDEVICESCALLBACKA
)(LPCDIDEVICEINSTANCEA
,LPVOID
);
232 typedef BOOL
CALLBACK (*LPDIENUMDEVICESCALLBACKW
)(LPCDIDEVICEINSTANCEW
,LPVOID
);
233 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK
)
235 typedef BOOL
CALLBACK (*LPDIENUMDEVICEOBJECTSCALLBACKA
)(LPCDIDEVICEOBJECTINSTANCEA
, LPVOID
);
236 typedef BOOL
CALLBACK (*LPDIENUMDEVICEOBJECTSCALLBACKW
)(LPCDIDEVICEOBJECTINSTANCEW
,LPVOID
);
237 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK
)
239 typedef BOOL
CALLBACK (*LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
)(LPDIRECTINPUTEFFECT
, LPVOID
);
241 #define DIK_ESCAPE 0x01
252 #define DIK_MINUS 0x0C /* - on main keyboard */
253 #define DIK_EQUALS 0x0D
254 #define DIK_BACK 0x0E /* backspace */
266 #define DIK_LBRACKET 0x1A
267 #define DIK_RBRACKET 0x1B
268 #define DIK_RETURN 0x1C /* Enter on main keyboard */
269 #define DIK_LCONTROL 0x1D
279 #define DIK_SEMICOLON 0x27
280 #define DIK_APOSTROPHE 0x28
281 #define DIK_GRAVE 0x29 /* accent grave */
282 #define DIK_LSHIFT 0x2A
283 #define DIK_BACKSLASH 0x2B
291 #define DIK_COMMA 0x33
292 #define DIK_PERIOD 0x34 /* . on main keyboard */
293 #define DIK_SLASH 0x35 /* / on main keyboard */
294 #define DIK_RSHIFT 0x36
295 #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
296 #define DIK_LMENU 0x38 /* left Alt */
297 #define DIK_SPACE 0x39
298 #define DIK_CAPITAL 0x3A
309 #define DIK_NUMLOCK 0x45
310 #define DIK_SCROLL 0x46 /* Scroll Lock */
311 #define DIK_NUMPAD7 0x47
312 #define DIK_NUMPAD8 0x48
313 #define DIK_NUMPAD9 0x49
314 #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
315 #define DIK_NUMPAD4 0x4B
316 #define DIK_NUMPAD5 0x4C
317 #define DIK_NUMPAD6 0x4D
318 #define DIK_ADD 0x4E /* + on numeric keypad */
319 #define DIK_NUMPAD1 0x4F
320 #define DIK_NUMPAD2 0x50
321 #define DIK_NUMPAD3 0x51
322 #define DIK_NUMPAD0 0x52
323 #define DIK_DECIMAL 0x53 /* . on numeric keypad */
326 #define DIK_F13 0x64 /* (NEC PC98) */
327 #define DIK_F14 0x65 /* (NEC PC98) */
328 #define DIK_F15 0x66 /* (NEC PC98) */
329 #define DIK_KANA 0x70 /* (Japanese keyboard) */
330 #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
331 #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
332 #define DIK_YEN 0x7D /* (Japanese keyboard) */
333 #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
334 #define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
335 #define DIK_AT 0x91 /* (NEC PC98) */
336 #define DIK_COLON 0x92 /* (NEC PC98) */
337 #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
338 #define DIK_KANJI 0x94 /* (Japanese keyboard) */
339 #define DIK_STOP 0x95 /* (NEC PC98) */
340 #define DIK_AX 0x96 /* (Japan AX) */
341 #define DIK_UNLABELED 0x97 /* (J3100) */
342 #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
343 #define DIK_RCONTROL 0x9D
344 #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
345 #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
346 #define DIK_SYSRQ 0xB7
347 #define DIK_RMENU 0xB8 /* right Alt */
348 #define DIK_PAUSE 0xC5 /* Pause */
349 #define DIK_HOME 0xC7 /* Home on arrow keypad */
350 #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
351 #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
352 #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
353 #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
354 #define DIK_END 0xCF /* End on arrow keypad */
355 #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
356 #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
357 #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
358 #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
359 #define DIK_LWIN 0xDB /* Left Windows key */
360 #define DIK_RWIN 0xDC /* Right Windows key */
361 #define DIK_APPS 0xDD /* AppMenu key */
362 #define DIK_POWER 0xDE
363 #define DIK_SLEEP 0xDF
364 #define DIK_BACKSPACE DIK_BACK /* backspace */
365 #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
366 #define DIK_LALT DIK_LMENU /* left Alt */
367 #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
368 #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
369 #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
370 #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
371 #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
372 #define DIK_RALT DIK_RMENU /* right Alt */
373 #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
374 #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
375 #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
376 #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
377 #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
378 #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
380 #define DIDFT_ALL 0x00000000
381 #define DIDFT_RELAXIS 0x00000001
382 #define DIDFT_ABSAXIS 0x00000002
383 #define DIDFT_AXIS 0x00000003
384 #define DIDFT_PSHBUTTON 0x00000004
385 #define DIDFT_TGLBUTTON 0x00000008
386 #define DIDFT_BUTTON 0x0000000C
387 #define DIDFT_POV 0x00000010
388 #define DIDFT_COLLECTION 0x00000040
389 #define DIDFT_NODATA 0x00000080
390 #define DIDFT_ANYINSTANCE 0x00FFFF00
391 #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
392 #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
393 #define DIDFT_GETTYPE(n) LOBYTE(n)
394 #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
395 #define DIDFT_FFACTUATOR 0x01000000
396 #define DIDFT_FFEFFECTTRIGGER 0x02000000
397 #define DIDFT_OUTPUT 0x10000000
398 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
399 #define DIDFT_NOCOLLECTION 0x00FFFF00
400 #define DIDF_ABSAXIS 0x00000001
401 #define DIDF_RELAXIS 0x00000002
403 #define DIGDD_PEEK 0x00000001
405 typedef struct DIDEVICEOBJECTDATA
{
410 } DIDEVICEOBJECTDATA
,*LPDIDEVICEOBJECTDATA
,*LPCDIDEVICEOBJECTDATA
;
412 typedef struct _DIOBJECTDATAFORMAT
{
417 } DIOBJECTDATAFORMAT
, *LPDIOBJECTDATAFORMAT
;
425 LPDIOBJECTDATAFORMAT rgodf
;
426 } DIDATAFORMAT
, *LPDIDATAFORMAT
,*LPCDIDATAFORMAT
;
433 } DIPROPHEADER
,*LPDIPROPHEADER
,*LPCDIPROPHEADER
;
435 #define DIPH_DEVICE 0
436 #define DIPH_BYOFFSET 1
438 #define DIPH_BYUSAGE 3
440 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
442 typedef struct DIPROPDWORD
{
445 } DIPROPDWORD
, *LPDIPROPDWORD
;
446 typedef const DIPROPDWORD
*LPCDIPROPDWORD
;
448 typedef struct DIPROPRANGE
{
452 } DIPROPRANGE
, *LPDIPROPRANGE
;
453 typedef const DIPROPRANGE
*LPCDIPROPRANGE
;
455 #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
456 #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
458 typedef struct DIPROPCAL
{
463 } DIPROPCAL
, *LPDIPROPCAL
;
464 typedef const DIPROPCAL
*LPCDIPROPCAL
;
466 typedef struct DIPROPGUIDANDPATH
{
469 WCHAR wszPath
[MAX_PATH
];
470 } DIPROPGUIDANDPATH
, *LPDIPROPGUIDANDPATH
,*LPCDIPROPGUIDANDPATH
;
472 /* special property GUIDs */
473 #define MAKEDIPROP(prop) ((REFGUID)(prop))
474 #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
475 #define DIPROP_AXISMODE MAKEDIPROP(2)
477 #define DIPROPAXISMODE_ABS 0
478 #define DIPROPAXISMODE_REL 1
480 #define DIPROP_GRANULARITY MAKEDIPROP(3)
481 #define DIPROP_RANGE MAKEDIPROP(4)
482 #define DIPROP_DEADZONE MAKEDIPROP(5)
483 #define DIPROP_SATURATION MAKEDIPROP(6)
484 #define DIPROP_FFGAIN MAKEDIPROP(7)
485 #define DIPROP_FFLOAD MAKEDIPROP(8)
486 #define DIPROP_AUTOCENTER MAKEDIPROP(9)
488 #define DIPROPAUTOCENTER_OFF 0
489 #define DIPROPAUTOCENTER_ON 1
491 #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
493 #define DIPROPCALIBRATIONMODE_COOKED 0
494 #define DIPROPCALIBRATIONMODE_RAW 1
496 #define DIPROP_CALIBRATION MAKEDIPROP(11)
497 #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
500 typedef struct DIDEVCAPS
{
507 #if(DIRECTINPUT_VERSION >= 0x0500)
508 DWORD dwFFSamplePeriod
;
509 DWORD dwFFMinTimeResolution
;
510 DWORD dwFirmwareRevision
;
511 DWORD dwHardwareRevision
;
512 DWORD dwFFDriverVersion
;
513 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
514 } DIDEVCAPS
,*LPDIDEVCAPS
;
516 #define DIDC_ATTACHED 0x00000001
517 #define DIDC_POLLEDDEVICE 0x00000002
518 #define DIDC_EMULATED 0x00000004
519 #define DIDC_POLLEDDATAFORMAT 0x00000008
520 #define DIDC_FORCEFEEDBACK 0x00000100
521 #define DIDC_FFATTACK 0x00000200
522 #define DIDC_FFFADE 0x00000400
523 #define DIDC_SATURATION 0x00000800
524 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
525 #define DIDC_POSNEGSATURATION 0x00002000
526 #define DIDC_DEADBAND 0x00004000
528 /* SetCooperativeLevel dwFlags */
529 #define DISCL_EXCLUSIVE 0x00000001
530 #define DISCL_NONEXCLUSIVE 0x00000002
531 #define DISCL_FOREGROUND 0x00000004
532 #define DISCL_BACKGROUND 0x00000008
534 typedef struct DICONSTANTFORCE
{
536 } DICONSTANTFORCE
, *LPDICONSTANTFORCE
;
538 typedef const DICONSTANTFORCE
*LPCDICONSTANTFORCE
;
540 typedef struct DIRAMPFORCE
{
543 } DIRAMPFORCE
, *LPDIRAMPFORCE
;
545 typedef const DIRAMPFORCE
*LPCDIRAMPFORCE
;
547 typedef struct DIPERIODIC
{
552 } DIPERIODIC
, *LPDIPERIODIC
;
554 typedef const DIPERIODIC
*LPCDIPERIODIC
;
556 typedef struct DICONDITION
{
558 LONG lPositiveCoefficient
;
559 LONG lNegativeCoefficient
;
560 DWORD dwPositiveSaturation
;
561 DWORD dwNegativeSaturation
;
563 } DICONDITION
, *LPDICONDITION
;
565 typedef const DICONDITION
*LPCDICONDITION
;
567 typedef struct DICUSTOMFORCE
{
569 DWORD dwSamplePeriod
;
572 } DICUSTOMFORCE
, *LPDICUSTOMFORCE
;
574 typedef const DICUSTOMFORCE
*LPCDICUSTOMFORCE
;
576 typedef struct DIENVELOPE
{
582 } DIENVELOPE
, *LPDIENVELOPE
;
584 typedef const DIENVELOPE
*LPCDIENVELOPE
;
586 typedef struct DIEFFECT
{
590 DWORD dwSamplePeriod
;
592 DWORD dwTriggerButton
;
593 DWORD dwTriggerRepeatInterval
;
597 LPDIENVELOPE lpEnvelope
;
598 DWORD cbTypeSpecificParams
;
599 LPVOID lpvTypeSpecificParams
;
600 } DIEFFECT
, *LPDIEFFECT
;
602 typedef const DIEFFECT
*LPCDIEFFECT
;
604 typedef struct DIEFFECTINFOA
{
608 DWORD dwStaticParams
;
609 DWORD dwDynamicParams
;
610 CHAR tszName
[MAX_PATH
];
611 } DIEFFECTINFOA
, *LPDIEFFECTINFOA
;
613 typedef struct DIEFFECTINFOW
{
617 DWORD dwStaticParams
;
618 DWORD dwDynamicParams
;
619 WCHAR tszName
[MAX_PATH
];
620 } DIEFFECTINFOW
, *LPDIEFFECTINFOW
;
623 typedef DIEFFECTINFOW DIEFFECTINFO
;
624 typedef LPDIEFFECTINFOW LPDIEFFECTINFO
;
626 typedef DIEFFECTINFOA DIEFFECTINFO
;
627 typedef LPDIEFFECTINFOA LPDIEFFECTINFO
;
630 typedef const DIEFFECTINFOA
*LPCDIEFFECTINFOA
;
631 typedef const DIEFFECTINFOW
*LPCDIEFFECTINFOW
;
632 typedef const DIEFFECTINFO
*LPCDIEFFECTINFO
;
634 typedef BOOL
CALLBACK (*LPDIENUMEFFECTSCALLBACKA
)(LPCDIEFFECTINFOA
, LPVOID
);
635 typedef BOOL
CALLBACK (*LPDIENUMEFFECTSCALLBACKW
)(LPCDIEFFECTINFOW
, LPVOID
);
637 typedef struct DIEFFESCAPE
{
644 } DIEFFESCAPE
, *LPDIEFFESCAPE
;
646 typedef struct DIJOYSTATE
{
656 } DIJOYSTATE
, *LPDIJOYSTATE
;
658 typedef struct DIJOYSTATE2
{
667 BYTE rgbButtons
[128];
668 LONG lVX
; /* 'v' as in velocity */
675 LONG lAX
; /* 'a' as in acceleration */
682 LONG lFX
; /* 'f' as in force */
685 LONG lFRx
; /* 'fr' as in rotational force aka torque */
689 } DIJOYSTATE2
, *LPDIJOYSTATE2
;
691 #define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
692 #define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
693 #define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
694 #define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
695 #define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
696 #define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
697 #define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
699 #define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
701 #define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
702 #define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
703 #define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
704 #define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
705 #define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
706 #define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
707 #define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
708 #define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
709 #define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
710 #define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
711 #define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
712 #define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
713 #define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
714 #define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
715 #define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
716 #define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
717 #define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
718 #define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
719 #define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
720 #define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
721 #define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
722 #define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
723 #define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
724 #define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
725 #define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
726 #define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
727 #define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
728 #define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
729 #define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
730 #define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
731 #define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
732 #define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
733 #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
735 /*****************************************************************************
736 * IDirectInputEffect interface
738 #define ICOM_INTERFACE IDirectInputEffect
739 #define IDirectInputEffect_METHODS \
740 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,, DWORD,, REFGUID,) \
741 ICOM_METHOD1(HRESULT,GetEffectGuid, LPGUID,) \
742 ICOM_METHOD2(HRESULT,GetParameters, LPDIEFFECT,, DWORD,) \
743 ICOM_METHOD2(HRESULT,SetParameters, LPCDIEFFECT,, DWORD,) \
744 ICOM_METHOD2(HRESULT,Start, DWORD,, DWORD,) \
745 ICOM_METHOD (HRESULT,Stop) \
746 ICOM_METHOD1(HRESULT,GetEffectStatus, LPDWORD,) \
747 ICOM_METHOD (HRESULT,Download) \
748 ICOM_METHOD (HRESULT,Unload) \
749 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,)
750 #define IDirectInputEffect_IMETHODS \
752 IDirectInputEffect_METHODS
753 ICOM_DEFINE(IDirectInputEffect
,IUnknown
)
754 #undef ICOM_INTERFACE
756 /*** IUnknown methods ***/
757 #define IDirectInputEffect_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
758 #define IDirectInputEffect_AddRef(p) ICOM_CALL (AddRef,p)
759 #define IDirectInputEffect_Release(p) ICOM_CALL (Release,p)
760 /*** IDirectInputEffect methods ***/
761 #define IDirectInputEffect_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
762 #define IDirectInputEffect_GetEffectGuid(p,a) ICOM_CALL1(GetEffectGuid,p,a)
763 #define IDirectInputEffect_GetParameters(p,a,b) ICOM_CALL2(GetParameters,p,a,b)
764 #define IDirectInputEffect_SetParameters(p,a,b) ICOM_CALL2(SetParameters,p,a,b)
765 #define IDirectInputEffect_Start(p,a,b) ICOM_CALL2(Start,p,a,b)
766 #define IDirectInputEffect_Stop(p) ICOM_CALL (Stop,p)
767 #define IDirectInputEffect_GetEffectStatus(p,a,b) ICOM_CALL1(GetEffectStatus,p,a)
768 #define IDirectInputEffect_Download(p) ICOM_CALL (Download,p)
769 #define IDirectInputEffect_Unload(p) ICOM_CALL (Unload,p)
770 #define IDirectInputEffect_Escape(p,a) ICOM_CALL1(Escape,p,a)
773 /*****************************************************************************
774 * IDirectInputDeviceA interface
776 #define ICOM_INTERFACE IDirectInputDeviceA
777 #define IDirectInputDeviceA_METHODS \
778 ICOM_METHOD1(HRESULT,GetCapabilities, LPDIDEVCAPS,lpDIDevCaps) \
779 ICOM_METHOD3(HRESULT,EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
780 ICOM_METHOD2(HRESULT,GetProperty, REFGUID,rguidProp, LPDIPROPHEADER,pdiph) \
781 ICOM_METHOD2(HRESULT,SetProperty, REFGUID,rguidProp, LPCDIPROPHEADER,pdiph) \
782 ICOM_METHOD (HRESULT,Acquire) \
783 ICOM_METHOD (HRESULT,Unacquire) \
784 ICOM_METHOD2(HRESULT,GetDeviceState, DWORD,cbData, LPVOID,lpvData) \
785 ICOM_METHOD4(HRESULT,GetDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,dwFlags) \
786 ICOM_METHOD1(HRESULT,SetDataFormat, LPCDIDATAFORMAT,lpdf) \
787 ICOM_METHOD1(HRESULT,SetEventNotification, HANDLE,hEvent) \
788 ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hwnd, DWORD,dwFlags) \
789 ICOM_METHOD3(HRESULT,GetObjectInfo, LPDIDEVICEOBJECTINSTANCEA,pdidoi, DWORD,dwObj, DWORD,dwHow) \
790 ICOM_METHOD1(HRESULT,GetDeviceInfo, LPDIDEVICEINSTANCEA,pdidi) \
791 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
792 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion, REFGUID,rguid)
793 #define IDirectInputDeviceA_IMETHODS \
795 IDirectInputDeviceA_METHODS
796 ICOM_DEFINE(IDirectInputDeviceA
,IUnknown
)
797 #undef ICOM_INTERFACE
799 /*** IUnknown methods ***/
800 #define IDirectInputDevice_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
801 #define IDirectInputDevice_AddRef(p) ICOM_CALL (AddRef,p)
802 #define IDirectInputDevice_Release(p) ICOM_CALL (Release,p)
803 /*** IDirectInputDevice methods ***/
804 #define IDirectInputDevice_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
805 #define IDirectInputDevice_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
806 #define IDirectInputDevice_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
807 #define IDirectInputDevice_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
808 #define IDirectInputDevice_Acquire(p) ICOM_CALL (Acquire,p)
809 #define IDirectInputDevice_Unacquire(p) ICOM_CALL (Unacquire,p)
810 #define IDirectInputDevice_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
811 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
812 #define IDirectInputDevice_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
813 #define IDirectInputDevice_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
814 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
815 #define IDirectInputDevice_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
816 #define IDirectInputDevice_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
817 #define IDirectInputDevice_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
818 #define IDirectInputDevice_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
821 /*****************************************************************************
822 * IDirectInputDevice2A interface
824 #define ICOM_INTERFACE IDirectInputDevice2A
825 #define IDirectInputDevice2A_METHODS \
826 ICOM_METHOD4(HRESULT,CreateEffect, REFGUID,rguid, LPCDIEFFECT,lpeff, LPDIRECTINPUTEFFECT*,ppdeff, LPUNKNOWN,punkOuter) \
827 ICOM_METHOD3(HRESULT,EnumEffects, LPDIENUMEFFECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwEffType) \
828 ICOM_METHOD2(HRESULT,GetEffectInfo, LPDIEFFECTINFOA,pdei, REFGUID,rguid) \
829 ICOM_METHOD1(HRESULT,GetForceFeedbackState, LPDWORD,pdwOut) \
830 ICOM_METHOD1(HRESULT,SendForceFeedbackCommand, DWORD,dwFlags) \
831 ICOM_METHOD3(HRESULT,EnumCreatedEffectObjects, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,lpCallback, LPVOID,pvRef, DWORD,fl) \
832 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,pesc) \
833 ICOM_METHOD (HRESULT,Poll) \
834 ICOM_METHOD4(HRESULT,SendDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,fl)
835 #define IDirectInputDevice2A_IMETHODS \
836 IDirectInputDeviceA_IMETHODS \
837 IDirectInputDevice2A_METHODS
838 ICOM_DEFINE(IDirectInputDevice2A
,IDirectInputDeviceA
)
839 #undef ICOM_INTERFACE
841 /*** IUnknown methods ***/
842 #define IDirectInputDevice2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
843 #define IDirectInputDevice2_AddRef(p) ICOM_CALL (AddRef,p)
844 #define IDirectInputDevice2_Release(p) ICOM_CALL (Release,p)
845 /*** IDirectInputDevice methods ***/
846 #define IDirectInputDevice2_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
847 #define IDirectInputDevice2_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
848 #define IDirectInputDevice2_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
849 #define IDirectInputDevice2_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
850 #define IDirectInputDevice2_Acquire(p) ICOM_CALL (Acquire,p)
851 #define IDirectInputDevice2_Unacquire(p) ICOM_CALL (Unacquire,p)
852 #define IDirectInputDevice2_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
853 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
854 #define IDirectInputDevice2_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
855 #define IDirectInputDevice2_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
856 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
857 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
858 #define IDirectInputDevice2_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
859 #define IDirectInputDevice2_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
860 #define IDirectInputDevice2_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
861 /*** IDirectInputDevice2 methods ***/
862 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) ICOM_CALL4(CreateEffect,p,a,b,c,d)
863 #define IDirectInputDevice2_EnumEffects(p,a,b,c) ICOM_CALL3(EnumEffects,p,a,b,c)
864 #define IDirectInputDevice2_GetEffectInfo(p,a,b) ICOM_CALL2(GetEffectInfo,p,a,b)
865 #define IDirectInputDevice2_GetForceFeedbackState(p,a) ICOM_CALL1(GetForceFeedbackState,p,a)
866 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) ICOM_CALL1(SendForceFeedbackCommand,p,a)
867 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) ICOM_CALL3(EnumCreatedEffectObjects,p,a,b,c)
868 #define IDirectInputDevice2_Escape(p,a) ICOM_CALL1(Escape,p,a)
869 #define IDirectInputDevice2_Poll(p) ICOM_CALL (Poll,p)
870 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d)
872 /* "Standard" Mouse report... */
873 typedef struct DIMOUSESTATE
{
880 /* "Standard" Mouse report for DInput 7... */
881 typedef struct DIMOUSESTATE2
{
888 #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
889 #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
890 #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
891 #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
892 #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
893 #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
894 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
897 /*****************************************************************************
898 * IDirectInputA interface
900 #define ICOM_INTERFACE IDirectInputA
901 #define IDirectInputA_METHODS \
902 ICOM_METHOD3(HRESULT,CreateDevice, REFGUID,rguid, LPDIRECTINPUTDEVICEA*,lplpDirectInputDevice, LPUNKNOWN,pUnkOuter) \
903 ICOM_METHOD4(HRESULT,EnumDevices, DWORD,dwDevType, LPDIENUMDEVICESCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
904 ICOM_METHOD1(HRESULT,GetDeviceStatus, REFGUID,rguidInstance) \
905 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
906 ICOM_METHOD2(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion)
907 #define IDirectInputA_IMETHODS \
909 IDirectInputA_METHODS
910 ICOM_DEFINE(IDirectInputA
,IUnknown
)
911 #undef ICOM_INTERFACE
913 /*** IUnknown methods ***/
914 #define IDirectInputA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
915 #define IDirectInputA_AddRef(p) ICOM_CALL (AddRef,p)
916 #define IDirectInputA_Release(p) ICOM_CALL (Release,p)
917 /*** IDirectInputA methods ***/
918 #define IDirectInputA_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
919 #define IDirectInputA_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
920 #define IDirectInputA_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
921 #define IDirectInputA_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
922 #define IDirectInputA_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
924 /* Export functions */
926 HRESULT WINAPI
DirectInputCreateA(HINSTANCE
,DWORD
,LPDIRECTINPUTA
*,LPUNKNOWN
);
927 HRESULT WINAPI
DirectInputCreateW(HINSTANCE
,DWORD
,LPDIRECTINPUTA
*,LPUNKNOWN
);
928 #define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate)
930 #endif /* __WINE_DINPUT_H */