Wine-20051011 vendor drop
Added: vendor/wine/dlls/dinput/Wine-20050111/
Modified: vendor/wine/dlls/dinput/Wine-20050111/dinput_main.c
Modified: vendor/wine/dlls/dinput/Wine-20050111/joystick_linux.c
Modified: vendor/wine/dlls/dinput/Wine-20050111/joystick_linuxinput.c
Modified: vendor/wine/dlls/dinput/Wine-20050111/keyboard.c
Modified: vendor/wine/dlls/dinput/Wine-20050111/mouse.c
Modified: vendor/wine/dlls/dinput/current/dinput_main.c
Modified: vendor/wine/dlls/dinput/current/joystick_linux.c
Modified: vendor/wine/dlls/dinput/current/joystick_linuxinput.c
Modified: vendor/wine/dlls/dinput/current/keyboard.c
Modified: vendor/wine/dlls/dinput/current/mouse.c

Copied: vendor/wine/dlls/dinput/Wine-20050111 (from rev 12927, vendor/wine/dlls/dinput/current)

Modified: vendor/wine/dlls/dinput/Wine-20050111/dinput_main.c
--- vendor/wine/dlls/dinput/current/dinput_main.c	2005-01-11 20:23:48 UTC (rev 12927)
+++ vendor/wine/dlls/dinput/Wine-20050111/dinput_main.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -704,13 +704,13 @@
 HRESULT WINAPI DINPUT_DllGetClassObject(REFCLSID rclsid, REFIID riid,
 					LPVOID *ppv)
 {
-    TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+    TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
     if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
     	*ppv = (LPVOID)&DINPUT_CF;
 	IClassFactory_AddRef((IClassFactory*)*ppv);
     return S_OK;
     }
 
-    FIXME("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+    FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
     return CLASS_E_CLASSNOTAVAILABLE;
 }

Modified: vendor/wine/dlls/dinput/Wine-20050111/joystick_linux.c
--- vendor/wine/dlls/dinput/current/joystick_linux.c	2005-01-11 20:23:48 UTC (rev 12927)
+++ vendor/wine/dlls/dinput/Wine-20050111/joystick_linux.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -157,7 +157,9 @@
         return FALSE;
     }
 
