Check for null pointers, keep wine msg test from crashing.

svn path=/trunk/; revision=34774
This commit is contained in:
James Tabor 2008-07-25 12:26:22 +00:00
parent 0104c42bb4
commit 9f5f04ab20

View file

@ -1441,6 +1441,11 @@ GetMessageA(LPMSG lpMsg,
MsgiKMToUMCleanup(&Info.Msg, &Conversion.UnicodeMsg); MsgiKMToUMCleanup(&Info.Msg, &Conversion.UnicodeMsg);
return (BOOL) -1; return (BOOL) -1;
} }
if (!lpMsg)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
*lpMsg = Conversion.AnsiMsg; *lpMsg = Conversion.AnsiMsg;
Conversion.Ansi = TRUE; Conversion.Ansi = TRUE;
Conversion.FinalMsg = lpMsg; Conversion.FinalMsg = lpMsg;
@ -1481,6 +1486,11 @@ GetMessageW(LPMSG lpMsg,
{ {
return (BOOL) -1; return (BOOL) -1;
} }
if (!lpMsg)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
*lpMsg = Conversion.UnicodeMsg; *lpMsg = Conversion.UnicodeMsg;
Conversion.Ansi = FALSE; Conversion.Ansi = FALSE;
Conversion.FinalMsg = lpMsg; Conversion.FinalMsg = lpMsg;
@ -1527,6 +1537,11 @@ PeekMessageA(LPMSG lpMsg,
MsgiKMToUMCleanup(&Info.Msg, &Conversion.UnicodeMsg); MsgiKMToUMCleanup(&Info.Msg, &Conversion.UnicodeMsg);
return (BOOL) -1; return (BOOL) -1;
} }
if (!lpMsg)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
*lpMsg = Conversion.AnsiMsg; *lpMsg = Conversion.AnsiMsg;
Conversion.Ansi = TRUE; Conversion.Ansi = TRUE;
Conversion.FinalMsg = lpMsg; Conversion.FinalMsg = lpMsg;
@ -1570,6 +1585,11 @@ PeekMessageW(
{ {
return (BOOL) -1; return (BOOL) -1;
} }
if (!lpMsg)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
*lpMsg = Conversion.UnicodeMsg; *lpMsg = Conversion.UnicodeMsg;
Conversion.Ansi = FALSE; Conversion.Ansi = FALSE;
Conversion.FinalMsg = lpMsg; Conversion.FinalMsg = lpMsg;