mirror of
https://github.com/reactos/reactos.git
synced 2024-09-01 00:03:39 +00:00
[WIN32K]
- Check devmode size in NtUserChangeDisplaySettings - Copy memory instead of setting fields in UserEnumDisplaySettings, so we don't lost anything. svn path=/branches/reactos-yarotows/; revision=47355
This commit is contained in:
parent
46b40c489f
commit
75e296c6be
|
@ -648,11 +648,8 @@ NtUserEnumDisplaySettings(
|
||||||
cbExtra = lpDevMode->dmDriverExtra;
|
cbExtra = lpDevMode->dmDriverExtra;
|
||||||
|
|
||||||
ProbeForWrite(lpDevMode, cbSize + cbExtra, 1);
|
ProbeForWrite(lpDevMode, cbSize + cbExtra, 1);
|
||||||
lpDevMode->dmPelsWidth = pdm->dmPelsWidth;
|
/* Output what we got */
|
||||||
lpDevMode->dmPelsHeight = pdm->dmPelsHeight;
|
RtlCopyMemory(lpDevMode, pdm, min(cbSize, pdm->dmSize));
|
||||||
lpDevMode->dmBitsPerPel = pdm->dmBitsPerPel;
|
|
||||||
lpDevMode->dmDisplayFrequency = pdm->dmDisplayFrequency;
|
|
||||||
lpDevMode->dmDisplayFlags = pdm->dmDisplayFlags;
|
|
||||||
|
|
||||||
/* output private/extra driver data */
|
/* output private/extra driver data */
|
||||||
if (cbExtra > 0 && pdm->dmDriverExtra > 0)
|
if (cbExtra > 0 && pdm->dmDriverExtra > 0)
|
||||||
|
@ -703,6 +700,8 @@ UserChangeDisplaySettings(
|
||||||
return DISP_CHANGE_BADPARAM;
|
return DISP_CHANGE_BADPARAM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (pdm->dmSize < FIELD_OFFSET(DEVMODEW, dmFields))
|
||||||
|
return DISP_CHANGE_FAILED;
|
||||||
else
|
else
|
||||||
dm = *pdm;
|
dm = *pdm;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue