[PATCH 4/4] ddraw: The surface isn't allowed to be NULL in EnumSurfacesCallbackThunk() and EnumCallback().

Henri Verbeet hverbeet at codeweavers.com
Mon Jul 19 05:47:59 CDT 2010


---
 dlls/ddraw/ddraw_thunks.c   |    5 ++---
 dlls/ddraw/surface_thunks.c |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/ddraw/ddraw_thunks.c b/dlls/ddraw/ddraw_thunks.c
index 28991d1..2c205e9 100644
--- a/dlls/ddraw/ddraw_thunks.c
+++ b/dlls/ddraw/ddraw_thunks.c
@@ -578,9 +578,8 @@ EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
 
     /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
      * IDirectDrawSurface vtable layout at the beginning  */
-    return cbcontext->func(
-            pSurf ? (IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)pSurf)->IDirectDrawSurface3_vtbl : NULL,
-            (LPDDSURFACEDESC)pDDSD, cbcontext->context);
+    return cbcontext->func((IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)pSurf)->IDirectDrawSurface3_vtbl,
+            (DDSURFACEDESC *)pDDSD, cbcontext->context);
 }
 
 static HRESULT WINAPI
diff --git a/dlls/ddraw/surface_thunks.c b/dlls/ddraw/surface_thunks.c
index be57c3b..6df6dcd 100644
--- a/dlls/ddraw/surface_thunks.c
+++ b/dlls/ddraw/surface_thunks.c
@@ -150,9 +150,8 @@ EnumCallback(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD,
 {
     const struct callback_info* info = context;
 
-    return info->callback(iface ?
-            (IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)iface)->IDirectDrawSurface3_vtbl : NULL,
-            (LPDDSURFACEDESC)pDDSD, info->context);
+    return info->callback((IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)iface)->IDirectDrawSurface3_vtbl,
+            (DDSURFACEDESC *)pDDSD, info->context);
 }
 
 static HRESULT WINAPI
-- 
1.7.1




More information about the wine-patches mailing list