Commit e50e78f1 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

cryptui: Fix crash with native riched20.

parent 732fce7c
...@@ -1666,6 +1666,7 @@ static void add_icon_to_control(HWND hwnd, int id) ...@@ -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);
...@@ -1695,6 +1696,9 @@ static void add_icon_to_control(HWND hwnd, int id) ...@@ -1695,6 +1696,9 @@ static void add_icon_to_control(HWND hwnd, int id)
(void**)&dataObject); (void**)&dataObject);
if (FAILED(hr)) if (FAILED(hr))
goto end; goto end;
hr = IRichEditOle_GetClientSite(richEditOle, &clientSite);
if (FAILED(hr))
goto end;
bitmap = LoadImageW(hInstance, MAKEINTRESOURCEW(id), IMAGE_BITMAP, 0, 0, bitmap = LoadImageW(hInstance, MAKEINTRESOURCEW(id), IMAGE_BITMAP, 0, 0,
LR_DEFAULTSIZE | LR_LOADTRANSPARENT); LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
if (!bitmap) if (!bitmap)
...@@ -1714,7 +1718,7 @@ static void add_icon_to_control(HWND hwnd, int id) ...@@ -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) ...@@ -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)
......
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