Commit e4ec89f2 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Return OLE_E_NOTRUNNING on a cache-miss when the object isn't running.

parent 4fcc5fec
......@@ -1021,8 +1021,17 @@ static HRESULT WINAPI DefaultHandler_GetData(
IDataObject_Release(cacheDataObject);
if (FAILED(hres) && object_is_running( This ))
if (hres == S_OK) return hres;
if (object_is_running( This ))
{
hres = IDataObject_GetData(This->pDataDelegate, pformatetcIn, pmedium);
if (hres == S_OK) return hres;
}
/* Query running state again, as the object may have closed during _GetData call */
if (!object_is_running( This ))
hres = OLE_E_NOTRUNNING;
return hres;
}
......@@ -1067,8 +1076,17 @@ static HRESULT WINAPI DefaultHandler_QueryGetData(
IDataObject_Release(cacheDataObject);
if (FAILED(hres) && object_is_running( This ))
if (hres == S_OK) return hres;
if (object_is_running( This ))
{
hres = IDataObject_QueryGetData(This->pDataDelegate, pformatetc);
if (hres == S_OK) return hres;
}
/* Query running state again, as the object may have closed during _QueryGetData call */
if (!object_is_running( This ))
hres = OLE_E_NOTRUNNING;
return hres;
}
......
......@@ -1933,7 +1933,6 @@ static void test_default_handler(void)
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ENHMF;
hr = IDataObject_QueryGetData(pDataObject, &fmtetc);
todo_wine
ok(hr == OLE_E_NOTRUNNING, "IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n", hr);
fmtetc.cfFormat = CF_TEXT;
......@@ -1942,7 +1941,6 @@ static void test_default_handler(void)
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_NULL;
hr = IDataObject_QueryGetData(pDataObject, &fmtetc);
todo_wine
ok(hr == OLE_E_NOTRUNNING, "IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n", hr);
hr = IOleObject_QueryInterface(pObject, &IID_IRunnableObject, (void **)&pRunnableObject);
......
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