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"
39 #include "device_private.h"
40 #include "dinput_private.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(dinput
);
44 /******************************************************************************
45 * Various debugging tools
47 void _dump_cooperativelevel_DI(DWORD dwFlags
) {
48 if (TRACE_ON(dinput
)) {
54 #define FE(x) { x, #x}
58 FE(DISCL_NONEXCLUSIVE
),
62 for (i
= 0; i
< (sizeof(flags
) / sizeof(flags
[0])); i
++)
63 if (flags
[i
].mask
& dwFlags
)
64 DPRINTF("%s ",flags
[i
].name
);
69 void _dump_EnumObjects_flags(DWORD dwFlags
) {
70 if (TRACE_ON(dinput
)) {
77 #define FE(x) { x, #x}
86 FE(DIDFT_FFEFFECTTRIGGER
),
88 FE(DIDFT_VENDORDEFINED
),
93 type
= (dwFlags
& 0xFF0000FF);
94 instance
= ((dwFlags
>> 8) & 0xFFFF);
96 if (type
== DIDFT_ALL
) {
97 DPRINTF(" DIDFT_ALL");
99 for (i
= 0; i
< (sizeof(flags
) / sizeof(flags
[0])); i
++) {
100 if (flags
[i
].mask
& type
) {
101 type
&= ~flags
[i
].mask
;
102 DPRINTF(" %s",flags
[i
].name
);
106 DPRINTF(" (unhandled: %08x)", type
);
109 DPRINTF(" / Instance: ");
110 if (instance
== ((DIDFT_ANYINSTANCE
>> 8) & 0xFFFF)) {
111 DPRINTF("DIDFT_ANYINSTANCE");
113 DPRINTF("%3d", instance
);
118 void _dump_DIPROPHEADER(LPCDIPROPHEADER diph
) {
119 if (TRACE_ON(dinput
)) {
120 DPRINTF(" - dwObj = 0x%08x\n", diph
->dwObj
);
121 DPRINTF(" - dwHow = %s\n",
122 ((diph
->dwHow
== DIPH_DEVICE
) ? "DIPH_DEVICE" :
123 ((diph
->dwHow
== DIPH_BYOFFSET
) ? "DIPH_BYOFFSET" :
124 ((diph
->dwHow
== DIPH_BYID
)) ? "DIPH_BYID" : "unknown")));
128 void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA
*ddoi
) {
129 if (TRACE_ON(dinput
)) {
130 DPRINTF(" - enumerating : %s ('%s') - %2d - 0x%08x - %s\n",
131 debugstr_guid(&ddoi
->guidType
), _dump_dinput_GUID(&ddoi
->guidType
), ddoi
->dwOfs
, ddoi
->dwType
, ddoi
->tszName
);
135 void _dump_OBJECTINSTANCEW(const DIDEVICEOBJECTINSTANCEW
*ddoi
) {
136 if (TRACE_ON(dinput
)) {
137 DPRINTF(" - enumerating : %s ('%s'), - %2d - 0x%08x - %s\n",
138 debugstr_guid(&ddoi
->guidType
), _dump_dinput_GUID(&ddoi
->guidType
), ddoi
->dwOfs
, ddoi
->dwType
, debugstr_w(ddoi
->tszName
));
142 /* This function is a helper to convert a GUID into any possible DInput GUID out there */
143 const char *_dump_dinput_GUID(const GUID
*guid
) {
145 static const struct {
149 #define FE(x) { &x, #x}
162 FE(GUID_SysKeyboard
),
164 FE(GUID_ConstantForce
),
170 FE(GUID_SawtoothDown
),
180 for (i
= 0; i
< (sizeof(guids
) / sizeof(guids
[0])); i
++) {
181 if (IsEqualGUID(guids
[i
].guid
, guid
)) {
182 return guids
[i
].name
;
185 return "Unknown GUID";
188 void _dump_DIDATAFORMAT(const DIDATAFORMAT
*df
) {
191 TRACE("Dumping DIDATAFORMAT structure:\n");
192 TRACE(" - dwSize: %d\n", df
->dwSize
);
193 if (df
->dwSize
!= sizeof(DIDATAFORMAT
)) {
194 WARN("Non-standard DIDATAFORMAT structure size %d\n", df
->dwSize
);
196 TRACE(" - dwObjsize: %d\n", df
->dwObjSize
);
197 if (df
->dwObjSize
!= sizeof(DIOBJECTDATAFORMAT
)) {
198 WARN("Non-standard DIOBJECTDATAFORMAT structure size %d\n", df
->dwObjSize
);
200 TRACE(" - dwFlags: 0x%08x (", df
->dwFlags
);
201 switch (df
->dwFlags
) {
202 case DIDF_ABSAXIS
: TRACE("DIDF_ABSAXIS"); break;
203 case DIDF_RELAXIS
: TRACE("DIDF_RELAXIS"); break;
204 default: TRACE("unknown"); break;
207 TRACE(" - dwDataSize: %d\n", df
->dwDataSize
);
208 TRACE(" - dwNumObjs: %d\n", df
->dwNumObjs
);
210 for (i
= 0; i
< df
->dwNumObjs
; i
++) {
211 TRACE(" - Object %d:\n", i
);
212 TRACE(" * GUID: %s ('%s')\n", debugstr_guid(df
->rgodf
[i
].pguid
), _dump_dinput_GUID(df
->rgodf
[i
].pguid
));
213 TRACE(" * dwOfs: %d\n", df
->rgodf
[i
].dwOfs
);
214 TRACE(" * dwType: 0x%08x\n", df
->rgodf
[i
].dwType
);
215 TRACE(" "); _dump_EnumObjects_flags(df
->rgodf
[i
].dwType
); TRACE("\n");
216 TRACE(" * dwFlags: 0x%08x\n", df
->rgodf
[i
].dwFlags
);
220 /******************************************************************************
221 * Get a config key from either the app-specific or the default config
223 DWORD
get_config_key( HKEY defkey
, HKEY appkey
, const char *name
,
224 char *buffer
, DWORD size
)
226 if (appkey
&& !RegQueryValueExA( appkey
, name
, 0, NULL
, (LPBYTE
)buffer
, &size
))
229 if (defkey
&& !RegQueryValueExA( defkey
, name
, 0, NULL
, (LPBYTE
)buffer
, &size
))
232 return ERROR_FILE_NOT_FOUND
;
235 /* Conversion between internal data buffer and external data buffer */
236 void fill_DataFormat(void *out
, const void *in
, const DataFormat
*df
) {
238 const char *in_c
= in
;
239 char *out_c
= (char *) out
;
241 if (df
->dt
== NULL
) {
242 /* This means that the app uses Wine's internal data format */
243 memcpy(out
, in
, df
->internal_format_size
);
245 for (i
= 0; i
< df
->size
; i
++) {
246 if (df
->dt
[i
].offset_in
>= 0) {
247 switch (df
->dt
[i
].size
) {
249 TRACE("Copying (c) to %d from %d (value %d)\n",
250 df
->dt
[i
].offset_out
, df
->dt
[i
].offset_in
, *(in_c
+ df
->dt
[i
].offset_in
));
251 *(out_c
+ df
->dt
[i
].offset_out
) = *(in_c
+ df
->dt
[i
].offset_in
);
255 TRACE("Copying (s) to %d from %d (value %d)\n",
256 df
->dt
[i
].offset_out
, df
->dt
[i
].offset_in
, *((const short *)(in_c
+ df
->dt
[i
].offset_in
)));
257 *((short *)(out_c
+ df
->dt
[i
].offset_out
)) = *((const short *)(in_c
+ df
->dt
[i
].offset_in
));
261 TRACE("Copying (i) to %d from %d (value %d)\n",
262 df
->dt
[i
].offset_out
, df
->dt
[i
].offset_in
, *((const int *)(in_c
+ df
->dt
[i
].offset_in
)));
263 *((int *)(out_c
+ df
->dt
[i
].offset_out
)) = *((const int *)(in_c
+ df
->dt
[i
].offset_in
));
267 memcpy((out_c
+ df
->dt
[i
].offset_out
), (in_c
+ df
->dt
[i
].offset_in
), df
->dt
[i
].size
);
271 switch (df
->dt
[i
].size
) {
273 TRACE("Copying (c) to %d default value %d\n",
274 df
->dt
[i
].offset_out
, df
->dt
[i
].value
);
275 *(out_c
+ df
->dt
[i
].offset_out
) = (char) df
->dt
[i
].value
;
279 TRACE("Copying (s) to %d default value %d\n",
280 df
->dt
[i
].offset_out
, df
->dt
[i
].value
);
281 *((short *) (out_c
+ df
->dt
[i
].offset_out
)) = (short) df
->dt
[i
].value
;
285 TRACE("Copying (i) to %d default value %d\n",
286 df
->dt
[i
].offset_out
, df
->dt
[i
].value
);
287 *((int *) (out_c
+ df
->dt
[i
].offset_out
)) = (int) df
->dt
[i
].value
;
291 memset((out_c
+ df
->dt
[i
].offset_out
), 0, df
->dt
[i
].size
);
299 void release_DataFormat(DataFormat
* format
)
301 TRACE("Deleting DataFormat: %p\n", format
);
303 HeapFree(GetProcessHeap(), 0, format
->dt
);
305 HeapFree(GetProcessHeap(), 0, format
->offsets
);
306 format
->offsets
= NULL
;
307 HeapFree(GetProcessHeap(), 0, format
->user_df
);
308 format
->user_df
= NULL
;
311 inline LPDIOBJECTDATAFORMAT
dataformat_to_odf(LPCDIDATAFORMAT df
, int idx
)
313 if (idx
< 0 || idx
>= df
->dwNumObjs
) return NULL
;
314 return (LPDIOBJECTDATAFORMAT
)((LPBYTE
)df
->rgodf
+ idx
* df
->dwObjSize
);
317 HRESULT
create_DataFormat(LPCDIDATAFORMAT asked_format
, DataFormat
*format
)
326 if (!format
->wine_df
) return DIERR_INVALIDPARAM
;
327 done
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, asked_format
->dwNumObjs
* sizeof(int));
328 dt
= HeapAlloc(GetProcessHeap(), 0, asked_format
->dwNumObjs
* sizeof(DataTransform
));
329 if (!dt
|| !done
) goto failed
;
331 if (!(format
->offsets
= HeapAlloc(GetProcessHeap(), 0, format
->wine_df
->dwNumObjs
* sizeof(int))))
334 if (!(format
->user_df
= HeapAlloc(GetProcessHeap(), 0, asked_format
->dwSize
)))
336 memcpy(format
->user_df
, asked_format
, asked_format
->dwSize
);
338 TRACE("Creating DataTransform :\n");
340 for (i
= 0; i
< format
->wine_df
->dwNumObjs
; i
++)
342 format
->offsets
[i
] = -1;
344 for (j
= 0; j
< asked_format
->dwNumObjs
; j
++) {
348 if (/* Check if the application either requests any GUID and if not, it if matches
349 * the GUID of the Wine object.
351 ((asked_format
->rgodf
[j
].pguid
== NULL
) ||
352 (format
->wine_df
->rgodf
[i
].pguid
== NULL
) ||
353 (IsEqualGUID(format
->wine_df
->rgodf
[i
].pguid
, asked_format
->rgodf
[j
].pguid
)))
355 (/* Then check if it accepts any instance id, and if not, if it matches Wine's
358 ((asked_format
->rgodf
[j
].dwType
& DIDFT_INSTANCEMASK
) == DIDFT_ANYINSTANCE
) ||
359 (DIDFT_GETINSTANCE(asked_format
->rgodf
[j
].dwType
) == 0x00FF) || /* This is mentionned in no DX docs, but it works fine - tested on WinXP */
360 (DIDFT_GETINSTANCE(asked_format
->rgodf
[j
].dwType
) == DIDFT_GETINSTANCE(format
->wine_df
->rgodf
[i
].dwType
)))
362 ( /* Then if the asked type matches the one Wine provides */
363 DIDFT_GETTYPE(asked_format
->rgodf
[j
].dwType
) & format
->wine_df
->rgodf
[i
].dwType
))
367 TRACE("Matching :\n");
368 TRACE(" - Asked (%d) :\n", j
);
369 TRACE(" * GUID: %s ('%s')\n",
370 debugstr_guid(asked_format
->rgodf
[j
].pguid
),
371 _dump_dinput_GUID(asked_format
->rgodf
[j
].pguid
));
372 TRACE(" * Offset: %3d\n", asked_format
->rgodf
[j
].dwOfs
);
373 TRACE(" * dwType: %08x\n", asked_format
->rgodf
[j
].dwType
);
374 TRACE(" "); _dump_EnumObjects_flags(asked_format
->rgodf
[j
].dwType
); TRACE("\n");
376 TRACE(" - Wine (%d) :\n", i
);
377 TRACE(" * GUID: %s ('%s')\n",
378 debugstr_guid(format
->wine_df
->rgodf
[i
].pguid
),
379 _dump_dinput_GUID(format
->wine_df
->rgodf
[i
].pguid
));
380 TRACE(" * Offset: %3d\n", format
->wine_df
->rgodf
[i
].dwOfs
);
381 TRACE(" * dwType: %08x\n", format
->wine_df
->rgodf
[i
].dwType
);
382 TRACE(" "); _dump_EnumObjects_flags(format
->wine_df
->rgodf
[i
].dwType
); TRACE("\n");
384 if (format
->wine_df
->rgodf
[i
].dwType
& DIDFT_BUTTON
)
385 dt
[index
].size
= sizeof(BYTE
);
387 dt
[index
].size
= sizeof(DWORD
);
388 dt
[index
].offset_in
= format
->wine_df
->rgodf
[i
].dwOfs
;
389 dt
[index
].offset_out
= asked_format
->rgodf
[j
].dwOfs
;
390 format
->offsets
[i
] = asked_format
->rgodf
[j
].dwOfs
;
392 next
= next
+ dt
[index
].size
;
394 if (format
->wine_df
->rgodf
[i
].dwOfs
!= dt
[index
].offset_out
)
402 if (j
== asked_format
->dwNumObjs
)
406 TRACE("Setting to default value :\n");
407 for (j
= 0; j
< asked_format
->dwNumObjs
; j
++) {
409 TRACE(" - Asked (%d) :\n", j
);
410 TRACE(" * GUID: %s ('%s')\n",
411 debugstr_guid(asked_format
->rgodf
[j
].pguid
),
412 _dump_dinput_GUID(asked_format
->rgodf
[j
].pguid
));
413 TRACE(" * Offset: %3d\n", asked_format
->rgodf
[j
].dwOfs
);
414 TRACE(" * dwType: %08x\n", asked_format
->rgodf
[j
].dwType
);
415 TRACE(" "); _dump_EnumObjects_flags(asked_format
->rgodf
[j
].dwType
); TRACE("\n");
417 if (asked_format
->rgodf
[j
].dwType
& DIDFT_BUTTON
)
418 dt
[index
].size
= sizeof(BYTE
);
420 dt
[index
].size
= sizeof(DWORD
);
421 dt
[index
].offset_in
= -1;
422 dt
[index
].offset_out
= asked_format
->rgodf
[j
].dwOfs
;
430 format
->internal_format_size
= format
->wine_df
->dwDataSize
;
431 format
->size
= index
;
433 HeapFree(GetProcessHeap(), 0, dt
);
438 HeapFree(GetProcessHeap(), 0, done
);
443 HeapFree(GetProcessHeap(), 0, done
);
444 HeapFree(GetProcessHeap(), 0, dt
);
446 HeapFree(GetProcessHeap(), 0, format
->offsets
);
447 format
->offsets
= NULL
;
448 HeapFree(GetProcessHeap(), 0, format
->user_df
);
449 format
->user_df
= NULL
;
451 return DIERR_OUTOFMEMORY
;
454 /* find an object by it's offset in a data format */
455 static int offset_to_object(const DataFormat
*df
, int offset
)
459 if (!df
->offsets
) return -1;
461 for (i
= 0; i
< df
->wine_df
->dwNumObjs
; i
++)
462 if (df
->offsets
[i
] == offset
) return i
;
467 int id_to_object(LPCDIDATAFORMAT df
, int id
)
472 for (i
= 0; i
< df
->dwNumObjs
; i
++)
473 if ((dataformat_to_odf(df
, i
)->dwType
& 0x00ffffff) == id
)
479 int id_to_offset(const DataFormat
*df
, int id
)
481 int obj
= id_to_object(df
->wine_df
, id
);
483 return obj
>= 0 && df
->offsets
? df
->offsets
[obj
] : -1;
486 int find_property(const DataFormat
*df
, LPCDIPROPHEADER ph
)
490 case DIPH_BYID
: return id_to_object(df
->wine_df
, ph
->dwObj
);
491 case DIPH_BYOFFSET
: return offset_to_object(df
, ph
->dwObj
);
493 FIXME("Unhandled ph->dwHow=='%04X'\n", (unsigned int)ph
->dwHow
);
499 BOOL
DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA lpddi
, LPVOID lpvRef
) {
500 DIDEVICEOBJECTINSTANCEW ddtmp
;
501 device_enumobjects_AtoWcb_data
* data
;
503 data
= (device_enumobjects_AtoWcb_data
*) lpvRef
;
505 memset(&ddtmp
, 0, sizeof(ddtmp
));
507 ddtmp
.dwSize
= sizeof(DIDEVICEINSTANCEW
);
508 ddtmp
.guidType
= lpddi
->guidType
;
509 ddtmp
.dwOfs
= lpddi
->dwOfs
;
510 ddtmp
.dwType
= lpddi
->dwType
;
511 ddtmp
.dwFlags
= lpddi
->dwFlags
;
512 MultiByteToWideChar(CP_ACP
, 0, lpddi
->tszName
, -1, ddtmp
.tszName
, MAX_PATH
);
514 if (lpddi
->dwSize
== sizeof(DIDEVICEINSTANCEA
)) {
516 * if dwSize < sizeof(DIDEVICEINSTANCEA of DInput version >= 5)
517 * force feedback and other newer datas aren't available
519 ddtmp
.dwFFMaxForce
= lpddi
->dwFFMaxForce
;
520 ddtmp
.dwFFForceResolution
= lpddi
->dwFFForceResolution
;
521 ddtmp
.wCollectionNumber
= lpddi
->wCollectionNumber
;
522 ddtmp
.wDesignatorIndex
= lpddi
->wDesignatorIndex
;
523 ddtmp
.wUsagePage
= lpddi
->wUsagePage
;
524 ddtmp
.wUsage
= lpddi
->wUsage
;
525 ddtmp
.dwDimension
= lpddi
->dwDimension
;
526 ddtmp
.wExponent
= lpddi
->wExponent
;
527 ddtmp
.wReserved
= lpddi
->wReserved
;
529 return data
->lpCallBack(&ddtmp
, data
->lpvRef
);
532 /******************************************************************************
533 * queue_event - add new event to the ring queue
536 void queue_event(LPDIRECTINPUTDEVICE8A iface
, int ofs
, DWORD data
, DWORD time
, DWORD seq
)
538 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
541 /* Event is being set regardless of the queue state */
542 if (This
->hEvent
) SetEvent(This
->hEvent
);
544 if (!This
->queue_len
|| This
->overflow
|| ofs
< 0) return;
546 next_pos
= (This
->queue_head
+ 1) % This
->queue_len
;
547 if (next_pos
== This
->queue_tail
)
549 TRACE(" queue overflowed\n");
550 This
->overflow
= TRUE
;
554 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n",
555 data
, ofs
, This
->queue_head
, This
->queue_len
);
557 This
->data_queue
[This
->queue_head
].dwOfs
= ofs
;
558 This
->data_queue
[This
->queue_head
].dwData
= data
;
559 This
->data_queue
[This
->queue_head
].dwTimeStamp
= time
;
560 This
->data_queue
[This
->queue_head
].dwSequence
= seq
;
561 This
->queue_head
= next_pos
;
562 /* Send event if asked */
565 /******************************************************************************
569 HRESULT WINAPI
IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface
)
571 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
574 if (!This
->data_format
.user_df
) return DIERR_INVALIDPARAM
;
575 if (This
->dwCoopLevel
& DISCL_FOREGROUND
&& This
->win
!= GetForegroundWindow())
576 return DIERR_OTHERAPPHASPRIO
;
578 EnterCriticalSection(&This
->crit
);
579 res
= This
->acquired
? S_FALSE
: DI_OK
;
583 This
->queue_head
= This
->queue_tail
= This
->overflow
= 0;
584 check_dinput_hooks(iface
);
586 LeaveCriticalSection(&This
->crit
);
591 /******************************************************************************
595 HRESULT WINAPI
IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface
)
597 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
600 EnterCriticalSection(&This
->crit
);
601 res
= !This
->acquired
? DI_NOEFFECT
: DI_OK
;
604 check_dinput_hooks(iface
);
605 LeaveCriticalSection(&This
->crit
);
610 /******************************************************************************
611 * IDirectInputDeviceA
614 HRESULT WINAPI
IDirectInputDevice2AImpl_SetDataFormat(
615 LPDIRECTINPUTDEVICE8A iface
, LPCDIDATAFORMAT df
)
617 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
620 if (!df
) return E_POINTER
;
621 TRACE("(%p) %p\n", This
, df
);
622 _dump_DIDATAFORMAT(df
);
624 if (df
->dwSize
!= sizeof(DIDATAFORMAT
)) return DIERR_INVALIDPARAM
;
625 if (This
->acquired
) return DIERR_ACQUIRED
;
627 EnterCriticalSection(&This
->crit
);
629 release_DataFormat(&This
->data_format
);
630 res
= create_DataFormat(df
, &This
->data_format
);
632 LeaveCriticalSection(&This
->crit
);
636 /******************************************************************************
637 * SetCooperativeLevel
639 * Set cooperative level and the source window for the events.
641 HRESULT WINAPI
IDirectInputDevice2AImpl_SetCooperativeLevel(
642 LPDIRECTINPUTDEVICE8A iface
, HWND hwnd
, DWORD dwflags
)
644 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
646 TRACE("(%p) %p,0x%08x\n", This
, hwnd
, dwflags
);
647 TRACE(" cooperative level : ");
648 _dump_cooperativelevel_DI(dwflags
);
650 if ((dwflags
& (DISCL_EXCLUSIVE
| DISCL_NONEXCLUSIVE
)) == 0 ||
651 (dwflags
& (DISCL_EXCLUSIVE
| DISCL_NONEXCLUSIVE
)) == (DISCL_EXCLUSIVE
| DISCL_NONEXCLUSIVE
) ||
652 (dwflags
& (DISCL_FOREGROUND
| DISCL_BACKGROUND
)) == 0 ||
653 (dwflags
& (DISCL_FOREGROUND
| DISCL_BACKGROUND
)) == (DISCL_FOREGROUND
| DISCL_BACKGROUND
))
654 return DIERR_INVALIDPARAM
;
656 if (dwflags
== (DISCL_NONEXCLUSIVE
| DISCL_BACKGROUND
))
657 hwnd
= GetDesktopWindow();
659 if (!hwnd
) return E_HANDLE
;
661 /* For security reasons native does not allow exclusive background level
662 for mouse and keyboard only */
663 if (dwflags
& DISCL_EXCLUSIVE
&& dwflags
& DISCL_BACKGROUND
&&
664 (IsEqualGUID(&This
->guid
, &GUID_SysMouse
) ||
665 IsEqualGUID(&This
->guid
, &GUID_SysKeyboard
)))
666 return DIERR_UNSUPPORTED
;
668 /* Store the window which asks for the mouse */
669 EnterCriticalSection(&This
->crit
);
671 This
->dwCoopLevel
= dwflags
;
672 LeaveCriticalSection(&This
->crit
);
677 /******************************************************************************
678 * SetEventNotification : specifies event to be sent on state change
680 HRESULT WINAPI
IDirectInputDevice2AImpl_SetEventNotification(
681 LPDIRECTINPUTDEVICE8A iface
, HANDLE event
)
683 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
685 TRACE("(%p) %p\n", This
, event
);
687 EnterCriticalSection(&This
->crit
);
688 This
->hEvent
= event
;
689 LeaveCriticalSection(&This
->crit
);
693 ULONG WINAPI
IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface
)
695 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
698 ref
= InterlockedDecrement(&(This
->ref
));
701 IDirectInputDevice_Unacquire(iface
);
702 /* Reset the FF state, free all effects, etc */
703 IDirectInputDevice8_SendForceFeedbackCommand(iface
, DISFFC_RESET
);
705 HeapFree(GetProcessHeap(), 0, This
->data_queue
);
707 /* Free data format */
708 HeapFree(GetProcessHeap(), 0, This
->data_format
.wine_df
->rgodf
);
709 HeapFree(GetProcessHeap(), 0, This
->data_format
.wine_df
);
710 release_DataFormat(&This
->data_format
);
712 EnterCriticalSection( &This
->dinput
->crit
);
713 list_remove( &This
->entry
);
714 LeaveCriticalSection( &This
->dinput
->crit
);
716 IDirectInput_Release((LPDIRECTINPUTDEVICE8A
)This
->dinput
);
717 This
->crit
.DebugInfo
->Spare
[0] = 0;
718 DeleteCriticalSection(&This
->crit
);
720 HeapFree(GetProcessHeap(), 0, This
);
725 HRESULT WINAPI
IDirectInputDevice2AImpl_QueryInterface(
726 LPDIRECTINPUTDEVICE8A iface
,REFIID riid
,LPVOID
*ppobj
729 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
731 TRACE("(this=%p,%s,%p)\n",This
,debugstr_guid(riid
),ppobj
);
732 if (IsEqualGUID(&IID_IUnknown
,riid
)) {
733 IDirectInputDevice2_AddRef(iface
);
737 if (IsEqualGUID(&IID_IDirectInputDeviceA
,riid
)) {
738 IDirectInputDevice2_AddRef(iface
);
742 if (IsEqualGUID(&IID_IDirectInputDevice2A
,riid
)) {
743 IDirectInputDevice2_AddRef(iface
);
747 if (IsEqualGUID(&IID_IDirectInputDevice7A
,riid
)) {
748 IDirectInputDevice7_AddRef(iface
);
752 if (IsEqualGUID(&IID_IDirectInputDevice8A
,riid
)) {
753 IDirectInputDevice8_AddRef(iface
);
757 TRACE("Unsupported interface !\n");
761 HRESULT WINAPI
IDirectInputDevice2WImpl_QueryInterface(
762 LPDIRECTINPUTDEVICE8W iface
,REFIID riid
,LPVOID
*ppobj
765 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
767 TRACE("(this=%p,%s,%p)\n",This
,debugstr_guid(riid
),ppobj
);
768 if (IsEqualGUID(&IID_IUnknown
,riid
)) {
769 IDirectInputDevice2_AddRef(iface
);
773 if (IsEqualGUID(&IID_IDirectInputDeviceW
,riid
)) {
774 IDirectInputDevice2_AddRef(iface
);
778 if (IsEqualGUID(&IID_IDirectInputDevice2W
,riid
)) {
779 IDirectInputDevice2_AddRef(iface
);
783 if (IsEqualGUID(&IID_IDirectInputDevice7W
,riid
)) {
784 IDirectInputDevice7_AddRef(iface
);
788 if (IsEqualGUID(&IID_IDirectInputDevice8W
,riid
)) {
789 IDirectInputDevice8_AddRef(iface
);
793 TRACE("Unsupported interface !\n");
797 ULONG WINAPI
IDirectInputDevice2AImpl_AddRef(
798 LPDIRECTINPUTDEVICE8A iface
)
800 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
801 return InterlockedIncrement(&(This
->ref
));
804 HRESULT WINAPI
IDirectInputDevice2AImpl_EnumObjects(LPDIRECTINPUTDEVICE8A iface
,
805 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback
, LPVOID lpvRef
, DWORD dwFlags
)
807 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
808 DIDEVICEOBJECTINSTANCEA ddoi
;
811 TRACE("(%p) %p,%p flags:%08x)\n", iface
, lpCallback
, lpvRef
, dwFlags
);
812 TRACE(" - flags = ");
813 _dump_EnumObjects_flags(dwFlags
);
816 /* Only the fields till dwFFMaxForce are relevant */
817 memset(&ddoi
, 0, sizeof(ddoi
));
818 ddoi
.dwSize
= FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA
, dwFFMaxForce
);
820 for (i
= 0; i
< This
->data_format
.wine_df
->dwNumObjs
; i
++)
822 LPDIOBJECTDATAFORMAT odf
= dataformat_to_odf(This
->data_format
.wine_df
, i
);
824 if (dwFlags
!= DIDFT_ALL
&& !(dwFlags
& DIEFT_GETTYPE(odf
->dwType
))) continue;
825 if (IDirectInputDevice_GetObjectInfo(iface
, &ddoi
, odf
->dwType
, DIPH_BYID
) != DI_OK
)
828 if (lpCallback(&ddoi
, lpvRef
) != DIENUM_CONTINUE
) break;
834 HRESULT WINAPI
IDirectInputDevice2WImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface
,
835 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback
, LPVOID lpvRef
, DWORD dwFlags
)
837 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
838 DIDEVICEOBJECTINSTANCEW ddoi
;
841 TRACE("(%p) %p,%p flags:%08x)\n", iface
, lpCallback
, lpvRef
, dwFlags
);
842 TRACE(" - flags = ");
843 _dump_EnumObjects_flags(dwFlags
);
846 /* Only the fields till dwFFMaxForce are relevant */
847 memset(&ddoi
, 0, sizeof(ddoi
));
848 ddoi
.dwSize
= FIELD_OFFSET(DIDEVICEOBJECTINSTANCEW
, dwFFMaxForce
);
850 for (i
= 0; i
< This
->data_format
.wine_df
->dwNumObjs
; i
++)
852 LPDIOBJECTDATAFORMAT odf
= dataformat_to_odf(This
->data_format
.wine_df
, i
);
854 if (dwFlags
!= DIDFT_ALL
&& !(dwFlags
& DIEFT_GETTYPE(odf
->dwType
))) continue;
855 if (IDirectInputDevice_GetObjectInfo(iface
, &ddoi
, odf
->dwType
, DIPH_BYID
) != DI_OK
)
858 if (lpCallback(&ddoi
, lpvRef
) != DIENUM_CONTINUE
) break;
864 /******************************************************************************
868 HRESULT WINAPI
IDirectInputDevice2AImpl_GetProperty(
869 LPDIRECTINPUTDEVICE8A iface
, REFGUID rguid
, LPDIPROPHEADER pdiph
)
871 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
873 TRACE("(%p) %s,%p\n", iface
, debugstr_guid(rguid
), pdiph
);
874 _dump_DIPROPHEADER(pdiph
);
876 if (HIWORD(rguid
)) return DI_OK
;
878 switch (LOWORD(rguid
))
880 case (DWORD
) DIPROP_BUFFERSIZE
:
882 LPDIPROPDWORD pd
= (LPDIPROPDWORD
)pdiph
;
884 if (pdiph
->dwSize
!= sizeof(DIPROPDWORD
)) return DIERR_INVALIDPARAM
;
886 pd
->dwData
= This
->queue_len
;
887 TRACE("buffersize = %d\n", pd
->dwData
);
891 WARN("Unknown property %s\n", debugstr_guid(rguid
));
898 /******************************************************************************
902 HRESULT WINAPI
IDirectInputDevice2AImpl_SetProperty(
903 LPDIRECTINPUTDEVICE8A iface
, REFGUID rguid
, LPCDIPROPHEADER pdiph
)
905 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
907 TRACE("(%p) %s,%p\n", iface
, debugstr_guid(rguid
), pdiph
);
908 _dump_DIPROPHEADER(pdiph
);
910 if (HIWORD(rguid
)) return DI_OK
;
912 switch (LOWORD(rguid
))
914 case (DWORD
) DIPROP_AXISMODE
:
916 LPCDIPROPDWORD pd
= (LPCDIPROPDWORD
)pdiph
;
918 if (pdiph
->dwSize
!= sizeof(DIPROPDWORD
)) return DIERR_INVALIDPARAM
;
919 if (pdiph
->dwHow
== DIPH_DEVICE
&& pdiph
->dwObj
) return DIERR_INVALIDPARAM
;
920 if (This
->acquired
) return DIERR_ACQUIRED
;
921 if (pdiph
->dwHow
!= DIPH_DEVICE
) return DIERR_UNSUPPORTED
;
922 if (!This
->data_format
.user_df
) return DI_OK
;
924 TRACE("Axis mode: %s\n", pd
->dwData
== DIPROPAXISMODE_ABS
? "absolute" :
927 EnterCriticalSection(&This
->crit
);
928 This
->data_format
.user_df
->dwFlags
&= ~DIDFT_AXIS
;
929 This
->data_format
.user_df
->dwFlags
|= pd
->dwData
== DIPROPAXISMODE_ABS
?
930 DIDF_ABSAXIS
: DIDF_RELAXIS
;
931 LeaveCriticalSection(&This
->crit
);
934 case (DWORD
) DIPROP_BUFFERSIZE
:
936 LPCDIPROPDWORD pd
= (LPCDIPROPDWORD
)pdiph
;
938 if (pdiph
->dwSize
!= sizeof(DIPROPDWORD
)) return DIERR_INVALIDPARAM
;
939 if (This
->acquired
) return DIERR_ACQUIRED
;
941 TRACE("buffersize = %d\n", pd
->dwData
);
943 EnterCriticalSection(&This
->crit
);
944 HeapFree(GetProcessHeap(), 0, This
->data_queue
);
946 This
->data_queue
= !pd
->dwData
? NULL
: HeapAlloc(GetProcessHeap(), 0,
947 pd
->dwData
* sizeof(DIDEVICEOBJECTDATA
));
948 This
->queue_head
= This
->queue_tail
= This
->overflow
= 0;
949 This
->queue_len
= pd
->dwData
;
951 LeaveCriticalSection(&This
->crit
);
955 WARN("Unknown property %s\n", debugstr_guid(rguid
));
956 return DIERR_UNSUPPORTED
;
962 HRESULT WINAPI
IDirectInputDevice2AImpl_GetObjectInfo(
963 LPDIRECTINPUTDEVICE8A iface
,
964 LPDIDEVICEOBJECTINSTANCEA pdidoi
,
968 DIDEVICEOBJECTINSTANCEW didoiW
;
972 (pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCEA
) &&
973 pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCE_DX3A
)))
974 return DIERR_INVALIDPARAM
;
976 didoiW
.dwSize
= sizeof(didoiW
);
977 res
= IDirectInputDevice2WImpl_GetObjectInfo((LPDIRECTINPUTDEVICE8W
)iface
, &didoiW
, dwObj
, dwHow
);
980 DWORD dwSize
= pdidoi
->dwSize
;
982 memset(pdidoi
, 0, pdidoi
->dwSize
);
983 pdidoi
->dwSize
= dwSize
;
984 pdidoi
->guidType
= didoiW
.guidType
;
985 pdidoi
->dwOfs
= didoiW
.dwOfs
;
986 pdidoi
->dwType
= didoiW
.dwType
;
987 pdidoi
->dwFlags
= didoiW
.dwFlags
;
993 HRESULT WINAPI
IDirectInputDevice2WImpl_GetObjectInfo(
994 LPDIRECTINPUTDEVICE8W iface
,
995 LPDIDEVICEOBJECTINSTANCEW pdidoi
,
999 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
1001 LPDIOBJECTDATAFORMAT odf
;
1004 TRACE("(%p) %d(0x%08x) -> %p\n", This
, dwHow
, dwObj
, pdidoi
);
1007 (pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCEW
) &&
1008 pdidoi
->dwSize
!= sizeof(DIDEVICEOBJECTINSTANCE_DX3W
)))
1009 return DIERR_INVALIDPARAM
;
1014 if (!This
->data_format
.offsets
) break;
1015 for (idx
= This
->data_format
.wine_df
->dwNumObjs
- 1; idx
>= 0; idx
--)
1016 if (This
->data_format
.offsets
[idx
] == dwObj
) break;
1019 dwObj
&= 0x00ffffff;
1020 for (idx
= This
->data_format
.wine_df
->dwNumObjs
- 1; idx
>= 0; idx
--)
1021 if ((dataformat_to_odf(This
->data_format
.wine_df
, idx
)->dwType
& 0x00ffffff) == dwObj
)
1026 FIXME("dwHow = DIPH_BYUSAGE not implemented\n");
1029 WARN("invalid parameter: dwHow = %08x\n", dwHow
);
1030 return DIERR_INVALIDPARAM
;
1032 if (idx
< 0) return DIERR_OBJECTNOTFOUND
;
1034 odf
= dataformat_to_odf(This
->data_format
.wine_df
, idx
);
1035 dwSize
= pdidoi
->dwSize
; /* save due to memset below */
1036 memset(pdidoi
, 0, pdidoi
->dwSize
);
1037 pdidoi
->dwSize
= dwSize
;
1038 if (odf
->pguid
) pdidoi
->guidType
= *odf
->pguid
;
1039 pdidoi
->dwOfs
= This
->data_format
.offsets
? This
->data_format
.offsets
[idx
] : odf
->dwOfs
;
1040 pdidoi
->dwType
= odf
->dwType
;
1041 pdidoi
->dwFlags
= odf
->dwFlags
;
1046 HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceData(
1047 LPDIRECTINPUTDEVICE8A iface
, DWORD dodsize
, LPDIDEVICEOBJECTDATA dod
,
1048 LPDWORD entries
, DWORD flags
)
1050 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
1051 HRESULT ret
= DI_OK
;
1054 TRACE("(%p) %p -> %p(%d) x%d, 0x%08x\n",
1055 This
, dod
, entries
, entries
? *entries
: 0, dodsize
, flags
);
1057 if (!This
->acquired
)
1058 return DIERR_NOTACQUIRED
;
1059 if (!This
->queue_len
)
1060 return DIERR_NOTBUFFERED
;
1061 if (dodsize
< sizeof(DIDEVICEOBJECTDATA_DX3
))
1062 return DIERR_INVALIDPARAM
;
1064 IDirectInputDevice2_Poll(iface
);
1065 EnterCriticalSection(&This
->crit
);
1067 len
= This
->queue_head
- This
->queue_tail
;
1068 if (len
< 0) len
+= This
->queue_len
;
1070 if ((*entries
!= INFINITE
) && (len
> *entries
)) len
= *entries
;
1075 for (i
= 0; i
< len
; i
++)
1077 int n
= (This
->queue_tail
+ i
) % This
->queue_len
;
1078 memcpy((char *)dod
+ dodsize
* i
, This
->data_queue
+ n
, dodsize
);
1084 ret
= DI_BUFFEROVERFLOW
;
1086 if (!(flags
& DIGDD_PEEK
))
1088 /* Advance reading position */
1089 This
->queue_tail
= (This
->queue_tail
+ len
) % This
->queue_len
;
1090 This
->overflow
= FALSE
;
1093 LeaveCriticalSection(&This
->crit
);
1095 TRACE("Returning %d events queued\n", *entries
);
1099 HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceInfo(
1100 LPDIRECTINPUTDEVICE8A iface
,
1101 LPDIDEVICEINSTANCEA pdidi
)
1103 FIXME("(this=%p,%p): stub!\n",
1109 HRESULT WINAPI
IDirectInputDevice2WImpl_GetDeviceInfo(
1110 LPDIRECTINPUTDEVICE8W iface
,
1111 LPDIDEVICEINSTANCEW pdidi
)
1113 FIXME("(this=%p,%p): stub!\n",
1119 HRESULT WINAPI
IDirectInputDevice2AImpl_RunControlPanel(
1120 LPDIRECTINPUTDEVICE8A iface
,
1124 FIXME("(this=%p,%p,0x%08x): stub!\n",
1125 iface
, hwndOwner
, dwFlags
);
1130 HRESULT WINAPI
IDirectInputDevice2AImpl_Initialize(
1131 LPDIRECTINPUTDEVICE8A iface
,
1136 FIXME("(this=%p,%p,%d,%s): stub!\n",
1137 iface
, hinst
, dwVersion
, debugstr_guid(rguid
));
1141 /******************************************************************************
1142 * IDirectInputDevice2A
1145 HRESULT WINAPI
IDirectInputDevice2AImpl_CreateEffect(
1146 LPDIRECTINPUTDEVICE8A iface
,
1149 LPDIRECTINPUTEFFECT
*ppdef
,
1150 LPUNKNOWN pUnkOuter
)
1152 FIXME("(this=%p,%s,%p,%p,%p): stub!\n",
1153 iface
, debugstr_guid(rguid
), lpeff
, ppdef
, pUnkOuter
);
1157 HRESULT WINAPI
IDirectInputDevice2AImpl_EnumEffects(
1158 LPDIRECTINPUTDEVICE8A iface
,
1159 LPDIENUMEFFECTSCALLBACKA lpCallback
,
1163 FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1164 iface
, lpCallback
, lpvRef
, dwFlags
);
1169 HRESULT WINAPI
IDirectInputDevice2WImpl_EnumEffects(
1170 LPDIRECTINPUTDEVICE8W iface
,
1171 LPDIENUMEFFECTSCALLBACKW lpCallback
,
1175 FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1176 iface
, lpCallback
, lpvRef
, dwFlags
);
1181 HRESULT WINAPI
IDirectInputDevice2AImpl_GetEffectInfo(
1182 LPDIRECTINPUTDEVICE8A iface
,
1183 LPDIEFFECTINFOA lpdei
,
1186 FIXME("(this=%p,%p,%s): stub!\n",
1187 iface
, lpdei
, debugstr_guid(rguid
));
1191 HRESULT WINAPI
IDirectInputDevice2WImpl_GetEffectInfo(
1192 LPDIRECTINPUTDEVICE8W iface
,
1193 LPDIEFFECTINFOW lpdei
,
1196 FIXME("(this=%p,%p,%s): stub!\n",
1197 iface
, lpdei
, debugstr_guid(rguid
));
1201 HRESULT WINAPI
IDirectInputDevice2AImpl_GetForceFeedbackState(
1202 LPDIRECTINPUTDEVICE8A iface
,
1205 FIXME("(this=%p,%p): stub!\n",
1210 HRESULT WINAPI
IDirectInputDevice2AImpl_SendForceFeedbackCommand(
1211 LPDIRECTINPUTDEVICE8A iface
,
1214 TRACE("(%p) 0x%08x:\n", iface
, dwFlags
);
1218 HRESULT WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
1219 LPDIRECTINPUTDEVICE8A iface
,
1220 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback
,
1224 FIXME("(this=%p,%p,%p,0x%08x): stub!\n",
1225 iface
, lpCallback
, lpvRef
, dwFlags
);
1229 HRESULT WINAPI
IDirectInputDevice2AImpl_Escape(
1230 LPDIRECTINPUTDEVICE8A iface
,
1231 LPDIEFFESCAPE lpDIEEsc
)
1233 FIXME("(this=%p,%p): stub!\n",
1238 HRESULT WINAPI
IDirectInputDevice2AImpl_Poll(
1239 LPDIRECTINPUTDEVICE8A iface
)
1241 IDirectInputDevice2AImpl
*This
= (IDirectInputDevice2AImpl
*)iface
;
1243 if (!This
->acquired
) return DIERR_NOTACQUIRED
;
1244 /* Because wine devices do not need to be polled, just return DI_NOEFFECT */
1248 HRESULT WINAPI
IDirectInputDevice2AImpl_SendDeviceData(
1249 LPDIRECTINPUTDEVICE8A iface
,
1251 LPCDIDEVICEOBJECTDATA rgdod
,
1255 FIXME("(this=%p,0x%08x,%p,%p,0x%08x): stub!\n",
1256 iface
, cbObjectData
, rgdod
, pdwInOut
, dwFlags
);
1261 HRESULT WINAPI
IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface
,
1262 LPCSTR lpszFileName
,
1263 LPDIENUMEFFECTSINFILECALLBACK pec
,
1267 FIXME("(%p)->(%s,%p,%p,%08x): stub !\n", iface
, lpszFileName
, pec
, pvRef
, dwFlags
);
1272 HRESULT WINAPI
IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface
,
1273 LPCWSTR lpszFileName
,
1274 LPDIENUMEFFECTSINFILECALLBACK pec
,
1278 FIXME("(%p)->(%s,%p,%p,%08x): stub !\n", iface
, debugstr_w(lpszFileName
), pec
, pvRef
, dwFlags
);
1283 HRESULT WINAPI
IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface
,
1284 LPCSTR lpszFileName
,
1286 LPDIFILEEFFECT rgDiFileEft
,
1289 FIXME("(%p)->(%s,%08x,%p,%08x): stub !\n", iface
, lpszFileName
, dwEntries
, rgDiFileEft
, dwFlags
);
1294 HRESULT WINAPI
IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface
,
1295 LPCWSTR lpszFileName
,
1297 LPDIFILEEFFECT rgDiFileEft
,
1300 FIXME("(%p)->(%s,%08x,%p,%08x): stub !\n", iface
, debugstr_w(lpszFileName
), dwEntries
, rgDiFileEft
, dwFlags
);
1305 HRESULT WINAPI
IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface
,
1306 LPDIACTIONFORMATA lpdiaf
,
1307 LPCSTR lpszUserName
,
1310 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, lpszUserName
, dwFlags
);
1315 HRESULT WINAPI
IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface
,
1316 LPDIACTIONFORMATW lpdiaf
,
1317 LPCWSTR lpszUserName
,
1320 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, debugstr_w(lpszUserName
), dwFlags
);
1325 HRESULT WINAPI
IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface
,
1326 LPDIACTIONFORMATA lpdiaf
,
1327 LPCSTR lpszUserName
,
1330 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, lpszUserName
, dwFlags
);
1335 HRESULT WINAPI
IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
,
1336 LPDIACTIONFORMATW lpdiaf
,
1337 LPCWSTR lpszUserName
,
1340 FIXME("(%p)->(%p,%s,%08x): stub !\n", iface
, lpdiaf
, debugstr_w(lpszUserName
), dwFlags
);
1345 HRESULT WINAPI
IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface
,
1346 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader
)
1348 FIXME("(%p)->(%p): stub !\n", iface
, lpdiDevImageInfoHeader
);
1353 HRESULT WINAPI
IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface
,
1354 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader
)
1356 FIXME("(%p)->(%p): stub !\n", iface
, lpdiDevImageInfoHeader
);