-    if ((dwDevType==0) || (GET_DIDEVICE_TYPE(dwDevType)==DIDEVTYPE_JOYSTICK)) {
+    if ((dwDevType == 0) ||
+	((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+	(((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))) {
         /* check whether we have a joystick */
         sprintf(dev, "%s%d", JOYDEV, id);
         if ((fd = open(dev,O_RDONLY)) < 0) {
@@ -205,7 +207,9 @@
         return FALSE;
     }
 
-    if ((dwDevType==0) || (GET_DIDEVICE_TYPE(dwDevType)==DIDEVTYPE_JOYSTICK)) {
+    if ((dwDevType == 0) ||
+	((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+	(((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))) {
         /* check whether we have a joystick */
         sprintf(dev, "%s%d", JOYDEV, id);
         if ((fd = open(dev,O_RDONLY)) < 0) {
@@ -552,7 +556,10 @@
 
     newDevice->devcaps.dwSize = sizeof(newDevice->devcaps);
     newDevice->devcaps.dwFlags = DIDC_ATTACHED;
-    newDevice->devcaps.dwDevType = DIDEVTYPE_JOYSTICK;
+    if (newDevice->dinput->version >= 8)
+        newDevice->devcaps.dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
+    else
+        newDevice->devcaps.dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
     newDevice->devcaps.dwFFSamplePeriod = 0;
     newDevice->devcaps.dwFFMinTimeResolution = 0;
     newDevice->devcaps.dwFirmwareRevision = 0;
@@ -573,18 +580,12 @@
 FAILED:
     hr = DIERR_OUTOFMEMORY;
 FAILED1:
-    if (newDevice->axis_map)
-        HeapFree(GetProcessHeap(),0,newDevice->axis_map);
-    if (newDevice->name)
-        HeapFree(GetProcessHeap(),0,newDevice->name);
-    if (newDevice->props)
-        HeapFree(GetProcessHeap(),0,newDevice->props);
-    if (newDevice->user_df->rgodf)
-        HeapFree(GetProcessHeap(),0,newDevice->user_df->rgodf);
-    if (newDevice->user_df)
-        HeapFree(GetProcessHeap(),0,newDevice->user_df);
-    if (newDevice)
-        HeapFree(GetProcessHeap(),0,newDevice);
+    HeapFree(GetProcessHeap(),0,newDevice->axis_map);
+    HeapFree(GetProcessHeap(),0,newDevice->name);
+    HeapFree(GetProcessHeap(),0,newDevice->props);
+    HeapFree(GetProcessHeap(),0,newDevice->user_df->rgodf);
+    HeapFree(GetProcessHeap(),0,newDevice->user_df);
+    HeapFree(GetProcessHeap(),0,newDevice);
     *pdev = 0;
 
     return hr;
@@ -669,16 +670,13 @@
         return ref;
 
     /* Free the device name */
-    if (This->name)
-        HeapFree(GetProcessHeap(),0,This->name);
+    HeapFree(GetProcessHeap(),0,This->name);
 
     /* Free the axis map */
-    if (This->axis_map)
-        HeapFree(GetProcessHeap(),0,This->axis_map);
+    HeapFree(GetProcessHeap(),0,This->axis_map);
 
     /* Free the data queue */
-    if (This->data_queue != NULL)
-        HeapFree(GetProcessHeap(),0,This->data_queue);
+    HeapFree(GetProcessHeap(),0,This->data_queue);
 
     /* Free the DataFormat */
     HeapFree(GetProcessHeap(), 0, This->user_df->rgodf);
@@ -762,12 +760,9 @@
 
 FAILED:
     WARN("out of memory\n");
-    if (new_props)
-        HeapFree(GetProcessHeap(),0,new_props);
-    if (new_rgodf)
-        HeapFree(GetProcessHeap(),0,new_rgodf);
-    if (new_df)
-        HeapFree(GetProcessHeap(),0,new_df);
+    HeapFree(GetProcessHeap(),0,new_props);
+    HeapFree(GetProcessHeap(),0,new_rgodf);
+    HeapFree(GetProcessHeap(),0,new_df);
     return DIERR_OUTOFMEMORY;
 }
 
@@ -1578,10 +1573,7 @@
     pdidi->guidInstance = GUID_Joystick;
     pdidi->guidProduct = DInput_Wine_Joystick_GUID;
     /* we only support traditional joysticks for now */
-    if (This->dinput->version >= 8)
-        pdidi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
-    else
-        pdidi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
+    pdidi->dwDevType = This->devcaps.dwDevType;
     strcpy(pdidi->tszInstanceName, "Joystick");
     strcpy(pdidi->tszProductName, This->name);
     if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3A)) {
@@ -1616,10 +1608,7 @@
     pdidi->guidInstance = GUID_Joystick;
     pdidi->guidProduct = DInput_Wine_Joystick_GUID;
     /* we only support traditional joysticks for now */
-    if (This->dinput->version >= 8)
-        pdidi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
-    else
-        pdidi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
+    pdidi->dwDevType = This->devcaps.dwDevType;
     MultiByteToWideChar(CP_ACP, 0, "Joystick", -1, pdidi->tszInstanceName, MAX_PATH);
     MultiByteToWideChar(CP_ACP, 0, This->name, -1, pdidi->tszProductName, MAX_PATH);
     if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3W)) {

Modified: vendor/wine/dlls/dinput/Wine-20050111/joystick_linuxinput.c
--- vendor/wine/dlls/dinput/current/joystick_linuxinput.c	2005-01-11 20:23:48 UTC (rev 12927)
+++ vendor/wine/dlls/dinput/Wine-20050111/joystick_linuxinput.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -175,8 +175,10 @@
   if (id != 0)
       return FALSE;
 
-  if ((dwDevType != 0) && (GET_DIDEVICE_TYPE(dwDevType) != DIDEVTYPE_JOYSTICK))
-      return FALSE;
+  if (!((dwDevType == 0) ||
+        ((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+        (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))))
+    return FALSE;
 
   if (dwFlags & DIEDFL_FORCEFEEDBACK)
     return FALSE;
@@ -211,8 +213,10 @@
   if (id != 0)
       return FALSE;
 
-  if ((dwDevType != 0) && (GET_DIDEVICE_TYPE(dwDevType) != DIDEVTYPE_JOYSTICK))
-      return FALSE;
+  if (!((dwDevType == 0) ||
+        ((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+        (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))))
+    return FALSE;
 
   if (dwFlags & DIEDFL_FORCEFEEDBACK)
     return FALSE;
@@ -229,7 +233,10 @@
   lpddi->guidProduct	= DInput_Wine_Joystick_GUID;
 
   lpddi->guidFFDriver = GUID_NULL;
-  lpddi->dwDevType    = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL<<8);
+  if (version >= 8)
+    lpddi->dwDevType    = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
+  else
+    lpddi->dwDevType    = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
 
   MultiByteToWideChar(CP_ACP, 0, "Joystick", -1, lpddi->tszInstanceName, MAX_PATH);
   /* ioctl JSIOCGNAME(len) */
@@ -339,8 +346,7 @@
 		return ref;
 
 	/* Free the data queue */
-	if (This->data_queue != NULL)
-	  HeapFree(GetProcessHeap(),0,This->data_queue);
+	HeapFree(GetProcessHeap(),0,This->data_queue);
 
 	/* Free the DataFormat */
 	HeapFree(GetProcessHeap(), 0, This->df);
@@ -756,7 +762,10 @@
 	wasacquired = 0;
     }
     lpDIDevCaps->dwFlags	= DIDC_ATTACHED;
-    lpDIDevCaps->dwDevType	= DIDEVTYPE_JOYSTICK;
+    if (This->dinput->version >= 8)
+        lpDIDevCaps->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
+    else
+        lpDIDevCaps->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
 
     axes=0;
     for (i=0;i<ABS_MAX;i++) if (test_bit(This->absbits,i)) axes++;

Modified: vendor/wine/dlls/dinput/Wine-20050111/keyboard.c
--- vendor/wine/dlls/dinput/current/keyboard.c	2005-01-11 20:23:48 UTC (rev 12927)
+++ vendor/wine/dlls/dinput/Wine-20050111/keyboard.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -206,7 +206,7 @@
 
   if ((dwDevType == 0) ||
       ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) ||
-      ((dwDevType == DI8DEVTYPE_KEYBOARD) && (version >= 8))) {
+      (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) {
     TRACE("Enumerating the Keyboard device\n");
  
     fill_keyboard_dideviceinstanceA(lpddi, version);
@@ -224,7 +224,7 @@
 
   if ((dwDevType == 0) ||
       ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) ||
-      ((dwDevType == DI8DEVTYPE_KEYBOARD) && (version >= 8))) {
+      (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) {
     TRACE("Enumerating the Keyboard device\n");
 
     fill_keyboard_dideviceinstanceW(lpddi, version);
@@ -317,8 +317,7 @@
 	LeaveCriticalSection(&keyboard_crit);
 
 	/* Free the data queue */
-	if (This->buffer != NULL)
-	  HeapFree(GetProcessHeap(),0,This->buffer);
+	HeapFree(GetProcessHeap(),0,This->buffer);
 
 	DeleteCriticalSection(&(This->crit));
 
@@ -569,36 +568,34 @@
 	LPDIRECTINPUTDEVICE8A iface,
 	LPDIDEVCAPS lpDIDevCaps)
 {
-  SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
+    SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
+    DIDEVCAPS devcaps;
 
-  TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
+    TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
 
-  if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS)) {
-    lpDIDevCaps->dwFlags = DIDC_ATTACHED;
+    if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) {
+        WARN("invalid parameter\n");
+        return DIERR_INVALIDPARAM;
+    }
+    
+    devcaps.dwSize = lpDIDevCaps->dwSize;
+    devcaps.dwFlags = DIDC_ATTACHED;
     if (This->dinput->version >= 8)
-        lpDIDevCaps->dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
+	devcaps.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
     else
-        lpDIDevCaps->dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
-    lpDIDevCaps->dwAxes = 0;
-    lpDIDevCaps->dwButtons = 256;
-    lpDIDevCaps->dwPOVs = 0;
-    lpDIDevCaps->dwFFSamplePeriod = 0;
-    lpDIDevCaps->dwFFMinTimeResolution = 0;
-    lpDIDevCaps->dwFirmwareRevision = 100;
-    lpDIDevCaps->dwHardwareRevision = 100;
-    lpDIDevCaps->dwFFDriverVersion = 0;
-  } else if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS_DX3)) {
-    lpDIDevCaps->dwFlags = DIDC_ATTACHED;
-    lpDIDevCaps->dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
-    lpDIDevCaps->dwAxes = 0;
-    lpDIDevCaps->dwButtons = 256;
-    lpDIDevCaps->dwPOVs = 0;
-  } else {
-    WARN("invalid parameter\n");
-    return DIERR_INVALIDPARAM;
-  }
+	devcaps.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
+    devcaps.dwAxes = 0;
+    devcaps.dwButtons = 256;
+    devcaps.dwPOVs = 0;
+    devcaps.dwFFSamplePeriod = 0;
+    devcaps.dwFFMinTimeResolution = 0;
+    devcaps.dwFirmwareRevision = 100;
+    devcaps.dwHardwareRevision = 100;
+    devcaps.dwFFDriverVersion = 0;
 
-  return DI_OK;
+    memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize);
+    
+    return DI_OK;
 }
 
 /******************************************************************************

Modified: vendor/wine/dlls/dinput/Wine-20050111/mouse.c
--- vendor/wine/dlls/dinput/current/mouse.c	2005-01-11 20:23:48 UTC (rev 12927)
+++ vendor/wine/dlls/dinput/Wine-20050111/mouse.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -210,7 +210,7 @@
 
     if ((dwDevType == 0) ||
 	((dwDevType == DIDEVTYPE_MOUSE) && (version < 8)) ||
-	((dwDevType == DI8DEVTYPE_MOUSE) && (version >= 8))) {
+	(((dwDevType == DI8DEVCLASS_POINTER) || (dwDevType == DI8DEVTYPE_MOUSE)) && (version >= 8))) {
 	TRACE("Enumerating the mouse device\n");
 	
 	fill_mouse_dideviceinstanceA(lpddi, version);
@@ -228,7 +228,7 @@
 
     if ((dwDevType == 0) ||
 	((dwDevType == DIDEVTYPE_MOUSE) && (version < 8)) ||
-	((dwDevType == DI8DEVTYPE_MOUSE) && (version >= 8))) {
+	(((dwDevType == DI8DEVCLASS_POINTER) || (dwDevType == DI8DEVTYPE_MOUSE)) && (version >= 8))) {
 	TRACE("Enumerating the mouse device\n");
 	
 	fill_mouse_dideviceinstanceW(lpddi, version);
@@ -333,8 +333,7 @@
 	return ref;
     
     /* Free the data queue */
-    if (This->data_queue != NULL)
-	HeapFree(GetProcessHeap(),0,This->data_queue);
+    HeapFree(GetProcessHeap(),0,This->data_queue);
     
     if (This->hook) {
 	UnhookWindowsHookEx( This->hook );
@@ -433,7 +432,7 @@
     /* Only allow mouse events every 10 ms.
      * This is to allow the cursor to start acceleration before
      * the warps happen. But if it involves a mouse button event we
-     * allow it since we don't want to loose the clicks.
+     * allow it since we don't want to lose the clicks.
      */
     if (((GetCurrentTime() - last_event) < 10)
         && wparam == WM_MOUSEMOVE)
@@ -502,9 +501,9 @@
     
     switch(wparam) {
         case WM_LBUTTONDOWN:
-	    GEN_EVENT(This->offset_array[WINE_MOUSE_L_POSITION], 0xFF,
+	    GEN_EVENT(This->offset_array[WINE_MOUSE_L_POSITION], 0x80,
 		      hook->time, This->dinput->evsequence++);
-	    This->m_state.rgbButtons[0] = 0xFF;
+	    This->m_state.rgbButtons[0] = 0x80;
 	    break;
 	case WM_LBUTTONUP:
 	    GEN_EVENT(This->offset_array[WINE_MOUSE_L_POSITION], 0x00,
@@ -512,9 +511,9 @@
 	    This->m_state.rgbButtons[0] = 0x00;
 	    break;
 	case WM_RBUTTONDOWN:
-	    GEN_EVENT(This->offset_array[WINE_MOUSE_R_POSITION], 0xFF,
+	    GEN_EVENT(This->offset_array[WINE_MOUSE_R_POSITION], 0x80,
 		      hook->time, This->dinput->evsequence++);
-	    This->m_state.rgbButtons[1] = 0xFF;
+	    This->m_state.rgbButtons[1] = 0x80;
 	    break;
 	case WM_RBUTTONUP:
 	    GEN_EVENT(This->offset_array[WINE_MOUSE_R_POSITION], 0x00,
@@ -522,9 +521,9 @@
 	    This->m_state.rgbButtons[1] = 0x00;
 	    break;
 	case WM_MBUTTONDOWN:
-	    GEN_EVENT(This->offset_array[WINE_MOUSE_M_POSITION], 0xFF,
+	    GEN_EVENT(This->offset_array[WINE_MOUSE_M_POSITION], 0x80,
 		      hook->time, This->dinput->evsequence++);
-	    This->m_state.rgbButtons[2] = 0xFF;
+	    This->m_state.rgbButtons[2] = 0x80;
 	    break;
 	case WM_MBUTTONUP:
 	    GEN_EVENT(This->offset_array[WINE_MOUSE_M_POSITION], 0x00,
@@ -923,33 +922,31 @@
 	LPDIDEVCAPS lpDIDevCaps)
 {
     SysMouseImpl *This = (SysMouseImpl *)iface;
-    
+    DIDEVCAPS devcaps;
+
     TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
-    
-    if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS)) {
-	lpDIDevCaps->dwFlags = DIDC_ATTACHED;
-	if (This->dinput->version >= 8)
-	    lpDIDevCaps->dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
-	else
-	    lpDIDevCaps->dwDevType = DIDEVTYPE_MOUSE | (DIDEVTYPEMOUSE_TRADITIONAL << 8);
-	lpDIDevCaps->dwAxes = 3;
-	lpDIDevCaps->dwButtons = 3;
-	lpDIDevCaps->dwPOVs = 0;
-	lpDIDevCaps->dwFFSamplePeriod = 0;
-	lpDIDevCaps->dwFFMinTimeResolution = 0;
-	lpDIDevCaps->dwFirmwareRevision = 100;
-	lpDIDevCaps->dwHardwareRevision = 100;
-	lpDIDevCaps->dwFFDriverVersion = 0;
-    } else if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS_DX3)) {
-	lpDIDevCaps->dwFlags = DIDC_ATTACHED;
-	lpDIDevCaps->dwDevType = DIDEVTYPE_MOUSE | (DIDEVTYPEMOUSE_TRADITIONAL << 8);
-	lpDIDevCaps->dwAxes = 3;
-	lpDIDevCaps->dwButtons = 3;
-	lpDIDevCaps->dwPOVs = 0;
-    } else {
+
+    if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) {
         WARN("invalid parameter\n");
         return DIERR_INVALIDPARAM;
     }
+
+    devcaps.dwSize = lpDIDevCaps->dwSize;
+    devcaps.dwFlags = DIDC_ATTACHED;
+    if (This->dinput->version >= 8)
+	devcaps.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
+    else
+	devcaps.dwDevType = DIDEVTYPE_MOUSE | (DIDEVTYPEMOUSE_TRADITIONAL << 8);
+    devcaps.dwAxes = 3;
+    devcaps.dwButtons = 3;
+    devcaps.dwPOVs = 0;
+    devcaps.dwFFSamplePeriod = 0;
+    devcaps.dwFFMinTimeResolution = 0;
+    devcaps.dwFirmwareRevision = 100;
+    devcaps.dwHardwareRevision = 100;
+    devcaps.dwFFDriverVersion = 0;
+
+    memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize);
     
     return DI_OK;
 }

Modified: vendor/wine/dlls/dinput/current/dinput_main.c
--- vendor/wine/dlls/dinput/current/dinput_main.c	2005-01-11 23:05:16 UTC (rev 12935)
+++ vendor/wine/dlls/dinput/current/dinput_main.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -704,13 +704,13 @@
 HRESULT WINAPI DINPUT_DllGetClassObject(REFCLSID rclsid, REFIID riid,
 					LPVOID *ppv)
 {
-    TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+    TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
     if ( IsEqualCLSID( &IID_IClassFactory, riid ) ) {
     	*ppv = (LPVOID)&DINPUT_CF;
 	IClassFactory_AddRef((IClassFactory*)*ppv);
     return S_OK;
     }
 
-    FIXME("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+    FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
     return CLASS_E_CLASSNOTAVAILABLE;
 }

Modified: vendor/wine/dlls/dinput/current/joystick_linux.c
--- vendor/wine/dlls/dinput/current/joystick_linux.c	2005-01-11 23:05:16 UTC (rev 12935)
+++ vendor/wine/dlls/dinput/current/joystick_linux.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -157,7 +157,9 @@
         return FALSE;
     }
 
-    if ((dwDevType==0) || (GET_DIDEVICE_TYPE(dwDevType)==DIDEVTYPE_JOYSTICK)) {
+    if ((dwDevType == 0) ||
+	((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+	(((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))) {
         /* check whether we have a joystick */
         sprintf(dev, "%s%d", JOYDEV, id);
         if ((fd = open(dev,O_RDONLY)) < 0) {
@@ -205,7 +207,9 @@
         return FALSE;
     }
 
-    if ((dwDevType==0) || (GET_DIDEVICE_TYPE(dwDevType)==DIDEVTYPE_JOYSTICK)) {
+    if ((dwDevType == 0) ||
+	((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+	(((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))) {
         /* check whether we have a joystick */
         sprintf(dev, "%s%d", JOYDEV, id);
         if ((fd = open(dev,O_RDONLY)) < 0) {
@@ -552,7 +556,10 @@
 
     newDevice->devcaps.dwSize = sizeof(newDevice->devcaps);
     newDevice->devcaps.dwFlags = DIDC_ATTACHED;
-    newDevice->devcaps.dwDevType = DIDEVTYPE_JOYSTICK;
+    if (newDevice->dinput->version >= 8)
+        newDevice->devcaps.dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
+    else
+        newDevice->devcaps.dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
     newDevice->devcaps.dwFFSamplePeriod = 0;
     newDevice->devcaps.dwFFMinTimeResolution = 0;
     newDevice->devcaps.dwFirmwareRevision = 0;
@@ -573,18 +580,12 @@
 FAILED:
     hr = DIERR_OUTOFMEMORY;
 FAILED1:
-    if (newDevice->axis_map)
-        HeapFree(GetProcessHeap(),0,newDevice->axis_map);
-    if (newDevice->name)
-        HeapFree(GetProcessHeap(),0,newDevice->name);
-    if (newDevice->props)
-        HeapFree(GetProcessHeap(),0,newDevice->props);
-    if (newDevice->user_df->rgodf)
-        HeapFree(GetProcessHeap(),0,newDevice->user_df->rgodf);
-    if (newDevice->user_df)
-        HeapFree(GetProcessHeap(),0,newDevice->user_df);
-    if (newDevice)
-        HeapFree(GetProcessHeap(),0,newDevice);
+    HeapFree(GetProcessHeap(),0,newDevice->axis_map);
+    HeapFree(GetProcessHeap(),0,newDevice->name);
+    HeapFree(GetProcessHeap(),0,newDevice->props);
+    HeapFree(GetProcessHeap(),0,newDevice->user_df->rgodf);
+    HeapFree(GetProcessHeap(),0,newDevice->user_df);
+    HeapFree(GetProcessHeap(),0,newDevice);
     *pdev = 0;
 
     return hr;
@@ -669,16 +670,13 @@
         return ref;
 
     /* Free the device name */
-    if (This->name)
-        HeapFree(GetProcessHeap(),0,This->name);
+    HeapFree(GetProcessHeap(),0,This->name);
 
     /* Free the axis map */
-    if (This->axis_map)
-        HeapFree(GetProcessHeap(),0,This->axis_map);
+    HeapFree(GetProcessHeap(),0,This->axis_map);
 
     /* Free the data queue */
-    if (This->data_queue != NULL)
-        HeapFree(GetProcessHeap(),0,This->data_queue);
+    HeapFree(GetProcessHeap(),0,This->data_queue);
 
     /* Free the DataFormat */
     HeapFree(GetProcessHeap(), 0, This->user_df->rgodf);
@@ -762,12 +760,9 @@
 
 FAILED:
     WARN("out of memory\n");
-    if (new_props)
-        HeapFree(GetProcessHeap(),0,new_props);
-    if (new_rgodf)
-        HeapFree(GetProcessHeap(),0,new_rgodf);
-    if (new_df)
-        HeapFree(GetProcessHeap(),0,new_df);
+    HeapFree(GetProcessHeap(),0,new_props);
+    HeapFree(GetProcessHeap(),0,new_rgodf);
+    HeapFree(GetProcessHeap(),0,new_df);
     return DIERR_OUTOFMEMORY;
 }
 
@@ -1578,10 +1573,7 @@
     pdidi->guidInstance = GUID_Joystick;
     pdidi->guidProduct = DInput_Wine_Joystick_GUID;
     /* we only support traditional joysticks for now */
-    if (This->dinput->version >= 8)
-        pdidi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
-    else
-        pdidi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
+    pdidi->dwDevType = This->devcaps.dwDevType;
     strcpy(pdidi->tszInstanceName, "Joystick");
     strcpy(pdidi->tszProductName, This->name);
     if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3A)) {
@@ -1616,10 +1608,7 @@
     pdidi->guidInstance = GUID_Joystick;
     pdidi->guidProduct = DInput_Wine_Joystick_GUID;
     /* we only support traditional joysticks for now */
-    if (This->dinput->version >= 8)
-        pdidi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
-    else
-        pdidi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
+    pdidi->dwDevType = This->devcaps.dwDevType;
     MultiByteToWideChar(CP_ACP, 0, "Joystick", -1, pdidi->tszInstanceName, MAX_PATH);
     MultiByteToWideChar(CP_ACP, 0, This->name, -1, pdidi->tszProductName, MAX_PATH);
     if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3W)) {

Modified: vendor/wine/dlls/dinput/current/joystick_linuxinput.c
--- vendor/wine/dlls/dinput/current/joystick_linuxinput.c	2005-01-11 23:05:16 UTC (rev 12935)
+++ vendor/wine/dlls/dinput/current/joystick_linuxinput.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -175,8 +175,10 @@
   if (id != 0)
       return FALSE;
 
-  if ((dwDevType != 0) && (GET_DIDEVICE_TYPE(dwDevType) != DIDEVTYPE_JOYSTICK))
-      return FALSE;
+  if (!((dwDevType == 0) ||
+        ((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+        (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))))
+    return FALSE;
 
   if (dwFlags & DIEDFL_FORCEFEEDBACK)
     return FALSE;
@@ -211,8 +213,10 @@
   if (id != 0)
       return FALSE;
 
-  if ((dwDevType != 0) && (GET_DIDEVICE_TYPE(dwDevType) != DIDEVTYPE_JOYSTICK))
-      return FALSE;
+  if (!((dwDevType == 0) ||
+        ((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 8)) ||
+        (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 8))))
+    return FALSE;
 
   if (dwFlags & DIEDFL_FORCEFEEDBACK)
     return FALSE;
@@ -229,7 +233,10 @@
   lpddi->guidProduct	= DInput_Wine_Joystick_GUID;
 
   lpddi->guidFFDriver = GUID_NULL;
-  lpddi->dwDevType    = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL<<8);
+  if (version >= 8)
+    lpddi->dwDevType    = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
+  else
+    lpddi->dwDevType    = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
 
   MultiByteToWideChar(CP_ACP, 0, "Joystick", -1, lpddi->tszInstanceName, MAX_PATH);
   /* ioctl JSIOCGNAME(len) */
@@ -339,8 +346,7 @@
 		return ref;
 
 	/* Free the data queue */
-	if (This->data_queue != NULL)
-	  HeapFree(GetProcessHeap(),0,This->data_queue);
+	HeapFree(GetProcessHeap(),0,This->data_queue);
 
 	/* Free the DataFormat */
 	HeapFree(GetProcessHeap(), 0, This->df);
@@ -756,7 +762,10 @@
 	wasacquired = 0;
     }
     lpDIDevCaps->dwFlags	= DIDC_ATTACHED;
-    lpDIDevCaps->dwDevType	= DIDEVTYPE_JOYSTICK;
+    if (This->dinput->version >= 8)
+        lpDIDevCaps->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
+    else
+        lpDIDevCaps->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
 
     axes=0;
     for (i=0;i<ABS_MAX;i++) if (test_bit(This->absbits,i)) axes++;

Modified: vendor/wine/dlls/dinput/current/keyboard.c
--- vendor/wine/dlls/dinput/current/keyboard.c	2005-01-11 23:05:16 UTC (rev 12935)
+++ vendor/wine/dlls/dinput/current/keyboard.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -206,7 +206,7 @@
 
   if ((dwDevType == 0) ||
       ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) ||
-      ((dwDevType == DI8DEVTYPE_KEYBOARD) && (version >= 8))) {
+      (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) {
     TRACE("Enumerating the Keyboard device\n");
  
     fill_keyboard_dideviceinstanceA(lpddi, version);
@@ -224,7 +224,7 @@
 
   if ((dwDevType == 0) ||
       ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) ||
-      ((dwDevType == DI8DEVTYPE_KEYBOARD) && (version >= 8))) {
+      (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 8))) {
     TRACE("Enumerating the Keyboard device\n");
 
     fill_keyboard_dideviceinstanceW(lpddi, version);
@@ -317,8 +317,7 @@
 	LeaveCriticalSection(&keyboard_crit);
 
 	/* Free the data queue */
-	if (This->buffer != NULL)
-	  HeapFree(GetProcessHeap(),0,This->buffer);
+	HeapFree(GetProcessHeap(),0,This->buffer);
 
 	DeleteCriticalSection(&(This->crit));
 
@@ -569,36 +568,34 @@
 	LPDIRECTINPUTDEVICE8A iface,
 	LPDIDEVCAPS lpDIDevCaps)
 {
-  SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
+    SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
+    DIDEVCAPS devcaps;
 
-  TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
+    TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
 
-  if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS)) {
-    lpDIDevCaps->dwFlags = DIDC_ATTACHED;
+    if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) {
+        WARN("invalid parameter\n");
+        return DIERR_INVALIDPARAM;
+    }
+    
+    devcaps.dwSize = lpDIDevCaps->dwSize;
+    devcaps.dwFlags = DIDC_ATTACHED;
     if (This->dinput->version >= 8)
-        lpDIDevCaps->dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
+	devcaps.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
     else
-        lpDIDevCaps->dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
-    lpDIDevCaps->dwAxes = 0;
-    lpDIDevCaps->dwButtons = 256;
-    lpDIDevCaps->dwPOVs = 0;
-    lpDIDevCaps->dwFFSamplePeriod = 0;
-    lpDIDevCaps->dwFFMinTimeResolution = 0;
-    lpDIDevCaps->dwFirmwareRevision = 100;
-    lpDIDevCaps->dwHardwareRevision = 100;
-    lpDIDevCaps->dwFFDriverVersion = 0;
-  } else if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS_DX3)) {
-    lpDIDevCaps->dwFlags = DIDC_ATTACHED;
-    lpDIDevCaps->dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
-    lpDIDevCaps->dwAxes = 0;
-    lpDIDevCaps->dwButtons = 256;
-    lpDIDevCaps->dwPOVs = 0;
-  } else {
-    WARN("invalid parameter\n");
-    return DIERR_INVALIDPARAM;
-  }
+	devcaps.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
+    devcaps.dwAxes = 0;
+    devcaps.dwButtons = 256;
+    devcaps.dwPOVs = 0;
+    devcaps.dwFFSamplePeriod = 0;
+    devcaps.dwFFMinTimeResolution = 0;
+    devcaps.dwFirmwareRevision = 100;
+    devcaps.dwHardwareRevision = 100;
+    devcaps.dwFFDriverVersion = 0;
 
-  return DI_OK;
+    memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize);
+    
+    return DI_OK;
 }
 
 /******************************************************************************

Modified: vendor/wine/dlls/dinput/current/mouse.c
--- vendor/wine/dlls/dinput/current/mouse.c	2005-01-11 23:05:16 UTC (rev 12935)
+++ vendor/wine/dlls/dinput/current/mouse.c	2005-01-11 23:06:20 UTC (rev 12936)
@@ -210,7 +210,7 @@
 
     if ((dwDevType == 0) ||
 	((dwDevType == DIDEVTYPE_MOUSE) && (version < 8)) ||
-	((dwDevType == DI8DEVTYPE_MOUSE) && (version >= 8))) {
+	(((dwDevType == DI8DEVCLASS_POINTER) || (dwDevType == DI8DEVTYPE_MOUSE)) && (version >= 8))) {
 	TRACE("Enumerating the mouse device\n");
 	
 	fill_mouse_dideviceinstanceA(lpddi, version);
@@ -228,7 +228,7 @@
 
     if ((dwDevType == 0) ||
 	((dwDevType == DIDEVTYPE_MOUSE) && (version < 8)) ||
-	((dwDevType == DI8DEVTYPE_MOUSE) && (version >= 8))) {
+	(((dwDevType == DI8DEVCLASS_POINTER) || (dwDevType == DI8DEVTYPE_MOUSE)) && (version >= 8))) {
 	TRACE("Enumerating the mouse device\n");
 	
 	fill_mouse_dideviceinstanceW(lpddi, version);
@@ -333,8 +333,7 @@
 	return ref;
     
     /* Free the data queue */
-    if (This->data_queue != NULL)
-	HeapFree(GetProcessHeap(),0,This->data_queue);
+    HeapFree(GetProcessHeap(),0,This->data_queue);
     
     if (This->hook) {
 	UnhookWindowsHookEx( This->hook );
@@ -433,7 +432,7 @@
     /* Only allow mouse events every 10 ms.
      * This is to allow the cursor to start acceleration before
      * the warps happen. But if it involves a mouse button event we
-     * allow it since we don't want to loose the clicks.
+     * allow it since we don't want to lose the clicks.
      */
     if (((GetCurrentTime() - last_event) < 10)
         && wparam == WM_MOUSEMOVE)
@@ -502,9 +501,9 @@
     
     switch(wparam) {
         case WM_LBUTTONDOWN:
-	    GEN_EVENT(This->offset_array[WINE_MOUSE_L_POSITION], 0xFF,
+	    GEN_EVENT(This->offset_array[WINE_MOUSE_L_POSITION], 0x80,
 		      hook->time, This->dinput->evsequence++);
-	    This->m_state.rgbButtons[0] = 0xFF;
+	    This->m_state.rgbButtons[0] = 0x80;
 	    break;
 	case WM_LBUTTONUP:
 	    GEN_EVENT(This->offset_array[WINE_MOUSE_L_POSITION], 0x00,
@@ -512,9 +511,9 @@
 	    This->m_state.rgbButtons[0] = 0x00;
 	    break;
 	case WM_RBUTTONDOWN:
-	    GEN_EVENT(This->offset_array[WINE_MOUSE_R_POSITION], 0xFF,
+	    GEN_EVENT(This->offset_array[WINE_MOUSE_R_POSITION], 0x80,
 		      hook->time, This->dinput->evsequence++);
-	    This->m_state.rgbButtons[1] = 0xFF;
+	    This->m_state.rgbButtons[1] = 0x80;
 	    break;
 	case WM_RBUTTONUP:
 	    GEN_EVENT(This->offset_array[WINE_MOUSE_R_POSITION], 0x00,
@@ -522,9 +521,9 @@
 	    This->m_state.rgbButtons[1] = 0x00;
 	    break;
 	case WM_MBUTTONDOWN:
-	    GEN_EVENT(This->offset_array[WINE_MOUSE_M_POSITION], 0xFF,
+	    GEN_EVENT(This->offset_array[WINE_MOUSE_M_POSITION], 0x80,
 		      hook->time, This->dinput->evsequence++);
-	    This->m_state.rgbButtons[2] = 0xFF;
+	    This->m_state.rgbButtons[2] = 0x80;
 	    break;
 	case WM_MBUTTONUP:
 	    GEN_EVENT(This->offset_array[WINE_MOUSE_M_POSITION], 0x00,
@@ -923,33 +922,31 @@
 	LPDIDEVCAPS lpDIDevCaps)
 {
     SysMouseImpl *This = (SysMouseImpl *)iface;
-    
+    DIDEVCAPS devcaps;
+
     TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
-    
-    if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS)) {
-	lpDIDevCaps->dwFlags = DIDC_ATTACHED;
-	if (This->dinput->version >= 8)
-	    lpDIDevCaps->dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
-	else
-	    lpDIDevCaps->dwDevType = DIDEVTYPE_MOUSE | (DIDEVTYPEMOUSE_TRADITIONAL << 8);
-	lpDIDevCaps->dwAxes = 3;
-	lpDIDevCaps->dwButtons = 3;
-	lpDIDevCaps->dwPOVs = 0;
-	lpDIDevCaps->dwFFSamplePeriod = 0;
-	lpDIDevCaps->dwFFMinTimeResolution = 0;
-	lpDIDevCaps->dwFirmwareRevision = 100;
-	lpDIDevCaps->dwHardwareRevision = 100;
-	lpDIDevCaps->dwFFDriverVersion = 0;
-    } else if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS_DX3)) {
-	lpDIDevCaps->dwFlags = DIDC_ATTACHED;
-	lpDIDevCaps->dwDevType = DIDEVTYPE_MOUSE | (DIDEVTYPEMOUSE_TRADITIONAL << 8);
-	lpDIDevCaps->dwAxes = 3;
-	lpDIDevCaps->dwButtons = 3;
-	lpDIDevCaps->dwPOVs = 0;
-    } else {
+
+    if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) {
         WARN("invalid parameter\n");
         return DIERR_INVALIDPARAM;
     }
+
+    devcaps.dwSize = lpDIDevCaps->dwSize;
+    devcaps.dwFlags = DIDC_ATTACHED;
+    if (This->dinput->version >= 8)
+	devcaps.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
+    else
+	devcaps.dwDevType = DIDEVTYPE_MOUSE | (DIDEVTYPEMOUSE_TRADITIONAL << 8);
+    devcaps.dwAxes = 3;
+    devcaps.dwButtons = 3;
+    devcaps.dwPOVs = 0;
+    devcaps.dwFFSamplePeriod = 0;
+    devcaps.dwFFMinTimeResolution = 0;
+    devcaps.dwFirmwareRevision = 100;
+    devcaps.dwHardwareRevision = 100;
+    devcaps.dwFFDriverVersion = 0;
+
+    memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize);
     
     return DI_OK;
 }