Author: cwittich
Date: Sat Sep 13 03:48:18 2008
New Revision: 36180
URL:
http://svn.reactos.org/svn/reactos?rev=36180&view=rev
Log:
fix kernel32 format_msg winetest
Modified:
trunk/reactos/dll/win32/kernel32/misc/errormsg.c
Modified: trunk/reactos/dll/win32/kernel32/misc/errormsg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/er…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/errormsg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/errormsg.c [iso-8859-1] Sat Sep 13 03:48:18
2008
@@ -171,6 +171,12 @@
if ((dwFlags & FORMAT_MESSAGE_FROM_STRING)
&&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
|| (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0;
+
+ if (!lpBuffer)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return 0;
+ }
if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK)
FIXME("line wrapping (%lu) not supported.\n", width);
@@ -423,6 +429,12 @@
&&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
|| (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0;
+ if (!lpBuffer)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK)
FIXME("line wrapping not supported.\n");
from = NULL;