user32: Check for valid cbSize in GetMonitorInfoW.

This commit is contained in:
Patrick Rudolph 2014-04-23 17:36:06 +02:00 committed by Alexandre Julliard
parent d1f554711f
commit 4ecda80c6c
1 changed files with 6 additions and 1 deletions

View File

@ -440,7 +440,12 @@ BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
*/
BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
{
BOOL ret = USER_Driver->pGetMonitorInfo( hMonitor, lpMonitorInfo );
BOOL ret;
if (lpMonitorInfo->cbSize != sizeof(MONITORINFOEXW) && lpMonitorInfo->cbSize != sizeof(MONITORINFO))
return FALSE;
ret = USER_Driver->pGetMonitorInfo( hMonitor, lpMonitorInfo );
if (ret)
TRACE("flags %04x, monitor %s, work %s\n", lpMonitorInfo->dwFlags,
wine_dbgstr_rect(&lpMonitorInfo->rcMonitor),