Version resources cleanup.
[wine/wine64.git] / dlls / dinput / device.c
blob9a2ec320b1a7530670ebd9a9ea58bb88e529bb28
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 if (TRACE_ON(dinput)) {
46 unsigned int i;
47 static const struct {
48 DWORD mask;
49 const char *name;
50 } flags[] = {
51 #define FE(x) { x, #x}
52 FE(DISCL_BACKGROUND),
53 FE(DISCL_EXCLUSIVE),
54 FE(DISCL_FOREGROUND),
55 FE(DISCL_NONEXCLUSIVE)
56 #undef FE
58 for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++)
59 if (flags[i].mask & dwFlags)
60 DPRINTF("%s ",flags[i].name);
61 DPRINTF("\n");
65 void _dump_EnumObjects_flags(DWORD dwFlags) {
66 if (TRACE_ON(dinput)) {
67 unsigned int i;
68 DWORD type, instance;
69 static const struct {
70 DWORD mask;
71 const char *name;
72 } flags[] = {
73 #define FE(x) { x, #x}
74 FE(DIDFT_RELAXIS),
75 FE(DIDFT_ABSAXIS),
76 FE(DIDFT_PSHBUTTON),
77 FE(DIDFT_TGLBUTTON),
78 FE(DIDFT_POV),
79 FE(DIDFT_COLLECTION),
80 FE(DIDFT_NODATA),
81 FE(DIDFT_FFACTUATOR),
82 FE(DIDFT_FFEFFECTTRIGGER),
83 FE(DIDFT_OUTPUT)
84 #undef FE
86 type = (dwFlags & 0xFF0000FF);
87 instance = ((dwFlags >> 8) & 0xFFFF);
88 DPRINTF("Type:");
89 if (type == DIDFT_ALL) {
90 DPRINTF(" DIDFT_ALL");
91 } else {
92 for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) {
93 if (flags[i].mask & type) {
94 type &= ~flags[i].mask;
95 DPRINTF(" %s",flags[i].name);
98 if (type) {
99 DPRINTF(" (unhandled: %08lx)", type);
102 DPRINTF(" / Instance: ");
103 if (instance == ((DIDFT_ANYINSTANCE >> 8) & 0xFFFF)) {
104 DPRINTF("DIDFT_ANYINSTANCE");
105 } else {
106 DPRINTF("%3ld", instance);
111 void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) {
112 if (TRACE_ON(dinput)) {
113 DPRINTF(" - dwObj = 0x%08lx\n", diph->dwObj);
114 DPRINTF(" - dwHow = %s\n",
115 ((diph->dwHow == DIPH_DEVICE) ? "DIPH_DEVICE" :
116 ((diph->dwHow == DIPH_BYOFFSET) ? "DIPH_BYOFFSET" :
117 ((diph->dwHow == DIPH_BYID)) ? "DIPH_BYID" : "unknown")));
121 void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) {
122 if (TRACE_ON(dinput)) {
123 DPRINTF(" - enumerating : %s ('%s') - %2ld - 0x%08lx - %s\n",
124 debugstr_guid(&ddoi->guidType), _dump_dinput_GUID(&ddoi->guidType), ddoi->dwOfs, ddoi->dwType, ddoi->tszName);
128 void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW *ddoi) {
129 if (TRACE_ON(dinput)) {
130 DPRINTF(" - enumerating : %s ('%s'), - %2ld - 0x%08lx - %s\n",
131 debugstr_guid(&ddoi->guidType), _dump_dinput_GUID(&ddoi->guidType), ddoi->dwOfs, ddoi->dwType, debugstr_w(ddoi->tszName));
135 /* This function is a helper to convert a GUID into any possible DInput GUID out there */
136 const char *_dump_dinput_GUID(const GUID *guid) {
137 unsigned int i;
138 static const struct {
139 const GUID *guid;
140 const char *name;
141 } guids[] = {
142 #define FE(x) { &x, #x}
143 FE(GUID_XAxis),
144 FE(GUID_YAxis),
145 FE(GUID_ZAxis),
146 FE(GUID_RxAxis),
147 FE(GUID_RyAxis),
148 FE(GUID_RzAxis),
149 FE(GUID_Slider),
150 FE(GUID_Button),
151 FE(GUID_Key),
152 FE(GUID_POV),
153 FE(GUID_Unknown),
154 FE(GUID_SysMouse),
155 FE(GUID_SysKeyboard),
156 FE(GUID_Joystick),
157 FE(GUID_ConstantForce),
158 FE(GUID_RampForce),
159 FE(GUID_Square),
160 FE(GUID_Sine),
161 FE(GUID_Triangle),
162 FE(GUID_SawtoothUp),
163 FE(GUID_SawtoothDown),
164 FE(GUID_Spring),
165 FE(GUID_Damper),
166 FE(GUID_Inertia),
167 FE(GUID_Friction),
168 FE(GUID_CustomForce)
169 #undef FE
171 if (guid == NULL)
172 return "null GUID";
173 for (i = 0; i < (sizeof(guids) / sizeof(guids[0])); i++) {
174 if (IsEqualGUID(guids[i].guid, guid)) {
175 return guids[i].name;
178 return "Unknown GUID";
181 void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) {
182 unsigned int i;
184 TRACE("Dumping DIDATAFORMAT structure:\n");
185 TRACE(" - dwSize: %ld\n", df->dwSize);
186 if (df->dwSize != sizeof(DIDATAFORMAT)) {
187 WARN("Non-standard DIDATAFORMAT structure size (%ld instead of %d).\n", df->dwSize, sizeof(DIDATAFORMAT));
189 TRACE(" - dwObjsize: %ld\n", df->dwObjSize);
190 if (df->dwObjSize != sizeof(DIOBJECTDATAFORMAT)) {
191 WARN("Non-standard DIOBJECTDATAFORMAT structure size (%ld instead of %d).\n", df->dwObjSize, sizeof(DIOBJECTDATAFORMAT));
193 TRACE(" - dwFlags: 0x%08lx (", df->dwFlags);
194 switch (df->dwFlags) {
195 case DIDF_ABSAXIS: TRACE("DIDF_ABSAXIS"); break;
196 case DIDF_RELAXIS: TRACE("DIDF_RELAXIS"); break;
197 default: TRACE("unknown"); break;
199 TRACE(")\n");
200 TRACE(" - dwDataSize: %ld\n", df->dwDataSize);
201 TRACE(" - dwNumObjs: %ld\n", df->dwNumObjs);
203 for (i = 0; i < df->dwNumObjs; i++) {
204 TRACE(" - Object %d:\n", i);
205 TRACE(" * GUID: %s ('%s')\n", debugstr_guid(df->rgodf[i].pguid), _dump_dinput_GUID(df->rgodf[i].pguid));
206 TRACE(" * dwOfs: %ld\n", df->rgodf[i].dwOfs);
207 TRACE(" * dwType: 0x%08lx\n", df->rgodf[i].dwType);
208 TRACE(" "); _dump_EnumObjects_flags(df->rgodf[i].dwType); TRACE("\n");
209 TRACE(" * dwFlags: 0x%08lx\n", df->rgodf[i].dwFlags);
213 /* Conversion between internal data buffer and external data buffer */
214 void fill_DataFormat(void *out, const void *in, DataFormat *df) {
215 int i;
216 char *in_c = (char *) in;
217 char *out_c = (char *) out;
219 if (df->dt == NULL) {
220 /* This means that the app uses Wine's internal data format */
221 memcpy(out, in, df->internal_format_size);
222 } else {
223 for (i = 0; i < df->size; i++) {
224 if (df->dt[i].offset_in >= 0) {
225 switch (df->dt[i].size) {
226 case 1:
227 TRACE("Copying (c) to %d from %d (value %d)\n",
228 df->dt[i].offset_out, df->dt[i].offset_in, *((char *) (in_c + df->dt[i].offset_in)));
229 *((char *) (out_c + df->dt[i].offset_out)) = *((char *) (in_c + df->dt[i].offset_in));
230 break;
232 case 2:
233 TRACE("Copying (s) to %d from %d (value %d)\n",
234 df->dt[i].offset_out, df->dt[i].offset_in, *((short *) (in_c + df->dt[i].offset_in)));
235 *((short *) (out_c + df->dt[i].offset_out)) = *((short *) (in_c + df->dt[i].offset_in));
236 break;
238 case 4:
239 TRACE("Copying (i) to %d from %d (value %d)\n",
240 df->dt[i].offset_out, df->dt[i].offset_in, *((int *) (in_c + df->dt[i].offset_in)));
241 *((int *) (out_c + df->dt[i].offset_out)) = *((int *) (in_c + df->dt[i].offset_in));
242 break;
244 default:
245 memcpy((out_c + df->dt[i].offset_out), (in_c + df->dt[i].offset_in), df->dt[i].size);
246 break;
248 } else {
249 switch (df->dt[i].size) {
250 case 1:
251 TRACE("Copying (c) to %d default value %d\n",
252 df->dt[i].offset_out, df->dt[i].value);
253 *((char *) (out_c + df->dt[i].offset_out)) = (char) df->dt[i].value;
254 break;
256 case 2:
257 TRACE("Copying (s) to %d default value %d\n",
258 df->dt[i].offset_out, df->dt[i].value);
259 *((short *) (out_c + df->dt[i].offset_out)) = (short) df->dt[i].value;
260 break;
262 case 4:
263 TRACE("Copying (i) to %d default value %d\n",
264 df->dt[i].offset_out, df->dt[i].value);
265 *((int *) (out_c + df->dt[i].offset_out)) = (int) df->dt[i].value;
266 break;
268 default:
269 memset((out_c + df->dt[i].offset_out), df->dt[i].size, 0);
270 break;
277 void release_DataFormat(DataFormat * format)
279 TRACE("Deleting DataTransform : \n");
281 HeapFree(GetProcessHeap(), 0, format->dt);
284 DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) {
285 DataFormat *ret;
286 DataTransform *dt;
287 unsigned int i, j;
288 int same = 1;
289 int *done;
290 int index = 0;
291 DWORD next = 0;
293 ret = (DataFormat *) HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
295 done = (int *) HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
296 memset(done, 0, sizeof(int) * asked_format->dwNumObjs);
298 dt = (DataTransform *) HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
300 TRACE("Creating DataTransform : \n");
302 for (i = 0; i < wine_format->dwNumObjs; i++) {
303 offset[i] = -1;
305 for (j = 0; j < asked_format->dwNumObjs; j++) {
306 if (done[j] == 1)
307 continue;
309 if (/* Check if the application either requests any GUID and if not, it if matches
310 * the GUID of the Wine object.
312 ((asked_format->rgodf[j].pguid == NULL) ||
313 (IsEqualGUID(wine_format->rgodf[i].pguid, asked_format->rgodf[j].pguid)))
315 (/* Then check if it accepts any instance id, and if not, if it matches Wine's
316 * instance id.
318 ((asked_format->rgodf[j].dwType & 0x00FFFF00) == DIDFT_ANYINSTANCE) ||
319 (DIDFT_GETINSTANCE(wine_format->rgodf[i].dwType) == DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType)))) {
321 done[j] = 1;
323 TRACE("Matching : \n");
324 TRACE(" - Asked (%d) :\n", j);
325 TRACE(" * GUID: %s ('%s')\n",
326 debugstr_guid(asked_format->rgodf[j].pguid),
327 _dump_dinput_GUID(asked_format->rgodf[j].pguid));
328 TRACE(" * Offset: %3ld\n", asked_format->rgodf[j].dwOfs);
329 TRACE(" * dwType: %08lx\n", asked_format->rgodf[j].dwType);
330 TRACE(" "); _dump_EnumObjects_flags(asked_format->rgodf[j].dwType); TRACE("\n");
332 TRACE(" - Wine (%d) :\n", j);
333 TRACE(" * GUID: %s ('%s')\n",
334 debugstr_guid(wine_format->rgodf[j].pguid),
335 _dump_dinput_GUID(wine_format->rgodf[j].pguid));
336 TRACE(" * Offset: %3ld\n", wine_format->rgodf[j].dwOfs);
337 TRACE(" * dwType: %08lx\n", wine_format->rgodf[j].dwType);
338 TRACE(" "); _dump_EnumObjects_flags(wine_format->rgodf[j].dwType); TRACE("\n");
340 if (wine_format->rgodf[i].dwType & DIDFT_BUTTON)
341 dt[index].size = sizeof(BYTE);
342 else
343 dt[index].size = sizeof(DWORD);
344 dt[index].offset_in = wine_format ->rgodf[i].dwOfs;
345 if (asked_format->rgodf[j].dwOfs < next) {
346 WARN("bad format: dwOfs=%ld, changing to %ld\n", asked_format->rgodf[j].dwOfs, next);
347 dt[index].offset_out = next;
348 offset[i] = next;
349 } else {
350 dt[index].offset_out = asked_format->rgodf[j].dwOfs;
351 offset[i] = asked_format->rgodf[j].dwOfs;
353 dt[index].value = 0;
354 next = next + dt[index].size;
356 if (wine_format->rgodf[i].dwOfs != dt[index].offset_out)
357 same = 0;
359 index++;
360 break;
364 if (j == asked_format->dwNumObjs)
365 same = 0;
368 TRACE("Setting to default value :\n");
369 for (j = 0; j < asked_format->dwNumObjs; j++) {
370 if (done[j] == 0) {
371 TRACE(" - Asked (%d) :\n", j);
372 TRACE(" * GUID: %s ('%s')\n",
373 debugstr_guid(asked_format->rgodf[j].pguid),
374 _dump_dinput_GUID(asked_format->rgodf[j].pguid));
375 TRACE(" * Offset: %3ld\n", asked_format->rgodf[j].dwOfs);
376 TRACE(" * dwType: %08lx\n", asked_format->rgodf[j].dwType);
377 TRACE(" "); _dump_EnumObjects_flags(asked_format->rgodf[j].dwType); TRACE("\n");
379 if (asked_format->rgodf[j].dwType & DIDFT_BUTTON)
380 dt[index].size = sizeof(BYTE);
381 else
382 dt[index].size = sizeof(DWORD);
383 dt[index].offset_in = -1;
384 dt[index].offset_out = asked_format->rgodf[j].dwOfs;
385 dt[index].value = 0;
386 index++;
388 same = 0;
392 ret->internal_format_size = wine_format->dwDataSize;
393 ret->size = index;
394 if (same) {
395 ret->dt = NULL;
396 HeapFree(GetProcessHeap(), 0, dt);
397 } else {
398 ret->dt = dt;
401 HeapFree(GetProcessHeap(), 0, done);
403 return ret;
406 BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA lpddi, LPVOID lpvRef) {
407 DIDEVICEOBJECTINSTANCEW ddtmp;
408 device_enumobjects_AtoWcb_data* data;
410 data = (device_enumobjects_AtoWcb_data*) lpvRef;
412 memset(&ddtmp, 0, sizeof(DIDEVICEINSTANCEW));
414 ddtmp.dwSize = sizeof(DIDEVICEINSTANCEW);
415 ddtmp.guidType = lpddi->guidType;
416 ddtmp.dwOfs = lpddi->dwOfs;
417 ddtmp.dwType = lpddi->dwType;
418 ddtmp.dwFlags = lpddi->dwFlags;
419 MultiByteToWideChar(CP_ACP, 0, lpddi->tszName, -1, ddtmp.tszName, MAX_PATH);
421 if (lpddi->dwSize == sizeof(DIDEVICEINSTANCEA)) {
423 * if dwSize < sizeof(DIDEVICEINSTANCEA of DInput version >= 5)
424 * force feedback and other newer datas aren't available
426 ddtmp.dwFFMaxForce = lpddi->dwFFMaxForce;
427 ddtmp.dwFFForceResolution = lpddi->dwFFForceResolution;
428 ddtmp.wCollectionNumber = lpddi->wCollectionNumber;
429 ddtmp.wDesignatorIndex = lpddi->wDesignatorIndex;
430 ddtmp.wUsagePage = lpddi->wUsagePage;
431 ddtmp.wUsage = lpddi->wUsage;
432 ddtmp.dwDimension = lpddi->dwDimension;
433 ddtmp.wExponent = lpddi->wExponent;
434 ddtmp.wReserved = lpddi->wReserved;
436 return data->lpCallBack(&ddtmp, data->lpvRef);
439 /******************************************************************************
440 * IDirectInputDeviceA
443 HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
444 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df
446 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
448 TRACE("(this=%p,%p)\n",This,df);
450 _dump_DIDATAFORMAT(df);
452 return DI_OK;
455 HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
456 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags
458 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
459 TRACE("(this=%p,0x%08lx,0x%08lx)\n",This,(DWORD)hwnd,dwflags);
460 if (TRACE_ON(dinput)) {
461 TRACE(" cooperative level : ");
462 _dump_cooperativelevel_DI(dwflags);
464 return DI_OK;
467 HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
468 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd
470 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
471 FIXME("(this=%p,0x%08lx): stub\n",This,(DWORD)hnd);
472 return DI_OK;
475 ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
477 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
478 ULONG ref;
479 ref = InterlockedDecrement(&(This->ref));
480 if (ref == 0)
481 HeapFree(GetProcessHeap(),0,This);
482 return ref;
485 HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(
486 LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj
489 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
491 TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
492 if (IsEqualGUID(&IID_IUnknown,riid)) {
493 IDirectInputDevice2_AddRef(iface);
494 *ppobj = This;
495 return DI_OK;
497 if (IsEqualGUID(&IID_IDirectInputDeviceA,riid)) {
498 IDirectInputDevice2_AddRef(iface);
499 *ppobj = This;
500 return DI_OK;
502 if (IsEqualGUID(&IID_IDirectInputDevice2A,riid)) {
503 IDirectInputDevice2_AddRef(iface);
504 *ppobj = This;
505 return DI_OK;
507 if (IsEqualGUID(&IID_IDirectInputDevice7A,riid)) {
508 IDirectInputDevice7_AddRef(iface);
509 *ppobj = This;
510 return DI_OK;
512 TRACE("Unsupported interface !\n");
513 return E_FAIL;
516 HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(
517 LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj
520 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
522 TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
523 if (IsEqualGUID(&IID_IUnknown,riid)) {
524 IDirectInputDevice2_AddRef(iface);
525 *ppobj = This;
526 return DI_OK;
528 if (IsEqualGUID(&IID_IDirectInputDeviceW,riid)) {
529 IDirectInputDevice2_AddRef(iface);
530 *ppobj = This;
531 return DI_OK;
533 if (IsEqualGUID(&IID_IDirectInputDevice2W,riid)) {
534 IDirectInputDevice2_AddRef(iface);
535 *ppobj = This;
536 return DI_OK;
538 if (IsEqualGUID(&IID_IDirectInputDevice7W,riid)) {
539 IDirectInputDevice7_AddRef(iface);
540 *ppobj = This;
541 return DI_OK;
543 TRACE("Unsupported interface !\n");
544 return E_FAIL;
547 ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
548 LPDIRECTINPUTDEVICE8A iface)
550 IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface;
551 return InterlockedIncrement(&(This->ref));
554 HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
555 LPDIRECTINPUTDEVICE8A iface,
556 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
557 LPVOID lpvRef,
558 DWORD dwFlags)
560 FIXME("(this=%p,%p,%p,%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags);
561 if (TRACE_ON(dinput)) {
562 DPRINTF(" - flags = ");
563 _dump_EnumObjects_flags(dwFlags);
564 DPRINTF("\n");
567 return DI_OK;
570 HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
571 LPDIRECTINPUTDEVICE8W iface,
572 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
573 LPVOID lpvRef,
574 DWORD dwFlags)
576 FIXME("(this=%p,%p,%p,%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags);
577 if (TRACE_ON(dinput)) {
578 DPRINTF(" - flags = ");
579 _dump_EnumObjects_flags(dwFlags);
580 DPRINTF("\n");
583 return DI_OK;
586 HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
587 LPDIRECTINPUTDEVICE8A iface,
588 REFGUID rguid,
589 LPDIPROPHEADER pdiph)
591 FIXME("(this=%p,%s,%p): stub!\n",
592 iface, debugstr_guid(rguid), pdiph);
594 if (TRACE_ON(dinput))
595 _dump_DIPROPHEADER(pdiph);
597 return DI_OK;
600 HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
601 LPDIRECTINPUTDEVICE8A iface,
602 LPDIDEVICEOBJECTINSTANCEA pdidoi,
603 DWORD dwObj,
604 DWORD dwHow)
606 FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n",
607 iface, pdidoi, dwObj, dwHow);
609 return DI_OK;
612 HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(
613 LPDIRECTINPUTDEVICE8W iface,
614 LPDIDEVICEOBJECTINSTANCEW pdidoi,
615 DWORD dwObj,
616 DWORD dwHow)
618 FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n",
619 iface, pdidoi, dwObj, dwHow);
621 return DI_OK;
624 HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
625 LPDIRECTINPUTDEVICE8A iface,
626 LPDIDEVICEINSTANCEA pdidi)
628 FIXME("(this=%p,%p): stub!\n",
629 iface, pdidi);
631 return DI_OK;
634 HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
635 LPDIRECTINPUTDEVICE8W iface,
636 LPDIDEVICEINSTANCEW pdidi)
638 FIXME("(this=%p,%p): stub!\n",
639 iface, pdidi);
641 return DI_OK;
644 HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
645 LPDIRECTINPUTDEVICE8A iface,
646 HWND hwndOwner,
647 DWORD dwFlags)
649 FIXME("(this=%p,%p,0x%08lx): stub!\n",
650 iface, hwndOwner, dwFlags);
652 return DI_OK;
655 HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
656 LPDIRECTINPUTDEVICE8A iface,
657 HINSTANCE hinst,
658 DWORD dwVersion,
659 REFGUID rguid)
661 FIXME("(this=%p,%p,%ld,%s): stub!\n",
662 iface, hinst, dwVersion, debugstr_guid(rguid));
663 return DI_OK;
666 /******************************************************************************
667 * IDirectInputDevice2A
670 HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
671 LPDIRECTINPUTDEVICE8A iface,
672 REFGUID rguid,
673 LPCDIEFFECT lpeff,
674 LPDIRECTINPUTEFFECT *ppdef,
675 LPUNKNOWN pUnkOuter)
677 FIXME("(this=%p,%s,%p,%p,%p): stub!\n",
678 iface, debugstr_guid(rguid), lpeff, ppdef, pUnkOuter);
679 return DI_OK;
682 HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
683 LPDIRECTINPUTDEVICE8A iface,
684 LPDIENUMEFFECTSCALLBACKA lpCallback,
685 LPVOID lpvRef,
686 DWORD dwFlags)
688 FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
689 iface, lpCallback, lpvRef, dwFlags);
691 return DI_OK;
694 HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
695 LPDIRECTINPUTDEVICE8W iface,
696 LPDIENUMEFFECTSCALLBACKW lpCallback,
697 LPVOID lpvRef,
698 DWORD dwFlags)
700 FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
701 iface, lpCallback, lpvRef, dwFlags);
703 return DI_OK;
706 HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
707 LPDIRECTINPUTDEVICE8A iface,
708 LPDIEFFECTINFOA lpdei,
709 REFGUID rguid)
711 FIXME("(this=%p,%p,%s): stub!\n",
712 iface, lpdei, debugstr_guid(rguid));
713 return DI_OK;
716 HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
717 LPDIRECTINPUTDEVICE8W iface,
718 LPDIEFFECTINFOW lpdei,
719 REFGUID rguid)
721 FIXME("(this=%p,%p,%s): stub!\n",
722 iface, lpdei, debugstr_guid(rguid));
723 return DI_OK;
726 HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
727 LPDIRECTINPUTDEVICE8A iface,
728 LPDWORD pdwOut)
730 FIXME("(this=%p,%p): stub!\n",
731 iface, pdwOut);
732 return DI_OK;
735 HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
736 LPDIRECTINPUTDEVICE8A iface,
737 DWORD dwFlags)
739 FIXME("(this=%p,0x%08lx): stub!\n",
740 iface, dwFlags);
741 return DI_OK;
744 HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
745 LPDIRECTINPUTDEVICE8A iface,
746 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
747 LPVOID lpvRef,
748 DWORD dwFlags)
750 FIXME("(this=%p,%p,%p,0x%08lx): stub!\n",
751 iface, lpCallback, lpvRef, dwFlags);
752 if (lpCallback)
753 lpCallback(NULL, lpvRef);
754 return DI_OK;
757 HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
758 LPDIRECTINPUTDEVICE8A iface,
759 LPDIEFFESCAPE lpDIEEsc)
761 FIXME("(this=%p,%p): stub!\n",
762 iface, lpDIEEsc);
763 return DI_OK;
766 HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
767 LPDIRECTINPUTDEVICE8A iface)
769 /* Because wine devices do not need to be polled, just return DI_NOEFFECT */
770 return DI_NOEFFECT;
773 HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
774 LPDIRECTINPUTDEVICE8A iface,
775 DWORD cbObjectData,
776 LPCDIDEVICEOBJECTDATA rgdod,
777 LPDWORD pdwInOut,
778 DWORD dwFlags)
780 FIXME("(this=%p,0x%08lx,%p,%p,0x%08lx): stub!\n",
781 iface, cbObjectData, rgdod, pdwInOut, dwFlags);
783 return DI_OK;
786 HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
787 LPCSTR lpszFileName,
788 LPDIENUMEFFECTSINFILECALLBACK pec,
789 LPVOID pvRef,
790 DWORD dwFlags)
792 FIXME("(%p)->(%s,%p,%p,%08lx): stub !\n", iface, lpszFileName, pec, pvRef, dwFlags);
794 return DI_OK;
797 HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
798 LPCWSTR lpszFileName,
799 LPDIENUMEFFECTSINFILECALLBACK pec,
800 LPVOID pvRef,
801 DWORD dwFlags)
803 FIXME("(%p)->(%s,%p,%p,%08lx): stub !\n", iface, debugstr_w(lpszFileName), pec, pvRef, dwFlags);
805 return DI_OK;
808 HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
809 LPCSTR lpszFileName,
810 DWORD dwEntries,
811 LPDIFILEEFFECT rgDiFileEft,
812 DWORD dwFlags)
814 FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, lpszFileName, dwEntries, rgDiFileEft, dwFlags);
816 return DI_OK;
819 HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
820 LPCWSTR lpszFileName,
821 DWORD dwEntries,
822 LPDIFILEEFFECT rgDiFileEft,
823 DWORD dwFlags)
825 FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, debugstr_w(lpszFileName), dwEntries, rgDiFileEft, dwFlags);
827 return DI_OK;
830 HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
831 LPDIACTIONFORMATA lpdiaf,
832 LPCSTR lpszUserName,
833 DWORD dwFlags)
835 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, lpszUserName, dwFlags);
837 return DI_OK;
840 HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
841 LPDIACTIONFORMATW lpdiaf,
842 LPCWSTR lpszUserName,
843 DWORD dwFlags)
845 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
847 return DI_OK;
850 HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
851 LPDIACTIONFORMATA lpdiaf,
852 LPCSTR lpszUserName,
853 DWORD dwFlags)
855 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, lpszUserName, dwFlags);
857 return DI_OK;
860 HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
861 LPDIACTIONFORMATW lpdiaf,
862 LPCWSTR lpszUserName,
863 DWORD dwFlags)
865 FIXME("(%p)->(%p,%s,%08lx): stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
867 return DI_OK;
870 HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
871 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader)
873 FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader);
875 return DI_OK;
878 HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
879 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader)
881 FIXME("(%p)->(%p): stub !\n", iface, lpdiDevImageInfoHeader);
883 return DI_OK;