cryptui: Fix crash with native riched20.
This commit is contained in:
parent
732fce7c3c
commit
e50e78f1cb
|
@ -1666,6 +1666,7 @@ static void add_icon_to_control(HWND hwnd, int id)
|
||||||
HBITMAP bitmap = NULL;
|
HBITMAP bitmap = NULL;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
STGMEDIUM stgm;
|
STGMEDIUM stgm;
|
||||||
|
LPOLECLIENTSITE clientSite = NULL;
|
||||||
REOBJECT reObject;
|
REOBJECT reObject;
|
||||||
|
|
||||||
TRACE("(%p, %d)\n", hwnd, id);
|
TRACE("(%p, %d)\n", hwnd, id);
|
||||||
|
@ -1693,6 +1694,9 @@ static void add_icon_to_control(HWND hwnd, int id)
|
||||||
goto end;
|
goto end;
|
||||||
hr = IOleObject_QueryInterface(object, &IID_IDataObject,
|
hr = IOleObject_QueryInterface(object, &IID_IDataObject,
|
||||||
(void**)&dataObject);
|
(void**)&dataObject);
|
||||||
|
if (FAILED(hr))
|
||||||
|
goto end;
|
||||||
|
hr = IRichEditOle_GetClientSite(richEditOle, &clientSite);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
goto end;
|
goto end;
|
||||||
bitmap = LoadImageW(hInstance, MAKEINTRESOURCEW(id), IMAGE_BITMAP, 0, 0,
|
bitmap = LoadImageW(hInstance, MAKEINTRESOURCEW(id), IMAGE_BITMAP, 0, 0,
|
||||||
|
@ -1714,7 +1718,7 @@ static void add_icon_to_control(HWND hwnd, int id)
|
||||||
reObject.clsid = clsid;
|
reObject.clsid = clsid;
|
||||||
reObject.poleobj = object;
|
reObject.poleobj = object;
|
||||||
reObject.pstg = NULL;
|
reObject.pstg = NULL;
|
||||||
reObject.polesite = NULL;
|
reObject.polesite = clientSite;
|
||||||
reObject.sizel.cx = reObject.sizel.cy = 0;
|
reObject.sizel.cx = reObject.sizel.cy = 0;
|
||||||
reObject.dvaspect = DVASPECT_CONTENT;
|
reObject.dvaspect = DVASPECT_CONTENT;
|
||||||
reObject.dwFlags = 0;
|
reObject.dwFlags = 0;
|
||||||
|
@ -1723,6 +1727,8 @@ static void add_icon_to_control(HWND hwnd, int id)
|
||||||
IRichEditOle_InsertObject(richEditOle, &reObject);
|
IRichEditOle_InsertObject(richEditOle, &reObject);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
if (clientSite)
|
||||||
|
IOleClientSite_Release(clientSite);
|
||||||
if (dataObject)
|
if (dataObject)
|
||||||
IDataObject_Release(dataObject);
|
IDataObject_Release(dataObject);
|
||||||
if (oleCache)
|
if (oleCache)
|
||||||
|
|
Loading…
Reference in New Issue