Author: jimtabor
Date: Fri Aug 10 11:39:46 2007
New Revision: 28270
URL: 
http://svn.reactos.org/svn/reactos?rev=28270&view=rev
Log:
- Removed NtGdiLPTODP/DPTOLP from w32ksvc.db and updated ntgdibad.h.
- Connected the gdi32 parts.
Modified:
    trunk/reactos/dll/win32/gdi32/gdi32.def
    trunk/reactos/dll/win32/gdi32/objects/coord.c
    trunk/reactos/include/reactos/win32k/ntgdibad.h
    trunk/reactos/subsystems/win32/win32k/objects/coord.c
    trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/gdi32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.def?…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/gdi32.def (original)
+++ trunk/reactos/dll/win32/gdi32/gdi32.def Fri Aug 10 11:39:46 2007
@@ -89,7 +89,7 @@
 CreateScalableFontResourceA@16
 CreateScalableFontResourceW@16
 CreateSolidBrush@4
-DPtoLP@12=NtGdiDPtoLP@12
+DPtoLP@12
 DeleteColorSpace@4
 DeleteDC@4=NtGdiDeleteObjectApp@4
 DeleteEnhMetaFile@4
@@ -464,7 +464,7 @@
 HT_Get8BPPMaskPalette@24
 IntersectClipRect@20=NtGdiIntersectClipRect@20
 InvertRgn@8=NtGdiInvertRgn@8
-LPtoDP@12=NtGdiLPtoDP@12
+LPtoDP@12
 LineDDA@24
 LineTo@12=NtGdiLineTo@12
 MaskBlt@48
Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/co…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/coord.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/coord.c Fri Aug 10 11:39:46 2007
@@ -103,7 +103,7 @@
                            PAGE_EXTENTS_CHANGED    | // do processing in kernel space.
                            WORLD_XFORM_CHANGED )
 #endif
-    return NtGdiTransformPoints( hDC, Points, Points, Count, 0); // Last is 0 or 2
+    return NtGdiTransformPoints( hDC, Points, Points, Count, GdiDpToLp); // DPtoLP mode.
 #if 0
   else
   {
@@ -129,7 +129,7 @@
                            PAGE_EXTENTS_CHANGED |
                            WORLD_XFORM_CHANGED )
 #endif
-    return NtGdiTransformPoints( hDC, Points, Points, Count, 0);
+    return NtGdiTransformPoints( hDC, Points, Points, Count, GdiLpToDp); // LPtoDP mode
 #if 0
   else
   {
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Fri Aug 10 11:39:46 2007
@@ -184,15 +184,6 @@
                                INT  Count,
                                INT  PolyFillMode);
-/* Use NtGdiTransformPoints with GdiDpToLp. */
-BOOL
-STDCALL
-NtGdiDPtoLP (
-       HDC     hDC,
-       LPPOINT Points,
-       int     Count
-       );
-
 /* Meta are user-mode. */
 BOOL
 STDCALL
@@ -493,15 +484,6 @@
 NtGdiGetWorldTransform (
        HDC     hDC,
        LPXFORM Xform
-       );
-
-/* Use NtGdiTransformPoints with GdiDpToLp */
-BOOL
-STDCALL
-NtGdiLPtoDP (
-       HDC     hDC,
-       LPPOINT Points,
-       int     Count
        );
 /* Needs to be done in user-mode. */
Modified: trunk/reactos/subsystems/win32/win32k/objects/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/coord.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/coord.c Fri Aug 10 11:39:46 2007
@@ -157,99 +157,6 @@
     CoordDPtoLP ( dc, &Points[i] );
 }
