[PATCH] dinput: Fix mac build

Andrew Eikum aeikum at codeweavers.com
Wed Aug 15 10:08:46 CDT 2018


Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
---
 dlls/dinput/joystick_osx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 282b6c2790..2b2aade813 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -988,16 +988,19 @@ static HRESULT joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINS
 {
     char name[MAX_PATH];
     char friendly[32];
+    IOHIDDeviceRef device;
 
     TRACE("dwDevType %u dwFlags 0x%08x version 0x%04x id %d\n", dwDevType, dwFlags, version, id);
 
     if (id >= find_joystick_devices()) return E_FAIL;
 
+    device = get_device_ref(id);
+
     if ((dwDevType == 0) ||
     ((dwDevType == DIDEVTYPE_JOYSTICK) && (version > 0x0300 && version < 0x0800)) ||
     (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800))) {
+
         if (dwFlags & DIEDFL_FORCEFEEDBACK) {
-            IOHIDDeviceRef device = get_device_ref(id);
             if(!device)
                 return S_FALSE;
             if(get_ff(device, NULL) != S_OK)
-- 
2.18.0




More information about the wine-devel mailing list