Module: wine Branch: master Commit: 2004db1bb1b7aca9259a756449c3ddf3872426a6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2004db1bb1b7aca9259a756449...
Author: Michael Stefaniuc mstefani@redhat.de Date: Tue Feb 2 00:11:49 2010 +0100
dinput: Don't use HIWORD to check if a REFGUID is a DIPROP.
---
dlls/dinput/device.c | 4 ++-- dlls/dinput/dinput_private.h | 2 ++ dlls/dinput/joystick.c | 4 ++-- dlls/dinput/joystick_linuxinput.c | 4 ++-- dlls/dinput/keyboard.c | 2 +- dlls/dinput/mouse.c | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index c0f15ff..a5c61ab 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -872,7 +872,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty( TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph);
- if (HIWORD(rguid)) return DI_OK; + if (!IS_DIPROP(rguid)) return DI_OK;
switch (LOWORD(rguid)) { @@ -906,7 +906,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty( TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph);
- if (HIWORD(rguid)) return DI_OK; + if (!IS_DIPROP(rguid)) return DI_OK;
switch (LOWORD(rguid)) { diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h index ddb9aa0..16b4559 100644 --- a/dlls/dinput/dinput_private.h +++ b/dlls/dinput/dinput_private.h @@ -65,4 +65,6 @@ typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM);
extern void _dump_diactionformatA(LPDIACTIONFORMATA);
+#define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0) + #endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */ diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 84e45c9..0f39a6d 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -53,7 +53,7 @@ HRESULT WINAPI JoystickAGenericImpl_SetProperty( if (TRACE_ON(dinput)) _dump_DIPROPHEADER(ph);
- if (!HIWORD(rguid)) { + if (IS_DIPROP(rguid)) { switch (LOWORD(rguid)) { case (DWORD_PTR)DIPROP_RANGE: { LPCDIPROPRANGE pr = (LPCDIPROPRANGE)ph; @@ -230,7 +230,7 @@ HRESULT WINAPI JoystickAGenericImpl_GetProperty( if (TRACE_ON(dinput)) _dump_DIPROPHEADER(pdiph);
- if (!HIWORD(rguid)) { + if (IS_DIPROP(rguid)) { switch (LOWORD(rguid)) { case (DWORD_PTR) DIPROP_RANGE: { LPDIPROPRANGE pr = (LPDIPROPRANGE)pdiph; diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 6c3c8cc..6da6066 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -847,7 +847,7 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface, TRACE("ph.dwSize = %d, ph.dwHeaderSize =%d, ph.dwObj = %d, ph.dwHow= %d\n", ph->dwSize, ph->dwHeaderSize, ph->dwObj, ph->dwHow);
- if (!HIWORD(rguid)) { + if (IS_DIPROP(rguid)) { switch (LOWORD(rguid)) { case (DWORD_PTR)DIPROP_CALIBRATIONMODE: { LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; @@ -898,7 +898,7 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph);
- if (HIWORD(rguid)) return DI_OK; + if (!IS_DIPROP(rguid)) return DI_OK;
switch (LOWORD(rguid)) { case (DWORD_PTR) DIPROP_AUTOCENTER: diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 3692878..4f6aac5 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -447,7 +447,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph);
- if (HIWORD(rguid)) return DI_OK; + if (!IS_DIPROP(rguid)) return DI_OK;
switch (LOWORD(rguid)) { diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 4809c56..e05d9e2 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -587,7 +587,7 @@ static HRESULT WINAPI SysMouseAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, TRACE("(%p) %s,%p\n", This, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph);
- if (!HIWORD(rguid)) { + if (IS_DIPROP(rguid)) { switch (LOWORD(rguid)) { case (DWORD_PTR) DIPROP_GRANULARITY: { LPDIPROPDWORD pr = (LPDIPROPDWORD) pdiph;