diff --git a/reactos/dll/directx/wine/dinput/dinput_main.c b/reactos/dll/directx/wine/dinput/dinput_main.c index c885b6800a1..8d24efba5b3 100644 --- a/reactos/dll/directx/wine/dinput/dinput_main.c +++ b/reactos/dll/directx/wine/dinput/dinput_main.c @@ -60,10 +60,6 @@ static inline IDirectInputImpl *impl_from_IDirectInput8W( IDirectInput8W *iface return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8W_iface ); } -static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface) -{ - return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8A_iface); -} static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface) { return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface); diff --git a/reactos/dll/directx/wine/dinput/joystick.c b/reactos/dll/directx/wine/dinput/joystick.c index df42d16c1a4..1c801ccd1c5 100644 --- a/reactos/dll/directx/wine/dinput/joystick.c +++ b/reactos/dll/directx/wine/dinput/joystick.c @@ -398,16 +398,38 @@ HRESULT WINAPI JoystickAGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface, REF return JoystickWGenericImpl_SetProperty(IDirectInputDevice8W_from_impl(This), rguid, ph); } +#define DEBUG_TYPE(x) case (x): str = #x; break void _dump_DIDEVCAPS(const DIDEVCAPS *lpDIDevCaps) { + int type = GET_DIDEVICE_TYPE(lpDIDevCaps->dwDevType); + const char *str; TRACE("dwSize: %d\n", lpDIDevCaps->dwSize); TRACE("dwFlags: %08x\n", lpDIDevCaps->dwFlags); - TRACE("dwDevType: %08x %s\n", lpDIDevCaps->dwDevType, - lpDIDevCaps->dwDevType == DIDEVTYPE_DEVICE ? "DIDEVTYPE_DEVICE" : - lpDIDevCaps->dwDevType == DIDEVTYPE_MOUSE ? "DIDEVTYPE_MOUSE" : - lpDIDevCaps->dwDevType == DIDEVTYPE_KEYBOARD ? "DIDEVTYPE_KEYBOARD" : - lpDIDevCaps->dwDevType == DIDEVTYPE_JOYSTICK ? "DIDEVTYPE_JOYSTICK" : - lpDIDevCaps->dwDevType == DIDEVTYPE_HID ? "DIDEVTYPE_HID" : "UNKNOWN"); + switch(type) + { + /* Directx <= 7 definitions */ + DEBUG_TYPE(DIDEVTYPE_DEVICE); + DEBUG_TYPE(DIDEVTYPE_MOUSE); + DEBUG_TYPE(DIDEVTYPE_KEYBOARD); + DEBUG_TYPE(DIDEVTYPE_JOYSTICK); + DEBUG_TYPE(DIDEVTYPE_HID); + /* Directx >= 8 definitions */ + DEBUG_TYPE(DI8DEVTYPE_DEVICE); + DEBUG_TYPE(DI8DEVTYPE_MOUSE); + DEBUG_TYPE(DI8DEVTYPE_KEYBOARD); + DEBUG_TYPE(DI8DEVTYPE_JOYSTICK); + DEBUG_TYPE(DI8DEVTYPE_GAMEPAD); + DEBUG_TYPE(DI8DEVTYPE_DRIVING); + DEBUG_TYPE(DI8DEVTYPE_FLIGHT); + DEBUG_TYPE(DI8DEVTYPE_1STPERSON); + DEBUG_TYPE(DI8DEVTYPE_DEVICECTRL); + DEBUG_TYPE(DI8DEVTYPE_SCREENPOINTER); + DEBUG_TYPE(DI8DEVTYPE_REMOTE); + DEBUG_TYPE(DI8DEVTYPE_SUPPLEMENTAL); + default: str = "UNKNOWN"; + } + + TRACE("dwDevType: %08x %s\n", lpDIDevCaps->dwDevType, str); TRACE("dwAxes: %d\n", lpDIDevCaps->dwAxes); TRACE("dwButtons: %d\n", lpDIDevCaps->dwButtons); TRACE("dwPOVs: %d\n", lpDIDevCaps->dwPOVs); @@ -419,6 +441,7 @@ void _dump_DIDEVCAPS(const DIDEVCAPS *lpDIDevCaps) TRACE("dwFFDriverVersion: %d\n", lpDIDevCaps->dwFFDriverVersion); } } +#undef DEBUG_TYPE HRESULT WINAPI JoystickWGenericImpl_GetCapabilities(LPDIRECTINPUTDEVICE8W iface, LPDIDEVCAPS lpDIDevCaps) { diff --git a/reactos/dll/directx/wine/dinput/joystick_linux.c b/reactos/dll/directx/wine/dinput/joystick_linux.c index 10aa350c068..418bdbb355f 100644 --- a/reactos/dll/directx/wine/dinput/joystick_linux.c +++ b/reactos/dll/directx/wine/dinput/joystick_linux.c @@ -87,10 +87,7 @@ static inline JoystickImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W return CONTAINING_RECORD(CONTAINING_RECORD(CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface), JoystickGenericImpl, base), JoystickImpl, generic); } -static inline IDirectInputDevice8A *IDirectInputDevice8A_from_impl(JoystickImpl *This) -{ - return &This->generic.base.IDirectInputDevice8A_iface; -} + static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(JoystickImpl *This) { return &This->generic.base.IDirectInputDevice8W_iface; @@ -149,6 +146,9 @@ static INT find_joystick_devices(void) WARN("ioctl(%s,JSIOCGAXES) failed: %s, defauting to 2\n", joydev.device, strerror(errno)); joydev.axis_count = 2; } +#else + WARN("reading number of joystick axes unsupported in this platform, defaulting to 2\n"); + joydev.axis_count = 2; #endif #ifdef JSIOCGBUTTONS if (ioctl(fd, JSIOCGBUTTONS, &joydev.button_count) < 0) @@ -156,6 +156,9 @@ static INT find_joystick_devices(void) WARN("ioctl(%s,JSIOCGBUTTONS) failed: %s, defauting to 2\n", joydev.device, strerror(errno)); joydev.button_count = 2; } +#else + WARN("reading number of joystick buttons unsupported in this platform, defaulting to 2\n"); + joydev.button_count = 2; #endif if (ioctl(fd, JSIOCGAXMAP, axes_map) < 0) diff --git a/reactos/dll/directx/wine/dinput/joystick_linuxinput.c b/reactos/dll/directx/wine/dinput/joystick_linuxinput.c index 2b754f2bd43..7d95c778447 100644 --- a/reactos/dll/directx/wine/dinput/joystick_linuxinput.c +++ b/reactos/dll/directx/wine/dinput/joystick_linuxinput.c @@ -124,10 +124,7 @@ static inline JoystickImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W return CONTAINING_RECORD(CONTAINING_RECORD(CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface), JoystickGenericImpl, base), JoystickImpl, generic); } -static inline IDirectInputDevice8A *IDirectInputDevice8A_from_impl(JoystickImpl *This) -{ - return &This->generic.base.IDirectInputDevice8A_iface; -} + static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(JoystickImpl *This) { return &This->generic.base.IDirectInputDevice8W_iface; diff --git a/reactos/dll/directx/wine/dinput/keyboard.c b/reactos/dll/directx/wine/dinput/keyboard.c index 28e7bd23ce8..decf3d13973 100644 --- a/reactos/dll/directx/wine/dinput/keyboard.c +++ b/reactos/dll/directx/wine/dinput/keyboard.c @@ -319,6 +319,10 @@ static HRESULT WINAPI SysKeyboardWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W ifac if (len != This->base.data_format.user_df->dwDataSize ) return DIERR_INVALIDPARAM; +#ifndef __REACTOS__ + __wine_check_for_events( QS_ALLINPUT ); +#endif + EnterCriticalSection(&This->base.crit); if (TRACE_ON(dinput)) { diff --git a/reactos/dll/directx/wine/dinput/mouse.c b/reactos/dll/directx/wine/dinput/mouse.c index d73a94a0434..73f7b5808ad 100644 --- a/reactos/dll/directx/wine/dinput/mouse.c +++ b/reactos/dll/directx/wine/dinput/mouse.c @@ -66,10 +66,7 @@ static inline SysMouseImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W { return CONTAINING_RECORD(CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface), SysMouseImpl, base); } -static inline IDirectInputDevice8A *IDirectInputDevice8A_from_impl(SysMouseImpl *This) -{ - return &This->base.IDirectInputDevice8A_iface; -} + static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(SysMouseImpl *This) { return &This->base.IDirectInputDevice8W_iface; @@ -536,6 +533,10 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface, if(This->base.acquired == 0) return DIERR_NOTACQUIRED; +#ifndef __REACTOS__ + __wine_check_for_events( QS_ALLINPUT ); +#endif + TRACE("(this=%p,0x%08x,%p):\n", This, len, ptr); _dump_mouse_state(&This->m_state); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 65e14008887..b72d3776cdf 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -36,7 +36,7 @@ reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.27 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.27 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.27 -reactos/dll/directx/wine/dinput # Synced to Wine-1.7.27 +reactos/dll/directx/wine/dinput # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.27 reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.27 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.27