Commit 79457d81 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Initialize the back-buffer with the correct VTable.

parent 7e5c2c04
...@@ -60,9 +60,9 @@ static XF86VidModeModeInfo *orig_mode = NULL; ...@@ -60,9 +60,9 @@ static XF86VidModeModeInfo *orig_mode = NULL;
/* This function is used both by DGA and DGA2 drivers, thus the virtual function table /* This function is used both by DGA and DGA2 drivers, thus the virtual function table
is not set here, but in the calling function */ is not set here, but in the calling function */
HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT( HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_with_VT(
LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd,LPDIRECTDRAWSURFACE *lpdsf, LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd,LPDIRECTDRAWSURFACE *lpdsf,
IUnknown *lpunk IUnknown *lpunk, void *vtable
) { ) {
ICOM_THIS(IDirectDraw2Impl,iface); ICOM_THIS(IDirectDraw2Impl,iface);
IDirectDrawSurfaceImpl* dsurf; IDirectDrawSurfaceImpl* dsurf;
...@@ -84,6 +84,8 @@ HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT( ...@@ -84,6 +84,8 @@ HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT(
HEAP_ZERO_MEMORY, HEAP_ZERO_MEMORY,
sizeof(dga_ds_private) sizeof(dga_ds_private)
); );
ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)vtable;
dspriv = (dga_ds_private*)dsurf->private; dspriv = (dga_ds_private*)dsurf->private;
IDirectDraw2_AddRef(iface); IDirectDraw2_AddRef(iface);
...@@ -148,7 +150,7 @@ HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT( ...@@ -148,7 +150,7 @@ HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT(
); );
IDirectDraw2_AddRef(iface); IDirectDraw2_AddRef(iface);
back->ref = 1; back->ref = 1;
ICOM_VTBL(back) = (ICOM_VTABLE(IDirectDrawSurface4)*)&dga_dds4vt; ICOM_VTBL(back) = (ICOM_VTABLE(IDirectDrawSurface4)*)vtable;
back->private = HeapAlloc( back->private = HeapAlloc(
GetProcessHeap(), GetProcessHeap(),
HEAP_ZERO_MEMORY, HEAP_ZERO_MEMORY,
...@@ -196,12 +198,8 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface( ...@@ -196,12 +198,8 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface(
IUnknown *lpunk IUnknown *lpunk
) { ) {
HRESULT ret; HRESULT ret;
IDirectDrawSurfaceImpl* dsurf;
ret = DGA_IDirectDraw2Impl_CreateSurface_no_VT(iface, lpddsd, lpdsf, lpunk); ret = DGA_IDirectDraw2Impl_CreateSurface_with_VT(iface, lpddsd, lpdsf, lpunk, &dga_dds4vt);
dsurf = *(IDirectDrawSurfaceImpl**)lpdsf;
ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)&dga_dds4vt;
return ret; return ret;
} }
......
...@@ -40,12 +40,8 @@ static HRESULT WINAPI DGA2_IDirectDraw2Impl_CreateSurface( ...@@ -40,12 +40,8 @@ static HRESULT WINAPI DGA2_IDirectDraw2Impl_CreateSurface(
IUnknown *lpunk IUnknown *lpunk
) { ) {
HRESULT ret; HRESULT ret;
IDirectDrawSurfaceImpl* dsurf;
ret = DGA_IDirectDraw2Impl_CreateSurface_no_VT(iface, lpddsd, lpdsf, lpunk); ret = DGA_IDirectDraw2Impl_CreateSurface_with_VT(iface, lpddsd, lpdsf, lpunk, &dga2_dds4vt);
dsurf = *(IDirectDrawSurfaceImpl**)lpdsf;
ICOM_VTBL(dsurf) = (ICOM_VTABLE(IDirectDrawSurface)*)&dga2_dds4vt;
return ret; return ret;
} }
......
...@@ -37,8 +37,8 @@ extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(LPDIRECTDRAWSURFACE ...@@ -37,8 +37,8 @@ extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_SetPalette(LPDIRECTDRAWSURFACE
extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_Unlock(LPDIRECTDRAWSURFACE4 iface,LPVOID surface) ; extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_Unlock(LPDIRECTDRAWSURFACE4 iface,LPVOID surface) ;
extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_GetDC(LPDIRECTDRAWSURFACE4 iface,HDC* lphdc); extern HRESULT WINAPI DGA_IDirectDrawSurface4Impl_GetDC(LPDIRECTDRAWSURFACE4 iface,HDC* lphdc);
extern HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_no_VT(LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd, extern HRESULT WINAPI DGA_IDirectDraw2Impl_CreateSurface_with_VT(LPDIRECTDRAW2 iface,LPDDSURFACEDESC lpddsd,
LPDIRECTDRAWSURFACE *lpdsf,IUnknown *lpunk) ; LPDIRECTDRAWSURFACE *lpdsf,IUnknown *lpunk, void *vtable) ;
extern HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 iface,REFIID refiid,LPVOID *obj) ; extern HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 iface,REFIID refiid,LPVOID *obj) ;
extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 iface,LPDDCAPS caps1,LPDDCAPS caps2) ; extern HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 iface,LPDDCAPS caps1,LPDDCAPS caps2) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment