4 #define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
5 #define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)
10 #define DIRECTINPUT_VERSION 0x0500
13 DEFINE_GUID(CLSID_DirectInput
, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
14 DEFINE_GUID(CLSID_DirectInputDevice
, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
17 DEFINE_GUID(IID_IDirectInputA
, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
18 DEFINE_GUID(IID_IDirectInputW
, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
19 DEFINE_GUID(IID_IDirectInput2A
, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
20 DEFINE_GUID(IID_IDirectInput2W
, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
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_IDirectInputEffect
, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
27 /* Predefined object types */
28 DEFINE_GUID(GUID_XAxis
, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
29 DEFINE_GUID(GUID_YAxis
, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
30 DEFINE_GUID(GUID_ZAxis
, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 DEFINE_GUID(GUID_RxAxis
,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
32 DEFINE_GUID(GUID_RyAxis
,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
33 DEFINE_GUID(GUID_RzAxis
,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
34 DEFINE_GUID(GUID_Slider
,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35 DEFINE_GUID(GUID_Button
,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
36 DEFINE_GUID(GUID_Key
, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
37 DEFINE_GUID(GUID_POV
, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
38 DEFINE_GUID(GUID_Unknown
,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
40 /* Predefined product GUIDs */
41 DEFINE_GUID(GUID_SysMouse
, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
42 DEFINE_GUID(GUID_SysKeyboard
, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
43 DEFINE_GUID(GUID_Joystick
, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
45 /* predefined forcefeedback effects */
46 DEFINE_GUID(GUID_ConstantForce
, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
47 DEFINE_GUID(GUID_RampForce
, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
48 DEFINE_GUID(GUID_Square
, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
49 DEFINE_GUID(GUID_Sine
, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
50 DEFINE_GUID(GUID_Triangle
, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
51 DEFINE_GUID(GUID_SawtoothUp
, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
52 DEFINE_GUID(GUID_SawtoothDown
, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
53 DEFINE_GUID(GUID_Spring
, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
54 DEFINE_GUID(GUID_Damper
, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
55 DEFINE_GUID(GUID_Inertia
, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
56 DEFINE_GUID(GUID_Friction
, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
57 DEFINE_GUID(GUID_CustomForce
, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
59 typedef struct IDirectInput32A IDirectInput32A
,*LPDIRECTINPUT32A
;
60 typedef struct IDirectInputDevice32A IDirectInputDevice32A
,*LPDIRECTINPUTDEVICE32A
;
61 typedef struct SysKeyboard32A SysKeyboard32A
,*LPSYSKEYBOARD32A
;
62 typedef struct SysMouse32A SysMouse32A
,*LPSYSMOUSE32A
;
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
126 CHAR tszName
[MAX_PATH
];
127 #if(DIRECTINPUT_VERSION >= 0x0500)
129 DWORD dwFFForceResolution
;
130 WORD wCollectionNumber
;
131 WORD wDesignatorIndex
;
137 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
138 } DIDEVICEOBJECTINSTANCE32A
, *LPDIDEVICEOBJECTINSTANCE32A
,*LPCDIDEVICEOBJECTINSTANCE32A
;
146 WCHAR tszName
[MAX_PATH
];
147 #if(DIRECTINPUT_VERSION >= 0x0500)
149 DWORD dwFFForceResolution
;
150 WORD wCollectionNumber
;
151 WORD wDesignatorIndex
;
157 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
158 } DIDEVICEOBJECTINSTANCE32W
, *LPDIDEVICEOBJECTINSTANCE32W
,*LPCDIDEVICEOBJECTINSTANCE32W
;
159 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE
)
160 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE
)
168 CHAR tszInstanceName
[MAX_PATH
];
169 CHAR tszProductName
[MAX_PATH
];
170 #if(DIRECTINPUT_VERSION >= 0x0500)
174 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
175 } DIDEVICEINSTANCE32A
, *LPDIDEVICEINSTANCE32A
, *LPCDIDEVICEINSTANCE32A
;
182 WCHAR tszInstanceName
[MAX_PATH
];
183 WCHAR tszProductName
[MAX_PATH
];
184 #if(DIRECTINPUT_VERSION >= 0x0500)
188 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
189 } DIDEVICEINSTANCE32W
, *LPDIDEVICEINSTANCE32W
, *LPCDIDEVICEINSTANCE32W
;
190 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE
)
191 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE
)
192 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE
)
194 typedef BOOL32 (CALLBACK
* LPDIENUMDEVICESCALLBACK32A
)(LPCDIDEVICEINSTANCE32A
,LPVOID
);
195 typedef BOOL32 (CALLBACK
* LPDIENUMDEVICESCALLBACK32W
)(LPCDIDEVICEINSTANCE32W
,LPVOID
);
196 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK
)
198 typedef BOOL32 (CALLBACK
* LPDIENUMDEVICEOBJECTSCALLBACK32A
)(LPCDIDEVICEOBJECTINSTANCE32A
, LPVOID
);
199 typedef BOOL32 (CALLBACK
* LPDIENUMDEVICEOBJECTSCALLBACK32W
)(LPCDIDEVICEOBJECTINSTANCE32W
,LPVOID
);
200 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK
)
202 #define DIK_ESCAPE 0x01
213 #define DIK_MINUS 0x0C /* - on main keyboard */
214 #define DIK_EQUALS 0x0D
215 #define DIK_BACK 0x0E /* backspace */
227 #define DIK_LBRACKET 0x1A
228 #define DIK_RBRACKET 0x1B
229 #define DIK_RETURN 0x1C /* Enter on main keyboard */
230 #define DIK_LCONTROL 0x1D
240 #define DIK_SEMICOLON 0x27
241 #define DIK_APOSTROPHE 0x28
242 #define DIK_GRAVE 0x29 /* accent grave */
243 #define DIK_LSHIFT 0x2A
244 #define DIK_BACKSLASH 0x2B
252 #define DIK_COMMA 0x33
253 #define DIK_PERIOD 0x34 /* . on main keyboard */
254 #define DIK_SLASH 0x35 /* / on main keyboard */
255 #define DIK_RSHIFT 0x36
256 #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
257 #define DIK_LMENU 0x38 /* left Alt */
258 #define DIK_SPACE 0x39
259 #define DIK_CAPITAL 0x3A
270 #define DIK_NUMLOCK 0x45
271 #define DIK_SCROLL 0x46 /* Scroll Lock */
272 #define DIK_NUMPAD7 0x47
273 #define DIK_NUMPAD8 0x48
274 #define DIK_NUMPAD9 0x49
275 #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
276 #define DIK_NUMPAD4 0x4B
277 #define DIK_NUMPAD5 0x4C
278 #define DIK_NUMPAD6 0x4D
279 #define DIK_ADD 0x4E /* + on numeric keypad */
280 #define DIK_NUMPAD1 0x4F
281 #define DIK_NUMPAD2 0x50
282 #define DIK_NUMPAD3 0x51
283 #define DIK_NUMPAD0 0x52
284 #define DIK_DECIMAL 0x53 /* . on numeric keypad */
287 #define DIK_F13 0x64 /* (NEC PC98) */
288 #define DIK_F14 0x65 /* (NEC PC98) */
289 #define DIK_F15 0x66 /* (NEC PC98) */
290 #define DIK_KANA 0x70 /* (Japanese keyboard) */
291 #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
292 #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
293 #define DIK_YEN 0x7D /* (Japanese keyboard) */
294 #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
295 #define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
296 #define DIK_AT 0x91 /* (NEC PC98) */
297 #define DIK_COLON 0x92 /* (NEC PC98) */
298 #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
299 #define DIK_KANJI 0x94 /* (Japanese keyboard) */
300 #define DIK_STOP 0x95 /* (NEC PC98) */
301 #define DIK_AX 0x96 /* (Japan AX) */
302 #define DIK_UNLABELED 0x97 /* (J3100) */
303 #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
304 #define DIK_RCONTROL 0x9D
305 #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
306 #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
307 #define DIK_SYSRQ 0xB7
308 #define DIK_RMENU 0xB8 /* right Alt */
309 #define DIK_PAUSE 0xC5 /* Pause */
310 #define DIK_HOME 0xC7 /* Home on arrow keypad */
311 #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
312 #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
313 #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
314 #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
315 #define DIK_END 0xCF /* End on arrow keypad */
316 #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
317 #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
318 #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
319 #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
320 #define DIK_LWIN 0xDB /* Left Windows key */
321 #define DIK_RWIN 0xDC /* Right Windows key */
322 #define DIK_APPS 0xDD /* AppMenu key */
323 #define DIK_POWER 0xDE
324 #define DIK_SLEEP 0xDF
325 #define DIK_BACKSPACE DIK_BACK /* backspace */
326 #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
327 #define DIK_LALT DIK_LMENU /* left Alt */
328 #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
329 #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
330 #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
331 #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
332 #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
333 #define DIK_RALT DIK_RMENU /* right Alt */
334 #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
335 #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
336 #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
337 #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
338 #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
339 #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
341 #define DIDFT_ALL 0x00000000
342 #define DIDFT_RELAXIS 0x00000001
343 #define DIDFT_ABSAXIS 0x00000002
344 #define DIDFT_AXIS 0x00000003
345 #define DIDFT_PSHBUTTON 0x00000004
346 #define DIDFT_TGLBUTTON 0x00000008
347 #define DIDFT_BUTTON 0x0000000C
348 #define DIDFT_POV 0x00000010
349 #define DIDFT_COLLECTION 0x00000040
350 #define DIDFT_NODATA 0x00000080
351 #define DIDFT_ANYINSTANCE 0x00FFFF00
352 #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
353 #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
354 #define DIDFT_GETTYPE(n) LOBYTE(n)
355 #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
356 #define DIDFT_FFACTUATOR 0x01000000
357 #define DIDFT_FFEFFECTTRIGGER 0x02000000
358 #define DIDFT_OUTPUT 0x10000000
359 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
360 #define DIDFT_NOCOLLECTION 0x00FFFF00
361 #define DIDF_ABSAXIS 0x00000001
362 #define DIDF_RELAXIS 0x00000002
364 #define DIGDD_PEEK 0x00000001
371 } DIDEVICEOBJECTDATA
,*LPDIDEVICEOBJECTDATA
,*LPCDIDEVICEOBJECTDATA
;
373 typedef struct _DIOBJECTDATAFORMAT
{
378 } DIOBJECTDATAFORMAT
, *LPDIOBJECTDATAFORMAT
;
386 LPDIOBJECTDATAFORMAT rgodf
;
387 } DIDATAFORMAT
, *LPDIDATAFORMAT
,*LPCDIDATAFORMAT
;
394 } DIPROPHEADER
,*LPDIPROPHEADER
,*LPCDIPROPHEADER
;
396 #define DIPH_DEVICE 0
397 #define DIPH_BYOFFSET 1
399 #define DIPH_BYUSAGE 3
401 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
403 typedef struct DIPROPDWORD
{
406 } DIPROPDWORD
, *LPDIPROPDWORD
;
407 typedef const DIPROPDWORD
*LPCDIPROPDWORD
;
409 typedef struct DIPROPRANGE
{
413 } DIPROPRANGE
, *LPDIPROPRANGE
;
414 typedef const DIPROPRANGE
*LPCDIPROPRANGE
;
416 #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
417 #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
419 typedef struct DIPROPCAL
{
424 } DIPROPCAL
, *LPDIPROPCAL
;
425 typedef const DIPROPCAL
*LPCDIPROPCAL
;
427 typedef struct DIPROPGUIDANDPATH
{
430 WCHAR wszPath
[MAX_PATH
];
431 } DIPROPGUIDANDPATH
, *LPDIPROPGUIDANDPATH
,*LPCDIPROPGUIDANDPATH
;
433 /* special property GUIDs */
434 #define MAKEDIPROP(prop) ((REFGUID)(prop))
435 #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
436 #define DIPROP_AXISMODE MAKEDIPROP(2)
438 #define DIPROPAXISMODE_ABS 0
439 #define DIPROPAXISMODE_REL 1
441 #define DIPROP_GRANULARITY MAKEDIPROP(3)
442 #define DIPROP_RANGE MAKEDIPROP(4)
443 #define DIPROP_DEADZONE MAKEDIPROP(5)
444 #define DIPROP_SATURATION MAKEDIPROP(6)
445 #define DIPROP_FFGAIN MAKEDIPROP(7)
446 #define DIPROP_FFLOAD MAKEDIPROP(8)
447 #define DIPROP_AUTOCENTER MAKEDIPROP(9)
449 #define DIPROPAUTOCENTER_OFF 0
450 #define DIPROPAUTOCENTER_ON 1
452 #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
454 #define DIPROPCALIBRATIONMODE_COOKED 0
455 #define DIPROPCALIBRATIONMODE_RAW 1
457 #define DIPROP_CALIBRATION MAKEDIPROP(11)
458 #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
461 typedef struct DIDEVCAPS
{
468 #if(DIRECTINPUT_VERSION >= 0x0500)
469 DWORD dwFFSamplePeriod
;
470 DWORD dwFFMinTimeResolution
;
471 DWORD dwFirmwareRevision
;
472 DWORD dwHardwareRevision
;
473 DWORD dwFFDriverVersion
;
474 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
475 } DIDEVCAPS
,*LPDIDEVCAPS
;
477 #define DIDC_ATTACHED 0x00000001
478 #define DIDC_POLLEDDEVICE 0x00000002
479 #define DIDC_EMULATED 0x00000004
480 #define DIDC_POLLEDDATAFORMAT 0x00000008
481 #define DIDC_FORCEFEEDBACK 0x00000100
482 #define DIDC_FFATTACK 0x00000200
483 #define DIDC_FFFADE 0x00000400
484 #define DIDC_SATURATION 0x00000800
485 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
486 #define DIDC_POSNEGSATURATION 0x00002000
487 #define DIDC_DEADBAND 0x00004000
489 /* SetCooperativeLevel dwFlags */
490 #define DISCL_EXCLUSIVE 0x00000001
491 #define DISCL_NONEXCLUSIVE 0x00000002
492 #define DISCL_FOREGROUND 0x00000004
493 #define DISCL_BACKGROUND 0x00000008
495 #define THIS LPDIRECTINPUTDEVICE32A this
496 typedef struct IDirectInputDeviceA_VTable
{
497 /*** IUnknown methods ***/
498 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
499 STDMETHOD_(ULONG
,AddRef
)(THIS
) PURE
;
500 STDMETHOD_(ULONG
,Release
)(THIS
) PURE
;
502 /*** IDirectInputDeviceA methods ***/
503 STDMETHOD(GetCapabilities
)(THIS_ LPDIDEVCAPS
) PURE
;
504 STDMETHOD(EnumObjects
)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACK32A
,LPVOID
,DWORD
) PURE
;
505 STDMETHOD(GetProperty
)(THIS_ REFGUID
,LPDIPROPHEADER
) PURE
;
506 STDMETHOD(SetProperty
)(THIS_ REFGUID
,LPCDIPROPHEADER
) PURE
;
507 STDMETHOD(Acquire
)(THIS
) PURE
;
508 STDMETHOD(Unacquire
)(THIS
) PURE
;
509 STDMETHOD(GetDeviceState
)(THIS_ DWORD
,LPVOID
) PURE
;
510 STDMETHOD(GetDeviceData
)(THIS_ DWORD
,LPDIDEVICEOBJECTDATA
,LPDWORD
,DWORD
) PURE
;
511 STDMETHOD(SetDataFormat
)(THIS_ LPCDIDATAFORMAT
) PURE
;
512 STDMETHOD(SetEventNotification
)(THIS_ HANDLE32
) PURE
;
513 STDMETHOD(SetCooperativeLevel
)(THIS_ HWND32
,DWORD
) PURE
;
514 STDMETHOD(GetObjectInfo
)(THIS_ LPDIDEVICEOBJECTINSTANCE32A
,DWORD
,DWORD
) PURE
;
515 STDMETHOD(GetDeviceInfo
)(THIS_ LPDIDEVICEINSTANCE32A
) PURE
;
516 STDMETHOD(RunControlPanel
)(THIS_ HWND32
,DWORD
) PURE
;
517 STDMETHOD(Initialize
)(THIS_ HINSTANCE32
,DWORD
,REFGUID
) PURE
;
518 } IDirectInputDeviceA_VTable
,*LPDIRECTINPUTDEVICEA_VTABLE
;
520 struct IDirectInputDevice32A
{
521 LPDIRECTINPUTDEVICEA_VTABLE lpvtbl
;
526 /* "Standard" Mouse report... */
527 struct DIMOUSESTATE
{
534 LPDIRECTINPUTDEVICEA_VTABLE lpvtbl
;
538 struct DIMOUSESTATE prevpos
;
541 struct SysKeyboard32A
{
542 LPDIRECTINPUTDEVICEA_VTABLE lpvtbl
;
549 #define THIS LPDIRECTINPUT32A this
550 typedef struct IDirectInputA_VTable
{
551 /*** IUnknown methods ***/
552 STDMETHOD(QueryInterface
)(THIS_ REFIID riid
, LPVOID
* ppvObj
) PURE
;
553 STDMETHOD_(ULONG
,AddRef
)(THIS
) PURE
;
554 STDMETHOD_(ULONG
,Release
)(THIS
) PURE
;
556 /*** IDirectInputA methods ***/
557 STDMETHOD(CreateDevice
)(THIS_ REFGUID
,LPDIRECTINPUTDEVICE32A
*,LPUNKNOWN
) PURE
;
558 STDMETHOD(EnumDevices
)(THIS_ DWORD
,LPDIENUMDEVICESCALLBACK32A
,LPVOID
,DWORD
) PURE
;
559 STDMETHOD(GetDeviceStatus
)(THIS_ REFGUID
) PURE
;
560 STDMETHOD(RunControlPanel
)(THIS_ HWND32
,DWORD
) PURE
;
561 STDMETHOD(Initialize
)(THIS_ HINSTANCE32
,DWORD
) PURE
;
562 } IDirectInputA_VTable
,*LPDIRECTINPUTA_VTABLE
;
564 struct IDirectInput32A
{
565 LPDIRECTINPUTA_VTABLE lpvtbl
;
570 #undef STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
571 #undef STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)