mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[WIN32K] Add some missing parameter checks. Fixes all but 4 tests in win32knt:NtUserEnumDisplaySettings. By Peter Hater. CORE-11524
svn path=/trunk/; revision=72624
This commit is contained in:
parent
d4b414cc35
commit
4e5e90c854
1 changed files with 27 additions and 1 deletions
|
@ -572,8 +572,28 @@ NtUserEnumDisplaySettings(
|
||||||
TRACE("Enter NtUserEnumDisplaySettings(%wZ, %lu, %p, 0x%lx)\n",
|
TRACE("Enter NtUserEnumDisplaySettings(%wZ, %lu, %p, 0x%lx)\n",
|
||||||
pustrDevice, iModeNum, lpDevMode, dwFlags);
|
pustrDevice, iModeNum, lpDevMode, dwFlags);
|
||||||
|
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
ProbeForWrite(lpDevMode, sizeof(DEVMODEW), 1);
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||||
|
}
|
||||||
|
_SEH2_END
|
||||||
|
|
||||||
|
if (lpDevMode->dmSize != sizeof(DEVMODEW))
|
||||||
|
{
|
||||||
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
if (pustrDevice)
|
if (pustrDevice)
|
||||||
{
|
{
|
||||||
|
if (pustrDevice->Buffer == NULL || pustrDevice->Length == 0)
|
||||||
|
{
|
||||||
|
Status = STATUS_INVALID_PARAMETER_1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize destination string */
|
/* Initialize destination string */
|
||||||
RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice));
|
RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice));
|
||||||
|
|
||||||
|
@ -647,10 +667,16 @@ NtUserEnumDisplaySettings(
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Status == STATUS_UNSUCCESSFUL)
|
||||||
|
{
|
||||||
|
Status = STATUS_INVALID_PARAMETER_1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
UserUpdateFullscreen(
|
UserUpdateFullscreen(
|
||||||
DWORD flags)
|
DWORD flags)
|
||||||
|
|
Loading…
Reference in a new issue