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_IDirectInput7A
, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
20 DEFINE_GUID(IID_IDirectInput7W
, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
21 DEFINE_GUID(IID_IDirectInputDeviceA
, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
22 DEFINE_GUID(IID_IDirectInputDeviceW
, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
23 DEFINE_GUID(IID_IDirectInputDevice2A
, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
24 DEFINE_GUID(IID_IDirectInputDevice2W
, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
25 DEFINE_GUID(IID_IDirectInputDevice7A
, 0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
26 DEFINE_GUID(IID_IDirectInputDevice7W
, 0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
27 DEFINE_GUID(IID_IDirectInputEffect
, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
29 /* Predefined object types */
30 DEFINE_GUID(GUID_XAxis
, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 DEFINE_GUID(GUID_YAxis
, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
32 DEFINE_GUID(GUID_ZAxis
, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
33 DEFINE_GUID(GUID_RxAxis
,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
34 DEFINE_GUID(GUID_RyAxis
,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35 DEFINE_GUID(GUID_RzAxis
,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
36 DEFINE_GUID(GUID_Slider
,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
37 DEFINE_GUID(GUID_Button
,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
38 DEFINE_GUID(GUID_Key
, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
39 DEFINE_GUID(GUID_POV
, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
40 DEFINE_GUID(GUID_Unknown
,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
42 /* Predefined product GUIDs */
43 DEFINE_GUID(GUID_SysMouse
, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
44 DEFINE_GUID(GUID_SysKeyboard
, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
45 DEFINE_GUID(GUID_Joystick
, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
47 /* predefined forcefeedback effects */
48 DEFINE_GUID(GUID_ConstantForce
, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
49 DEFINE_GUID(GUID_RampForce
, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
50 DEFINE_GUID(GUID_Square
, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
51 DEFINE_GUID(GUID_Sine
, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
52 DEFINE_GUID(GUID_Triangle
, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
53 DEFINE_GUID(GUID_SawtoothUp
, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
54 DEFINE_GUID(GUID_SawtoothDown
, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
55 DEFINE_GUID(GUID_Spring
, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
56 DEFINE_GUID(GUID_Damper
, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
57 DEFINE_GUID(GUID_Inertia
, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
58 DEFINE_GUID(GUID_Friction
, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
59 DEFINE_GUID(GUID_CustomForce
, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
61 typedef struct IDirectInputA IDirectInputA
,*LPDIRECTINPUTA
;
62 typedef struct IDirectInput2A IDirectInput2A
,*LPDIRECTINPUT2A
;
63 typedef struct IDirectInput7A IDirectInput7A
,*LPDIRECTINPUT7A
;
64 typedef struct IDirectInputDeviceA IDirectInputDeviceA
,*LPDIRECTINPUTDEVICEA
;
65 typedef struct IDirectInputDevice2A IDirectInputDevice2A
,*LPDIRECTINPUTDEVICE2A
;
66 typedef struct IDirectInputEffect IDirectInputEffect
,*LPDIRECTINPUTEFFECT
;
67 typedef struct SysKeyboardA SysKeyboardA
,*LPSYSKEYBOARDA
;
68 typedef struct SysMouseA SysMouseA
,*LPSYSMOUSEA
;
70 #define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput)
71 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT
)
72 #define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7)
73 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7
)
74 #define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice)
75 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE
)
76 #define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2)
77 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2
)
80 #define DI_NOTATTACHED S_FALSE
81 #define DI_BUFFEROVERFLOW S_FALSE
82 #define DI_PROPNOEFFECT S_FALSE
83 #define DI_NOEFFECT S_FALSE
84 #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
85 #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
86 #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
87 #define DI_TRUNCATED ((HRESULT)0x00000008L)
88 #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
90 #define DIERR_OLDDIRECTINPUTVERSION \
91 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
92 #define DIERR_BETADIRECTINPUTVERSION \
93 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
94 #define DIERR_BADDRIVERVER \
95 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
96 #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
97 #define DIERR_NOTFOUND \
98 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
99 #define DIERR_OBJECTNOTFOUND \
100 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
101 #define DIERR_INVALIDPARAM E_INVALIDARG
102 #define DIERR_NOINTERFACE E_NOINTERFACE
103 #define DIERR_GENERIC E_FAIL
104 #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
105 #define DIERR_UNSUPPORTED E_NOTIMPL
106 #define DIERR_NOTINITIALIZED \
107 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
108 #define DIERR_ALREADYINITIALIZED \
109 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
110 #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
111 #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
112 #define DIERR_INPUTLOST \
113 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
114 #define DIERR_ACQUIRED \
115 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
116 #define DIERR_NOTACQUIRED \
117 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
118 #define DIERR_READONLY E_ACCESSDENIED
119 #define DIERR_HANDLEEXISTS E_ACCESSDENIED
121 #define E_PENDING 0x8000000AL
123 #define DIERR_INSUFFICIENTPRIVS 0x80040200L
124 #define DIERR_DEVICEFULL 0x80040201L
125 #define DIERR_MOREDATA 0x80040202L
126 #define DIERR_NOTDOWNLOADED 0x80040203L
127 #define DIERR_HASEFFECTS 0x80040204L
128 #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
129 #define DIERR_INCOMPLETEEFFECT 0x80040206L
130 #define DIERR_NOTBUFFERED 0x80040207L
131 #define DIERR_EFFECTPLAYING 0x80040208L
132 #define DIERR_UNPLUGGED 0x80040209L
133 #define DIERR_REPORTFULL 0x8004020AL
135 #define DIENUM_STOP 0
136 #define DIENUM_CONTINUE 1
138 #define DIEDFL_ALLDEVICES 0x00000000
139 #define DIEDFL_ATTACHEDONLY 0x00000000
140 #define DIEDFL_FORCEFEEDBACK 0x00000100
141 #define DIEDFL_INCLUDEALIASES 0x00010000
142 #define DIEDFL_INCLUDEPHANTOMS 0x00020000
144 #define DIDEVTYPE_DEVICE 1
145 #define DIDEVTYPE_MOUSE 2
146 #define DIDEVTYPE_KEYBOARD 3
147 #define DIDEVTYPE_JOYSTICK 4
148 #define DIDEVTYPE_HID 0x00010000
150 #define DIDEVTYPEMOUSE_UNKNOWN 1
151 #define DIDEVTYPEMOUSE_TRADITIONAL 2
152 #define DIDEVTYPEMOUSE_FINGERSTICK 3
153 #define DIDEVTYPEMOUSE_TOUCHPAD 4
154 #define DIDEVTYPEMOUSE_TRACKBALL 5
156 #define DIDEVTYPEKEYBOARD_UNKNOWN 0
157 #define DIDEVTYPEKEYBOARD_PCXT 1
158 #define DIDEVTYPEKEYBOARD_OLIVETTI 2
159 #define DIDEVTYPEKEYBOARD_PCAT 3
160 #define DIDEVTYPEKEYBOARD_PCENH 4
161 #define DIDEVTYPEKEYBOARD_NOKIA1050 5
162 #define DIDEVTYPEKEYBOARD_NOKIA9140 6
163 #define DIDEVTYPEKEYBOARD_NEC98 7
164 #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
165 #define DIDEVTYPEKEYBOARD_NEC98106 9
166 #define DIDEVTYPEKEYBOARD_JAPAN106 10
167 #define DIDEVTYPEKEYBOARD_JAPANAX 11
168 #define DIDEVTYPEKEYBOARD_J3100 12
170 #define DIDEVTYPEJOYSTICK_UNKNOWN 1
171 #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
172 #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
173 #define DIDEVTYPEJOYSTICK_GAMEPAD 4
174 #define DIDEVTYPEJOYSTICK_RUDDER 5
175 #define DIDEVTYPEJOYSTICK_WHEEL 6
176 #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
184 CHAR tszName
[MAX_PATH
];
185 #if(DIRECTINPUT_VERSION >= 0x0500)
187 DWORD dwFFForceResolution
;
188 WORD wCollectionNumber
;
189 WORD wDesignatorIndex
;
195 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
196 } DIDEVICEOBJECTINSTANCEA
, *LPDIDEVICEOBJECTINSTANCEA
,*LPCDIDEVICEOBJECTINSTANCEA
;
204 WCHAR tszName
[MAX_PATH
];
205 #if(DIRECTINPUT_VERSION >= 0x0500)
207 DWORD dwFFForceResolution
;
208 WORD wCollectionNumber
;
209 WORD wDesignatorIndex
;
215 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
216 } DIDEVICEOBJECTINSTANCEW
, *LPDIDEVICEOBJECTINSTANCEW
,*LPCDIDEVICEOBJECTINSTANCEW
;
217 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE
)
218 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE
)
226 CHAR tszInstanceName
[MAX_PATH
];
227 CHAR tszProductName
[MAX_PATH
];
228 #if(DIRECTINPUT_VERSION >= 0x0500)
232 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
233 } DIDEVICEINSTANCEA
, *LPDIDEVICEINSTANCEA
, *LPCDIDEVICEINSTANCEA
;
240 WCHAR tszInstanceName
[MAX_PATH
];
241 WCHAR tszProductName
[MAX_PATH
];
242 #if(DIRECTINPUT_VERSION >= 0x0500)
246 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
247 } DIDEVICEINSTANCEW
, *LPDIDEVICEINSTANCEW
, *LPCDIDEVICEINSTANCEW
;
248 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE
)
249 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE
)
250 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE
)
252 typedef BOOL
CALLBACK (*LPDIENUMDEVICESCALLBACKA
)(LPCDIDEVICEINSTANCEA
,LPVOID
);
253 typedef BOOL
CALLBACK (*LPDIENUMDEVICESCALLBACKW
)(LPCDIDEVICEINSTANCEW
,LPVOID
);
254 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK
)
256 typedef BOOL
CALLBACK (*LPDIENUMDEVICEOBJECTSCALLBACKA
)(LPCDIDEVICEOBJECTINSTANCEA
, LPVOID
);
257 typedef BOOL
CALLBACK (*LPDIENUMDEVICEOBJECTSCALLBACKW
)(LPCDIDEVICEOBJECTINSTANCEW
,LPVOID
);
258 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK
)
260 typedef BOOL
CALLBACK (*LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
)(LPDIRECTINPUTEFFECT
, LPVOID
);
262 #define DIK_ESCAPE 0x01
273 #define DIK_MINUS 0x0C /* - on main keyboard */
274 #define DIK_EQUALS 0x0D
275 #define DIK_BACK 0x0E /* backspace */
287 #define DIK_LBRACKET 0x1A
288 #define DIK_RBRACKET 0x1B
289 #define DIK_RETURN 0x1C /* Enter on main keyboard */
290 #define DIK_LCONTROL 0x1D
300 #define DIK_SEMICOLON 0x27
301 #define DIK_APOSTROPHE 0x28
302 #define DIK_GRAVE 0x29 /* accent grave */
303 #define DIK_LSHIFT 0x2A
304 #define DIK_BACKSLASH 0x2B
312 #define DIK_COMMA 0x33
313 #define DIK_PERIOD 0x34 /* . on main keyboard */
314 #define DIK_SLASH 0x35 /* / on main keyboard */
315 #define DIK_RSHIFT 0x36
316 #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
317 #define DIK_LMENU 0x38 /* left Alt */
318 #define DIK_SPACE 0x39
319 #define DIK_CAPITAL 0x3A
330 #define DIK_NUMLOCK 0x45
331 #define DIK_SCROLL 0x46 /* Scroll Lock */
332 #define DIK_NUMPAD7 0x47
333 #define DIK_NUMPAD8 0x48
334 #define DIK_NUMPAD9 0x49
335 #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
336 #define DIK_NUMPAD4 0x4B
337 #define DIK_NUMPAD5 0x4C
338 #define DIK_NUMPAD6 0x4D
339 #define DIK_ADD 0x4E /* + on numeric keypad */
340 #define DIK_NUMPAD1 0x4F
341 #define DIK_NUMPAD2 0x50
342 #define DIK_NUMPAD3 0x51
343 #define DIK_NUMPAD0 0x52
344 #define DIK_DECIMAL 0x53 /* . on numeric keypad */
347 #define DIK_F13 0x64 /* (NEC PC98) */
348 #define DIK_F14 0x65 /* (NEC PC98) */
349 #define DIK_F15 0x66 /* (NEC PC98) */
350 #define DIK_KANA 0x70 /* (Japanese keyboard) */
351 #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
352 #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
353 #define DIK_YEN 0x7D /* (Japanese keyboard) */
354 #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
355 #define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
356 #define DIK_AT 0x91 /* (NEC PC98) */
357 #define DIK_COLON 0x92 /* (NEC PC98) */
358 #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
359 #define DIK_KANJI 0x94 /* (Japanese keyboard) */
360 #define DIK_STOP 0x95 /* (NEC PC98) */
361 #define DIK_AX 0x96 /* (Japan AX) */
362 #define DIK_UNLABELED 0x97 /* (J3100) */
363 #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
364 #define DIK_RCONTROL 0x9D
365 #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
366 #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
367 #define DIK_SYSRQ 0xB7
368 #define DIK_RMENU 0xB8 /* right Alt */
369 #define DIK_PAUSE 0xC5 /* Pause */
370 #define DIK_HOME 0xC7 /* Home on arrow keypad */
371 #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
372 #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
373 #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
374 #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
375 #define DIK_END 0xCF /* End on arrow keypad */
376 #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
377 #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
378 #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
379 #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
380 #define DIK_LWIN 0xDB /* Left Windows key */
381 #define DIK_RWIN 0xDC /* Right Windows key */
382 #define DIK_APPS 0xDD /* AppMenu key */
383 #define DIK_POWER 0xDE
384 #define DIK_SLEEP 0xDF
385 #define DIK_BACKSPACE DIK_BACK /* backspace */
386 #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
387 #define DIK_LALT DIK_LMENU /* left Alt */
388 #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
389 #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
390 #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
391 #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
392 #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
393 #define DIK_RALT DIK_RMENU /* right Alt */
394 #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
395 #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
396 #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
397 #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
398 #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
399 #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
401 #define DIDFT_ALL 0x00000000
402 #define DIDFT_RELAXIS 0x00000001
403 #define DIDFT_ABSAXIS 0x00000002
404 #define DIDFT_AXIS 0x00000003
405 #define DIDFT_PSHBUTTON 0x00000004
406 #define DIDFT_TGLBUTTON 0x00000008
407 #define DIDFT_BUTTON 0x0000000C
408 #define DIDFT_POV 0x00000010
409 #define DIDFT_COLLECTION 0x00000040
410 #define DIDFT_NODATA 0x00000080
411 #define DIDFT_ANYINSTANCE 0x00FFFF00
412 #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
413 #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
414 #define DIDFT_GETTYPE(n) LOBYTE(n)
415 #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
416 #define DIDFT_FFACTUATOR 0x01000000
417 #define DIDFT_FFEFFECTTRIGGER 0x02000000
418 #define DIDFT_OUTPUT 0x10000000
419 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
420 #define DIDFT_NOCOLLECTION 0x00FFFF00
421 #define DIDF_ABSAXIS 0x00000001
422 #define DIDF_RELAXIS 0x00000002
424 #define DIGDD_PEEK 0x00000001
426 typedef struct DIDEVICEOBJECTDATA
{
431 } DIDEVICEOBJECTDATA
,*LPDIDEVICEOBJECTDATA
,*LPCDIDEVICEOBJECTDATA
;
433 typedef struct _DIOBJECTDATAFORMAT
{
438 } DIOBJECTDATAFORMAT
, *LPDIOBJECTDATAFORMAT
;
446 LPDIOBJECTDATAFORMAT rgodf
;
447 } DIDATAFORMAT
, *LPDIDATAFORMAT
;
448 typedef const DIDATAFORMAT
*LPCDIDATAFORMAT
;
455 } DIPROPHEADER
,*LPDIPROPHEADER
;
456 typedef const DIPROPHEADER
*LPCDIPROPHEADER
;
458 #define DIPH_DEVICE 0
459 #define DIPH_BYOFFSET 1
461 #define DIPH_BYUSAGE 3
463 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
465 typedef struct DIPROPDWORD
{
468 } DIPROPDWORD
, *LPDIPROPDWORD
;
469 typedef const DIPROPDWORD
*LPCDIPROPDWORD
;
471 typedef struct DIPROPRANGE
{
475 } DIPROPRANGE
, *LPDIPROPRANGE
;
476 typedef const DIPROPRANGE
*LPCDIPROPRANGE
;
478 #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
479 #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
481 typedef struct DIPROPCAL
{
486 } DIPROPCAL
, *LPDIPROPCAL
;
487 typedef const DIPROPCAL
*LPCDIPROPCAL
;
489 typedef struct DIPROPGUIDANDPATH
{
492 WCHAR wszPath
[MAX_PATH
];
493 } DIPROPGUIDANDPATH
, *LPDIPROPGUIDANDPATH
,*LPCDIPROPGUIDANDPATH
;
495 /* special property GUIDs */
497 #define MAKEDIPROP(prop) (*(const GUID *)(prop))
499 #define MAKEDIPROP(prop) ((REFGUID)(prop))
501 #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
502 #define DIPROP_AXISMODE MAKEDIPROP(2)
504 #define DIPROPAXISMODE_ABS 0
505 #define DIPROPAXISMODE_REL 1
507 #define DIPROP_GRANULARITY MAKEDIPROP(3)
508 #define DIPROP_RANGE MAKEDIPROP(4)
509 #define DIPROP_DEADZONE MAKEDIPROP(5)
510 #define DIPROP_SATURATION MAKEDIPROP(6)
511 #define DIPROP_FFGAIN MAKEDIPROP(7)
512 #define DIPROP_FFLOAD MAKEDIPROP(8)
513 #define DIPROP_AUTOCENTER MAKEDIPROP(9)
515 #define DIPROPAUTOCENTER_OFF 0
516 #define DIPROPAUTOCENTER_ON 1
518 #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
520 #define DIPROPCALIBRATIONMODE_COOKED 0
521 #define DIPROPCALIBRATIONMODE_RAW 1
523 #define DIPROP_CALIBRATION MAKEDIPROP(11)
524 #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
527 typedef struct DIDEVCAPS
{
534 #if(DIRECTINPUT_VERSION >= 0x0500)
535 DWORD dwFFSamplePeriod
;
536 DWORD dwFFMinTimeResolution
;
537 DWORD dwFirmwareRevision
;
538 DWORD dwHardwareRevision
;
539 DWORD dwFFDriverVersion
;
540 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
541 } DIDEVCAPS
,*LPDIDEVCAPS
;
543 #define DIDC_ATTACHED 0x00000001
544 #define DIDC_POLLEDDEVICE 0x00000002
545 #define DIDC_EMULATED 0x00000004
546 #define DIDC_POLLEDDATAFORMAT 0x00000008
547 #define DIDC_FORCEFEEDBACK 0x00000100
548 #define DIDC_FFATTACK 0x00000200
549 #define DIDC_FFFADE 0x00000400
550 #define DIDC_SATURATION 0x00000800
551 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
552 #define DIDC_POSNEGSATURATION 0x00002000
553 #define DIDC_DEADBAND 0x00004000
555 /* SetCooperativeLevel dwFlags */
556 #define DISCL_EXCLUSIVE 0x00000001
557 #define DISCL_NONEXCLUSIVE 0x00000002
558 #define DISCL_FOREGROUND 0x00000004
559 #define DISCL_BACKGROUND 0x00000008
561 typedef struct DICONSTANTFORCE
{
563 } DICONSTANTFORCE
, *LPDICONSTANTFORCE
;
565 typedef const DICONSTANTFORCE
*LPCDICONSTANTFORCE
;
567 typedef struct DIRAMPFORCE
{
570 } DIRAMPFORCE
, *LPDIRAMPFORCE
;
572 typedef const DIRAMPFORCE
*LPCDIRAMPFORCE
;
574 typedef struct DIPERIODIC
{
579 } DIPERIODIC
, *LPDIPERIODIC
;
581 typedef const DIPERIODIC
*LPCDIPERIODIC
;
583 typedef struct DICONDITION
{
585 LONG lPositiveCoefficient
;
586 LONG lNegativeCoefficient
;
587 DWORD dwPositiveSaturation
;
588 DWORD dwNegativeSaturation
;
590 } DICONDITION
, *LPDICONDITION
;
592 typedef const DICONDITION
*LPCDICONDITION
;
594 typedef struct DICUSTOMFORCE
{
596 DWORD dwSamplePeriod
;
599 } DICUSTOMFORCE
, *LPDICUSTOMFORCE
;
601 typedef const DICUSTOMFORCE
*LPCDICUSTOMFORCE
;
603 typedef struct DIENVELOPE
{
609 } DIENVELOPE
, *LPDIENVELOPE
;
611 typedef const DIENVELOPE
*LPCDIENVELOPE
;
613 typedef struct DIEFFECT
{
617 DWORD dwSamplePeriod
;
619 DWORD dwTriggerButton
;
620 DWORD dwTriggerRepeatInterval
;
624 LPDIENVELOPE lpEnvelope
;
625 DWORD cbTypeSpecificParams
;
626 LPVOID lpvTypeSpecificParams
;
627 } DIEFFECT
, *LPDIEFFECT
;
629 typedef const DIEFFECT
*LPCDIEFFECT
;
631 typedef struct DIEFFECTINFOA
{
635 DWORD dwStaticParams
;
636 DWORD dwDynamicParams
;
637 CHAR tszName
[MAX_PATH
];
638 } DIEFFECTINFOA
, *LPDIEFFECTINFOA
;
640 typedef struct DIEFFECTINFOW
{
644 DWORD dwStaticParams
;
645 DWORD dwDynamicParams
;
646 WCHAR tszName
[MAX_PATH
];
647 } DIEFFECTINFOW
, *LPDIEFFECTINFOW
;
650 typedef DIEFFECTINFOW DIEFFECTINFO
;
651 typedef LPDIEFFECTINFOW LPDIEFFECTINFO
;
653 typedef DIEFFECTINFOA DIEFFECTINFO
;
654 typedef LPDIEFFECTINFOA LPDIEFFECTINFO
;
657 typedef const DIEFFECTINFOA
*LPCDIEFFECTINFOA
;
658 typedef const DIEFFECTINFOW
*LPCDIEFFECTINFOW
;
659 typedef const DIEFFECTINFO
*LPCDIEFFECTINFO
;
661 typedef BOOL
CALLBACK (*LPDIENUMEFFECTSCALLBACKA
)(LPCDIEFFECTINFOA
, LPVOID
);
662 typedef BOOL
CALLBACK (*LPDIENUMEFFECTSCALLBACKW
)(LPCDIEFFECTINFOW
, LPVOID
);
664 typedef struct DIEFFESCAPE
{
671 } DIEFFESCAPE
, *LPDIEFFESCAPE
;
673 typedef struct DIJOYSTATE
{
683 } DIJOYSTATE
, *LPDIJOYSTATE
;
685 typedef struct DIJOYSTATE2
{
694 BYTE rgbButtons
[128];
695 LONG lVX
; /* 'v' as in velocity */
702 LONG lAX
; /* 'a' as in acceleration */
709 LONG lFX
; /* 'f' as in force */
712 LONG lFRx
; /* 'fr' as in rotational force aka torque */
716 } DIJOYSTATE2
, *LPDIJOYSTATE2
;
718 #define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
719 #define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
720 #define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
721 #define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
722 #define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
723 #define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
724 #define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
726 #define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
728 #define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
729 #define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
730 #define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
731 #define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
732 #define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
733 #define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
734 #define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
735 #define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
736 #define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
737 #define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
738 #define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
739 #define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
740 #define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
741 #define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
742 #define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
743 #define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
744 #define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
745 #define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
746 #define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
747 #define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
748 #define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
749 #define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
750 #define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
751 #define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
752 #define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
753 #define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
754 #define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
755 #define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
756 #define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
757 #define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
758 #define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
759 #define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
760 #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
762 /*****************************************************************************
763 * IDirectInputEffect interface
765 #define ICOM_INTERFACE IDirectInputEffect
766 #define IDirectInputEffect_METHODS \
767 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,, DWORD,, REFGUID,) \
768 ICOM_METHOD1(HRESULT,GetEffectGuid, LPGUID,) \
769 ICOM_METHOD2(HRESULT,GetParameters, LPDIEFFECT,, DWORD,) \
770 ICOM_METHOD2(HRESULT,SetParameters, LPCDIEFFECT,, DWORD,) \
771 ICOM_METHOD2(HRESULT,Start, DWORD,, DWORD,) \
772 ICOM_METHOD (HRESULT,Stop) \
773 ICOM_METHOD1(HRESULT,GetEffectStatus, LPDWORD,) \
774 ICOM_METHOD (HRESULT,Download) \
775 ICOM_METHOD (HRESULT,Unload) \
776 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,)
777 #define IDirectInputEffect_IMETHODS \
779 IDirectInputEffect_METHODS
780 ICOM_DEFINE(IDirectInputEffect
,IUnknown
)
781 #undef ICOM_INTERFACE
783 /*** IUnknown methods ***/
784 #define IDirectInputEffect_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
785 #define IDirectInputEffect_AddRef(p) ICOM_CALL (AddRef,p)
786 #define IDirectInputEffect_Release(p) ICOM_CALL (Release,p)
787 /*** IDirectInputEffect methods ***/
788 #define IDirectInputEffect_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
789 #define IDirectInputEffect_GetEffectGuid(p,a) ICOM_CALL1(GetEffectGuid,p,a)
790 #define IDirectInputEffect_GetParameters(p,a,b) ICOM_CALL2(GetParameters,p,a,b)
791 #define IDirectInputEffect_SetParameters(p,a,b) ICOM_CALL2(SetParameters,p,a,b)
792 #define IDirectInputEffect_Start(p,a,b) ICOM_CALL2(Start,p,a,b)
793 #define IDirectInputEffect_Stop(p) ICOM_CALL (Stop,p)
794 #define IDirectInputEffect_GetEffectStatus(p,a,b) ICOM_CALL1(GetEffectStatus,p,a)
795 #define IDirectInputEffect_Download(p) ICOM_CALL (Download,p)
796 #define IDirectInputEffect_Unload(p) ICOM_CALL (Unload,p)
797 #define IDirectInputEffect_Escape(p,a) ICOM_CALL1(Escape,p,a)
800 /*****************************************************************************
801 * IDirectInputDeviceA interface
803 #define ICOM_INTERFACE IDirectInputDeviceA
804 #define IDirectInputDeviceA_METHODS \
805 ICOM_METHOD1(HRESULT,GetCapabilities, LPDIDEVCAPS,lpDIDevCaps) \
806 ICOM_METHOD3(HRESULT,EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
807 ICOM_METHOD2(HRESULT,GetProperty, REFGUID,rguidProp, LPDIPROPHEADER,pdiph) \
808 ICOM_METHOD2(HRESULT,SetProperty, REFGUID,rguidProp, LPCDIPROPHEADER,pdiph) \
809 ICOM_METHOD (HRESULT,Acquire) \
810 ICOM_METHOD (HRESULT,Unacquire) \
811 ICOM_METHOD2(HRESULT,GetDeviceState, DWORD,cbData, LPVOID,lpvData) \
812 ICOM_METHOD4(HRESULT,GetDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,dwFlags) \
813 ICOM_METHOD1(HRESULT,SetDataFormat, LPCDIDATAFORMAT,lpdf) \
814 ICOM_METHOD1(HRESULT,SetEventNotification, HANDLE,hEvent) \
815 ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hwnd, DWORD,dwFlags) \
816 ICOM_METHOD3(HRESULT,GetObjectInfo, LPDIDEVICEOBJECTINSTANCEA,pdidoi, DWORD,dwObj, DWORD,dwHow) \
817 ICOM_METHOD1(HRESULT,GetDeviceInfo, LPDIDEVICEINSTANCEA,pdidi) \
818 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
819 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion, REFGUID,rguid)
820 #define IDirectInputDeviceA_IMETHODS \
822 IDirectInputDeviceA_METHODS
823 ICOM_DEFINE(IDirectInputDeviceA
,IUnknown
)
824 #undef ICOM_INTERFACE
826 /*** IUnknown methods ***/
827 #define IDirectInputDevice_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
828 #define IDirectInputDevice_AddRef(p) ICOM_CALL (AddRef,p)
829 #define IDirectInputDevice_Release(p) ICOM_CALL (Release,p)
830 /*** IDirectInputDevice methods ***/
831 #define IDirectInputDevice_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
832 #define IDirectInputDevice_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
833 #define IDirectInputDevice_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
834 #define IDirectInputDevice_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
835 #define IDirectInputDevice_Acquire(p) ICOM_CALL (Acquire,p)
836 #define IDirectInputDevice_Unacquire(p) ICOM_CALL (Unacquire,p)
837 #define IDirectInputDevice_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
838 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
839 #define IDirectInputDevice_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
840 #define IDirectInputDevice_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
841 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
842 #define IDirectInputDevice_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
843 #define IDirectInputDevice_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
844 #define IDirectInputDevice_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
845 #define IDirectInputDevice_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
848 /*****************************************************************************
849 * IDirectInputDevice2A interface
851 #define ICOM_INTERFACE IDirectInputDevice2A
852 #define IDirectInputDevice2A_METHODS \
853 ICOM_METHOD4(HRESULT,CreateEffect, REFGUID,rguid, LPCDIEFFECT,lpeff, LPDIRECTINPUTEFFECT*,ppdeff, LPUNKNOWN,punkOuter) \
854 ICOM_METHOD3(HRESULT,EnumEffects, LPDIENUMEFFECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwEffType) \
855 ICOM_METHOD2(HRESULT,GetEffectInfo, LPDIEFFECTINFOA,pdei, REFGUID,rguid) \
856 ICOM_METHOD1(HRESULT,GetForceFeedbackState, LPDWORD,pdwOut) \
857 ICOM_METHOD1(HRESULT,SendForceFeedbackCommand, DWORD,dwFlags) \
858 ICOM_METHOD3(HRESULT,EnumCreatedEffectObjects, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,lpCallback, LPVOID,pvRef, DWORD,fl) \
859 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,pesc) \
860 ICOM_METHOD (HRESULT,Poll) \
861 ICOM_METHOD4(HRESULT,SendDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,fl)
862 #define IDirectInputDevice2A_IMETHODS \
863 IDirectInputDeviceA_IMETHODS \
864 IDirectInputDevice2A_METHODS
865 ICOM_DEFINE(IDirectInputDevice2A
,IDirectInputDeviceA
)
866 #undef ICOM_INTERFACE
868 /*** IUnknown methods ***/
869 #define IDirectInputDevice2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
870 #define IDirectInputDevice2_AddRef(p) ICOM_CALL (AddRef,p)
871 #define IDirectInputDevice2_Release(p) ICOM_CALL (Release,p)
872 /*** IDirectInputDevice methods ***/
873 #define IDirectInputDevice2_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
874 #define IDirectInputDevice2_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
875 #define IDirectInputDevice2_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
876 #define IDirectInputDevice2_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
877 #define IDirectInputDevice2_Acquire(p) ICOM_CALL (Acquire,p)
878 #define IDirectInputDevice2_Unacquire(p) ICOM_CALL (Unacquire,p)
879 #define IDirectInputDevice2_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
880 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
881 #define IDirectInputDevice2_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
882 #define IDirectInputDevice2_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
883 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
884 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
885 #define IDirectInputDevice2_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
886 #define IDirectInputDevice2_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
887 #define IDirectInputDevice2_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
888 /*** IDirectInputDevice2 methods ***/
889 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) ICOM_CALL4(CreateEffect,p,a,b,c,d)
890 #define IDirectInputDevice2_EnumEffects(p,a,b,c) ICOM_CALL3(EnumEffects,p,a,b,c)
891 #define IDirectInputDevice2_GetEffectInfo(p,a,b) ICOM_CALL2(GetEffectInfo,p,a,b)
892 #define IDirectInputDevice2_GetForceFeedbackState(p,a) ICOM_CALL1(GetForceFeedbackState,p,a)
893 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) ICOM_CALL1(SendForceFeedbackCommand,p,a)
894 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) ICOM_CALL3(EnumCreatedEffectObjects,p,a,b,c)
895 #define IDirectInputDevice2_Escape(p,a) ICOM_CALL1(Escape,p,a)
896 #define IDirectInputDevice2_Poll(p) ICOM_CALL (Poll,p)
897 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d)
899 /* "Standard" Mouse report... */
900 typedef struct DIMOUSESTATE
{
907 /* "Standard" Mouse report for DInput 7... */
908 typedef struct DIMOUSESTATE2
{
915 #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
916 #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
917 #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
918 #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
919 #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
920 #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
921 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
926 extern const DIDATAFORMAT c_dfDIMouse
;
927 extern const DIDATAFORMAT c_dfDIMouse2
; /* DX 7 */
928 extern const DIDATAFORMAT c_dfDIKeyboard
;
929 extern const DIDATAFORMAT c_dfDIJoystick
;
930 extern const DIDATAFORMAT c_dfDIJoystick2
;
935 /*****************************************************************************
936 * IDirectInputA interface
938 #define ICOM_INTERFACE IDirectInputA
939 #define IDirectInputA_METHODS \
940 ICOM_METHOD3(HRESULT,CreateDevice, REFGUID,rguid, LPDIRECTINPUTDEVICEA*,lplpDirectInputDevice, LPUNKNOWN,pUnkOuter) \
941 ICOM_METHOD4(HRESULT,EnumDevices, DWORD,dwDevType, LPDIENUMDEVICESCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
942 ICOM_METHOD1(HRESULT,GetDeviceStatus, REFGUID,rguidInstance) \
943 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
944 ICOM_METHOD2(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion)
945 #define IDirectInputA_IMETHODS \
947 IDirectInputA_METHODS
948 ICOM_DEFINE(IDirectInputA
,IUnknown
)
949 #undef ICOM_INTERFACE
951 /*** IUnknown methods ***/
952 #define IDirectInputA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
953 #define IDirectInputA_AddRef(p) ICOM_CALL (AddRef,p)
954 #define IDirectInputA_Release(p) ICOM_CALL (Release,p)
955 /*** IDirectInputA methods ***/
956 #define IDirectInputA_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
957 #define IDirectInputA_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
958 #define IDirectInputA_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
959 #define IDirectInputA_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
960 #define IDirectInputA_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
962 /*****************************************************************************
963 * IDirectInput2A interface
965 #define ICOM_INTERFACE IDirectInput2A
966 #define IDirectInput2A_METHODS \
967 ICOM_METHOD3(HRESULT,FindDevice, REFGUID,rguid, LPCSTR,pszName, LPGUID,pguidInstance)
968 #define IDirectInput2A_IMETHODS \
969 IDirectInputA_IMETHODS \
970 IDirectInput2A_METHODS
971 ICOM_DEFINE(IDirectInput2A
,IDirectInputA
)
972 #undef ICOM_INTERFACE
974 /*** IUnknown methods ***/
975 #define IDirectInput2A_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
976 #define IDirectInput2A_AddRef(p) ICOM_CALL (AddRef,p)
977 #define IDirectInput2A_Release(p) ICOM_CALL (Release,p)
978 /*** IDirectInputA methods ***/
979 #define IDirectInput2A_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
980 #define IDirectInput2A_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
981 #define IDirectInput2A_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
982 #define IDirectInput2A_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
983 #define IDirectInput2A_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
984 /*** IDirectInput2A methods ***/
985 #define IDirectInput2A_FindDevice(p,a,b,c) ICOM_CALL3(FindDevice,p,a,b,c)
987 /*****************************************************************************
988 * IDirectInput7A interface
990 #define ICOM_INTERFACE IDirectInput7A
991 #define IDirectInput7A_METHODS \
992 ICOM_METHOD4(HRESULT,CreateDeviceEx, REFGUID,rguid, REFIID,riid, LPVOID*,pvOut, LPUNKNOWN,lpUnknownOuter)
993 #define IDirectInput7A_IMETHODS \
994 IDirectInput2A_IMETHODS \
995 IDirectInput7A_METHODS
996 ICOM_DEFINE(IDirectInput7A
,IDirectInput2A
)
997 #undef ICOM_INTERFACE
999 /*** IUnknown methods ***/
1000 #define IDirectInput7A_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1001 #define IDirectInput7A_AddRef(p) ICOM_CALL (AddRef,p)
1002 #define IDirectInput7A_Release(p) ICOM_CALL (Release,p)
1003 /*** IDirectInputA methods ***/
1004 #define IDirectInput7A_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
1005 #define IDirectInput7A_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
1006 #define IDirectInput7A_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
1007 #define IDirectInput7A_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
1008 #define IDirectInput7A_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
1009 /*** IDirectInput2A methods ***/
1010 #define IDirectInput7A_FindDevice(p,a,b,c) ICOM_CALL3(FindDevice,p,a,b,c)
1011 /*** IDirectInput7A methods ***/
1012 #define IDirectInput7A_CreateDeviceEx(p,a,b,c,d) ICOM_CALL4(CreateDeviceEx,p,a,b,c,d)
1014 /* Export functions */
1020 HRESULT WINAPI
DirectInputCreateA(HINSTANCE
,DWORD
,LPDIRECTINPUTA
*,LPUNKNOWN
);
1021 HRESULT WINAPI
DirectInputCreateW(HINSTANCE
,DWORD
,LPDIRECTINPUTA
*,LPUNKNOWN
);
1022 #define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate)
1024 HRESULT WINAPI
DirectInputCreateEx(HINSTANCE
,DWORD
,REFIID
,LPVOID
*,LPUNKNOWN
);
1030 #endif /* __WINE_DINPUT_H */