mirror of
https://github.com/reactos/reactos.git
synced 2025-01-12 01:00:06 +00:00
- zero DISPLAY_DEVICEW struct before passing it to NtUserEnumDisplayDevices
- copy string the resulting strings on success but on failure - fix 2 memory leaks in EnumDisplayMonitors - fixes a user32_winetest error svn path=/trunk/; revision=33612
This commit is contained in:
parent
45a63ea020
commit
dd8f25a940
1 changed files with 6 additions and 2 deletions
|
@ -62,13 +62,14 @@ EnumDisplayDevicesA(
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
RtlZeroMemory(&DisplayDeviceW, sizeof(DISPLAY_DEVICEW));
|
||||
DisplayDeviceW.cb = sizeof(DISPLAY_DEVICEW);
|
||||
rc = NtUserEnumDisplayDevices (
|
||||
&Device,
|
||||
iDevNum,
|
||||
&DisplayDeviceW,
|
||||
dwFlags );
|
||||
if (!rc)
|
||||
if (rc)
|
||||
{
|
||||
/* Copy result from DisplayDeviceW to lpDisplayDevice */
|
||||
lpDisplayDevice->StateFlags = DisplayDeviceW.StateFlags;
|
||||
|
@ -169,6 +170,8 @@ EnumDisplayMonitors(
|
|||
if (iCount <= 0)
|
||||
{
|
||||
/* FIXME: SetLastError() */
|
||||
HeapFree(hHeap, 0, hMonitorList);
|
||||
HeapFree(hHeap, 0, pRectList);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -188,7 +191,8 @@ EnumDisplayMonitors(
|
|||
if (!lpfnEnum(hMonitor, hMonitorDC, pMonitorRect, dwData))
|
||||
break;
|
||||
}
|
||||
|
||||
HeapFree(hHeap, 0, hMonitorList);
|
||||
HeapFree(hHeap, 0, pRectList);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue