[PATCH 3/6] ole32: Return OLE_E_NOTRUNNING on a cache-miss when the object isn't running.
Huw Davies
huw at codeweavers.com
Wed Oct 14 04:33:49 CDT 2015
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
dlls/ole32/defaulthandler.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/defaulthandler.c b/dlls/ole32/defaulthandler.c
index ad79e99..9f6fa2b 100644
--- a/dlls/ole32/defaulthandler.c
+++ b/dlls/ole32/defaulthandler.c
@@ -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;
}
--
1.8.0
More information about the wine-patches
mailing list