richedit: Initialize fields for windowless richedit controls.

Dylan Smith dylan.ah.smith at gmail.com
Mon Jan 25 00:27:30 CST 2010


The field exStyleFlags is initialized in ME_CreatTextHost for only windowed
richedit controls. The field rcFormat is initialized by
ITextHost::TxClientRect which is application code, so should be
pre-initialized before calling this function.

Caught by valgrind.
---
 dlls/riched20/txtsrv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20100125/4322cdd0/attachment-0001.htm>
-------------- next part --------------
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index 4006acd..7ab2af4 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -87,6 +87,8 @@ HRESULT WINAPI CreateTextServices(IUnknown  * pUnkOuter,
    ITextImpl->pMyHost = pITextHost;
    ITextImpl->lpVtbl = &textservices_Vtbl;
    ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
+   ITextImpl->editor->exStyleFlags = 0;
+   ITextImpl->editor->rcFormat = (RECT){0,0,0,0};
    ME_HandleMessage(ITextImpl->editor, WM_CREATE, 0, 0, TRUE, &hres);
 
    if (pUnkOuter)


More information about the wine-patches mailing list