src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2573 40b89e3d7ab5
parent 2572 bb1481265341
child 2574 c1f07fdd1e2d
--- a/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:23:52 2008 +0000
+++ b/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:29:12 2008 +0000
@@ -74,6 +74,7 @@
 struct haptic_hweffect
 {
    DIEFFECT effect;
+   LPDIRECTINPUTEFFECT ref;
 };
 
 
@@ -190,7 +191,7 @@
  * Callback to get all supported effects.
  */
 #define EFFECT_TEST(e,s)   \
-if (pei->guid == &(e))      \
+if (&pei->guid == &(e))      \
    haptic->supported |= (s)
 static BOOL CALLBACK
 DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
@@ -978,8 +979,8 @@
 
    /* Create the actual effect. */
    ret = IDirectInputDevice2_SetParameters(effect->hweffect->ref, &temp, flags);
-   if (ret != FF_OK) {
-      SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret));
+   if (FAILED(ret)) {
+      DI_SetError("Unable to update effect",ret);
       goto err_update;
    }