https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3d81dc48a7dbe99078d0c…
commit 3d81dc48a7dbe99078d0cbd0a0ca48dcb452fe7e
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Dec 29 16:14:58 2019 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Dec 29 20:08:44 2019 +0100
[WIN32K:NTUSER] Correctly capture UNICODE_STRING in NtUserEnumDisplaySettings.
---
win32ss/user/ntuser/display.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/win32ss/user/ntuser/display.c b/win32ss/user/ntuser/display.c
index a23d19590d3..5295573437e 100644
--- a/win32ss/user/ntuser/display.c
+++ b/win32ss/user/ntuser/display.c
@@ -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)
{