comparison lib/legacy_dx/dinputd.h @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8b8875f5b359
1 /****************************************************************************
2 *
3 * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
4 *
5 * File: dinputd.h
6 * Content: DirectInput include file for device driver implementors
7 *
8 ****************************************************************************/
9 #ifndef __DINPUTD_INCLUDED__
10 #define __DINPUTD_INCLUDED__
11
12 #ifndef DIRECTINPUT_VERSION
13 #define DIRECTINPUT_VERSION 0x0800
14 #pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
15 #endif
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 /****************************************************************************
22 *
23 * Interfaces
24 *
25 ****************************************************************************/
26
27 #ifndef DIJ_RINGZERO
28
29 DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
30 DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
32
33 DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
34
35 #endif /* DIJ_RINGZERO */
36
37
38 /****************************************************************************
39 *
40 * IDirectInputEffectDriver
41 *
42 ****************************************************************************/
43
44 typedef struct DIOBJECTATTRIBUTES {
45 DWORD dwFlags;
46 WORD wUsagePage;
47 WORD wUsage;
48 } DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
49 typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
50
51 typedef struct DIFFOBJECTATTRIBUTES {
52 DWORD dwFFMaxForce;
53 DWORD dwFFForceResolution;
54 } DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
55 typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
56
57 typedef struct DIOBJECTCALIBRATION {
58 LONG lMin;
59 LONG lCenter;
60 LONG lMax;
61 } DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
62 typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
63
64 typedef struct DIPOVCALIBRATION {
65 LONG lMin[5];
66 LONG lMax[5];
67 } DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
68 typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
69
70 typedef struct DIEFFECTATTRIBUTES {
71 DWORD dwEffectId;
72 DWORD dwEffType;
73 DWORD dwStaticParams;
74 DWORD dwDynamicParams;
75 DWORD dwCoords;
76 } DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
77 typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
78
79 typedef struct DIFFDEVICEATTRIBUTES {
80 DWORD dwFlags;
81 DWORD dwFFSamplePeriod;
82 DWORD dwFFMinTimeResolution;
83 } DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
84 typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
85
86 typedef struct DIDRIVERVERSIONS {
87 DWORD dwSize;
88 DWORD dwFirmwareRevision;
89 DWORD dwHardwareRevision;
90 DWORD dwFFDriverVersion;
91 } DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
92 typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
93
94 typedef struct DIDEVICESTATE {
95 DWORD dwSize;
96 DWORD dwState;
97 DWORD dwLoad;
98 } DIDEVICESTATE, *LPDIDEVICESTATE;
99
100 #define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
101
102 #ifndef DIJ_RINGZERO
103
104 typedef struct DIHIDFFINITINFO {
105 DWORD dwSize;
106 LPWSTR pwszDeviceInterface;
107 GUID GuidInstance;
108 } DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
109
110 #undef INTERFACE
111 #define INTERFACE IDirectInputEffectDriver
112
113 DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
114 {
115 /*** IUnknown methods ***/
116 STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
117 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
118 STDMETHOD_(ULONG,Release)(THIS) PURE;
119
120 /*** IDirectInputEffectDriver methods ***/
121 STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
122 STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
123 STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
124 STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
125 STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
126 STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
127 STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
128 STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
129 STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
130 STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
131 STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
132 };
133
134 typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
135
136 #if !defined(__cplusplus) || defined(CINTERFACE)
137 #define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
138 #define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
139 #define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
140 #define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
141 #define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
142 #define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
143 #define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
144 #define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
145 #define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
146 #define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
147 #define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
148 #define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
149 #define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
150 #define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
151 #else
152 #define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
153 #define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
154 #define IDirectInputEffectDriver_Release(p) (p)->Release()
155 #define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
156 #define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
157 #define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
158 #define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
159 #define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
160 #define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
161 #define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
162 #define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
163 #define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
164 #define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
165 #define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
166 #endif
167
168
169 #endif /* DIJ_RINGZERO */
170
171
172 /****************************************************************************
173 *
174 * IDirectInputJoyConfig
175 *
176 ****************************************************************************/
177
178 /****************************************************************************
179 *
180 * Definitions copied from the DDK
181 *
182 ****************************************************************************/
183
184 #ifndef JOY_HW_NONE
185
186 /* pre-defined joystick types */
187 #define JOY_HW_NONE 0
188 #define JOY_HW_CUSTOM 1
189 #define JOY_HW_2A_2B_GENERIC 2
190 #define JOY_HW_2A_4B_GENERIC 3
191 #define JOY_HW_2B_GAMEPAD 4
192 #define JOY_HW_2B_FLIGHTYOKE 5
193 #define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
194 #define JOY_HW_3A_2B_GENERIC 7
195 #define JOY_HW_3A_4B_GENERIC 8
196 #define JOY_HW_4B_GAMEPAD 9
197 #define JOY_HW_4B_FLIGHTYOKE 10
198 #define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
199 #define JOY_HW_TWO_2A_2B_WITH_Y 12
200 #define JOY_HW_LASTENTRY 13
201
202
203 /* calibration flags */
204 #define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
205 #define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
206 #define JOY_ISCAL_R 0x00000004l /* R is calibrated */
207 #define JOY_ISCAL_U 0x00000008l /* U is calibrated */
208 #define JOY_ISCAL_V 0x00000010l /* V is calibrated */
209 #define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
210
211 /* point of view constants */
212 #define JOY_POV_NUMDIRS 4
213 #define JOY_POVVAL_FORWARD 0
214 #define JOY_POVVAL_BACKWARD 1
215 #define JOY_POVVAL_LEFT 2
216 #define JOY_POVVAL_RIGHT 3
217
218 /* Specific settings for joystick hardware */
219 #define JOY_HWS_HASZ 0x00000001l /* has Z info? */
220 #define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
221 #define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
222 #define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
223 #define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
224 #define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
225 #define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
226 /* X defaults to J1 X axis */
227 #define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
228 #define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
229 #define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
230 /* Y defaults to J1 Y axis */
231 #define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
232 #define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
233 #define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
234 /* Z defaults to J2 Y axis */
235 #define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
236 #define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
237 #define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
238 /* POV defaults to J2 Y axis, if it is not button based */
239 #define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
240 #define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
241 #define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
242 /* R defaults to J2 X axis */
243 #define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
244 #define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
245 #define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
246 #define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
247 /* U & V for future hardware */
248 #define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
249 #define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
250
251 /* Usage settings */
252 #define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
253 #define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
254 #define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
255
256 /* reserved for future use -> as link to next possible dword */
257 #define JOY_US_RESERVED 0x80000000l /* reserved */
258
259
260 /* Settings for TypeInfo Flags1 */
261 #define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
262 #define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
263 #define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
264 #define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
265 #define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
266
267 /* Settings for TypeInfo Flags2 */
268 #define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
269 #define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
270 #define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
271 #define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
272 #define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
273 #define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
274 #define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
275 #define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
276 #define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
277 #define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
278 #define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
279 #define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
280 #define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
281 #define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
282
283 /* struct for storing x,y, z, and rudder values */
284 typedef struct joypos_tag {
285 DWORD dwX;
286 DWORD dwY;
287 DWORD dwZ;
288 DWORD dwR;
289 DWORD dwU;
290 DWORD dwV;
291 } JOYPOS, FAR *LPJOYPOS;
292
293 /* struct for storing ranges */
294 typedef struct joyrange_tag {
295 JOYPOS jpMin;
296 JOYPOS jpMax;
297 JOYPOS jpCenter;
298 } JOYRANGE,FAR *LPJOYRANGE;
299
300 /*
301 * dwTimeout - value at which to timeout joystick polling
302 * jrvRanges - range of values app wants returned for axes
303 * jpDeadZone - area around center to be considered
304 * as "dead". specified as a percentage
305 * (0-100). Only X & Y handled by system driver
306 */
307 typedef struct joyreguservalues_tag {
308 DWORD dwTimeOut;
309 JOYRANGE jrvRanges;
310 JOYPOS jpDeadZone;
311 } JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
312
313 typedef struct joyreghwsettings_tag {
314 DWORD dwFlags;
315 DWORD dwNumButtons;
316 } JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
317
318 /* range of values returned by the hardware (filled in by calibration) */
319 /*
320 * jrvHardware - values returned by hardware
321 * dwPOVValues - POV values returned by hardware
322 * dwCalFlags - what has been calibrated
323 */
324 typedef struct joyreghwvalues_tag {
325 JOYRANGE jrvHardware;
326 DWORD dwPOVValues[JOY_POV_NUMDIRS];
327 DWORD dwCalFlags;
328 } JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
329
330 /* hardware configuration */
331 /*
332 * hws - hardware settings
333 * dwUsageSettings - usage settings
334 * hwv - values returned by hardware
335 * dwType - type of joystick
336 * dwReserved - reserved for OEM drivers
337 */
338 typedef struct joyreghwconfig_tag {
339 JOYREGHWSETTINGS hws;
340 DWORD dwUsageSettings;
341 JOYREGHWVALUES hwv;
342 DWORD dwType;
343 DWORD dwReserved;
344 } JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
345
346 /* joystick calibration info structure */
347 typedef struct joycalibrate_tag {
348 UINT wXbase;
349 UINT wXdelta;
350 UINT wYbase;
351 UINT wYdelta;
352 UINT wZbase;
353 UINT wZdelta;
354 } JOYCALIBRATE;
355 typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
356
357 #endif
358
359 #ifndef DIJ_RINGZERO
360
361 #define MAX_JOYSTRING 256
362 typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
363
364 #ifndef MAX_JOYSTICKOEMVXDNAME
365 #define MAX_JOYSTICKOEMVXDNAME 260
366 #endif
367
368 #define DITC_REGHWSETTINGS 0x00000001
369 #define DITC_CLSIDCONFIG 0x00000002
370 #define DITC_DISPLAYNAME 0x00000004
371 #define DITC_CALLOUT 0x00000008
372 #define DITC_HARDWAREID 0x00000010
373 #define DITC_FLAGS1 0x00000020
374 #define DITC_FLAGS2 0x00000040
375 #define DITC_MAPFILE 0x00000080
376
377
378
379 /* This structure is defined for DirectX 5.0 compatibility */
380
381 typedef struct DIJOYTYPEINFO_DX5 {
382 DWORD dwSize;
383 JOYREGHWSETTINGS hws;
384 CLSID clsidConfig;
385 WCHAR wszDisplayName[MAX_JOYSTRING];
386 WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
387 } DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
388 typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
389
390 /* This structure is defined for DirectX 6.1 compatibility */
391 typedef struct DIJOYTYPEINFO_DX6 {
392 DWORD dwSize;
393 JOYREGHWSETTINGS hws;
394 CLSID clsidConfig;
395 WCHAR wszDisplayName[MAX_JOYSTRING];
396 WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
397 WCHAR wszHardwareId[MAX_JOYSTRING];
398 DWORD dwFlags1;
399 } DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
400 typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
401
402 typedef struct DIJOYTYPEINFO {
403 DWORD dwSize;
404 JOYREGHWSETTINGS hws;
405 CLSID clsidConfig;
406 WCHAR wszDisplayName[MAX_JOYSTRING];
407 WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
408 #if(DIRECTINPUT_VERSION >= 0x05b2)
409 WCHAR wszHardwareId[MAX_JOYSTRING];
410 DWORD dwFlags1;
411 #if(DIRECTINPUT_VERSION >= 0x0800)
412 DWORD dwFlags2;
413 WCHAR wszMapFile[MAX_JOYSTRING];
414 #endif /* DIRECTINPUT_VERSION >= 0x0800 */
415 #endif /* DIRECTINPUT_VERSION >= 0x05b2 */
416 } DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
417 typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
418 #define DIJC_GUIDINSTANCE 0x00000001
419 #define DIJC_REGHWCONFIGTYPE 0x00000002
420 #define DIJC_GAIN 0x00000004
421 #define DIJC_CALLOUT 0x00000008
422 #define DIJC_WDMGAMEPORT 0x00000010
423
424 /* This structure is defined for DirectX 5.0 compatibility */
425
426 typedef struct DIJOYCONFIG_DX5 {
427 DWORD dwSize;
428 GUID guidInstance;
429 JOYREGHWCONFIG hwc;
430 DWORD dwGain;
431 WCHAR wszType[MAX_JOYSTRING];
432 WCHAR wszCallout[MAX_JOYSTRING];
433 } DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
434 typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
435
436 typedef struct DIJOYCONFIG {
437 DWORD dwSize;
438 GUID guidInstance;
439 JOYREGHWCONFIG hwc;
440 DWORD dwGain;
441 WCHAR wszType[MAX_JOYSTRING];
442 WCHAR wszCallout[MAX_JOYSTRING];
443 #if(DIRECTINPUT_VERSION >= 0x05b2)
444 GUID guidGameport;
445 #endif /* DIRECTINPUT_VERSION >= 0x05b2 */
446 } DIJOYCONFIG, *LPDIJOYCONFIG;
447 typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
448
449
450 #define DIJU_USERVALUES 0x00000001
451 #define DIJU_GLOBALDRIVER 0x00000002
452 #define DIJU_GAMEPORTEMULATOR 0x00000004
453
454 typedef struct DIJOYUSERVALUES {
455 DWORD dwSize;
456 JOYREGUSERVALUES ruv;
457 WCHAR wszGlobalDriver[MAX_JOYSTRING];
458 WCHAR wszGameportEmulator[MAX_JOYSTRING];
459 } DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
460 typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
461
462 DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
463 DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
464 DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
465 DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
466
467 #undef INTERFACE
468 #define INTERFACE IDirectInputJoyConfig
469
470 DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown)
471 {
472 /*** IUnknown methods ***/
473 STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
474 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
475 STDMETHOD_(ULONG,Release)(THIS) PURE;
476
477 /*** IDirectInputJoyConfig methods ***/
478 STDMETHOD(Acquire)(THIS) PURE;
479 STDMETHOD(Unacquire)(THIS) PURE;
480 STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
481 STDMETHOD(SendNotify)(THIS) PURE;
482 STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
483 STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
484 STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE;
485 STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
486 STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
487 STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
488 STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
489 STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
490 STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
491 STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
492 STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
493 STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE;
494 };
495
496 typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG;
497
498 #if !defined(__cplusplus) || defined(CINTERFACE)
499 #define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
500 #define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p)
501 #define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p)
502 #define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p)
503 #define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p)
504 #define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
505 #define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p)
506 #define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
507 #define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
508 #define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c)
509 #define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
510 #define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
511 #define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
512 #define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
513 #define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
514 #define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
515 #define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
516 #define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
517 #define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c)
518 #else
519 #define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
520 #define IDirectInputJoyConfig_AddRef(p) (p)->AddRef()
521 #define IDirectInputJoyConfig_Release(p) (p)->Release()
522 #define IDirectInputJoyConfig_Acquire(p) (p)->Acquire()
523 #define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire()
524 #define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
525 #define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify()
526 #define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
527 #define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
528 #define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c)
529 #define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a)
530 #define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
531 #define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
532 #define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a)
533 #define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
534 #define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
535 #define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
536 #define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
537 #define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c)
538 #endif
539
540 #endif /* DIJ_RINGZERO */
541
542 #if(DIRECTINPUT_VERSION >= 0x0800)
543
544 #ifndef DIJ_RINGZERO
545
546 #undef INTERFACE
547 #define INTERFACE IDirectInputJoyConfig8
548
549 DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
550 {
551 /*** IUnknown methods ***/
552 STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
553 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
554 STDMETHOD_(ULONG,Release)(THIS) PURE;
555
556 /*** IDirectInputJoyConfig8 methods ***/
557 STDMETHOD(Acquire)(THIS) PURE;
558 STDMETHOD(Unacquire)(THIS) PURE;
559 STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
560 STDMETHOD(SendNotify)(THIS) PURE;
561 STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
562 STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
563 STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE;
564 STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
565 STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
566 STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
567 STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
568 STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
569 STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
570 STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
571 STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
572 STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
573 };
574
575 typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
576
577 #if !defined(__cplusplus) || defined(CINTERFACE)
578 #define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
579 #define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p)
580 #define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p)
581 #define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p)
582 #define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
583 #define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
584 #define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p)
585 #define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
586 #define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
587 #define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
588 #define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
589 #define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
590 #define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
591 #define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
592 #define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
593 #define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
594 #define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
595 #define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
596 #define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a)
597 #else
598 #define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
599 #define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef()
600 #define IDirectInputJoyConfig8_Release(p) (p)->Release()
601 #define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire()
602 #define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire()
603 #define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
604 #define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify()
605 #define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
606 #define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
607 #define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d)
608 #define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a)
609 #define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
610 #define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
611 #define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a)
612 #define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
613 #define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
614 #define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
615 #define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
616 #define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a)
617 #endif
618
619 #endif /* DIJ_RINGZERO */
620
621 /****************************************************************************
622 *
623 * Notification Messages
624 *
625 ****************************************************************************/
626
627 /* RegisterWindowMessage with this to get DirectInput notification messages */
628 #define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
629 #define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
630
631 #ifdef UNICODE
632 #define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
633 #else
634 #define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
635 #endif
636
637 #define DIMSGWP_NEWAPPSTART 0x00000001
638 #define DIMSGWP_DX8APPSTART 0x00000002
639 #define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
640
641 #endif /* DIRECTINPUT_VERSION >= 0x0800 */
642
643 #define DIAPPIDFLAG_NOTIME 0x00000001
644 #define DIAPPIDFLAG_NOSIZE 0x00000002
645
646 #define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
647 #define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
648 #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
649 #define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
650 #define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
651 #define DIRECTINPUT_REGSTR_VAL_IDA "Id"
652 #define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
653 #define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
654
655 #define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
656 #define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
657 #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
658 #define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
659 #define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
660 #define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
661 #define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
662 #define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
663
664 #ifdef UNICODE
665 #define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
666 #define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
667 #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
668 #define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
669 #define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
670 #define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
671 #define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
672 #define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
673 #else
674 #define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
675 #define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
676 #define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
677 #define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
678 #define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
679 #define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
680 #define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
681 #define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
682 #endif
683
684
685 /****************************************************************************
686 *
687 * Return Codes
688 *
689 ****************************************************************************/
690
691 #define DIERR_NOMOREITEMS \
692 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
693
694 /*
695 * Device driver-specific codes.
696 */
697
698 #define DIERR_DRIVERFIRST 0x80040300L
699 #define DIERR_DRIVERLAST 0x800403FFL
700
701 /*
702 * Unless the specific driver has been precisely identified, no meaning
703 * should be attributed to these values other than that the driver
704 * originated the error. However, to illustrate the types of error that
705 * may be causing the failure, the PID force feedback driver distributed
706 * with DirectX 7 could return the following errors:
707 *
708 * DIERR_DRIVERFIRST + 1
709 * The requested usage was not found.
710 * DIERR_DRIVERFIRST + 2
711 * The parameter block couldn't be downloaded to the device.
712 * DIERR_DRIVERFIRST + 3
713 * PID initialization failed.
714 * DIERR_DRIVERFIRST + 4
715 * The provided values couldn't be scaled.
716 */
717
718
719 /*
720 * Device installer errors.
721 */
722
723 /*
724 * Registry entry or DLL for class installer invalid
725 * or class installer not found.
726 */
727 #define DIERR_INVALIDCLASSINSTALLER 0x80040400L
728
729 /*
730 * The user cancelled the install operation.
731 */
732 #define DIERR_CANCELLED 0x80040401L
733
734 /*
735 * The INF file for the selected device could not be
736 * found or is invalid or is damaged.
737 */
738 #define DIERR_BADINF 0x80040402L
739
740 /****************************************************************************
741 *
742 * Map files
743 *
744 ****************************************************************************/
745
746 /*
747 * Delete particular data from default map file.
748 */
749 #define DIDIFT_DELETE 0x01000000
750
751 #ifdef __cplusplus
752 };
753 #endif
754
755 #endif /* __DINPUTD_INCLUDED__ */