2 * Copyright 2000 Lionel Ulmer
3 * Copyright 2000-2001 TransGaming Technologies Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
21 #define __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
40 int internal_format_size
;
43 int *offsets
; /* object offsets */
44 LPDIDATAFORMAT wine_df
; /* wine internal data format */
45 LPDIDATAFORMAT user_df
; /* user defined data format */
48 /* Device implementation */
49 typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl
;
50 struct IDirectInputDevice2AImpl
55 CRITICAL_SECTION crit
;
61 LPDIDEVICEOBJECTDATA data_queue
; /* buffer for 'GetDeviceData'. */
62 int queue_len
; /* size of the queue - set in 'SetProperty' */
63 int queue_head
; /* position to write new event into queue */
64 int queue_tail
; /* next event to read from queue */
65 BOOL overflow
; /* return DI_BUFFEROVERFLOW in 'GetDeviceData' */
67 DataFormat data_format
; /* user data format and wine to user format converter */
70 /* Routines to do DataFormat / WineFormat conversions */
71 extern void fill_DataFormat(void *out
, const void *in
, const DataFormat
*df
) ;
72 extern HRESULT
create_DataFormat(LPCDIDATAFORMAT asked_format
, DataFormat
*format
);
73 extern void release_DataFormat(DataFormat
*df
) ;
74 extern void queue_event(LPDIRECTINPUTDEVICE8A iface
, int ofs
, DWORD data
, DWORD time
, DWORD seq
);
75 /* Helper functions to work with data format */
76 extern int id_to_offset(const DataFormat
*df
, int id
);
77 extern int find_property(const DataFormat
*df
, LPCDIPROPHEADER ph
);
80 * Callback Data used by specific callback
81 * for EnumObject on 'W' interfaces
84 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack
;
86 } device_enumobjects_AtoWcb_data
;
88 extern BOOL
DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA
, LPVOID
);
91 /* Various debug tools */
92 extern void _dump_cooperativelevel_DI(DWORD dwFlags
) ;
93 extern void _dump_EnumObjects_flags(DWORD dwFlags
) ;
94 extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph
) ;
95 extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA
*ddoi
) ;
96 extern void _dump_OBJECTINSTANCEW(const DIDEVICEOBJECTINSTANCEW
*ddoi
) ;
97 extern void _dump_DIDATAFORMAT(const DIDATAFORMAT
*df
) ;
98 extern const char *_dump_dinput_GUID(const GUID
*guid
) ;
101 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface
);
102 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface
);
103 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetDataFormat(
104 LPDIRECTINPUTDEVICE8A iface
,LPCDIDATAFORMAT df
) ;
105 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetCooperativeLevel(
106 LPDIRECTINPUTDEVICE8A iface
,HWND hwnd
,DWORD dwflags
) ;
107 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetEventNotification(
108 LPDIRECTINPUTDEVICE8A iface
,HANDLE hnd
) ;
109 extern ULONG WINAPI
IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface
) ;
110 extern HRESULT WINAPI
IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface
,REFIID riid
,LPVOID
*ppobj
);
111 extern HRESULT WINAPI
IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface
,REFIID riid
,LPVOID
*ppobj
);
112 extern ULONG WINAPI
IDirectInputDevice2AImpl_AddRef(
113 LPDIRECTINPUTDEVICE8A iface
) ;
114 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumObjects(
115 LPDIRECTINPUTDEVICE8A iface
,
116 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback
,
119 extern HRESULT WINAPI
IDirectInputDevice2WImpl_EnumObjects(
120 LPDIRECTINPUTDEVICE8W iface
,
121 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback
,
124 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface
, REFGUID rguid
, LPDIPROPHEADER pdiph
);
125 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface
, REFGUID rguid
, LPCDIPROPHEADER pdiph
);
126 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetObjectInfo(
127 LPDIRECTINPUTDEVICE8A iface
,
128 LPDIDEVICEOBJECTINSTANCEA pdidoi
,
131 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface
,
132 LPDIDEVICEOBJECTINSTANCEW pdidoi
,
135 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface
,
136 DWORD dodsize
, LPDIDEVICEOBJECTDATA dod
, LPDWORD entries
, DWORD flags
);
137 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceInfo(
138 LPDIRECTINPUTDEVICE8A iface
,
139 LPDIDEVICEINSTANCEA pdidi
) ;
140 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetDeviceInfo(
141 LPDIRECTINPUTDEVICE8W iface
,
142 LPDIDEVICEINSTANCEW pdidi
) ;
143 extern HRESULT WINAPI
IDirectInputDevice2AImpl_RunControlPanel(
144 LPDIRECTINPUTDEVICE8A iface
,
147 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Initialize(
148 LPDIRECTINPUTDEVICE8A iface
,
152 extern HRESULT WINAPI
IDirectInputDevice2AImpl_CreateEffect(
153 LPDIRECTINPUTDEVICE8A iface
,
156 LPDIRECTINPUTEFFECT
*ppdef
,
157 LPUNKNOWN pUnkOuter
) ;
158 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumEffects(
159 LPDIRECTINPUTDEVICE8A iface
,
160 LPDIENUMEFFECTSCALLBACKA lpCallback
,
163 extern HRESULT WINAPI
IDirectInputDevice2WImpl_EnumEffects(
164 LPDIRECTINPUTDEVICE8W iface
,
165 LPDIENUMEFFECTSCALLBACKW lpCallback
,
168 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetEffectInfo(
169 LPDIRECTINPUTDEVICE8A iface
,
170 LPDIEFFECTINFOA lpdei
,
172 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetEffectInfo(
173 LPDIRECTINPUTDEVICE8W iface
,
174 LPDIEFFECTINFOW lpdei
,
176 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetForceFeedbackState(
177 LPDIRECTINPUTDEVICE8A iface
,
179 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SendForceFeedbackCommand(
180 LPDIRECTINPUTDEVICE8A iface
,
182 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
183 LPDIRECTINPUTDEVICE8A iface
,
184 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback
,
187 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Escape(
188 LPDIRECTINPUTDEVICE8A iface
,
189 LPDIEFFESCAPE lpDIEEsc
) ;
190 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Poll(
191 LPDIRECTINPUTDEVICE8A iface
) ;
192 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SendDeviceData(
193 LPDIRECTINPUTDEVICE8A iface
,
195 LPCDIDEVICEOBJECTDATA rgdod
,
198 extern HRESULT WINAPI
IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface
,
200 LPDIENUMEFFECTSINFILECALLBACK pec
,
203 extern HRESULT WINAPI
IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface
,
204 LPCWSTR lpszFileName
,
205 LPDIENUMEFFECTSINFILECALLBACK pec
,
208 extern HRESULT WINAPI
IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface
,
211 LPDIFILEEFFECT rgDiFileEft
,
213 extern HRESULT WINAPI
IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface
,
214 LPCWSTR lpszFileName
,
216 LPDIFILEEFFECT rgDiFileEft
,
218 extern HRESULT WINAPI
IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface
,
219 LPDIACTIONFORMATA lpdiaf
,
222 extern HRESULT WINAPI
IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface
,
223 LPDIACTIONFORMATW lpdiaf
,
224 LPCWSTR lpszUserName
,
226 extern HRESULT WINAPI
IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface
,
227 LPDIACTIONFORMATA lpdiaf
,
230 extern HRESULT WINAPI
IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
,
231 LPDIACTIONFORMATW lpdiaf
,
232 LPCWSTR lpszUserName
,
234 extern HRESULT WINAPI
IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface
,
235 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader
);
236 extern HRESULT WINAPI
IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface
,
237 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader
);
239 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */