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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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.
31 #include "wine/debug.h"
32 #include "wine/unicode.h"
38 #include "device_private.h"
39 #include "dinput_private.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(dinput
);
43 /******************************************************************************
44 * Various debugging tools
46 void _dump_cooperativelevel_DI(DWORD dwFlags
) {
47 if (TRACE_ON(dinput
)) {
53 #define FE(x) { x, #x}
57 FE(DISCL_NONEXCLUSIVE
),
61 for (i
= 0; i
< (sizeof(flags
) / sizeof(flags
[0])); i
++)
62 if (flags
[i
].mask
& dwFlags
)
63 DPRINTF("%s ",flags
[i
].name
);
68 void _dump_EnumObjects_flags(DWORD dwFlags
) {
69 if (TRACE_ON(dinput
)) {
76 #define FE(x) { x, #x}
85 FE(DIDFT_FFEFFECTTRIGGER
),
87 FE(DIDFT_VENDORDEFINED
),
92 type
= (dwFlags
& 0xFF0000FF);
93 instance
= ((dwFlags
>> 8) & 0xFFFF);
95 if (type
== DIDFT_ALL
) {
96 DPRINTF(" DIDFT_ALL");
98 for (i
= 0; i
< (sizeof(flags
) / sizeof(flags
[0])); i
++) {
99 if (flags
[i
].mask
& type
) {
100 type
&= ~flags
[i
].mask
;
101 DPRINTF(" %s",flags
[i
].name
);
105 DPRINTF(" (unhandled: %08x)", type
);
108 DPRINTF(" / Instance: ");
109 if (instance
== ((DIDFT_ANYINSTANCE
>> 8) & 0xFFFF)) {
110 DPRINTF("DIDFT_ANYINSTANCE");
112 DPRINTF("%3d", instance
);
117 void _dump_DIPROPHEADER(LPCDIPROPHEADER diph
) {
118 if (TRACE_ON(dinput
)) {
119 DPRINTF(" - dwObj = 0x%08x\n", diph
->dwObj
);
120 DPRINTF(" - dwHow = %s\n",
121 ((diph
->dwHow
== DIPH_DEVICE
) ? "DIPH_DEVICE" :
122 ((diph
->dwHow
== DIPH_BYOFFSET
) ? "DIPH_BYOFFSET" :
123 ((diph
->dwHow
== DIPH_BYID
)) ? "DIPH_BYID" : "unknown")));
127 void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA
*ddoi
) {
128 if (TRACE_ON(dinput
)) {
129 DPRINTF(" - enumerating : %s ('%s') - %2d - 0x%08x - %s\n",
130 debugstr_guid(&ddoi
->guidType
), _dump_dinput_GUID(&ddoi
->guidType
), ddoi
->dwOfs
, ddoi
->dwType
, ddoi
->tszName
);
134 void _dump_OBJECTINSTANCEW(const DIDEVICEOBJECTINSTANCEW
*ddoi
) {
135 if (TRACE_ON(dinput
)) {
136 DPRINTF(" - enumerating : %s ('%s'), - %2d - 0x%08x - %s\n",
137 debugstr_guid(&ddoi
->guidType
), _dump_dinput_GUID(&ddoi
->guidType
), ddoi
->dwOfs
, ddoi
->dwType
, debugstr_w(ddoi
->tszName
));
141 /* This function is a helper to convert a GUID into any possible DInput GUID out there */
142 const char *_dump_dinput_GUID(const GUID
*guid
) {
144 static const struct {
148 #define FE(x) { &x, #x}
161 FE(GUID_SysKeyboard
),
163 FE(GUID_ConstantForce
),
169 FE(GUID_SawtoothDown
),
179 for (i
= 0; i
< (sizeof(guids
) / sizeof(guids
[0])); i
++) {
180 if (IsEqualGUID(guids
[i
].guid
, guid
)) {
181 return guids
[i
].name
;
184 return "Unknown GUID";
187 void _dump_DIDATAFORMAT(const DIDATAFORMAT
*df
) {
190 TRACE("Dumping DIDATAFORMAT structure:\n");
191 TRACE(" - dwSize: %d\n", df
->dwSize
);
192 if (df
->dwSize
!= sizeof(DIDATAFORMAT
)) {
193 WARN("Non-standard DIDATAFORMAT structure size %d\n", df
->dwSize
);
195 TRACE(" - dwObjsize: %d\n", df
->dwObjSize
);
196 if (df
->dwObjSize
!= sizeof(DIOBJECTDATAFORMAT
)) {
197 WARN("Non-standard DIOBJECTDATAFORMAT structure size %d\n", df
->dwObjSize
);
199 TRACE(" - dwFlags: 0x%08x (", df
->dwFlags
);
200 switch (df
->dwFlags
) {
201 case DIDF_ABSAXIS
: TRACE("DIDF_ABSAXIS"); break;
202 case DIDF_RELAXIS
: TRACE("DIDF_RELAXIS"); break;
203 default: TRACE("unknown"); break;
206 TRACE(" - dwDataSize: %d\n", df
->dwDataSize
);
207 TRACE(" - dwNumObjs: %d\n", df
->dwNumObjs
);
209 for (i
= 0; i
< df
->dwNumObjs
; i
++) {
210 TRACE(" - Object %d:\n", i
);
211 TRACE(" * GUID: %s ('%s')\n", debugstr_guid(df
->rgodf
[i
].pguid
), _dump_dinput_GUID(df
->rgodf
[i
].pguid
));
212 TRACE(" * dwOfs: %d\n", df
->rgodf
[i
].dwOfs
);
213 TRACE(" * dwType: 0x%08x\n", df
->rgodf
[i
].dwType
);
214 TRACE(" "); _dump_EnumObjects_flags(df
->rgodf
[i
].dwType
); TRACE("\n");
215 TRACE(" * dwFlags: 0x%08x\n", df
->rgodf
[i
].dwFlags
);
219 /* Conversion between internal data buffer and external data buffer */
220 void fill_DataFormat(void *out
, const void *in
, const DataFormat
*df
) {
222 const char *in_c
= in
;
223 char *out_c
= (char *) out
;
225 if (df
->dt
== NULL
) {
226 /* This means that the app uses Wine's internal data format */
227 memcpy(out
, in
, df
->internal_format_size
);
229 for (i
= 0; i
< df
->size
; i
++) {
230 if (df
->dt
[i
].offset_in
>= 0) {
231 switch (df
->dt
[i
].size
) {
233 TRACE("Copying (c) to %d from %d (value %d)\n",
234 df
->dt
[i
].offset_out
, df
->dt
[i
].offset_in
, *(in_c
+ df
->dt
[i
].offset_in
));
235 *(out_c
+ df
->dt
[i
].offset_out
) = *(in_c
+ df
->dt
[i
].offset_in
);
239 TRACE("Copying (s) to %d from %d (value %d)\n",
240 df
->dt
[i
].offset_out
, df
->dt
[i
].offset_in
, *((const short *)(in_c
+ df
->dt
[i
].offset_in
)));
241 *((short *)(out_c
+ df
->dt
[i
].offset_out
)) = *((const short *)(in_c
+ df
->dt
[i
].offset_in
));
245 TRACE("Copying (i) to %d from %d (value %d)\n",
246 df
->dt
[i
].offset_out
, df
->dt
[i
].offset_in
, *((const int *)(in_c
+ df
->dt
[i
].offset_in
)));
247 *((int *)(out_c
+ df
->dt
[i
].offset_out
)) = *((const int *)(in_c
+ df
->dt
[i
].offset_in
));
251 memcpy((out_c
+ df
->dt
[i
].offset_out
), (in_c
+ df
->dt
[i
].offset_in
), df
->dt
[i
].size
);
255 switch (df
->dt
[i
].size
) {
257 TRACE("Copying (c) to %d default value %d\n",
258 df
->dt
[i
].offset_out
, df
->dt
[i
].value
);
259 *(out_c
+ df
->dt
[i
].offset_out
) = (char) df
->dt
[i
].value
;
263 TRACE("Copying (s) to %d default value %d\n",
264 df
->dt
[i
].offset_out
, df
->dt
[i
].value
);
265 *((short *) (out_c
+ df
->dt
[i
].offset_out
)) = (short) df
->dt
[i
].value
;
269 TRACE("Copying (i) to %d default value %d\n",
270 df
->dt
[i
].offset_out
, df
->dt
[i
].value
);
271 *((int *) (out_c
+ df
->dt
[i
].offset_out
)) = (int) df
->dt
[i
].value
;
275 memset((out_c
+ df
->dt
[i
].offset_out
), 0, df
->dt
[i
].size
);
283 void release_DataFormat(DataFormat
* format
)
285 TRACE("Deleting DataFormat: %p\n", format
);
287 HeapFree(GetProcessHeap(), 0, format
->dt
);
289 HeapFree(GetProcessHeap(), 0, format
->offsets
);
290 format
->offsets
= NULL
;
291 HeapFree(GetProcessHeap(), 0, format
->user_df
);
292 format
->user_df
= NULL
;
295 inline LPDIOBJECTDATAFORMAT
dataformat_to_odf(LPCDIDATAFORMAT df
, int idx
)
297 if (idx
< 0 || idx
>= df
->dwNumObjs
) return NULL
;
298 return (LPDIOBJECTDATAFORMAT
)((LPBYTE
)df
->rgodf
+ idx
* df
->dwObjSize
);
301 HRESULT
create_DataFormat(LPCDIDATAFORMAT asked_format
, DataFormat
*format
)
310 if (!format
->wine_df
) return DIERR_INVALIDPARAM
;
311 done
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, asked_format
->dwNumObjs
* sizeof(int));
312 dt
= HeapAlloc(GetProcessHeap(), 0, asked_format
->dwNumObjs
* sizeof(DataTransform
));
313 if (!dt
|| !done
) goto failed
;
315 if (!(format
->offsets
= HeapAlloc(GetProcessHeap(), 0, format
->wine_df
->dwNumObjs
* sizeof(int))))
318 if (!(format
->user_df
= HeapAlloc(GetProcessHeap(), 0, asked_format
->dwSize
)))
320 memcpy(format
->user_df
, asked_format
, asked_format
->dwSize
);
322 TRACE("Creating DataTransform :\n");
324 for (i
= 0; i
< format
->wine_df
->dwNumObjs
; i
++)
326 format
->offsets
[i
] = -1;
328 for (j
= 0; j
< asked_format
->dwNumObjs
; j
++) {
332 if (/* Check if the application either requests any GUID and if not, it if matches
333 * the GUID of the Wine object.
335 ((asked_format
->rgodf
[j
].pguid
== NULL
) ||
336 (format
->wine_df
->rgodf
[i
].pguid
== NULL
) ||
337 (IsEqualGUID(format
->wine_df
->rgodf
[i
].pguid
, asked_format
->rgodf
[j
].pguid
)))
339 (/* Then check if it accepts any instance id, and if not, if it matches Wine's
342 ((asked_format
->rgodf
[j
].dwType
& DIDFT_INSTANCEMASK
) == DIDFT_ANYINSTANCE
) ||
343 (DIDFT_GETINSTANCE(asked_format
->rgodf
[j
].dwType
) == 0x00FF) || /* This is mentionned in no DX docs, but it works fine - tested on WinXP */
344 (DIDFT_GETINSTANCE(asked_format
->rgodf
[j
].dwType
) == DIDFT_GETINSTANCE(format
->wine_df
->rgodf
[i
].dwType
)))
346 ( /* Then if the asked type matches the one Wine provides */
347 DIDFT_GETTYPE(asked_format
->rgodf
[j
].dwType
) & format
->wine_df
->rgodf
[i
].dwType
))
351 TRACE("Matching :\n");
352 TRACE(" - Asked (%d) :\n", j
);
353 TRACE(" * GUID: %s ('%s')\n",
354 debugstr_guid(asked_format
->rgodf
[j
].pguid
),
355 _dump_dinput_GUID(asked_format
->rgodf
[j
].pguid
));
356 TRACE(" * Offset: %3d\n", asked_format
->rgodf
[j
].dwOfs
);
357 TRACE(" * dwType: %08x\n", asked_format
->rgodf
[j
].dwType
);
358 TRACE(" "); _dump_EnumObjects_flags(asked_format
->rgodf
[j
].dwType
); TRACE("\n");
360 TRACE(" - Wine (%d) :\n", i
);
361 TRACE(" * GUID: %s ('%s')\n",
362 debugstr_guid(format
->wine_df
->rgodf
[i
].pguid
),
363 _dump_dinput_GUID(format
->wine_df
->rgodf
[i
].pguid
));
364 TRACE(" * Offset: %3d\n", format
->wine_df
->rgodf
[i
].dwOfs
);
365 TRACE(" * dwType: %08x\n", format
->wine_df
->rgodf
[i
].dwType
);
366 TRACE(" "); _dump_EnumObjects_flags(format
->wine_df
->rgodf
[i
].dwType
); TRACE("\n");
368 if (format
->wine_df
->rgodf
[i
].dwType
& DIDFT_BUTTON
)
369 dt
[index
].size
= sizeof(BYTE
);
371 dt
[index
].size
= sizeof(DWORD
);
372 dt
[index
].offset_in
= format
->wine_df
->rgodf
[i
].dwOfs
;
373 dt
[index
].offset_out
= asked_format
->rgodf
[j
].dwOfs
;
374 format
->offsets
[i
] = asked_format
->rgodf
[j
].dwOfs
;
376 next
= next
+ dt
[index
].size
;
378 if (format
->wine_df
->rgodf
[i
].dwOfs
!= dt
[index
].offset_out
)
386 if (j
== asked_format
->dwNumObjs
)
390 TRACE("Setting to default value :\n");
391 for (j
= 0; j
< asked_format
->dwNumObjs
; j
++) {
393 TRACE(" - Asked (%d) :\n", j
);
394 TRACE(" * GUID: %s ('%s')\n",
395 debugstr_guid(asked_format
->rgodf
[j
].pguid
),
396 _dump_dinput_GUID(asked_format
->rgodf
[j
].pguid
));
397 TRACE(" * Offset: %3d\n", asked_format
->rgodf
[j
].dwOfs
);
398 TRACE(" * dwType: %08x\n", asked_format
->rgodf
[j
].dwType
);
399 TRACE(" "); _dump_EnumObjects_flags(asked_format
->rgodf
[j
].dwType
); TRACE("\n");
401 if (asked_format
->rgodf
[j
].dwType
& DIDFT_BUTTON
)
402 dt
[index
].size
= sizeof(BYTE
);
404 dt
[index
].size
= sizeof(DWORD
);
405 dt
[index
].offset_in
= -1;
406 dt
[index
].offset_out
= asked_format
->rgodf
[j
].dwOfs
;
414 format
->internal_format_size
= format
->wine_df
->dwDataSize
;
415 format
->size
= index
;
417 HeapFree(GetProcessHeap(), 0, dt
);
422 HeapFree(GetProcessHeap(), 0, done
);
427 HeapFree(GetProcessHeap(), 0, done
);
428 HeapFree(GetProcessHeap(), 0, dt
);
430 HeapFree(GetProcessHeap(), 0, format
->offsets
);
431 format
->offsets
= NULL
;
432 HeapFree(GetProcessHeap(), 0, format
->user_df
);
433 format
->user_df
= NULL
;
435 return DIERR_OUTOFMEMORY
;
438 /* find an object by it's offset in a data format */
439 static int offset_to_object(const DataFormat
*df
, int offset
)
443 if (!df
->offsets
) return -1;
445 for (i
= 0; i
< df
->wine_df
->dwNumObjs
; i
++)
446 if (df
->offsets
[i
] == offset
) return i
;
451 static int id_to_object(LPCDIDATAFORMAT df
, int id
)
456 for (i
= 0; i
< df
->dwNumObjs
; i
++)
457 if ((dataformat_to_odf(df
, i
)->dwType
& 0x00ffffff) == id
)
463 int id_to_offset(const DataFormat
*df
, int id
)
465 int obj
= id_to_object(df
->wine_df
, id
);
467 return obj
>= 0 && df
->offsets
? df
->offsets
[obj
] : -1;
470 int find_property(const DataFormat
*df
, LPCDIPROPHEADER ph
)
474 case DIPH_BYID
: return id_to_object(df
->wine_df
, ph
->dwObj
);
475 case DIPH_BYOFFSET
: return offset_to_object(df
, ph
->dwObj
);
477 FIXME("Unhandled ph->dwHow=='%04X'\n", (unsigned int)ph
->dwHow
);
483 BOOL
DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA lpddi
, LPVOID lpvRef
) {
484 DIDEVICEOBJECTINSTANCEW ddtmp
;
485 device_enumobjects_AtoWcb_data
* data
;
487 data
= (device_enumobjects_AtoWcb_data
*) lpvRef
;
489 memset(&ddtmp
, 0, sizeof(ddtmp
));
491 ddtmp
.dwSize
= sizeof(DIDEVICEINSTANCEW
);
492 ddtmp
.guidType
= lpddi
->guidType
;
493 ddtmp
.dwOfs
= lpddi
->dwOfs
;
494 ddtmp
.dwType
= lpddi
->dwType
;
495 ddtmp
.dwFlags
= lpddi
->dwFlags
;
496 MultiByteToWideChar(CP_ACP
, 0, lpddi
->tszName
, -1, ddtmp
.tszName
, MAX_PATH
);
498 if (lpddi
->dwSize
== sizeof(DIDEVICEINSTANCEA
)) {
500 * if dwSize < sizeof(DIDEVICEINSTANCEA of DInput version >= 5)
501 * force feedback and other newer datas aren't available
503 ddtmp
.dwFFMaxForce
= lpddi
->dwFFMaxForce
;
504 ddtmp
.dwFFForceResolution
= lpddi
->dwFFForceResolution
;
505 ddtmp
.wCollectionNumber
= lpddi
->wCollectionNumber
;
506 ddtmp
.wDesignatorIndex
= lpddi
->wDesignatorIndex
;
507 ddtmp
.wUsagePage
= lpddi
->wUsagePage
;
508 ddtmp
.wUsage
= lpddi
->wUsage
;
509 ddtmp
.dwDimension
= lpddi
->dwDimension
;
510 ddtmp
.wExponent
= lpddi
->wExponent
;
511 ddtmp
.wReserved
= lpddi
->wReserved
;
513 return data
->lpCallBack(&ddtmp
, data
->lpvRef
);
516 /******************************************************************************
517 * queue_event - add new event to the ring queue
520 void queue_event(LPDIRECTINPUTDEVICE8A iface
, int ofs
, DWORD data
, DWORD time
, DWORD seq
)
522 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
525 /* Event is being set regardless of the queue state */
526 if (This
->hEvent
) SetEvent(This
->hEvent
);
528 if (!This
->queue_len
|| This
->overflow
|| ofs
< 0) return;
530 next_pos
= (This
->queue_head
+ 1) % This
->queue_len
;
531 if (next_pos
== This
->queue_tail
)
533 TRACE(" queue overflowed\n");
534 This
->overflow
= TRUE
;
538 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n",
539 data
, ofs
, This
->queue_head
, This
->queue_len
);
541 This
->data_queue
[This
->queue_head
].dwOfs
= ofs
;
542 This
->data_queue
[This
->queue_head
].dwData
= data
;
543 This
->data_queue
[This
->queue_head
].dwTimeStamp
= time
;
544 This
->data_queue
[This
->queue_head
].dwSequence
= seq
;
545 This
->queue_head
= next_pos
;
546 /* Send event if asked */
549 /******************************************************************************
553 HRESULT WINAPI
IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface
)
555 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
558 if (!This
->data_format
.user_df
) return DIERR_INVALIDPARAM
;
559 if (This
->dwCoopLevel
& DISCL_FOREGROUND
&& This
->win
!= GetForegroundWindow())
560 return DIERR_OTHERAPPHASPRIO
;
562 EnterCriticalSection(&This
->crit
);
563 res
= This
->acquired
? S_FALSE
: DI_OK
;
566 This
->queue_head
= This
->queue_tail
= This
->overflow
= 0;
567 LeaveCriticalSection(&This
->crit
);
572 /******************************************************************************
576 HRESULT WINAPI
IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface
)
578 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
581 EnterCriticalSection(&This
->crit
);
582 res
= !This
->acquired
? DI_NOEFFECT
: DI_OK
;
584 LeaveCriticalSection(&This
->crit
);
589 /******************************************************************************
590 * IDirectInputDeviceA
593 HRESULT WINAPI
IDirectInputDevice2AImpl_SetDataFormat(
594 LPDIRECTINPUTDEVICE8A iface
, LPCDIDATAFORMAT df
)
596 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
599 if (!df
) return E_POINTER
;
600 TRACE("(%p) %p\n", This
, df
);
601 _dump_DIDATAFORMAT(df
);
603 if (df
->dwSize
!= sizeof(DIDATAFORMAT
)) return DIERR_INVALIDPARAM
;
604 if (This
->acquired
) return DIERR_ACQUIRED
;
606 EnterCriticalSection(&This
->crit
);
608 release_DataFormat(&This
->data_format
);
609 res
= create_DataFormat(df
, &This
->data_format
);
611 LeaveCriticalSection(&This
->crit
);
615 /******************************************************************************
616 * SetCooperativeLevel
618 * Set cooperative level and the source window for the events.
620 HRESULT WINAPI
IDirectInputDevice2AImpl_SetCooperativeLevel(
621 LPDIRECTINPUTDEVICE8A iface
, HWND hwnd
, DWORD dwflags
)
623 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
625 TRACE("(%p) %p,0x%08x\n", This
, hwnd
, dwflags
);
626 TRACE(" cooperative level : ");
627 _dump_cooperativelevel_DI(dwflags
);
629 if ((dwflags
& (DISCL_EXCLUSIVE
| DISCL_NONEXCLUSIVE
)) == 0 ||
630 (dwflags
& (DISCL_EXCLUSIVE
| DISCL_NONEXCLUSIVE
)) == (DISCL_EXCLUSIVE
| DISCL_NONEXCLUSIVE
) ||
631 (dwflags
& (DISCL_FOREGROUND
| DISCL_BACKGROUND
)) == 0 ||
632 (dwflags
& (DISCL_FOREGROUND
| DISCL_BACKGROUND
)) == (DISCL_FOREGROUND
| DISCL_BACKGROUND
))
633 return DIERR_INVALIDPARAM
;
635 if (dwflags
== (DISCL_NONEXCLUSIVE
| DISCL_BACKGROUND
))
636 hwnd
= GetDesktopWindow();
638 if (!hwnd
) return E_HANDLE
;
640 /* For security reasons native does not allow exclusive background level
641 for mouse and keyboard only */
642 if (dwflags
& DISCL_EXCLUSIVE
&& dwflags
& DISCL_BACKGROUND
&&
643 (IsEqualGUID(&This
->guid
, &GUID_SysMouse
) ||
644 IsEqualGUID(&This
->guid
, &GUID_SysKeyboard
)))
645 return DIERR_UNSUPPORTED
;
647 /* Store the window which asks for the mouse */
648 EnterCriticalSection(&This
->crit
);
650 This
->dwCoopLevel
= dwflags
;
651 LeaveCriticalSection(&This
->crit
);
656 /******************************************************************************
657 * SetEventNotification : specifies event to be sent on state change
659 HRESULT WINAPI
IDirectInputDevice2AImpl_SetEventNotification(
660 LPDIRECTINPUTDEVICE8A iface
, HANDLE event
)
662 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
664 TRACE("(%p) %p\n", This
, event
);
666 EnterCriticalSection(&This
->crit
);
667 This
->hEvent
= event
;
668 LeaveCriticalSection(&This
->crit
);
672 ULONG WINAPI
IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface
)
674 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
677 ref
= InterlockedDecrement(&(This
->ref
));
680 IDirectInputDevice_Unacquire(iface
);
681 /* Reset the FF state, free all effects, etc */
682 IDirectInputDevice8_SendForceFeedbackCommand(iface
, DISFFC_RESET
);
684 HeapFree(GetProcessHeap(), 0, This
->data_queue
);
686 /* Free data format */
687 HeapFree(GetProcessHeap(), 0, This
->data_format
.wine_df
->rgodf
);
688 HeapFree(GetProcessHeap(), 0, This
->data_format
.wine_df
);
689 release_DataFormat(&This
->data_format
);
691 IDirectInput_Release((LPDIRECTINPUTDEVICE8A
)This
->dinput
);
692 This
->crit
.DebugInfo
->Spare
[0] = 0;
693 DeleteCriticalSection(&This
->crit
);
695 HeapFree(GetProcessHeap(), 0, This
);
700 HRESULT WINAPI
IDirectInputDevice2AImpl_QueryInterface(
701 LPDIRECTINPUTDEVICE8A iface
,REFIID riid
,LPVOID
*ppobj
704 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
706 TRACE("(this=%p,%s,%p)\n",This
,debugstr_guid(riid
),ppobj
);
707 if (IsEqualGUID(&IID_IUnknown
,riid
)) {
708 IDirectInputDevice2_AddRef(iface
);
712 if (IsEqualGUID(&IID_IDirectInputDeviceA
,riid
)) {
713 IDirectInputDevice2_AddRef(iface
);
717 if (IsEqualGUID(&IID_IDirectInputDevice2A
,riid
)) {
718 IDirectInputDevice2_AddRef(iface
);
722 if (IsEqualGUID(&IID_IDirectInputDevice7A
,riid
)) {
723 IDirectInputDevice7_AddRef(iface
);
727 if (IsEqualGUID(&IID_IDirectInputDevice8A
,riid
)) {
728 IDirectInputDevice8_AddRef(iface
);
732 TRACE("Unsupported interface !\n");
736 HRESULT WINAPI
IDirectInputDevice2WImpl_QueryInterface(
737 LPDIRECTINPUTDEVICE8W iface
,REFIID riid
,LPVOID
*ppobj
740 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
742 TRACE("(this=%p,%s,%p)\n",This
,debugstr_guid(riid
),ppobj
);
743 if (IsEqualGUID(&IID_IUnknown
,riid
)) {
744 IDirectInputDevice2_AddRef(iface
);
748 if (IsEqualGUID(&IID_IDirectInputDeviceW
,riid
)) {
749 IDirectInputDevice2_AddRef(iface
);
753 if (IsEqualGUID(&IID_IDirectInputDevice2W
,riid
)) {
754 IDirectInputDevice2_AddRef(iface
);
758 if (IsEqualGUID(&IID_IDirectInputDevice7W
,riid
)) {
759 IDirectInputDevice7_AddRef(iface
);
763 if (IsEqualGUID(&IID_IDirectInputDevice8W
,riid
)) {
764 IDirectInputDevice8_AddRef(iface
);
768 TRACE("Unsupported interface !\n");
772 ULONG WINAPI
IDirectInputDevice2AImpl_AddRef(
773 LPDIRECTINPUTDEVICE8A iface
)
775 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
776 return InterlockedIncrement(&(This
->ref
));
779 HRESULT WINAPI
IDirectInputDevice2AImpl_EnumObjects(LPDIRECTINPUTDEVICE8A iface
,
780 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback
, LPVOID lpvRef
, DWORD dwFlags
)
782 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
783 DIDEVICEOBJECTINSTANCEA ddoi
;
786 TRACE("(%p) %p,%p flags:%08x)\n", iface
, lpCallback
, lpvRef
, dwFlags
);
787 TRACE(" - flags = ");
788 _dump_EnumObjects_flags(dwFlags
);
791 /* Only the fields till dwFFMaxForce are relevant */
792 memset(&ddoi
, 0, sizeof(ddoi
));
793 ddoi
.dwSize
= FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA
, dwFFMaxForce
);
795 for (i
= 0; i
< This
->data_format
.wine_df
->dwNumObjs
; i
++)
797 LPDIOBJECTDATAFORMAT odf
= dataformat_to_odf(This
->data_format
.wine_df
, i
);
799 if (dwFlags
!= DIDFT_ALL
&& !(dwFlags
& DIEFT_GETTYPE(odf
->dwType
))) continue;
800 if (IDirectInputDevice_GetObjectInfo(iface
, &ddoi
, odf
->dwType
, DIPH_BYID
) != DI_OK
)
803 if (lpCallback(&ddoi
, lpvRef
) != DIENUM_CONTINUE
) break;
809 HRESULT WINAPI
IDirectInputDevice2WImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface
,
810 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback
, LPVOID lpvRef
, DWORD dwFlags
)
812 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
813 DIDEVICEOBJECTINSTANCEW ddoi
;
816 TRACE("(%p) %p,%p flags:%08x)\n", iface
, lpCallback
, lpvRef
, dwFlags
);
817 TRACE(" - flags = ");
818 _dump_EnumObjects_flags(dwFlags
);
821 /* Only the fields till dwFFMaxForce are relevant */
822 memset(&ddoi
, 0, sizeof(ddoi
));
823 ddoi
.dwSize
= FIELD_OFFSET(DIDEVICEOBJECTINSTANCEW
, dwFFMaxForce
);
825 for (i
= 0; i
< This
->data_format
.wine_df
->dwNumObjs
; i
++)
827 LPDIOBJECTDATAFORMAT odf
= dataformat_to_odf(This
->data_format
.wine_df
, i
);
829 if (dwFlags
!= DIDFT_ALL
&& !(dwFlags
& DIEFT_GETTYPE(odf
->dwType
))) continue;
830 if (IDirectInputDevice_GetObjectInfo(iface
, &ddoi
, odf
->dwType
, DIPH_BYID
) != DI_OK
)
833 if (lpCallback(&ddoi
, lpvRef
) != DIENUM_CONTINUE
) break;
839 /******************************************************************************
843 HRESULT WINAPI
IDirectInputDevice2AImpl_GetProperty(
844 LPDIRECTINPUTDEVICE8A iface
, REFGUID rguid
, LPDIPROPHEADER pdiph
)
846 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
848 TRACE("(%p) %s,%p\n", iface
, debugstr_guid(rguid
), pdiph
);
849 _dump_DIPROPHEADER(pdiph
);
851 if (HIWORD(rguid
)) return DI_OK
;
853 switch (LOWORD(rguid
))
855 case (DWORD
) DIPROP_BUFFERSIZE
:
857 LPDIPROPDWORD pd
= (LPDIPROPDWORD
)pdiph
;
859 if (pdiph
->dwSize
!= sizeof(DIPROPDWORD
)) return DIERR_INVALIDPARAM
;
861 pd
->dwData
= This
->queue_len
;
862 TRACE("buffersize = %d\n", pd
->dwData
);
866 WARN("Unknown property %s\n", debugstr_guid(rguid
));
873 /******************************************************************************
877 HRESULT WINAPI
IDirectInputDevice2AImpl_SetProperty(
878 LPDIRECTINPUTDEVICE8A iface
, REFGUID rguid
, LPCDIPROPHEADER pdiph
)
880 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
882 TRACE("(%p) %s,%p\n", iface
, debugstr_guid(rguid
), pdiph
);
883 _dump_DIPROPHEADER(pdiph
);
885 if (HIWORD(rguid
)) return DI_OK
;
887 switch (LOWORD(rguid
))
889 case (DWORD
) DIPROP_AXISMODE
:
891 LPCDIPROPDWORD pd
= (LPCDIPROPDWORD
)pdiph
;
893 if (pdiph
->dwSize
!= sizeof(DIPROPDWORD
)) return DIERR_INVALIDPARAM
;
894 if (pdiph
->dwHow
== DIPH_DEVICE
&& pdiph
->dwObj
) return DIERR_INVALIDPARAM
;
895 if (This
->acquired
) return DIERR_ACQUIRED
;
896 if (pdiph
->dwHow
!= DIPH_DEVICE
) return DIERR_UNSUPPORTED
;
897 if (!This
->data_format
.user_df
) return DI_OK
;
899 TRACE("Axis mode: %s\n", pd
->dwData
== DIPROPAXISMODE_ABS
? "absolute" :
902 EnterCriticalSection(&This
->crit
);
903 This
->data_format
.user_df
->dwFlags
&= ~DIDFT_AXIS
;
904 This
->data_format
.user_df
->dwFlags
|= pd
->dwData
== DIPROPAXISMODE_ABS
?
905 DIDF_ABSAXIS
: DIDF_RELAXIS
;
906 LeaveCriticalSection(&This
->crit
);
909 case (DWORD
) DIPROP_BUFFERSIZE
:
911 LPCDIPROPDWORD pd
= (LPCDIPROPDWORD
)pdiph
;
913 if (pdiph
->dwSize
!= sizeof(DIPROPDWORD
)) return DIERR_INVALIDPARAM
;
914 if (This
->acquired
) return DIERR_ACQUIRED
;
916 TRACE("buffersize = %d\n", pd
->dwData
);
918 EnterCriticalSection(&This
->crit
);
919 HeapFree(GetProcessHeap(), 0, This
->data_queue
);
921 This
->data_queue
= !pd
->dwData
? NULL
: HeapAlloc(GetProcessHeap(), 0,
922 pd
->dwData
* sizeof(DIDEVICEOBJECTDATA
));
923 This
->queue_head
= This
->queue_tail
= This
->overflow
= 0;
924 This
->queue_len
= pd
->dwData
;
926 LeaveCriticalSection(&This
->crit
);
930 WARN("Unknown property %s\n", debugstr_guid(rguid
));
931 return DIERR_UNSUPPORTED
;
937 HRESULT WINAPI
IDirectInputDevice2AImpl_GetObjectInfo(
938 LPDIRECTINPUTDEVICE8A iface
,
939 LPDIDEVICEOBJECTINSTANCEA pdidoi
,
943 DIDEVICEOBJECTINSTANCEW didoiW
;
947 (pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCEA
) &&
948 pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCE_DX3A
)))
949 return DIERR_INVALIDPARAM
;
951 didoiW
.dwSize
= sizeof(didoiW
);
952 res
= IDirectInputDevice2WImpl_GetObjectInfo((LPDIRECTINPUTDEVICE8W
)iface
, &didoiW
, dwObj
, dwHow
);
955 DWORD dwSize
= pdidoi
->dwSize
;
957 memset(pdidoi
, 0, pdidoi
->dwSize
);
958 pdidoi
->dwSize
= dwSize
;
959 pdidoi
->guidType
= didoiW
.guidType
;
960 pdidoi
->dwOfs
= didoiW
.dwOfs
;
961 pdidoi
->dwType
= didoiW
.dwType
;
962 pdidoi
->dwFlags
= didoiW
.dwFlags
;
968 HRESULT WINAPI
IDirectInputDevice2WImpl_GetObjectInfo(
969 LPDIRECTINPUTDEVICE8W iface
,
970 LPDIDEVICEOBJECTINSTANCEW pdidoi
,
974 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
976 LPDIOBJECTDATAFORMAT odf
;
979 TRACE("(%p) %d(0x%08x) -> %p\n", This
, dwHow
, dwObj
, pdidoi
);
982 (pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCEW
) &&
983 pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCE_DX3W
)))
984 return DIERR_INVALIDPARAM
;
989 if (!This
->data_format
.offsets
) break;
990 for (idx
= This
->data_format
.wine_df
->dwNumObjs
- 1; idx
>= 0; idx
--)
991 if (This
->data_format
.offsets
[idx
] == dwObj
) break;
995 for (idx
= This
->data_format
.wine_df
->dwNumObjs
- 1; idx
>= 0; idx
--)
996 if ((dataformat_to_odf(This
->data_format
.wine_df
, idx
)->dwType
& 0x00ffffff) == dwObj
)
1001 FIXME("dwHow = DIPH_BYUSAGE not implemented\n");
1004 WARN("invalid parameter: dwHow = %08x\n", dwHow
);
1005 return DIERR_INVALIDPARAM
;
1007 if (idx
< 0) return DIERR_OBJECTNOTFOUND
;
1009 odf
= dataformat_to_odf(This
->data_format
.wine_df
, idx
);
1010 dwSize
= pdidoi
->dwSize
; /* save due to memset below */
1011 memset(pdidoi
, 0, pdidoi
->dwSize
);
1012 pdidoi
->dwSize
= dwSize
;
1013 if (odf
->pguid
) pdidoi
->guidType
= *odf
->pguid
;
1014 pdidoi
->dwOfs
= This
->data_format
.offsets
? This
->data_format
.offsets
[idx
] : odf
->dwOfs
;
1015 pdidoi
->dwType
= odf
->dwType
;
1016 pdidoi
->dwFlags
= odf
->dwFlags
;
1021 HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceData(
1022 LPDIRECTINPUTDEVICE8A iface
, DWORD dodsize
, LPDIDEVICEOBJECTDATA dod
,
1023 LPDWORD entries
, DWORD flags
)
1025 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
1026 HRESULT ret
= DI_OK
;
1029 TRACE("(%p) %p -> %p(%d) x%d, 0x%08x\n",
1030 This
, dod
, entries
, entries
? *entries
: 0, dodsize
, flags
);
1032 if (!This
->acquired
)
1033 return DIERR_NOTACQUIRED
;
1034 if (!This
->queue_len
)
1035 return DIERR_NOTBUFFERED
;
1036 if (dodsize
< sizeof(DIDEVICEOBJECTDATA_DX3
))
1037 return DIERR_INVALIDPARAM
;
1039 IDirectInputDevice2_Poll(iface
);
1040 EnterCriticalSection(&This
->crit
);
1042 len
= This
->queue_head
- This
->queue_tail
;
1043 if (len
< 0) len
+= This
->queue_len
;
1045 if ((*entries
!= INFINITE
) && (len
> *entries
)) len
= *entries
;
1050 for (i
= 0; i
< len
; i
++)
1052 int n
= (This
->queue_tail
+ i
) % This
->queue_len
;
1053 memcpy((char *)dod
+ dodsize
* i
, This
->data_queue
+ n
, dodsize
);
1059 ret
= DI_BUFFEROVERFLOW
;
1061 if (!(flags
& DIGDD_PEEK
))
1063 /* Advance reading position */
1064 This
->queue_tail
= (This
->queue_tail
+ len
) % This
->queue_len
;
1065 This
->overflow
= FALSE
;
1068 LeaveCriticalSection(&This
->crit
);
1070 TRACE("Returning %d events queued\n", *entries
);
1074 HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceInfo(
1075 LPDIRECTINPUTDEVICE8A iface
,
1076 LPDIDEVICEINSTANCEA pdidi
)
1078 FIXME("(this=%p,%p): stub!\n",
1084 HRESULT WINAPI
IDirectInputDevice2WImpl_GetDeviceInfo(
1085 LPDIRECTINPUTDEVICE8W iface
,
1086 LPDIDEVICEINSTANCEW pdidi
)
1088 FIXME("(this=%p,%p): stub!\n",
1094 HRESULT WINAPI
IDirectInputDevice2AImpl_RunControlPanel(
1095 LPDIRECTINPUTDEVICE8A iface
,
1099 FIXME("(this=%p,%p,0x%08x): stub!\n",
1100 iface
, hwndOwner
, dwFlags
);
1105 HRESULT WINAPI
IDirectInputDevice2AImpl_Initialize(
1106 LPDIRECTINPUTDEVICE8A iface
,
1111 FIXME("(this=%p,%p,%d,%s): stub!\n",
1112 iface
, hinst
, dwVersion
, debugstr_guid(rguid
));
1116 /******************************************************************************
1117 * IDirectInputDevice2A
1120 HRESULT WINAPI
IDirectInputDevice2AImpl_CreateEffect(
1121 LPDIRECTINPUTDEVICE8A iface
,
1124 LPDIRECTINPUTEFFECT
*ppdef
,
1125 LPUNKNOWN pUnkOuter
)
1127 FIXME("(this=%p,%s,%p,%p,%p): stub!\n",
1128 iface
, debugstr_guid(rguid
), lpeff
, ppdef
, pUnkOuter
);
1132 HRESULT WINAPI
IDirectInputDevice2AImpl_EnumEffects(
1133 LPDIRECTINPUTDEVICE8A iface
,
1134 LPDIENUMEFFECTSCALLBACKA lpCallback
,
1138 FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1139 iface
, lpCallback
, lpvRef
, dwFlags
);
1144 HRESULT WINAPI
IDirectInputDevice2WImpl_EnumEffects(
1145 LPDIRECTINPUTDEVICE8W iface
,
1146 LPDIENUMEFFECTSCALLBACKW lpCallback
,
1150 FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1151 iface
, lpCallback
, lpvRef
, dwFlags
);
1156 HRESULT WINAPI
IDirectInputDevice2AImpl_GetEffectInfo(
1157 LPDIRECTINPUTDEVICE8A iface
,
1158 LPDIEFFECTINFOA lpdei
,
1161 FIXME("(this=%p,%p,%s): stub!\n",
1162 iface
, lpdei
, debugstr_guid(rguid
));
1166 HRESULT WINAPI
IDirectInputDevice2WImpl_GetEffectInfo(
1167 LPDIRECTINPUTDEVICE8W iface
,
1168 LPDIEFFECTINFOW lpdei
,
1171 FIXME("(this=%p,%p,%s): stub!\n",
1172 iface
, lpdei
, debugstr_guid(rguid
));
1176 HRESULT WINAPI
IDirectInputDevice2AImpl_GetForceFeedbackState(
1177 LPDIRECTINPUTDEVICE8A iface
,
1180 FIXME("(this=%p,%p): stub!\n",
1185 HRESULT WINAPI
IDirectInputDevice2AImpl_SendForceFeedbackCommand(
1186 LPDIRECTINPUTDEVICE8A iface
,
1189 TRACE("(%p) 0x%08x:\n", iface
, dwFlags
);
1193 HRESULT WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
1194 LPDIRECTINPUTDEVICE8A iface
,
1195 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback
,
1199 FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1200 iface
, lpCallback
, lpvRef
, dwFlags
);
1204 HRESULT WINAPI
IDirectInputDevice2AImpl_Escape(
1205 LPDIRECTINPUTDEVICE8A iface
,
1206 LPDIEFFESCAPE lpDIEEsc
)
1208 FIXME("(this=%p,%p): stub!\n",
1213 HRESULT WINAPI
IDirectInputDevice2AImpl_Poll(
1214 LPDIRECTINPUTDEVICE8A iface
)
1216 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
1218 if (!This
->acquired
) return DIERR_NOTACQUIRED
;
1219 /* Because wine devices do not need to be polled, just return DI_NOEFFECT */
1223 HRESULT WINAPI
IDirectInputDevice2AImpl_SendDeviceData(
1224 LPDIRECTINPUTDEVICE8A iface
,
1226 LPCDIDEVICEOBJECTDATA rgdod
,
1230 FIXME("(this=%p,0x%08x,%p,%p,0x%08x): stub!\n",
1231 iface
, cbObjectData
, rgdod
, pdwInOut
, dwFlags
);
1236 HRESULT WINAPI
IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface
,
1237 LPCSTR lpszFileName
,
1238 LPDIENUMEFFECTSINFILECALLBACK pec
,
1242 FIXME("(%p)->(%s,%p,%p,%08x): stub !\n", iface
, lpszFileName
, pec
, pvRef
, dwFlags
);
1247 HRESULT WINAPI
IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface
,
1248 LPCWSTR lpszFileName
,
1249 LPDIENUMEFFECTSINFILECALLBACK pec
,
1253 FIXME("(%p)->(%s,%p,%p,%08x): stub !\n", iface
, debugstr_w(lpszFileName
), pec
, pvRef
, dwFlags
);
1258 HRESULT WINAPI
IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface
,
1259 LPCSTR lpszFileName
,
1261 LPDIFILEEFFECT rgDiFileEft
,
1264 FIXME("(%p)->(%s,%08x,%p,%08x): stub !\n", iface
, lpszFileName
, dwEntries
, rgDiFileEft
, dwFlags
);
1269 HRESULT WINAPI
IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface
,
1270 LPCWSTR lpszFileName
,
1272 LPDIFILEEFFECT rgDiFileEft
,
1275 FIXME("(%p)->(%s,%08x,%p,%08x): stub !\n", iface
, debugstr_w(lpszFileName
), dwEntries
, rgDiFileEft
, dwFlags
);
1280 HRESULT WINAPI
IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface
,
1281 LPDIACTIONFORMATA lpdiaf
,
1282 LPCSTR lpszUserName
,
1285 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, lpszUserName
, dwFlags
);
1290 HRESULT WINAPI
IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface
,
1291 LPDIACTIONFORMATW lpdiaf
,
1292 LPCWSTR lpszUserName
,
1295 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, debugstr_w(lpszUserName
), dwFlags
);
1300 HRESULT WINAPI
IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface
,
1301 LPDIACTIONFORMATA lpdiaf
,
1302 LPCSTR lpszUserName
,
1305 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, lpszUserName
, dwFlags
);
1310 HRESULT WINAPI
IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
,
1311 LPDIACTIONFORMATW lpdiaf
,
1312 LPCWSTR lpszUserName
,
1315 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, debugstr_w(lpszUserName
), dwFlags
);
1320 HRESULT WINAPI
IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface
,
1321 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader
)
1323 FIXME("(%p)->(%p): stub !\n", iface
, lpdiDevImageInfoHeader
);
1328 HRESULT WINAPI
IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface
,
1329 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader
)
1331 FIXME("(%p)->(%p): stub !\n", iface
, lpdiDevImageInfoHeader
);