-/*!
- * Converts points from device coordinates into logical coordinates. Conversion depends
on the mapping mode,
- * world transfrom, viewport origin settings for the given device context.
- * \param      hDC             device context.
- * \param      Points  an array of POINT structures (in/out).
- * \param      Count   number of elements in the array of POINT structures.
- * \return  TRUE       if success.
-*/
-BOOL STDCALL
-NtGdiDPtoLP(HDC  hDC,
-          LPPOINT  UnsafePoints,
-          int  Count)
-{
-   PDC dc;
-   NTSTATUS Status = STATUS_SUCCESS;
-   LPPOINT Points;
-   ULONG Size;
-
-   dc = DC_LockDc(hDC);
-   if (!dc)
-   {
-     SetLastWin32Error(ERROR_INVALID_HANDLE);
-     return FALSE;
-   }
-
-   if (!UnsafePoints || Count <= 0)
-   {
-     DC_UnlockDc(dc);
-     SetLastWin32Error(ERROR_INVALID_PARAMETER);
-     return FALSE;
-   }
-
-   Size = Count * sizeof(POINT);
-
-   Points = (LPPOINT)ExAllocatePoolWithTag(PagedPool, Size, TAG_COORD);
-   if(!Points)
-   {
-     DC_UnlockDc(dc);
-     SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
-     return FALSE;
-   }
-
-   _SEH_TRY
-   {
-      ProbeForWrite(UnsafePoints,
-                    Size,
-                    1);
-      RtlCopyMemory(Points,
-                    UnsafePoints,
-                    Size);
-   }
-   _SEH_HANDLE
-   {
-      Status = _SEH_GetExceptionCode();
-   }
-   _SEH_END;
-
-   if(!NT_SUCCESS(Status))
-   {
-     DC_UnlockDc(dc);
-     ExFreePool(Points);
-     SetLastNtError(Status);
-     return FALSE;
-   }
-
-   IntDPtoLP(dc, Points, Count);
-
-   _SEH_TRY
-   {
-      /* pointer was already probed! */
-      RtlCopyMemory(UnsafePoints,
-                    Points,
-                    Size);
-   }
-   _SEH_HANDLE
-   {
-      Status = _SEH_GetExceptionCode();
-   }
-   _SEH_END;
-
-   if(!NT_SUCCESS(Status))
-   {
-     DC_UnlockDc(dc);
-     ExFreePool(Points);
-     SetLastNtError(Status);
-     return FALSE;
-   }
-
-   DC_UnlockDc(dc);
-   ExFreePool(Points);
-   return TRUE;
-}
-
 int
 FASTCALL
 IntGetGraphicsMode ( PDC dc )
@@ -390,8 +297,13 @@
  * \param      Count   number of elements in the array of POINT structures.
  * \return  TRUE       if success.
 */
-BOOL STDCALL
-NtGdiLPtoDP ( HDC hDC, LPPOINT UnsafePoints, INT Count )
+BOOL
+APIENTRY
+NtGdiTransformPoints( HDC hDC,
+                      PPOINT UnsafePtsIn,
+                      PPOINT UnsafePtOut,
+                      INT Count,
+                      INT iMode )
 {
    PDC dc;
    NTSTATUS Status = STATUS_SUCCESS;
@@ -405,7 +317,7 @@
      return FALSE;
    }
-   if (!UnsafePoints || Count <= 0)
+   if (!UnsafePtsIn || !UnsafePtOut || Count <= 0)
    {
      DC_UnlockDc(dc);
      SetLastWin32Error(ERROR_INVALID_PARAMETER);
@@ -424,11 +336,14 @@
    _SEH_TRY
    {
-      ProbeForWrite(UnsafePoints,
+      ProbeForWrite(UnsafePtOut,
+                    Size,
+                    1);
+      ProbeForRead(UnsafePtsIn,
                     Size,
                     1);
       RtlCopyMemory(Points,
-                    UnsafePoints,
+                    UnsafePtsIn,
                     Size);
    }
    _SEH_HANDLE
@@ -445,12 +360,28 @@
      return FALSE;
    }
-   IntLPtoDP(dc, Points, Count);
+   switch (iMode)
+   {
+      case GdiDpToLp:
+        IntDPtoLP(dc, Points, Count);
+        break;
+      case GdiLpToDp:
+        IntLPtoDP(dc, Points, Count);
+        break;
+      case 2: // Not supported yet. Need testing.
+      default:
+      {
+        DC_UnlockDc(dc);
+        ExFreePool(Points);
+        SetLastWin32Error(ERROR_INVALID_PARAMETER);
+        return FALSE;
+      }
+   }
    _SEH_TRY
    {
       /* pointer was already probed! */
-      RtlCopyMemory(UnsafePoints,
+      RtlCopyMemory(UnsafePtOut,
                     Points,
                     Size);
    }
@@ -471,19 +402,6 @@
    DC_UnlockDc(dc);
    ExFreePool(Points);
    return TRUE;
-}
-
-
-BOOL
-APIENTRY
-NtGdiTransformPoints( HDC hdc,
-                      PPOINT UnsafePtsIn,
-                      PPOINT UnsafePtOut,
-                      INT Count,
-                      INT iMode )
-{
-   UNIMPLEMENTED;
-   return FALSE;
 }
 BOOL
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Fri Aug 10 11:39:46 2007
@@ -770,7 +770,6 @@
 NtGdiCreatePolygonRgn                   3
 NtGdiCreatePolyPolygonRgn               4
 NtGdiCreateScalableFontResource         4
-NtGdiDPtoLP                             3
 NtGdiDeleteEnhMetaFile                  1
 NtGdiDeleteObject                       1
 NtGdiEnumEnhMetaFile                    5
@@ -816,7 +815,6 @@
 NtGdiGetTextColor                       1
 NtGdiGetTextExtentPoint32               4
 NtGdiGetWorldTransform                  2
-NtGdiLPtoDP                             3
 NtGdiMoveToEx                           4
 NtGdiOffsetViewportOrgEx                4
 NtGdiOffsetWindowOrgEx                  4