ddraw: COM cleanup for the IDirectDraw7 iface.
This commit is contained in:
parent
cd8c18e83c
commit
9745108096
File diff suppressed because it is too large
Load Diff
|
@ -95,8 +95,8 @@ struct FvfToDecl
|
|||
|
||||
struct IDirectDrawImpl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
const IDirectDraw7Vtbl *lpVtbl;
|
||||
/* Interfaces */
|
||||
IDirectDraw7 IDirectDraw7_iface;
|
||||
IDirectDraw4 IDirectDraw4_iface;
|
||||
IDirectDraw3 IDirectDraw3_iface;
|
||||
IDirectDraw2 IDirectDraw2_iface;
|
||||
|
|
|
@ -119,7 +119,7 @@ IDirect3DDeviceImpl_7_QueryInterface(IDirect3DDevice7 *iface,
|
|||
/* Check DirectDraw Interfacs */
|
||||
else if( IsEqualGUID( &IID_IDirectDraw7, refiid ) )
|
||||
{
|
||||
*obj = This->ddraw;
|
||||
*obj = &This->ddraw->IDirectDraw7_iface;
|
||||
TRACE("(%p) Returning IDirectDraw7 interface at %p\n", This, *obj);
|
||||
}
|
||||
else if ( IsEqualGUID( &IID_IDirectDraw4, refiid ) )
|
||||
|
|
|
@ -273,8 +273,8 @@ DDRAW_Create(const GUID *guid,
|
|||
return hr;
|
||||
}
|
||||
|
||||
hr = IDirectDraw7_QueryInterface((IDirectDraw7 *)This, iid, DD);
|
||||
IDirectDraw7_Release((IDirectDraw7 *)This);
|
||||
hr = IDirectDraw7_QueryInterface(&This->IDirectDraw7_iface, iid, DD);
|
||||
IDirectDraw7_Release(&This->IDirectDraw7_iface);
|
||||
if (SUCCEEDED(hr)) list_add_head(&global_ddraw_list, &This->ddraw_list_entry);
|
||||
else WARN("Failed to query interface %s from ddraw object %p.\n", debugstr_guid(iid), This);
|
||||
|
||||
|
@ -941,7 +941,7 @@ DllMain(HINSTANCE hInstDLL,
|
|||
IDirectDraw2_AddRef(&ddraw->IDirectDraw2_iface);
|
||||
IDirectDraw3_AddRef(&ddraw->IDirectDraw3_iface);
|
||||
IDirectDraw4_AddRef(&ddraw->IDirectDraw4_iface);
|
||||
IDirectDraw7_AddRef((IDirectDraw7 *)ddraw);
|
||||
IDirectDraw7_AddRef(&ddraw->IDirectDraw7_iface);
|
||||
|
||||
/* Does a D3D device exist? Destroy it
|
||||
* TODO: Destroy all Vertex buffers, Lights, Materials
|
||||
|
@ -960,8 +960,8 @@ DllMain(HINSTANCE hInstDLL,
|
|||
desc.dwSize = sizeof(desc);
|
||||
for(i = 0; i <= 1; i++)
|
||||
{
|
||||
hr = IDirectDraw7_EnumSurfaces((IDirectDraw7 *)ddraw,
|
||||
DDENUMSURFACES_ALL, &desc, ddraw, DestroyCallback);
|
||||
hr = IDirectDraw7_EnumSurfaces(&ddraw->IDirectDraw7_iface, DDENUMSURFACES_ALL,
|
||||
&desc, ddraw, DestroyCallback);
|
||||
if(hr != D3D_OK)
|
||||
ERR("(%p) EnumSurfaces failed, prepare for trouble\n", ddraw);
|
||||
}
|
||||
|
@ -977,7 +977,7 @@ DllMain(HINSTANCE hInstDLL,
|
|||
while(IDirectDraw2_Release(&ddraw->IDirectDraw2_iface));
|
||||
while(IDirectDraw3_Release(&ddraw->IDirectDraw3_iface));
|
||||
while(IDirectDraw4_Release(&ddraw->IDirectDraw4_iface));
|
||||
while(IDirectDraw7_Release((IDirectDraw7 *)ddraw));
|
||||
while(IDirectDraw7_Release(&ddraw->IDirectDraw7_iface));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
|
|||
return hr;
|
||||
}
|
||||
|
||||
palette->ifaceToRelease = (IUnknown *)ddraw;
|
||||
palette->ifaceToRelease = (IUnknown *)&ddraw->IDirectDraw7_iface;
|
||||
IUnknown_AddRef(palette->ifaceToRelease);
|
||||
|
||||
return DD_OK;
|
||||
|
|
|
@ -2254,7 +2254,7 @@ static HRESULT WINAPI ddraw_surface7_GetDDInterface(IDirectDrawSurface7 *iface,
|
|||
switch(This->version)
|
||||
{
|
||||
case 7:
|
||||
*DD = This->ddraw;
|
||||
*DD = &This->ddraw->IDirectDraw7_iface;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
|
Loading…
Reference in New Issue