Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions win32ss/user/ntuser/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,13 @@ NtUserEnumDisplayDevices(
/* Check the buffer size */
if (pDisplayDevice->cb)
{
DWORD cbCopy = min(pDisplayDevice->cb, sizeof(dispdev));

/* Probe the output buffer */
pDisplayDevice->cb = min(pDisplayDevice->cb, sizeof(dispdev));
ProbeForWrite(pDisplayDevice, pDisplayDevice->cb, 1);
ProbeForWrite(pDisplayDevice, cbCopy, 1);

/* Copy as much as the given buffer allows */
RtlCopyMemory(pDisplayDevice, &dispdev, pDisplayDevice->cb);
RtlCopyMemory(pDisplayDevice, &dispdev, cbCopy);
}
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
Expand Down