Fixed warnings with gcc option "-Wwrite-strings".
[wine/wine64.git] / dlls / dinput / device.c
blob683b13feccb30db334a512f1cd0ca3fc0375d9d6
1 /* DirectInput Device
3 * Copyright 1998 Marcus Meissner
4 * Copyright 1998,1999 Lionel Ulmer
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /* This file contains all the Device specific functions that can be used as stubs
23 by real device implementations.
25 It also contains all the helper functions.
27 #include "config.h"
29 #include <stdarg.h>
30 #include <string.h>
31 #include "wine/debug.h"
32 #include "wine/unicode.h"
33 #include "windef.h"
34 #include "winbase.h"
35 #include "winerror.h"
36 #include "dinput.h"
37 #include "device_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(dinput);
41 /******************************************************************************
42 * Various debugging tools
44 void _dump_cooperativelevel_DI(DWORD dwFlags) {
45 int i;
46 const struct {
47 DWORD mask;
48 const char *name;
49 } flags[] = {
50 #define FE(x) { x, #x},
51 FE(DISCL_BACKGROUND)
52 FE(DISCL_EXCLUSIVE)
53 FE(DISCL_FOREGROUND)
54 FE(DISCL_NONEXCLUSIVE)
55 #undef FE
57 for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
58 if (flags[i].mask & dwFlags)
59 DPRINTF("%s ",flags[i].name);
60 DPRINTF("\n");
63 void _dump_EnumObjects_flags(DWORD dwFlags) {
64 int i;
65 const struct {
66 DWORD mask;
67 const char *name;
68 } flags[] = {
69 #define FE(x) { x, #x},
70 FE(DIDFT_ABSAXIS)
71 FE(DIDFT_ALL)
72 FE(DIDFT_AXIS)
73 FE(DIDFT_BUTTON)
74 FE(DIDFT_COLLECTION)
75 FE(DIDFT_FFACTUATOR)
76 FE(DIDFT_FFEFFECTTRIGGER)
77 FE(DIDFT_NOCOLLECTION)
78 FE(DIDFT_NODATA)
79 FE(DIDFT_OUTPUT)
80 FE(DIDFT_POV)
81 FE(DIDFT_PSHBUTTON)
82 FE(DIDFT_RELAXIS)
83 FE(DIDFT_TGLBUTTON)
84 #undef FE
86 if (dwFlags == DIDFT_ALL) {
87 DPRINTF("DIDFT_ALL");
88 return;
90 for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
91 if (flags[i].mask & dwFlags)
92 DPRINTF("%s ",flags[i].name);
93 if (dwFlags & DIDFT_INSTANCEMASK)
94 DPRINTF("Instance(%04lx) ", dwFlags >> 8);
97 void _dump_DIPROPHEADER(DIPROPHEADER *diph) {
98 DPRINTF(" - dwObj = 0x%08lx\n", diph->dwObj);
99 DPRINTF(" - dwHow = %s\n",
100 ((diph->dwHow == DIPH_DEVICE) ? "DIPH_DEVICE" :
101 ((diph->dwHow == DIPH_BYOFFSET) ? "DIPH_BYOFFSET" :
102 ((diph->dwHow == DIPH_BYID)) ? "DIPH_BYID" : "unknown")));
105 void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) {
106 if (TRACE_ON(dinput)) {
107 DPRINTF(" - enumerating : %s - %2ld - 0x%08lx - %s\n",
108 debugstr_guid(&ddoi->guidType), ddoi->dwOfs, ddoi->dwType, ddoi->tszName);
112 void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW *ddoi) {
113 if (TRACE_ON(dinput)) {
114 DPRINTF(" - enumerating : %s - %2ld - 0x%08lx - %s\n",
115 debugstr_guid(&ddoi->guidType), ddoi->dwOfs, ddoi->dwType, debugstr_w(ddoi->tszName));
119 /* Conversion between internal data buffer and external data buffer */
120 void fill_DataFormat(void *out, void *in, DataFormat *df) {
121 int i;
122 char *in_c = (char *) in;
123 char *out_c = (char *) out;
125 if (df->dt == NULL) {
126 /* This means that the app uses Wine's internal data format */
127 memcpy(out, in, df->internal_format_size);
128 } else {
129 for (i = 0; i < df->size; i++) {
130 if (df->dt[i].offset_in >= 0) {
131 switch (df->dt[i].size) {
132 case 1:
133 TRACE("Copying (c) to %d from %d (value %d)\n",
134 df->dt[i].offset_out, df->dt[i].offset_in, *((char *) (in_c + df->dt[i].offset_in)));
135 *((char *) (out_c + df->dt[i].offset_out)) = *((char *) (in_c + df->dt[i].offset_in));
136 break;
138 case 2:
139 TRACE("Copying (s) to %d from %d (value %d)\n",
140 df->dt[i].offset_out, df->dt[i].offset_in, *((short *) (in_c + df->dt[i].offset_in)));
141 *((short *) (out_c + df->dt[i].offset_out)) = *((short *) (in_c + df->dt[i].offset_in));
142 break;
144 case 4:
145 TRACE("Copying (i) to %d from %d (value %d)\n",
146 df->dt[i].offset_out, df->dt[i].offset_in, *((int *) (in_c + df->dt[i].offset_in)));
147 *((int *) (out_c + df->dt[i].offset_out)) = *((int *) (in_c + df->dt[i].offset_in));
148 break;
150 default:
151 memcpy((out_c + df->dt[i].offset_out), (in_c + df->dt[i].offset_in), df->dt[i].size);
153 } else {
154 switch (df->dt[i].size) {
155 case 1:
156 TRACE("Copying (c) to %d default value %d\n",
157 df->dt[i].offset_out, df->dt[i].value);
158 *((char *) (out_c + df->dt[i].offset_out)) = (char) df->dt[i].value;
159 break;
161 case 2:
162 TRACE("Copying (s) to %d default value %d\n",
163 df->dt[i].offset_out, df->dt[i].value);
164 *((short *) (out_c + df->dt[i].offset_out)) = (short) df->dt[i].value;
165 break;
167 case 4:
168 TRACE("Copying (i) to %d default value %d\n",
169 df->dt[i].offset_out, df->dt[i].value);
170 *((int *) (out_c + df->dt[i].offset_out)) = (int) df->dt[i].value;
171 break;
173 default:
174 memset((out_c + df->dt[i].offset_out), df->dt[i].size, 0);
181 DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) {
182 DataFormat *ret;
183 DataTransform *dt;
184 int i, j;
185 int same = 1;
186 int *done;
187 int index = 0;
189 ret = (DataFormat *) HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
191 done = (int *) HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
192 memset(done, 0, sizeof(int) * asked_format->dwNumObjs);
194 dt = (DataTransform *) HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
196 TRACE("Creating DataTransform : \n");
198 for (i = 0; i < wine_format->dwNumObjs; i++) {
199 offset[i] = -1;
201 for (j = 0; j < asked_format->dwNumObjs; j++) {
202 if (done[j] == 1)
203 continue;
205 if (((asked_format->rgodf[j].pguid == NULL) || (IsEqualGUID(wine_format->rgodf[i].pguid, asked_format->rgodf[j].pguid)))
207 (wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) {
209 done[j] = 1;
211 TRACE("Matching : \n");
212 TRACE(" - Asked (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n",
213 j, debugstr_guid(asked_format->rgodf[j].pguid),
214 asked_format->rgodf[j].dwOfs,
215 DIDFT_GETTYPE(asked_format->rgodf[j].dwType), DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType));
217 TRACE(" - Wine (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n",
218 j, debugstr_guid(wine_format->rgodf[i].pguid),
219 wine_format->rgodf[i].dwOfs,
220 DIDFT_GETTYPE(wine_format->rgodf[i].dwType), DIDFT_GETINSTANCE(wine_format->rgodf[i].dwType));
222 if (wine_format->rgodf[i].dwType & DIDFT_BUTTON)
223 dt[index].size = sizeof(BYTE);
224 else
225 dt[index].size = sizeof(DWORD);
226 dt[index].offset_in = wine_format ->rgodf[i].dwOfs;
227 dt[index].offset_out = asked_format->rgodf[j].dwOfs;
228 dt[index].value = 0;
229 index++;
231 if (wine_format->rgodf[i].dwOfs != asked_format->rgodf[j].dwOfs)
232 same = 0;
234 offset[i] = asked_format->rgodf[j].dwOfs;
235 break;
239 if (j == asked_format->dwNumObjs)
240 same = 0;
243 TRACE("Setting to default value :\n");
244 for (j = 0; j < asked_format->dwNumObjs; j++) {
245 if (done[j] == 0) {
246 TRACE(" - Asked (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n",
247 j, debugstr_guid(asked_format->rgodf[j].pguid),
248 asked_format->rgodf[j].dwOfs,
249 DIDFT_GETTYPE(asked_format->rgodf[j].dwType), DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType));
252 if (asked_format->rgodf[j].dwType & DIDFT_BUTTON)
253 dt[index].size = sizeof(BYTE);
254 else
255 dt[index].size = sizeof(DWORD);
256 dt[index].offset_in = -1;
257 dt[index].offset_out = asked_format->rgodf[j].dwOfs;
258 dt[index].value = 0;
259 index++;
261 same = 0;
265 ret->internal_format_size = wine_format->dwDataSize;
266 ret->size = index;
267 if (same) {
268 ret->dt = NULL;
269 HeapFree(GetProcessHeap(), 0, dt);
270 } else {
271 ret->dt = dt;
274 HeapFree(GetProcessHeap(), 0, done);
276 return ret;
279 BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA lpddi, LPVOID lpvRef) {
280 DIDEVICEOBJECTINSTANCEW ddtmp;
281 device_enumobjects_AtoWcb_data* data;
283 data = (device_enumobjects_AtoWcb_data*) lpvRef;
285 memset(&ddtmp, 0, sizeof(DIDEVICEINSTANCEW));
287 ddtmp.dwSize = sizeof(DIDEVICEINSTANCEW);
288 ddtmp.guidType = lpddi->guidType;
289 ddtmp.dwOfs = lpddi->dwOfs;
290 ddtmp.dwType = lpddi->dwType;
291 ddtmp.dwFlags = lpddi->dwFlags;
292 MultiByteToWideChar(CP_ACP, 0, lpddi->tszName, -1, ddtmp.tszName, MAX_PATH);
294 if (lpddi->dwSize == sizeof(DIDEVICEINSTANCEA)) {
296 * if dwSize < sizeof(DIDEVICEINSTANCEA of DInput version >= 5)
297 * force feedback and other newer datas aren't available
299 ddtmp.dwFFMaxForce = lpddi->dwFFMaxForce;
300 ddtmp.dwFFForceResolution = lpddi->dwFFForceResolution;
301 ddtmp.wCollectionNumber = lpddi->wCollectionNumber;
302 ddtmp.wDesignatorIndex = lpddi->wDesignatorIndex;
303 ddtmp.wUsagePage = lpddi->wUsagePage;
304 ddtmp.wUsage = lpddi->wUsage;
305 ddtmp.dwDimension = lpddi->dwDimension;
306 ddtmp.wExponent = lpddi->wExponent;
307 ddtmp.wReserved = lpddi->wReserved;
309 return data->lpCallBack(&ddtmp, data->lpvRef);
312 /******************************************************************************
313 * IDirectInputDeviceA
316 HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
317 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df
319 int i;
320 ICOM_THIS(IDirectInputDevice2AImpl,iface);
322 TRACE("(this=%p,%p)\n",This,df);
324 TRACE("df.dwSize=%ld\n",df->dwSize);
325 TRACE("(df.dwObjsize=%ld)\n",df->dwObjSize);
326 TRACE("(df.dwFlags=0x%08lx)\n",df->dwFlags);
327 TRACE("(df.dwDataSize=%ld)\n",df->dwDataSize);
328 TRACE("(df.dwNumObjs=%ld)\n",df->dwNumObjs);
330 for (i=0;i<df->dwNumObjs;i++) {
331 TRACE("df.rgodf[%d].guid %s\n",i,debugstr_guid(df->rgodf[i].pguid));
332 TRACE("df.rgodf[%d].dwOfs %ld\n",i,df->rgodf[i].dwOfs);
333 TRACE("dwType 0x%02x,dwInstance %d\n",DIDFT_GETTYPE(df->rgodf[i].dwType),DIDFT_GETINSTANCE(df->rgodf[i].dwType));
334 TRACE("df.rgodf[%d].dwFlags 0x%08lx\n",i,df->rgodf[i].dwFlags);
336 return DI_OK;
339 HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
340 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags
342 ICOM_THIS(IDirectInputDevice2AImpl,iface);
343 TRACE("(this=%p,0x%08lx,0x%08lx)\n",This,(DWORD)hwnd,dwflags);
344 if (TRACE_ON(dinput)) {
345 TRACE(" cooperative level : ");
346 _dump_cooperativelevel_DI(dwflags);
348 return DI_OK;
351 HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
352 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd
354 ICOM_THIS(IDirectInputDevice2AImpl,iface);
355 FIXME("(this=%p,0x%08lx): stub\n",This,(DWORD)hnd);
356 return DI_OK;
359 ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
361 ICOM_THIS(IDirectInputDevice2AImpl,iface);
362 This->ref--;
363 if (This->ref)
364 return This->ref;
365 HeapFree(GetProcessHeap(),0,This);
366 return DI_OK;
369 HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(
370 LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj
373 ICOM_THIS(IDirectInputDevice2AImpl,iface);
375 TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
376 if (IsEqualGUID(&IID_IUnknown,riid)) {
377 IDirectInputDevice2_AddRef(iface);
378 *ppobj = This;
379 return DI_OK;
381 if (IsEqualGUID(&IID_IDirectInputDeviceA,riid)) {
382 IDirectInputDevice2_AddRef(iface);
383 *ppobj = This;
384 return DI_OK;
386 if (IsEqualGUID(&IID_IDirectInputDevice2A,riid)) {
387 IDirectInputDevice2_AddRef(iface);
388 *ppobj = This;
389 return DI_OK;
391 if (IsEqualGUID(&IID_IDirectInputDevice7A,riid)) {
392 IDirectInputDevice7_AddRef(iface);
393 *ppobj = This;
394 return DI_OK;
396 TRACE("Unsupported interface !\n");
397 return E_FAIL;
400 HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(
401 LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj
404 ICOM_THIS(IDirectInputDevice2AImpl,iface);
406 TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
407 if (IsEqualGUID(&IID_IUnknown,riid)) {
408 IDirectInputDevice2_AddRef(iface);
409 *ppobj = This;
410 return DI_OK;
412 if (IsEqualGUID(&IID_IDirectInputDeviceW,riid)) {
413 IDirectInputDevice2_AddRef(iface);
414 *ppobj = This;
415 return DI_OK;
417 if (IsEqualGUID(&IID_IDirectInputDevice2W,riid)) {
418 IDirectInputDevice2_AddRef(iface);
419 *ppobj = This;
420 return DI_OK;
422 if (IsEqualGUID(&IID_IDirectInputDevice7W,riid)) {
423 IDirectInputDevice7_AddRef(iface);
424 *ppobj = This;
425 return DI_OK;
427 TRACE("Unsupported interface !\n");
428 return E_FAIL;
431 ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
432 LPDIRECTINPUTDEVICE8A iface)
434 ICOM_THIS(IDirectInputDevice2AImpl,iface);
435 return ++This->ref;
438 HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
439 LPDIRECTINPUTDEVICE8A iface,
440 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
441 LPVOID lpvRef,
442 DWORD dwFlags)
444 FIXME("(this=%p,%p,%p,%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags);
445 if (TRACE_ON(dinput)) {
446 DPRINTF(" - flags = ");
447 _dump_EnumObjects_flags(dwFlags);
448 DPRINTF("\n");
451 return DI_OK;
454 HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
455 LPDIRECTINPUTDEVICE8W iface,
456 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
457 LPVOID lpvRef,
458 DWORD dwFlags)
460 FIXME("(this=%p,%p,%p,%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags);
461 if (TRACE_ON(dinput)) {
462 DPRINTF(" - flags = ");
463 _dump_EnumObjects_flags(dwFlags);
464 DPRINTF("\n");
467 return DI_OK;
470 HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
471 LPDIRECTINPUTDEVICE8A iface,
472 REFGUID rguid,
473 LPDIPROPHEADER pdiph)
475 FIXME("(this=%p,%s,%p): stub!\n",
476 iface, debugstr_guid(rguid), pdiph);
478 if (TRACE_ON(dinput))
479 _dump_DIPROPHEADER(pdiph);
481 return DI_OK;
484 HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
485 LPDIRECTINPUTDEVICE8A iface,
486 LPDIDEVICEOBJECTINSTANCEA pdidoi,
487 DWORD dwObj,
488 DWORD dwHow)
490 FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n",
491 iface, pdidoi, dwObj, dwHow);
493 return DI_OK;
496 HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
497 LPDIRECTINPUTDEVICE8W iface,
498 LPDIDEVICEOBJECTINSTANCEW pdidoi,
499 DWORD dwObj,
500 DWORD dwHow)
502 FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n",
503 iface, pdidoi, dwObj, dwHow);
505 return DI_OK;
508 HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
509 LPDIRECTINPUTDEVICE8A iface,
510 LPDIDEVICEINSTANCEA pdidi)
512 FIXME("(this=%p,%p): stub!\n",
513 iface, pdidi);
515 return DI_OK;
517 HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
518 LPDIRECTINPUTDEVICE8W iface,
519 LPDIDEVICEINSTANCEW pdidi)
521 FIXME("(this=%p,%p): stub!\n",
522 iface, pdidi);
524 return DI_OK;
527 HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
528 LPDIRECTINPUTDEVICE8A iface,
529 HWND hwndOwner,
530 DWORD dwFlags)
532 FIXME("(this=%p,%p,0x%08lx): stub!\n",
533 iface, hwndOwner, dwFlags);
535 return DI_OK;
538 HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
539 LPDIRECTINPUTDEVICE8A iface,
540 HINSTANCE hinst,
541 DWORD dwVersion,
542 REFGUID rguid)
544 FIXME("(this=%p,%p,%ld,%s): stub!\n",
545 iface, hinst, dwVersion, debugstr_guid(rguid));
546 return DI_OK;
549 /******************************************************************************
550 * IDirectInputDevice2A
553 HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
554 LPDIRECTINPUTDEVICE8A iface,
555 REFGUID rguid,
556 LPCDIEFFECT lpeff,
557 LPDIRECTINPUTEFFECT *ppdef,
558 LPUNKNOWN pUnkOuter)
560 FIXME("(this=%p,%s,%p,%p,%p): stub!\n",
561 iface, debugstr_guid(rguid), lpeff, ppdef, pUnkOuter);
562 return DI_OK;
565 HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
566 LPDIRECTINPUTDEVICE8A iface,
567 LPDIENUMEFFECTSCALLBACKA lpCallback,
568 LPVOID lpvRef,
569 DWORD dwFlags)
571 FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
572 iface, lpCallback, lpvRef, dwFlags);
574 if (lpCallback)
575 lpCallback(NULL, lpvRef);
576 return DI_OK;
579 HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
580 LPDIRECTINPUTDEVICE8W iface,
581 LPDIENUMEFFECTSCALLBACKW lpCallback,
582 LPVOID lpvRef,
583 DWORD dwFlags)
585 FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
586 iface, lpCallback, lpvRef, dwFlags);
588 if (lpCallback)
589 lpCallback(NULL, lpvRef);
590 return DI_OK;
593 HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
594 LPDIRECTINPUTDEVICE8A iface,
595 LPDIEFFECTINFOA lpdei,
596 REFGUID rguid)
598 FIXME("(this=%p,%p,%s): stub!\n",
599 iface, lpdei, debugstr_guid(rguid));
600 return DI_OK;
603 HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
604 LPDIRECTINPUTDEVICE8W iface,
605 LPDIEFFECTINFOW lpdei,
606 REFGUID rguid)
608 FIXME("(this=%p,%p,%s): stub!\n",
609 iface, lpdei, debugstr_guid(rguid));
610 return DI_OK;
613 HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
614 LPDIRECTINPUTDEVICE8A iface,
615 LPDWORD pdwOut)
617 FIXME("(this=%p,%p): stub!\n",
618 iface, pdwOut);
619 return DI_OK;
622 HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
623 LPDIRECTINPUTDEVICE8A iface,
624 DWORD dwFlags)
626 FIXME("(this=%p,0x%08lx): stub!\n",
627 iface, dwFlags);
628 return DI_OK;
631 HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
632 LPDIRECTINPUTDEVICE8A iface,
633 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
634 LPVOID lpvRef,
635 DWORD dwFlags)
637 FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
638 iface, lpCallback, lpvRef, dwFlags);
639 if (lpCallback)
640 lpCallback(NULL, lpvRef);
641 return DI_OK;
644 HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
645 LPDIRECTINPUTDEVICE8A iface,
646 LPDIEFFESCAPE lpDIEEsc)
648 FIXME("(this=%p,%p): stub!\n",
649 iface, lpDIEEsc);
650 return DI_OK;
653 HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
654 LPDIRECTINPUTDEVICE8A iface)
656 /* Because wine devices do not need to be polled, just return DI_NOEFFECT */
657 return DI_NOEFFECT;
660 HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
661 LPDIRECTINPUTDEVICE8A iface,
662 DWORD cbObjectData,
663 LPCDIDEVICEOBJECTDATA rgdod,
664 LPDWORD pdwInOut,
665 DWORD dwFlags)
667 FIXME("(this=%p,0x%08lx,%p,%p,0x%08lx): stub!\n",
668 iface, cbObjectData, rgdod, pdwInOut, dwFlags);
670 return DI_OK;
673 HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
674 LPCSTR lpszFileName,
675 LPDIENUMEFFECTSINFILECALLBACK pec,
676 LPVOID pvRef,
677 DWORD dwFlags)
679 FIXME("(%p)->(%s,%p,%p,%08lx): stub !\n", iface, lpszFileName, pec, pvRef, dwFlags);
681 return DI_OK;
684 HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
685 LPCWSTR lpszFileName,
686 LPDIENUMEFFECTSINFILECALLBACK pec,
687 LPVOID pvRef,
688 DWORD dwFlags)
690 FIXME("(%p)->(%s,%p,%p,%08lx): stub !\n", iface, debugstr_w(lpszFileName), pec, pvRef, dwFlags);
692 return DI_OK;
695 HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
696 LPCSTR lpszFileName,
697 DWORD dwEntries,
698 LPDIFILEEFFECT rgDiFileEft,
699 DWORD dwFlags)
701 FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, lpszFileName, dwEntries, rgDiFileEft, dwFlags);
703 return DI_OK;
706 HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
707 LPCWSTR lpszFileName,
708 DWORD dwEntries,
709 LPDIFILEEFFECT rgDiFileEft,
710 DWORD dwFlags)
712 FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, debugstr_w(lpszFileName), dwEntries, rgDiFileEft, dwFlags);
714 return DI_OK;
717 HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
718 LPDIACTIONFORMATA lpdiaf,
719 LPCSTR lpszUserName,
720 DWORD dwFlags)
722 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, lpszUserName, dwFlags);
724 return DI_OK;
727 HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
728 LPDIACTIONFORMATW lpdiaf,
729 LPCWSTR lpszUserName,
730 DWORD dwFlags)
732 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
734 return DI_OK;
737 HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
738 LPDIACTIONFORMATA lpdiaf,
739 LPCSTR lpszUserName,
740 DWORD dwFlags)
742 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, lpszUserName, dwFlags);
744 return DI_OK;
747 HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
748 LPDIACTIONFORMATW lpdiaf,
749 LPCWSTR lpszUserName,
750 DWORD dwFlags)
752 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
754 return DI_OK;
757 HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
758 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader)
760 FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader);
762 return DI_OK;
765 HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
766 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader)
768 FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader);
770 return DI_OK;