From 432bd7570f9bf36afca993aab4e46a5803d76e60 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 7 Jan 2010 18:55:24 +0000 Subject: [PATCH] [User32] - Patch by Marcus Meissner : EM_REPLACESEL Handle OOM error. - Will sync to wine after a review of new WOW implementation. svn path=/trunk/; revision=44987 --- reactos/dll/win32/user32/controls/edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/user32/controls/edit.c b/reactos/dll/win32/user32/controls/edit.c index 77430fb8567..6d9480e8b74 100644 --- a/reactos/dll/win32/user32/controls/edit.c +++ b/reactos/dll/win32/user32/controls/edit.c @@ -5004,8 +5004,8 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, { LPSTR textA = (LPSTR)lParam; INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0); - if((textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) - MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW); + if(!(textW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR)))) break; + MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, countW); } EDIT_EM_ReplaceSel(es, (BOOL)wParam, textW, TRUE, TRUE);