From f461b39b765712561a6b0a83bb167ec509c170e2 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 19 Jul 2010 12:47:57 +0200 Subject: [PATCH] ddraw: Get rid of the useless "ddraw_owner" fields. --- dlls/ddraw/clipper.c | 6 ++---- dlls/ddraw/ddraw.c | 1 - dlls/ddraw/ddraw_private.h | 3 +-- dlls/ddraw/surface.c | 10 +++------- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/dlls/ddraw/clipper.c b/dlls/ddraw/clipper.c index 4fa4c363ea..a8a324217b 100644 --- a/dlls/ddraw/clipper.c +++ b/dlls/ddraw/clipper.c @@ -254,19 +254,17 @@ static HRESULT WINAPI IDirectDrawClipperImpl_GetHWnd( static HRESULT WINAPI IDirectDrawClipperImpl_Initialize( LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags ) { - IDirectDrawImpl* pOwner; IDirectDrawClipperImpl *This = (IDirectDrawClipperImpl *)iface; TRACE("(%p)->(%p,0x%08x)\n", This, lpDD, dwFlags); EnterCriticalSection(&ddraw_cs); - if (This->ddraw_owner != NULL) + if (This->initialized) { LeaveCriticalSection(&ddraw_cs); return DDERR_ALREADYINITIALIZED; } - pOwner = lpDD ? ddraw_from_ddraw1(lpDD) : NULL; - This->ddraw_owner = pOwner; + This->initialized = TRUE; LeaveCriticalSection(&ddraw_cs); return DD_OK; diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 69c663adaa..05c8c62641 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -3041,7 +3041,6 @@ IDirectDrawImpl_CreatePalette(IDirectDraw7 *iface, object->lpVtbl = &IDirectDrawPalette_Vtbl; object->ref = 1; - object->ddraw_owner = This; hr = IWineD3DDevice_CreatePalette(This->wineD3DDevice, Flags, ColorTable, &object->wineD3DPalette, (IUnknown *)object); diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 1cb30702d9..3de8668d4f 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -469,7 +469,7 @@ struct IDirectDrawClipperImpl LONG ref; IWineD3DClipper *wineD3DClipper; - IDirectDrawImpl *ddraw_owner; + BOOL initialized; }; extern const IDirectDrawClipperVtbl IDirectDrawClipper_Vtbl DECLSPEC_HIDDEN; @@ -489,7 +489,6 @@ struct IDirectDrawPaletteImpl IWineD3DPalette *wineD3DPalette; /* IDirectDrawPalette fields */ - IDirectDrawImpl *ddraw_owner; IUnknown *ifaceToRelease; }; extern const IDirectDrawPaletteVtbl IDirectDrawPalette_Vtbl DECLSPEC_HIDDEN; diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index e64ef3ab5e..e8372babac 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1676,14 +1676,10 @@ IDirectDrawSurfaceImpl_GetSurfaceDesc(IDirectDrawSurface7 *iface, * DDERR_ALREADYINITIALIZED * *****************************************************************************/ -static HRESULT WINAPI -IDirectDrawSurfaceImpl_Initialize(IDirectDrawSurface7 *iface, - IDirectDraw *DD, - DDSURFACEDESC2 *DDSD) +static HRESULT WINAPI IDirectDrawSurfaceImpl_Initialize(IDirectDrawSurface7 *iface, + IDirectDraw *ddraw, DDSURFACEDESC2 *surface_desc) { - IDirectDrawSurfaceImpl *This = (IDirectDrawSurfaceImpl *)iface; - IDirectDrawImpl *ddimpl = DD ? ddraw_from_ddraw1(DD) : NULL; - TRACE("(%p)->(%p,%p)\n",This,ddimpl,DDSD); + TRACE("iface %p, ddraw %p, surface_desc %p.\n", iface, ddraw, surface_desc); return DDERR_ALREADYINITIALIZED; }