[ros-diffs] [jimtabor] 44987: [User32] - Patch by Marcus Meissner : EM_REPLACESEL Handle OOM error. - Will sync to wine after a review of new WOW implementation.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Thu Jan 7 19:55:24 CET 2010


Author: jimtabor
Date: Thu Jan  7 19:55:24 2010
New Revision: 44987

URL: http://svn.reactos.org/svn/reactos?rev=44987&view=rev
Log:
[User32]
- Patch by Marcus Meissner : EM_REPLACESEL Handle OOM error.
- Will sync to wine after a review of new WOW implementation.

Modified:
    trunk/reactos/dll/win32/user32/controls/edit.c

Modified: trunk/reactos/dll/win32/user32/controls/edit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/edit.c?rev=44987&r1=44986&r2=44987&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] Thu Jan  7 19:55:24 2010
@@ -5004,8 +5004,8 @@
 		{
 		    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);




More information about the Ros-diffs mailing list