[GDI32]
authorRafal Harabien <rafalh@reactos.org>
Wed, 13 Apr 2011 08:14:37 +0000 (08:14 +0000)
committerRafal Harabien <rafalh@reactos.org>
Wed, 13 Apr 2011 08:14:37 +0000 (08:14 +0000)
* DPtoLP/LPtoDP functions should return TRUE even if they get 0 or less points or if pointer to points is invalid. See gdi32:DPtoLP apitest.
* Fixes 24 gdi32:DPtoLP apitests.

svn path=/trunk/; revision=51328

reactos/subsystems/win32/win32k/objects/coord.c

index 634320a..67b57b3 100644 (file)
@@ -256,18 +256,14 @@ NtGdiTransformPoints(
     PDC pdc;
     LPPOINT Points;
     ULONG Size;
-    BOOL ret;
+    BOOL ret = TRUE;
+
+    if (Count <= 0)
+        return TRUE;
 
     pdc = DC_LockDc(hDC);
     if (!pdc)
     {
-        EngSetLastError(ERROR_INVALID_HANDLE);
-        return FALSE;
-    }
-
-    if (!UnsafePtsIn || !UnsafePtOut || Count <= 0)
-    {
-        DC_UnlockDc(pdc);
         EngSetLastError(ERROR_INVALID_PARAMETER);
         return FALSE;
     }
@@ -291,8 +287,7 @@ NtGdiTransformPoints(
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
-        SetLastNtError(_SEH2_GetExceptionCode());
-        ret = FALSE;
+        /* Do not set last error */
         _SEH2_YIELD(goto leave;)
     }
     _SEH2_END;
@@ -323,8 +318,7 @@ NtGdiTransformPoints(
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
-        SetLastNtError(_SEH2_GetExceptionCode());
-        ret = FALSE;
+        /* Do not set last error */
     }
     _SEH2_END;