mirror of
https://github.com/reactos/reactos.git
synced 2024-11-28 05:53:31 +08:00
[WIN32K:NTUSER] Correctly capture UNICODE_STRING in NtUserEnumDisplaySettings.
This commit is contained in:
parent
be92be2e37
commit
3d81dc48a7
@ -596,6 +596,7 @@ NtUserEnumDisplaySettings(
|
||||
OUT LPDEVMODEW lpDevMode,
|
||||
IN DWORD dwFlags)
|
||||
{
|
||||
UNICODE_STRING ustrDeviceUser;
|
||||
UNICODE_STRING ustrDevice;
|
||||
WCHAR awcDevice[CCHDEVICENAME];
|
||||
NTSTATUS Status;
|
||||
@ -633,15 +634,17 @@ NtUserEnumDisplaySettings(
|
||||
_SEH2_TRY
|
||||
{
|
||||
/* Probe the UNICODE_STRING and the buffer */
|
||||
ProbeForReadUnicodeString(pustrDevice);
|
||||
ustrDeviceUser = ProbeForReadUnicodeString(pustrDevice);
|
||||
|
||||
if (!pustrDevice->Length || !pustrDevice->Buffer)
|
||||
if (!ustrDeviceUser.Length || !ustrDeviceUser.Buffer)
|
||||
ExRaiseStatus(STATUS_NO_MEMORY);
|
||||
|
||||
ProbeForRead(pustrDevice->Buffer, pustrDevice->Length, sizeof(UCHAR));
|
||||
ProbeForRead(ustrDeviceUser.Buffer,
|
||||
ustrDeviceUser.Length,
|
||||
sizeof(UCHAR));
|
||||
|
||||
/* Copy the string */
|
||||
RtlCopyUnicodeString(&ustrDevice, pustrDevice);
|
||||
RtlCopyUnicodeString(&ustrDevice, &ustrDeviceUser);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user