diff --git a/win32ss/gdi/gdi32/objects/coord.c b/win32ss/gdi/gdi32/objects/coord.c
index a42fa1236b..4a28acaf68 100644
--- a/win32ss/gdi/gdi32/objects/coord.c
+++ b/win32ss/gdi/gdi32/objects/coord.c
@@ -7,6 +7,9 @@
  */
 #include <precomp.h>
 
+#define NDEBUG
+#include <debug.h>
+
 /* Currently we use a MATRIX inside the DC_ATTR containing the
    coordinate transformations, while we deal with XFORM structures
    internally. If we move all coordinate transformation to gdi32,
@@ -279,7 +282,6 @@ GetWorldTransform(
     _In_ HDC hdc,
     _Out_ LPXFORM pxform)
 {
-#if 0
     PDC_ATTR pdcattr;
 
     pdcattr = GdiGetDcAttr(hdc);
@@ -288,7 +290,7 @@ GetWorldTransform(
         SetLastError(ERROR_INVALID_HANDLE);
         return FALSE;
     }
-
+#if 0
     if (pdcattr->flXform & ANY_XFORM_INVALID)
     {
         GdiFixupTransforms(pdcattr);
@@ -367,7 +369,7 @@ GetViewportExtEx(
     if ((pdcattr->flXform & PAGE_EXTENTS_CHANGED) &&
         (pdcattr->iMapMode == MM_ISOTROPIC))
     {
-        /* Call win32k to do the work */
+        /* Call win32k to do the work */ DPRINT1("GetViewportExtEx MM_ISOTROPIC PAGE_EXTENTS_CHANGED\n");
         return NtGdiGetDCPoint(hdc, GdiGetViewPortExt, (PPOINTL)lpSize);
     }
 
