ole32: Rewrite _Run() to return early on failure.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e6042cf6a6
commit
a56a0eb063
@ -1330,26 +1330,30 @@ static HRESULT WINAPI DefaultHandler_Run(
|
|||||||
This->object_state = object_state_running;
|
This->object_state = object_state_running;
|
||||||
|
|
||||||
hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn);
|
hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn);
|
||||||
|
if (FAILED(hr)) goto fail;
|
||||||
|
|
||||||
if (SUCCEEDED(hr) && This->clientSite)
|
if (This->clientSite)
|
||||||
hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite);
|
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
|
||||||
{
|
{
|
||||||
IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage,
|
hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite);
|
||||||
(void **)&This->pPSDelegate);
|
if (FAILED(hr)) goto fail;
|
||||||
if (This->pPSDelegate)
|
|
||||||
{
|
|
||||||
if(This->storage_state == storage_state_initialised)
|
|
||||||
hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage);
|
|
||||||
else if(This->storage_state == storage_state_loaded)
|
|
||||||
hr = IPersistStorage_Load(This->pPSDelegate, This->storage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SUCCEEDED(hr) && This->containerApp)
|
hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage,
|
||||||
|
(void **)&This->pPSDelegate);
|
||||||
|
if (FAILED(hr)) goto fail;
|
||||||
|
|
||||||
|
if (This->storage_state == storage_state_initialised)
|
||||||
|
hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage);
|
||||||
|
else if (This->storage_state == storage_state_loaded)
|
||||||
|
hr = IPersistStorage_Load(This->pPSDelegate, This->storage);
|
||||||
|
if (FAILED(hr)) goto fail;
|
||||||
|
|
||||||
|
if (This->containerApp)
|
||||||
|
{
|
||||||
hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp,
|
hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp,
|
||||||
This->containerObj);
|
This->containerObj);
|
||||||
|
if (FAILED(hr)) goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: do more stuff here:
|
/* FIXME: do more stuff here:
|
||||||
* - IOleObject_GetMiscStatus
|
* - IOleObject_GetMiscStatus
|
||||||
@ -1357,20 +1361,22 @@ static HRESULT WINAPI DefaultHandler_Run(
|
|||||||
* - IOleCache_OnRun
|
* - IOleCache_OnRun
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject,
|
||||||
hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject,
|
(void **)&This->pDataDelegate);
|
||||||
(void **)&This->pDataDelegate);
|
if (FAILED(hr)) goto fail;
|
||||||
|
|
||||||
if (SUCCEEDED(hr) && This->dataAdviseHolder)
|
if (This->dataAdviseHolder)
|
||||||
hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
|
|
||||||
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
{
|
||||||
DefaultHandler_Stop(This);
|
hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
|
||||||
release_delegates(This);
|
if (FAILED(hr)) goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
DefaultHandler_Stop(This);
|
||||||
|
release_delegates(This);
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user