http://bugs.winehq.org/show_bug.cgi?id=27482
--- Comment #11 from Henri Verbeet hverbeet@gmail.com 2012-01-20 13:01:18 CST --- (In reply to comment #10)
if (!iface) return NULL;
- assert(iface->lpVtbl == &ddraw_surface7_vtbl);
- return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface7_iface);
- if (iface->lpVtbl == &ddraw_surface7_vtbl)
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface7_iface);
- if (((IDirectDrawSurface4 *)iface)->lpVtbl == &ddraw_surface4_vtbl)
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface4_iface);
- if (((IDirectDrawSurface3 *)iface)->lpVtbl == &ddraw_surface3_vtbl)
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface3_iface);
- if (((IDirectDrawSurface2 *)iface)->lpVtbl == &ddraw_surface2_vtbl)
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface2_iface);
- if (((IDirectDrawSurface *)iface)->lpVtbl == &ddraw_surface1_vtbl)
return CONTAINING_RECORD(iface, IDirectDrawSurfaceImpl, IDirectDrawSurface_iface);
- FIXME("Unknown interface for object at %p.\n", iface);
- return NULL;
Although it would still not make me feel particularly happy about all this, can't you just explicitly QueryInterface() for the IDirectDrawSurface7 interface and then continue as before?