@@ -503,10 +505,10 @@ SetViewportExtEx(
     {
         if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
         {
-            if (pdcattr->ulDirty_ & DC_FONTTEXT_DIRTY)
+            if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
             {
                 NtGdiFlush(); // Sync up pdcattr from Kernel space.
-                pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+                pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
             }
         }
 
@@ -519,8 +521,7 @@ SetViewportExtEx(
             NtGdiMirrorWindowOrg(hdc);
 
         /* Update xform flags */
-        pdcattr->flXform |= (PAGE_EXTENTS_CHANGED | INVALIDATE_ATTRIBUTES |
-                             DEVICE_TO_WORLD_INVALID);
+        pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
     }
 
     return TRUE;
@@ -548,7 +549,7 @@ SetWindowOrgEx(
         /* Do not set LastError here! */
         return FALSE;
     }
-#if 0
+
     if (lpPoint)
     {
         lpPoint->x = pdcattr->ptlWindowOrg.x;
@@ -558,23 +559,24 @@ SetWindowOrgEx(
     if ((pdcattr->ptlWindowOrg.x == X) && (pdcattr->ptlWindowOrg.y == Y))
         return TRUE;
 
-    if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
+    if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
     {
-        if (pdcattr->ulDirty_ & DC_FONTTEXT_DIRTY)
+        if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
         {
             NtGdiFlush(); // Sync up pdcattr from Kernel space.
-            pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+            pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
         }
     }
 
     pdcattr->ptlWindowOrg.x = X;
-    pdcattr->lWindowOrgx    = X;
     pdcattr->ptlWindowOrg.y = Y;
+
+    pdcattr->lWindowOrgx    = X;
     if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc);
-    pdcattr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID);
+    pdcattr->flXform |= (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
     return TRUE;
-#endif
-    return NtGdiSetWindowOrgEx(hdc, X, Y, lpPoint);
+
+//    return NtGdiSetWindowOrgEx(hdc, X, Y, lpPoint);
 }
 
 /*
@@ -630,10 +632,10 @@ SetWindowExtEx(
 
         if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
         {
-            if (pdcattr->ulDirty_ & DC_FONTTEXT_DIRTY)
+            if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
             {
                 NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
-                pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+                pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
             }
         }
 
@@ -671,20 +673,19 @@ SetViewportOrgEx(
         return FALSE;
     }
 
-#if 0
     if (lpPoint)
     {
         lpPoint->x = pdcattr->ptlViewportOrg.x;
         lpPoint->y = pdcattr->ptlViewportOrg.y;
         if (pdcattr->dwLayout & LAYOUT_RTL) lpPoint->x = -lpPoint->x;
     }
-    pdcattr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID);
+    pdcattr->flXform |= (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
     if (pdcattr->dwLayout & LAYOUT_RTL) X = -X;
     pdcattr->ptlViewportOrg.x = X;
     pdcattr->ptlViewportOrg.y = Y;
     return TRUE;
-#endif
-    return NtGdiSetViewportOrgEx(hdc,X,Y,lpPoint);
+
+//    return NtGdiSetViewportOrgEx(hdc,X,Y,lpPoint);
 }
 
 /*
@@ -854,10 +855,9 @@ OffsetViewportOrgEx(
     _In_ int nYOffset,
     _Out_opt_ LPPOINT lpPoint)
 {
-    //PDC_ATTR pdcattr;
+    PDC_ATTR pdcattr;
 
     HANDLE_METADC(BOOL, OffsetViewportOrgEx, FALSE, hdc, nXOffset, nYOffset, lpPoint);
-#if 0
 
     /* Get the DC attribute */
     pdcattr = GdiGetDcAttr(hdc);
@@ -875,7 +875,7 @@ OffsetViewportOrgEx(
 
     if ( nXOffset || nYOffset != nXOffset )
     {
-        if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
+        if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
         {
             if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
             {
@@ -884,14 +884,14 @@ OffsetViewportOrgEx(
             }
         }
 
-        pdcattr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID);
+        pdcattr->flXform |= (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
         if (pdcattr->dwLayout & LAYOUT_RTL) nXOffset = -nXOffset;
         pdcattr->ptlViewportOrg.x += nXOffset;
         pdcattr->ptlViewportOrg.y += nYOffset;
     }
     return TRUE;
-#endif
-    return  NtGdiOffsetViewportOrgEx(hdc, nXOffset, nYOffset, lpPoint);
+
+//    return  NtGdiOffsetViewportOrgEx(hdc, nXOffset, nYOffset, lpPoint);
 }
 
 /*
@@ -906,11 +906,10 @@ OffsetWindowOrgEx(
     _In_ int nYOffset,
     _Out_opt_ LPPOINT lpPoint)
 {
-    //PDC_ATTR pdcattr;
+    PDC_ATTR pdcattr;
 
     HANDLE_METADC(BOOL, OffsetWindowOrgEx, FALSE, hdc, nXOffset, nYOffset, lpPoint);
 
-#if 0
     /* Get the DC attribute */
     pdcattr = GdiGetDcAttr(hdc);
     if (!pdcattr)
@@ -922,12 +921,12 @@ OffsetWindowOrgEx(
     if ( lpPoint )
     {
         *lpPoint   = (POINT)pdcattr->ptlWindowOrg;
-        lpPoint->x = pdcattr->lWindowOrgx;
+        //lpPoint->x = pdcattr->lWindowOrgx;
     }
 
     if ( nXOffset || nYOffset != nXOffset )
     {
-        if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
+        if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
         {
             if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
             {
@@ -936,13 +935,13 @@ OffsetWindowOrgEx(
             }
         }
 
-        pdcattr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID);
+        pdcattr->flXform |= (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
         pdcattr->ptlWindowOrg.x += nXOffset;
         pdcattr->ptlWindowOrg.y += nYOffset;
         pdcattr->lWindowOrgx += nXOffset;
     }
     return TRUE;
-#endif
-    return NtGdiOffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
+
+//    return NtGdiOffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
 }
 
diff --git a/win32ss/gdi/gdi32/objects/dc.c b/win32ss/gdi/gdi32/objects/dc.c
index 7ea146ab20..716e42ee51 100644
--- a/win32ss/gdi/gdi32/objects/dc.c
+++ b/win32ss/gdi/gdi32/objects/dc.c
@@ -1162,7 +1162,7 @@ SetPolyFillMode(
         if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
         {
             NtGdiFlush(); // Sync up pdcattr from Kernel space.
-            pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+            pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
         }
     }
 
@@ -1230,7 +1230,7 @@ SetGraphicsMode(
         if (pdcattr->ulDirty_ & DC_MODE_DIRTY)
         {
             NtGdiFlush(); // Sync up pdcattr from Kernel space.
-            pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
+            pdcattr->ulDirty_ &= ~DC_MODE_DIRTY;
         }
     }
 
diff --git a/win32ss/gdi/gdi32/objects/font.c b/win32ss/gdi/gdi32/objects/font.c
index 8789223183..0d88defc57 100644
--- a/win32ss/gdi/gdi32/objects/font.c
+++ b/win32ss/gdi/gdi32/objects/font.c
@@ -2239,27 +2239,14 @@ SetMapperFlags(
 {
     DWORD Ret = GDI_ERROR;
     PDC_ATTR Dc_Attr;
-#if 0
-    if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+
+    /* Get the DC attribute */
+    Dc_Attr = GdiGetDcAttr(hDC);
+    if (Dc_Attr == NULL)
     {
-        if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
-            return MFDRV_SetMapperFlags( hDC, flags);
-        else
-        {
-            PLDC pLDC = Dc_Attr->pvLDC;
-            if ( !pLDC )
-            {
-                SetLastError(ERROR_INVALID_HANDLE);
-                return GDI_ERROR;
-            }
-            if (pLDC->iType == LDC_EMFLDC)
-            {
-                return EMFDRV_SetMapperFlags( hDC, flags);
-            }
-        }
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return GDI_ERROR;
     }
-#endif
-    if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return GDI_ERROR;
 
     if (NtCurrentTeb()->GdiTebBatch.HDC == hDC)
     {
diff --git a/win32ss/gdi/gdi32/objects/painting.c b/win32ss/gdi/gdi32/objects/painting.c
index 8fc0d645c3..f41e7a78ab 100644
--- a/win32ss/gdi/gdi32/objects/painting.c
+++ b/win32ss/gdi/gdi32/objects/painting.c
@@ -469,6 +469,7 @@ PatBlt(
         pgO = GdiAllocBatchCommand(hdc, GdiBCPatBlt);
         if (pgO)
         {
+            pdcattr->ulDirty_ |= DC_MODE_DIRTY;
             pgO->nXLeft  = nXLeft;
             pgO->nYLeft  = nYLeft;
             pgO->nWidth  = nWidth;
@@ -553,6 +554,7 @@ PolyPatBlt(
 
             if ((pTeb->GdiTebBatch.Offset + cjSize) <= GDIBATCHBUFSIZE)
             {
+                pdcattr->ulDirty_ |= DC_MODE_DIRTY;
                 pgO->Count = nCount;
                 pgO->Mode  = dwMode;
                 pgO->rop4  = dwRop;
diff --git a/win32ss/gdi/gdi32/objects/text.c b/win32ss/gdi/gdi32/objects/text.c
index e35c7c99e8..ab86a51f11 100644
--- a/win32ss/gdi/gdi32/objects/text.c
+++ b/win32ss/gdi/gdi32/objects/text.c
@@ -526,6 +526,7 @@ ExtTextOutW(
                 pgO = GdiAllocBatchCommand(hdc, GdiBCExtTextOut);
                 if (pgO)
                 {
+                    pdcattr->ulDirty_ |= DC_MODE_DIRTY;
                     pgO->Count = cwc;
                     pgO->Rect = *lprc;
                     pgO->Options = fuOptions;
