ddraw: Implement ddraw7_Initialize().
This commit is contained in:
parent
feb96511a9
commit
ec04f80cf6
|
@ -1537,11 +1537,22 @@ static HRESULT WINAPI ddraw2_GetAvailableVidMem(IDirectDraw2 *iface,
|
|||
* DDERR_ALREADYINITIALIZED on repeated calls
|
||||
*
|
||||
*****************************************************************************/
|
||||
static HRESULT WINAPI ddraw7_Initialize(IDirectDraw7 *iface, GUID *Guid)
|
||||
static HRESULT WINAPI ddraw7_Initialize(IDirectDraw7 *iface, GUID *guid)
|
||||
{
|
||||
FIXME("iface %p, guid %s stub!\n", iface, debugstr_guid(Guid));
|
||||
IDirectDrawImpl *This = impl_from_IDirectDraw7(iface);
|
||||
|
||||
return DDERR_ALREADYINITIALIZED;
|
||||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
|
||||
|
||||
if (This->initialized)
|
||||
return DDERR_ALREADYINITIALIZED;
|
||||
|
||||
/* FIXME: To properly take the GUID into account we should call
|
||||
* ddraw_init() here instead of in DDRAW_Create(). */
|
||||
if (guid)
|
||||
FIXME("Ignoring guid %s.\n", debugstr_guid(guid));
|
||||
|
||||
This->initialized = TRUE;
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ddraw4_Initialize(IDirectDraw4 *iface, GUID *guid)
|
||||
|
@ -1575,7 +1586,7 @@ static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
|
|||
{
|
||||
TRACE("iface %p, riid %s.\n", iface, debugstr_guid(riid));
|
||||
|
||||
return D3D_OK;
|
||||
return DDERR_ALREADYINITIALIZED;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -81,6 +81,7 @@ struct IDirectDrawImpl
|
|||
|
||||
/* See comment in IDirectDraw::AddRef */
|
||||
LONG ref7, ref4, ref2, ref3, ref1, numIfaces;
|
||||
BOOL initialized;
|
||||
|
||||
/* WineD3D linkage */
|
||||
struct wined3d *wineD3D;
|
||||
|
|
|
@ -275,6 +275,14 @@ DirectDrawCreate(GUID *GUID,
|
|||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = DDRAW_Create(GUID, (void **) DD, UnkOuter, &IID_IDirectDraw);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IDirectDraw_Initialize(*DD, GUID);
|
||||
if (FAILED(hr))
|
||||
IDirectDraw_Release(*DD);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -304,6 +312,15 @@ DirectDrawCreateEx(GUID *GUID,
|
|||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = DDRAW_Create(GUID, DD, UnkOuter, iid);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
IDirectDraw7 *ddraw7 = *(IDirectDraw7 **)DD;
|
||||
hr = IDirectDraw7_Initialize(ddraw7, GUID);
|
||||
if (FAILED(hr))
|
||||
IDirectDraw7_Release(ddraw7);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue