mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[USER32]
- Change ChangeDisplaySettingsExA to look more like wine's one [WIN32K] - Return correct value if buffer is to small in UserChangeDisplaySettings (wine tests) - Do not set an invalid size to the devmode we're passing ti UserChangeDisplaySettings, we might access garbage Now all ChangeDisplaySettings related wine tests pass. svn path=/branches/reactos-yarotows/; revision=47386
This commit is contained in:
parent
de271b9b4f
commit
5e6e009cd6
2 changed files with 13 additions and 10 deletions
|
@ -457,7 +457,6 @@ ChangeDisplaySettingsExA(
|
|||
LONG rc;
|
||||
UNICODE_STRING DeviceName;
|
||||
PUNICODE_STRING pDeviceName = &DeviceName;
|
||||
LPDEVMODEW pDevModeW;
|
||||
|
||||
if (lpszDeviceName != NULL)
|
||||
{
|
||||
|
@ -471,14 +470,19 @@ ChangeDisplaySettingsExA(
|
|||
pDeviceName = NULL;
|
||||
|
||||
if (lpDevMode != NULL)
|
||||
{
|
||||
LPDEVMODEW pDevModeW;
|
||||
pDevModeW = GdiConvertToDevmodeW(lpDevMode);
|
||||
else
|
||||
pDevModeW = NULL;
|
||||
|
||||
if(pDevModeW)
|
||||
{
|
||||
rc = NtUserChangeDisplaySettings ( pDeviceName, pDevModeW, hwnd, dwflags, lParam );
|
||||
|
||||
if (pDevModeW != NULL)
|
||||
RtlFreeHeap(GetProcessHeap(), 0, pDevModeW);
|
||||
}
|
||||
else
|
||||
rc = DISP_CHANGE_SUCCESSFUL;
|
||||
}
|
||||
else
|
||||
rc = NtUserChangeDisplaySettings ( pDeviceName, NULL, hwnd, dwflags, lParam );
|
||||
|
||||
if (lpszDeviceName != NULL)
|
||||
RtlFreeUnicodeString ( &DeviceName );
|
||||
|
|
|
@ -708,7 +708,7 @@ UserChangeDisplaySettings(
|
|||
}
|
||||
}
|
||||
else if (pdm->dmSize < FIELD_OFFSET(DEVMODEW, dmFields))
|
||||
return DISP_CHANGE_FAILED;
|
||||
return DISP_CHANGE_BADMODE; /* This is what winXP SP3 returns */
|
||||
else
|
||||
dm = *pdm;
|
||||
|
||||
|
@ -899,7 +899,6 @@ NtUserChangeDisplaySettings(
|
|||
/* Probe and copy the full DEVMODE */
|
||||
ProbeForRead(lpDevMode, dmLocal.dmSize, 1);
|
||||
RtlCopyMemory(&dmLocal, lpDevMode, dmLocal.dmSize);
|
||||
dmLocal.dmSize = sizeof(dmLocal);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue