/[cvs]/api/include/dinputd.h
ViewVC logotype

Annotation of /api/include/dinputd.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (hide annotations) (vendor branch)
Sun Jul 1 20:47:59 2001 UTC (23 years, 4 months ago) by bearsoft
Branch: lazy, MAIN
CVS Tags: start, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
First import

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

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26