From 45c2f87c8749ec0ca2e5eec5784dd8cd90c42c03 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 21 Apr 2015 10:14:12 +0000 Subject: [PATCH] [WIN32K:NTUSER] - Fix some GetWindowPlacement tests CORE-9578 svn path=/trunk/; revision=67333 --- reactos/win32ss/user/ntuser/winpos.c | 10 ++++------ rostests/apitests/user32/GetWindowPlacement.c | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index 7a472533d67..ea0b66db98e 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -3038,20 +3038,18 @@ NtUserGetWindowPlacement(HWND hWnd, } Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT)); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); RETURN( FALSE); } - if(Safepl.length != sizeof(WINDOWPLACEMENT)) - { - RETURN( FALSE); - } + + Safepl.length = sizeof(WINDOWPLACEMENT); IntGetWindowPlacement(Wnd, &Safepl); Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT)); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); RETURN( FALSE); diff --git a/rostests/apitests/user32/GetWindowPlacement.c b/rostests/apitests/user32/GetWindowPlacement.c index 32d580d2bd4..c5fe2072e84 100644 --- a/rostests/apitests/user32/GetWindowPlacement.c +++ b/rostests/apitests/user32/GetWindowPlacement.c @@ -39,6 +39,7 @@ START_TEST(GetWindowPlacement) ok(ret == FALSE, "ret = %d\n", ret); ok(error == ERROR_NOACCESS, "error = %lu\n", error); + FillMemory(buffer, sizeof(buffer), 0x55); SetLastError(0xfeedfab1); ret = GetWindowPlacement(GetDesktopWindow(), (PVOID)(ALIGN_UP_BY(buffer, 16) + 1)); error = GetLastError(); -- 2.17.1