advpack: Forward SetPerUserSecValuesA to its Unicode counterpart.
[wine] / dlls / dinput / device_private.h
1 /*
2  * Copyright 2000 Lionel Ulmer
3  * Copyright 2000-2001 TransGaming Technologies Inc.
4  *
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.
9  *
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.
14  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #ifndef __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
21 #define __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
22
23 #include <stdarg.h>
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "dinput.h"
28
29 /* Device implementation */
30 typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl;
31 struct IDirectInputDevice2AImpl
32 {
33         const IDirectInputDevice2AVtbl *lpVtbl;
34         LONG                            ref;
35         GUID                            guid;
36 };
37
38 /* Routines to do DataFormat / WineFormat conversions */
39 typedef struct {
40   int size;
41   int offset_in;
42   int offset_out;
43   int value;
44 } DataTransform;
45
46 typedef struct {
47   int size;
48   int internal_format_size;
49   DataTransform *dt;
50 } DataFormat;
51 extern void fill_DataFormat(void *out, const void *in, DataFormat *df) ;
52 extern DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) ;
53 extern void release_DataFormat(DataFormat *df) ;
54
55 extern HHOOK set_dinput_hook(int hook_id, LPVOID proc);
56
57 /* Used to fill events in the queue */
58 #define GEN_EVENT(offset,data,xtime,seq)                                        \
59 {                                                                               \
60   /* If queue_len > 0, queuing is requested -> TRACE the event queued */        \
61   if (This->queue_len > 0) {                                                    \
62     int nq;                                                                     \
63     TRACE(" queueing %d at offset %d (queue head %d / size %d)\n",              \
64           (int) (data), (int) (offset),                                         \
65           (int) (This->queue_head), (int) (This->queue_len));                   \
66                                                                                 \
67     nq = This->queue_head+1;                                                    \
68     while (nq >= This->queue_len) nq -= This->queue_len;                        \
69     if ((offset >= 0) && (nq != This->queue_tail)) {                            \
70       This->data_queue[This->queue_head].dwOfs = offset;                        \
71       This->data_queue[This->queue_head].dwData = data;                         \
72       This->data_queue[This->queue_head].dwTimeStamp = xtime;                   \
73       This->data_queue[This->queue_head].dwSequence = seq;                      \
74       This->queue_head = nq;                                                    \
75     } else                                                                      \
76       This->overflow = TRUE;                                                    \
77   }                                                                             \
78 }
79
80 /**
81  * Callback Data used by specific callback 
82  *  for EnumObject on 'W' interfaces
83  */
84 typedef struct {
85   LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack;
86   LPVOID lpvRef;
87 } device_enumobjects_AtoWcb_data;
88
89 extern BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
90
91
92 /* Various debug tools */
93 extern void _dump_cooperativelevel_DI(DWORD dwFlags) ;
94 extern void _dump_EnumObjects_flags(DWORD dwFlags) ;
95 extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) ;
96 extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) ;
97 extern void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW *ddoi) ;
98 extern void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) ;
99 extern const char *_dump_dinput_GUID(const GUID *guid) ;
100
101 /* And the stubs */
102 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
103         LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
104 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
105         LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
106 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
107         LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
108 extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
109 extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj);
110 extern HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj);
111 extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
112         LPDIRECTINPUTDEVICE8A iface) ;
113 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
114         LPDIRECTINPUTDEVICE8A iface,
115         LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
116         LPVOID lpvRef,
117         DWORD dwFlags) ;
118 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
119         LPDIRECTINPUTDEVICE8W iface,
120         LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
121         LPVOID lpvRef,
122         DWORD dwFlags) ;
123 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
124         LPDIRECTINPUTDEVICE8A iface,
125         REFGUID rguid,
126         LPDIPROPHEADER pdiph) ;
127 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
128         LPDIRECTINPUTDEVICE8A iface,
129         LPDIDEVICEOBJECTINSTANCEA pdidoi,
130         DWORD dwObj,
131         DWORD dwHow) ;
132 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, 
133                                                              LPDIDEVICEOBJECTINSTANCEW pdidoi,
134                                                              DWORD dwObj,
135                                                              DWORD dwHow);
136 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
137         LPDIRECTINPUTDEVICE8A iface,
138         LPDIDEVICEINSTANCEA pdidi) ;
139 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
140         LPDIRECTINPUTDEVICE8W iface,
141         LPDIDEVICEINSTANCEW pdidi) ;
142 extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
143         LPDIRECTINPUTDEVICE8A iface,
144         HWND hwndOwner,
145         DWORD dwFlags) ;
146 extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
147         LPDIRECTINPUTDEVICE8A iface,
148         HINSTANCE hinst,
149         DWORD dwVersion,
150         REFGUID rguid) ;
151 extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
152         LPDIRECTINPUTDEVICE8A iface,
153         REFGUID rguid,
154         LPCDIEFFECT lpeff,
155         LPDIRECTINPUTEFFECT *ppdef,
156         LPUNKNOWN pUnkOuter) ;
157 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
158         LPDIRECTINPUTDEVICE8A iface,
159         LPDIENUMEFFECTSCALLBACKA lpCallback,
160         LPVOID lpvRef,
161         DWORD dwFlags) ;
162 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
163         LPDIRECTINPUTDEVICE8W iface,
164         LPDIENUMEFFECTSCALLBACKW lpCallback,
165         LPVOID lpvRef,
166         DWORD dwFlags) ;
167 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
168         LPDIRECTINPUTDEVICE8A iface,
169         LPDIEFFECTINFOA lpdei,
170         REFGUID rguid) ;
171 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
172         LPDIRECTINPUTDEVICE8W iface,
173         LPDIEFFECTINFOW lpdei,
174         REFGUID rguid) ;
175 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
176         LPDIRECTINPUTDEVICE8A iface,
177         LPDWORD pdwOut) ;
178 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
179         LPDIRECTINPUTDEVICE8A iface,
180         DWORD dwFlags) ;
181 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
182         LPDIRECTINPUTDEVICE8A iface,
183         LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
184         LPVOID lpvRef,
185         DWORD dwFlags) ;
186 extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
187         LPDIRECTINPUTDEVICE8A iface,
188         LPDIEFFESCAPE lpDIEEsc) ;
189 extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
190         LPDIRECTINPUTDEVICE8A iface) ;
191 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
192         LPDIRECTINPUTDEVICE8A iface,
193         DWORD cbObjectData,
194         LPCDIDEVICEOBJECTDATA rgdod,
195         LPDWORD pdwInOut,
196         DWORD dwFlags) ;
197 extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
198                                                                  LPCSTR lpszFileName,
199                                                                  LPDIENUMEFFECTSINFILECALLBACK pec,
200                                                                  LPVOID pvRef,
201                                                                  DWORD dwFlags) ;
202 extern HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
203                                                                  LPCWSTR lpszFileName,
204                                                                  LPDIENUMEFFECTSINFILECALLBACK pec,
205                                                                  LPVOID pvRef,
206                                                                  DWORD dwFlags) ;
207 extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
208                                                                  LPCSTR lpszFileName,
209                                                                  DWORD dwEntries,
210                                                                  LPDIFILEEFFECT rgDiFileEft,
211                                                                  DWORD dwFlags) ;
212 extern HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
213                                                                  LPCWSTR lpszFileName,
214                                                                  DWORD dwEntries,
215                                                                  LPDIFILEEFFECT rgDiFileEft,
216                                                                  DWORD dwFlags) ;
217 extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
218                                                               LPDIACTIONFORMATA lpdiaf,
219                                                               LPCSTR lpszUserName,
220                                                               DWORD dwFlags);
221 extern HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
222                                                               LPDIACTIONFORMATW lpdiaf,
223                                                               LPCWSTR lpszUserName,
224                                                               DWORD dwFlags);
225 extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
226                                                             LPDIACTIONFORMATA lpdiaf,
227                                                             LPCSTR lpszUserName,
228                                                             DWORD dwFlags);
229 extern HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
230                                                             LPDIACTIONFORMATW lpdiaf,
231                                                             LPCWSTR lpszUserName,
232                                                             DWORD dwFlags);
233 extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
234                                                             LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader);
235 extern HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
236                                                             LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader);
237
238 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */