From 9f5f04ab200bb8f30b4fcac545720f1f9ba1ce4b Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 25 Jul 2008 12:26:22 +0000 Subject: [PATCH] Check for null pointers, keep wine msg test from crashing. svn path=/trunk/; revision=34774 --- reactos/dll/win32/user32/windows/message.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/reactos/dll/win32/user32/windows/message.c b/reactos/dll/win32/user32/windows/message.c index 7d27a8eea94..3296aa08920 100644 --- a/reactos/dll/win32/user32/windows/message.c +++ b/reactos/dll/win32/user32/windows/message.c @@ -1441,6 +1441,11 @@ GetMessageA(LPMSG lpMsg, MsgiKMToUMCleanup(&Info.Msg, &Conversion.UnicodeMsg); return (BOOL) -1; } + if (!lpMsg) + { + SetLastError( ERROR_NOACCESS ); + return FALSE; + } *lpMsg = Conversion.AnsiMsg; Conversion.Ansi = TRUE; Conversion.FinalMsg = lpMsg; @@ -1481,6 +1486,11 @@ GetMessageW(LPMSG lpMsg, { return (BOOL) -1; } + if (!lpMsg) + { + SetLastError( ERROR_NOACCESS ); + return FALSE; + } *lpMsg = Conversion.UnicodeMsg; Conversion.Ansi = FALSE; Conversion.FinalMsg = lpMsg; @@ -1527,6 +1537,11 @@ PeekMessageA(LPMSG lpMsg, MsgiKMToUMCleanup(&Info.Msg, &Conversion.UnicodeMsg); return (BOOL) -1; } + if (!lpMsg) + { + SetLastError( ERROR_NOACCESS ); + return FALSE; + } *lpMsg = Conversion.AnsiMsg; Conversion.Ansi = TRUE; Conversion.FinalMsg = lpMsg; @@ -1570,6 +1585,11 @@ PeekMessageW( { return (BOOL) -1; } + if (!lpMsg) + { + SetLastError( ERROR_NOACCESS ); + return FALSE; + } *lpMsg = Conversion.UnicodeMsg; Conversion.Ansi = FALSE; Conversion.FinalMsg = lpMsg;