Move all DirectInput code from DI2 to DI8.
authorRyan C. Gordon
Thu, 29 Nov 2012 15:24:56 -0500
changeset 67161616f6b3738c
parent 6715 a02458e71c95
child 6717 2acd95060548
Move all DirectInput code from DI2 to DI8.

Fixes failing Haptic subsystem initialization on Windows.
src/haptic/windows/SDL_syshaptic.c
src/joystick/windows/SDL_dxjoystick.c
src/joystick/windows/SDL_dxjoystick_c.h
     1.1 --- a/src/haptic/windows/SDL_syshaptic.c	Thu Nov 29 09:48:42 2012 -0800
     1.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Thu Nov 29 15:24:56 2012 -0500
     1.3 @@ -49,7 +49,7 @@
     1.4   */
     1.5  struct haptic_hwdata
     1.6  {
     1.7 -    LPDIRECTINPUTDEVICE2 device;
     1.8 +    LPDIRECTINPUTDEVICE8 device;
     1.9      DWORD axes[3];              /* Axes to use. */
    1.10      int is_joystick;            /* Device is loaded as joystick. */
    1.11  };
    1.12 @@ -69,7 +69,7 @@
    1.13   * Internal stuff.
    1.14   */
    1.15  static SDL_bool coinitialized = SDL_FALSE;
    1.16 -static LPDIRECTINPUT dinput = NULL;
    1.17 +static LPDIRECTINPUT8 dinput = NULL;
    1.18  
    1.19  
    1.20  /*
    1.21 @@ -85,8 +85,8 @@
    1.22  static int DI_GUIDIsSame(const GUID * a, const GUID * b);
    1.23  static int SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic,
    1.24                                            DIDEVICEINSTANCE instance);
    1.25 -static int SDL_SYS_HapticOpenFromDevice2(SDL_Haptic * haptic,
    1.26 -                                         LPDIRECTINPUTDEVICE2 device2);
    1.27 +static int SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic,
    1.28 +                                         LPDIRECTINPUTDEVICE8 device8);
    1.29  static DWORD DIGetTriggerButton(Uint16 button);
    1.30  static int SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir,
    1.31                                  int naxes);
    1.32 @@ -151,8 +151,8 @@
    1.33  
    1.34      coinitialized = SDL_TRUE;
    1.35  
    1.36 -    ret = CoCreateInstance(&CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER,
    1.37 -                           &IID_IDirectInput, (LPVOID) & dinput);
    1.38 +    ret = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
    1.39 +                           &IID_IDirectInput8, (LPVOID) & dinput);
    1.40      if (FAILED(ret)) {
    1.41          SDL_SYS_HapticQuit();
    1.42          DI_SetError("CoCreateInstance", ret);
    1.43 @@ -167,7 +167,7 @@
    1.44                       GetLastError());
    1.45          return -1;
    1.46      }
    1.47 -    ret = IDirectInput_Initialize(dinput, instance, DIRECTINPUT_VERSION);
    1.48 +    ret = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION);
    1.49      if (FAILED(ret)) {
    1.50          SDL_SYS_HapticQuit();
    1.51          DI_SetError("Initializing DirectInput device", ret);
    1.52 @@ -175,7 +175,7 @@
    1.53      }
    1.54  
    1.55      /* Look for haptic devices. */
    1.56 -    ret = IDirectInput_EnumDevices(dinput,
    1.57 +    ret = IDirectInput8_EnumDevices(dinput,
    1.58                                     0,
    1.59                                     EnumHapticsCallback,
    1.60                                     NULL,
    1.61 @@ -197,14 +197,14 @@
    1.62  EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
    1.63  {
    1.64      HRESULT ret;
    1.65 -    LPDIRECTINPUTDEVICE device;
    1.66 +    LPDIRECTINPUTDEVICE8 device;
    1.67  
    1.68      /* Copy the instance over, useful for creating devices. */
    1.69      SDL_memcpy(&SDL_hapticlist[SDL_numhaptics].instance, pdidInstance,
    1.70                 sizeof(DIDEVICEINSTANCE));
    1.71  
    1.72      /* Open the device */
    1.73 -    ret = IDirectInput_CreateDevice(dinput, &pdidInstance->guidInstance,
    1.74 +    ret = IDirectInput8_CreateDevice(dinput, &pdidInstance->guidInstance,
    1.75                                      &device, NULL);
    1.76      if (FAILED(ret)) {
    1.77          /* DI_SetError("Creating DirectInput device",ret); */
    1.78 @@ -213,12 +213,12 @@
    1.79  
    1.80      /* Get capabilities. */
    1.81      SDL_hapticlist[SDL_numhaptics].capabilities.dwSize = sizeof(DIDEVCAPS);
    1.82 -    ret = IDirectInputDevice_GetCapabilities(device,
    1.83 +    ret = IDirectInputDevice8_GetCapabilities(device,
    1.84                                               &SDL_hapticlist[SDL_numhaptics].
    1.85                                               capabilities);
    1.86      if (FAILED(ret)) {
    1.87          /* DI_SetError("Getting device capabilities",ret); */
    1.88 -        IDirectInputDevice_Release(device);
    1.89 +        IDirectInputDevice8_Release(device);
    1.90          return DIENUM_CONTINUE;
    1.91      }
    1.92  
    1.93 @@ -226,7 +226,7 @@
    1.94      SDL_hapticlist[SDL_numhaptics].name = WIN_StringToUTF8(SDL_hapticlist[SDL_numhaptics].instance.tszProductName);
    1.95  
    1.96      /* Close up device and count it. */
    1.97 -    IDirectInputDevice_Release(device);
    1.98 +    IDirectInputDevice8_Release(device);
    1.99      SDL_numhaptics++;
   1.100  
   1.101      /* Watch out for hard limit. */
   1.102 @@ -306,16 +306,16 @@
   1.103   *
   1.104   *    Steps:
   1.105   *       - Open temporary DirectInputDevice interface.
   1.106 - *       - Create DirectInputDevice2 interface.
   1.107 + *       - Create DirectInputDevice8 interface.
   1.108   *       - Release DirectInputDevice interface.
   1.109 - *       - Call SDL_SYS_HapticOpenFromDevice2
   1.110 + *       - Call SDL_SYS_HapticOpenFromDevice8
   1.111   */
   1.112  static int
   1.113  SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance)
   1.114  {
   1.115      HRESULT ret;
   1.116      int ret2;
   1.117 -    LPDIRECTINPUTDEVICE device;
   1.118 +    LPDIRECTINPUTDEVICE8 device;
   1.119  
   1.120      /* Allocate the hwdata */
   1.121      haptic->hwdata = (struct haptic_hwdata *)
   1.122 @@ -327,26 +327,26 @@
   1.123      SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
   1.124  
   1.125      /* Open the device */
   1.126 -    ret = IDirectInput_CreateDevice(dinput, &instance.guidInstance,
   1.127 +    ret = IDirectInput8_CreateDevice(dinput, &instance.guidInstance,
   1.128                                      &device, NULL);
   1.129      if (FAILED(ret)) {
   1.130          DI_SetError("Creating DirectInput device", ret);
   1.131          goto creat_err;
   1.132      }
   1.133  
   1.134 -    /* Now get the IDirectInputDevice2 interface, instead. */
   1.135 -    ret = IDirectInputDevice_QueryInterface(device,
   1.136 -                                            &IID_IDirectInputDevice2,
   1.137 +    /* Now get the IDirectInputDevice8 interface, instead. */
   1.138 +    ret = IDirectInputDevice8_QueryInterface(device,
   1.139 +                                            &IID_IDirectInputDevice8,
   1.140                                              (LPVOID *) & haptic->hwdata->
   1.141                                              device);
   1.142      /* Done with the temporary one now. */
   1.143 -    IDirectInputDevice_Release(device);
   1.144 +    IDirectInputDevice8_Release(device);
   1.145      if (FAILED(ret)) {
   1.146          DI_SetError("Querying DirectInput interface", ret);
   1.147          goto creat_err;
   1.148      }
   1.149  
   1.150 -    ret2 = SDL_SYS_HapticOpenFromDevice2(haptic, haptic->hwdata->device);
   1.151 +    ret2 = SDL_SYS_HapticOpenFromDevice8(haptic, haptic->hwdata->device);
   1.152      if (ret2 < 0) {
   1.153          goto query_err;
   1.154      }
   1.155 @@ -354,7 +354,7 @@
   1.156      return 0;
   1.157  
   1.158    query_err:
   1.159 -    IDirectInputDevice2_Release(haptic->hwdata->device);
   1.160 +    IDirectInputDevice8_Release(haptic->hwdata->device);
   1.161    creat_err:
   1.162      if (haptic->hwdata != NULL) {
   1.163          SDL_free(haptic->hwdata);
   1.164 @@ -375,17 +375,17 @@
   1.165   *       - Get supported featuers.
   1.166   */
   1.167  static int
   1.168 -SDL_SYS_HapticOpenFromDevice2(SDL_Haptic * haptic,
   1.169 -                              LPDIRECTINPUTDEVICE2 device2)
   1.170 +SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic,
   1.171 +                              LPDIRECTINPUTDEVICE8 device8)
   1.172  {
   1.173      HRESULT ret;
   1.174      DIPROPDWORD dipdw;
   1.175  
   1.176 -    /* We'll use the device2 from now on. */
   1.177 -    haptic->hwdata->device = device2;
   1.178 +    /* We'll use the device8 from now on. */
   1.179 +    haptic->hwdata->device = device8;
   1.180  
   1.181      /* Grab it exclusively to use force feedback stuff. */
   1.182 -    ret = IDirectInputDevice2_SetCooperativeLevel(haptic->hwdata->device,
   1.183 +    ret = IDirectInputDevice8_SetCooperativeLevel(haptic->hwdata->device,
   1.184                                                    SDL_HelperWindow,
   1.185                                                    DISCL_EXCLUSIVE |
   1.186                                                    DISCL_BACKGROUND);
   1.187 @@ -395,7 +395,7 @@
   1.188      }
   1.189  
   1.190      /* Set data format. */
   1.191 -    ret = IDirectInputDevice2_SetDataFormat(haptic->hwdata->device,
   1.192 +    ret = IDirectInputDevice8_SetDataFormat(haptic->hwdata->device,
   1.193                                              &c_dfDIJoystick2);
   1.194      if (FAILED(ret)) {
   1.195          DI_SetError("Setting data format", ret);
   1.196 @@ -403,7 +403,7 @@
   1.197      }
   1.198  
   1.199      /* Get number of axes. */
   1.200 -    ret = IDirectInputDevice2_EnumObjects(haptic->hwdata->device,
   1.201 +    ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device,
   1.202                                            DI_DeviceObjectCallback,
   1.203                                            haptic, DIDFT_AXIS);
   1.204      if (FAILED(ret)) {
   1.205 @@ -412,14 +412,14 @@
   1.206      }
   1.207  
   1.208      /* Acquire the device. */
   1.209 -    ret = IDirectInputDevice2_Acquire(haptic->hwdata->device);
   1.210 +    ret = IDirectInputDevice8_Acquire(haptic->hwdata->device);
   1.211      if (FAILED(ret)) {
   1.212          DI_SetError("Acquiring DirectInput device", ret);
   1.213          goto acquire_err;
   1.214      }
   1.215  
   1.216      /* Reset all actuators - just in case. */
   1.217 -    ret = IDirectInputDevice2_SendForceFeedbackCommand(haptic->hwdata->device,
   1.218 +    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
   1.219                                                         DISFFC_RESET);
   1.220      if (FAILED(ret)) {
   1.221          DI_SetError("Resetting device", ret);
   1.222 @@ -427,7 +427,7 @@
   1.223      }
   1.224  
   1.225      /* Enabling actuators. */
   1.226 -    ret = IDirectInputDevice2_SendForceFeedbackCommand(haptic->hwdata->device,
   1.227 +    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
   1.228                                                         DISFFC_SETACTUATORSON);
   1.229      if (FAILED(ret)) {
   1.230          DI_SetError("Enabling actuators", ret);
   1.231 @@ -435,7 +435,7 @@
   1.232      }
   1.233  
   1.234      /* Get supported effects. */
   1.235 -    ret = IDirectInputDevice2_EnumEffects(haptic->hwdata->device,
   1.236 +    ret = IDirectInputDevice8_EnumEffects(haptic->hwdata->device,
   1.237                                            DI_EffectCallback, haptic,
   1.238                                            DIEFT_ALL);
   1.239      if (FAILED(ret)) {
   1.240 @@ -453,7 +453,7 @@
   1.241      dipdw.diph.dwObj = 0;
   1.242      dipdw.diph.dwHow = DIPH_DEVICE;
   1.243      dipdw.dwData = 10000;
   1.244 -    ret = IDirectInputDevice2_SetProperty(haptic->hwdata->device,
   1.245 +    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
   1.246                                            DIPROP_FFGAIN, &dipdw.diph);
   1.247      if (!FAILED(ret)) {         /* Gain is supported. */
   1.248          haptic->supported |= SDL_HAPTIC_GAIN;
   1.249 @@ -461,7 +461,7 @@
   1.250      dipdw.diph.dwObj = 0;
   1.251      dipdw.diph.dwHow = DIPH_DEVICE;
   1.252      dipdw.dwData = DIPROPAUTOCENTER_OFF;
   1.253 -    ret = IDirectInputDevice2_SetProperty(haptic->hwdata->device,
   1.254 +    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
   1.255                                            DIPROP_AUTOCENTER, &dipdw.diph);
   1.256      if (!FAILED(ret)) {         /* Autocenter is supported. */
   1.257          haptic->supported |= SDL_HAPTIC_AUTOCENTER;
   1.258 @@ -492,7 +492,7 @@
   1.259  
   1.260      /* Error handling */
   1.261    acquire_err:
   1.262 -    IDirectInputDevice2_Unacquire(haptic->hwdata->device);
   1.263 +    IDirectInputDevice8_Unacquire(haptic->hwdata->device);
   1.264      return -1;
   1.265  
   1.266  }
   1.267 @@ -555,12 +555,12 @@
   1.268      joy_instance.dwSize = sizeof(DIDEVICEINSTANCE);
   1.269  
   1.270      /* Get the device instances. */
   1.271 -    ret = IDirectInputDevice2_GetDeviceInfo(haptic->hwdata->device,
   1.272 +    ret = IDirectInputDevice8_GetDeviceInfo(haptic->hwdata->device,
   1.273                                              &hap_instance);
   1.274      if (FAILED(ret)) {
   1.275          return 0;
   1.276      }
   1.277 -    ret = IDirectInputDevice2_GetDeviceInfo(joystick->hwdata->InputDevice,
   1.278 +    ret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice,
   1.279                                              &joy_instance);
   1.280      if (FAILED(ret)) {
   1.281          return 0;
   1.282 @@ -586,7 +586,7 @@
   1.283  
   1.284      /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */
   1.285      for (i=0; i<SDL_numhaptics; i++) {
   1.286 -        idret = IDirectInputDevice2_GetDeviceInfo(joystick->hwdata->InputDevice,
   1.287 +        idret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice,
   1.288                &joy_instance);
   1.289          if (FAILED(idret)) {
   1.290              return -1;
   1.291 @@ -612,7 +612,7 @@
   1.292  
   1.293      /* Now open the device. */
   1.294      ret =
   1.295 -        SDL_SYS_HapticOpenFromDevice2(haptic, joystick->hwdata->InputDevice);
   1.296 +        SDL_SYS_HapticOpenFromDevice8(haptic, joystick->hwdata->InputDevice);
   1.297      if (ret < 0) {
   1.298          return -1;
   1.299      }
   1.300 @@ -638,10 +638,10 @@
   1.301          haptic->neffects = 0;
   1.302  
   1.303          /* Clean up */
   1.304 -        IDirectInputDevice2_Unacquire(haptic->hwdata->device);
   1.305 +        IDirectInputDevice8_Unacquire(haptic->hwdata->device);
   1.306          /* Only release if isn't grabbed by a joystick. */
   1.307          if (haptic->hwdata->is_joystick == 0) {
   1.308 -            IDirectInputDevice2_Release(haptic->hwdata->device);
   1.309 +            IDirectInputDevice8_Release(haptic->hwdata->device);
   1.310          }
   1.311  
   1.312          /* Free */
   1.313 @@ -667,7 +667,7 @@
   1.314      }
   1.315  
   1.316      if (dinput != NULL) {
   1.317 -        IDirectInput_Release(dinput);
   1.318 +        IDirectInput8_Release(dinput);
   1.319          dinput = NULL;
   1.320      }
   1.321  
   1.322 @@ -1148,7 +1148,7 @@
   1.323      }
   1.324  
   1.325      /* Create the actual effect. */
   1.326 -    ret = IDirectInputDevice2_CreateEffect(haptic->hwdata->device, type,
   1.327 +    ret = IDirectInputDevice8_CreateEffect(haptic->hwdata->device, type,
   1.328                                             &effect->hweffect->effect,
   1.329                                             &effect->hweffect->ref, NULL);
   1.330      if (FAILED(ret)) {
   1.331 @@ -1319,7 +1319,7 @@
   1.332      dipdw.dwData = gain * 100;  /* 0 to 10,000 */
   1.333  
   1.334      /* Try to set the autocenter. */
   1.335 -    ret = IDirectInputDevice2_SetProperty(haptic->hwdata->device,
   1.336 +    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
   1.337                                            DIPROP_FFGAIN, &dipdw.diph);
   1.338      if (FAILED(ret)) {
   1.339          DI_SetError("Setting gain", ret);
   1.340 @@ -1348,7 +1348,7 @@
   1.341          DIPROPAUTOCENTER_ON;
   1.342  
   1.343      /* Try to set the autocenter. */
   1.344 -    ret = IDirectInputDevice2_SetProperty(haptic->hwdata->device,
   1.345 +    ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
   1.346                                            DIPROP_AUTOCENTER, &dipdw.diph);
   1.347      if (FAILED(ret)) {
   1.348          DI_SetError("Setting autocenter", ret);
   1.349 @@ -1368,7 +1368,7 @@
   1.350      HRESULT ret;
   1.351  
   1.352      /* Pause the device. */
   1.353 -    ret = IDirectInputDevice2_SendForceFeedbackCommand(haptic->hwdata->device,
   1.354 +    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
   1.355                                                         DISFFC_PAUSE);
   1.356      if (FAILED(ret)) {
   1.357          DI_SetError("Pausing the device", ret);
   1.358 @@ -1388,7 +1388,7 @@
   1.359      HRESULT ret;
   1.360  
   1.361      /* Unpause the device. */
   1.362 -    ret = IDirectInputDevice2_SendForceFeedbackCommand(haptic->hwdata->device,
   1.363 +    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
   1.364                                                         DISFFC_CONTINUE);
   1.365      if (FAILED(ret)) {
   1.366          DI_SetError("Pausing the device", ret);
   1.367 @@ -1408,7 +1408,7 @@
   1.368      HRESULT ret;
   1.369  
   1.370      /* Try to stop the effects. */
   1.371 -    ret = IDirectInputDevice2_SendForceFeedbackCommand(haptic->hwdata->device,
   1.372 +    ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
   1.373                                                         DISFFC_STOPALL);
   1.374      if (FAILED(ret)) {
   1.375          DI_SetError("Stopping the device", ret);
     2.1 --- a/src/joystick/windows/SDL_dxjoystick.c	Thu Nov 29 09:48:42 2012 -0800
     2.2 +++ b/src/joystick/windows/SDL_dxjoystick.c	Thu Nov 29 15:24:56 2012 -0500
     2.3 @@ -63,7 +63,7 @@
     2.4  
     2.5  /* local variables */
     2.6  static SDL_bool coinitialized = SDL_FALSE;
     2.7 -static LPDIRECTINPUT dinput = NULL;
     2.8 +static LPDIRECTINPUT8 dinput = NULL;
     2.9  static SDL_bool s_bDeviceAdded = SDL_FALSE;
    2.10  static SDL_bool s_bDeviceRemoved = SDL_FALSE;
    2.11  static int s_nInstanceID = -1;
    2.12 @@ -919,7 +919,7 @@
    2.13  SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
    2.14  {
    2.15      HRESULT result;
    2.16 -    LPDIRECTINPUTDEVICE device;
    2.17 +    LPDIRECTINPUTDEVICE8 device;
    2.18      DIPROPDWORD dipdw;
    2.19  	JoyStick_DeviceData *joystickdevice = SYS_Joystick;
    2.20  
    2.21 @@ -1008,7 +1008,7 @@
    2.22  			return (-1);
    2.23  		}
    2.24  
    2.25 -		/* Now get the IDirectInputDevice2 interface, instead. */
    2.26 +		/* Now get the IDirectInputDevice8 interface, instead. */
    2.27  		result = IDirectInputDevice8_QueryInterface(device,
    2.28  												   &IID_IDirectInputDevice8,
    2.29  												   (LPVOID *) & joystick->
    2.30 @@ -1017,7 +1017,7 @@
    2.31  		IDirectInputDevice8_Release(device);
    2.32  
    2.33  		if (FAILED(result)) {
    2.34 -			SetDIerror("IDirectInputDevice::QueryInterface", result);
    2.35 +			SetDIerror("IDirectInputDevice8::QueryInterface", result);
    2.36  			return (-1);
    2.37  		}
    2.38  
    2.39 @@ -1029,7 +1029,7 @@
    2.40  													DISCL_NONEXCLUSIVE |
    2.41  													DISCL_BACKGROUND);
    2.42  		if (FAILED(result)) {
    2.43 -			SetDIerror("IDirectInputDevice2::SetCooperativeLevel", result);
    2.44 +			SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result);
    2.45  			return (-1);
    2.46  		}
    2.47  
    2.48 @@ -1038,7 +1038,7 @@
    2.49  			IDirectInputDevice8_SetDataFormat(joystick->hwdata->InputDevice,
    2.50  											  &c_dfDIJoystick2);
    2.51  		if (FAILED(result)) {
    2.52 -			SetDIerror("IDirectInputDevice2::SetDataFormat", result);
    2.53 +			SetDIerror("IDirectInputDevice8::SetDataFormat", result);
    2.54  			return (-1);
    2.55  		}
    2.56  
    2.57 @@ -1048,7 +1048,7 @@
    2.58  												&joystick->hwdata->Capabilities);
    2.59  
    2.60  		if (FAILED(result)) {
    2.61 -			SetDIerror("IDirectInputDevice2::GetCapabilities", result);
    2.62 +			SetDIerror("IDirectInputDevice8::GetCapabilities", result);
    2.63  			return (-1);
    2.64  		}
    2.65  
    2.66 @@ -1058,7 +1058,7 @@
    2.67  			result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
    2.68  
    2.69  			if (FAILED(result)) {
    2.70 -				SetDIerror("IDirectInputDevice2::Acquire", result);
    2.71 +				SetDIerror("IDirectInputDevice8::Acquire", result);
    2.72  				return (-1);
    2.73  			}
    2.74  
    2.75 @@ -1070,7 +1070,7 @@
    2.76  
    2.77  			/* Not necessarily supported, ignore if not supported.
    2.78  			if (FAILED(result)) {
    2.79 -				SetDIerror("IDirectInputDevice2::SendForceFeedbackCommand",
    2.80 +				SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand",
    2.81  						   result);
    2.82  				return (-1);
    2.83  			}
    2.84 @@ -1079,7 +1079,7 @@
    2.85  			result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
    2.86  
    2.87  			if (FAILED(result)) {
    2.88 -				SetDIerror("IDirectInputDevice2::Unacquire", result);
    2.89 +				SetDIerror("IDirectInputDevice8::Unacquire", result);
    2.90  				return (-1);
    2.91  			}
    2.92  
    2.93 @@ -1095,7 +1095,7 @@
    2.94  
    2.95  			/* Not necessarily supported, ignore if not supported.
    2.96  			if (FAILED(result)) {
    2.97 -				SetDIerror("IDirectInputDevice2::SetProperty", result);
    2.98 +				SetDIerror("IDirectInputDevice8::SetProperty", result);
    2.99  				return (-1);
   2.100  			}
   2.101  			*/
   2.102 @@ -1124,7 +1124,7 @@
   2.103  			 * to use less reliable polling. */
   2.104  			joystick->hwdata->buffered = 0;
   2.105  		} else if (FAILED(result)) {
   2.106 -			SetDIerror("IDirectInputDevice2::SetProperty", result);
   2.107 +			SetDIerror("IDirectInputDevice8::SetProperty", result);
   2.108  			return (-1);
   2.109  		}
   2.110  	}
     3.1 --- a/src/joystick/windows/SDL_dxjoystick_c.h	Thu Nov 29 09:48:42 2012 -0800
     3.2 +++ b/src/joystick/windows/SDL_dxjoystick_c.h	Thu Nov 29 15:24:56 2012 -0500
     3.3 @@ -84,7 +84,7 @@
     3.4  /* The private structure used to keep track of a joystick */
     3.5  struct joystick_hwdata
     3.6  {
     3.7 -    LPDIRECTINPUTDEVICE2 InputDevice;
     3.8 +    LPDIRECTINPUTDEVICE8 InputDevice;
     3.9      DIDEVCAPS Capabilities;
    3.10      int buffered;
    3.11  	JoystickGUID guid;