[WIN32K:NTUSER]
authorThomas Faber <thomas.faber@reactos.org>
Tue, 21 Apr 2015 10:14:12 +0000 (10:14 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Tue, 21 Apr 2015 10:14:12 +0000 (10:14 +0000)
- Fix some GetWindowPlacement tests
CORE-9578

svn path=/trunk/; revision=67333

reactos/win32ss/user/ntuser/winpos.c
rostests/apitests/user32/GetWindowPlacement.c

index 7a47253..ea0b66d 100644 (file)
@@ -3038,20 +3038,18 @@ NtUserGetWindowPlacement(HWND hWnd,
    }
 
    Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
    }
 
    Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
-   if(!NT_SUCCESS(Status))
+   if (!NT_SUCCESS(Status))
    {
       SetLastNtError(Status);
       RETURN( FALSE);
    }
    {
       SetLastNtError(Status);
       RETURN( FALSE);
    }
-   if(Safepl.length != sizeof(WINDOWPLACEMENT))
-   {
-      RETURN( FALSE);
-   }
+
+   Safepl.length = sizeof(WINDOWPLACEMENT);
 
    IntGetWindowPlacement(Wnd, &Safepl);
 
    Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT));
 
    IntGetWindowPlacement(Wnd, &Safepl);
 
    Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT));
-   if(!NT_SUCCESS(Status))
+   if (!NT_SUCCESS(Status))
    {
       SetLastNtError(Status);
       RETURN( FALSE);
    {
       SetLastNtError(Status);
       RETURN( FALSE);
index 32d580d..c5fe207 100644 (file)
@@ -39,6 +39,7 @@ START_TEST(GetWindowPlacement)
     ok(ret == FALSE, "ret = %d\n", ret);
     ok(error == ERROR_NOACCESS, "error = %lu\n", error);
 
     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();
     SetLastError(0xfeedfab1);
     ret = GetWindowPlacement(GetDesktopWindow(), (PVOID)(ALIGN_UP_BY(buffer, 16) + 1));
     error = GetLastError();