[ros-diffs] [greatlrd] 33673: gdi32 rename GdiSharedHandleTable to pGdiSharedHandleTable, GDI_BatchLimit to GdiBatchLimit, GdiDevCaps to pGdiDevCaps for match windows xp/vista add pGdiSharedMemory it is same as pGdiSharedHandleTable but it is more logic to use pGdiSharedMemory for share memory stuff change GdiBatchLimit init value to 20 to match vista GdiProcessSetup() using now GetAppCompatFlags2 to determent to use GdiBatchLimit or not, if the flag is not set the GdiBatchLimit is set to 0 add include/reactos/dll/user32/user32_ros.h for prototype for GetAppCompatFlags2

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sat May 24 19:02:56 CEST 2008


Author: greatlrd
Date: Sat May 24 12:02:55 2008
New Revision: 33673

URL: http://svn.reactos.org/svn/reactos?rev=33673&view=rev
Log:
gdi32
rename GdiSharedHandleTable to pGdiSharedHandleTable, GDI_BatchLimit to GdiBatchLimit, GdiDevCaps to pGdiDevCaps for match windows xp/vista 
add pGdiSharedMemory it is same as pGdiSharedHandleTable but it is more logic to use pGdiSharedMemory for share memory stuff 
change GdiBatchLimit  init value to 20 to match vista
GdiProcessSetup() 
using now GetAppCompatFlags2 to determent to use GdiBatchLimit or not, if the flag is not set the GdiBatchLimit is set to 0
add include/reactos/dll/user32/user32_ros.h for prototype for GetAppCompatFlags2






Added:
    branches/win32k-gdi-dx/include/reactos/dll/user32/
    branches/win32k-gdi-dx/include/reactos/dll/user32/user32_ros.h   (with props)
Modified:
    branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h
    branches/win32k-gdi-dx/dll/win32/gdi32/main/dllmain.c
    branches/win32k-gdi-dx/dll/win32/gdi32/misc/gdientry.c
    branches/win32k-gdi-dx/dll/win32/gdi32/misc/misc.c
    branches/win32k-gdi-dx/dll/win32/gdi32/objects/brush.c
    branches/win32k-gdi-dx/dll/win32/gdi32/objects/dc.c
    branches/win32k-gdi-dx/dll/win32/user32/misc/stubs.c

Modified: branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Sat May 24 12:02:55 2008
@@ -8,13 +8,15 @@
 
 
 /* DATA **********************************************************************/
+#include <dll/user32/user32_ros.h>
 
 extern PGDI_TABLE_ENTRY GdiHandleTable;
-extern PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable;
+extern PGDI_SHARED_HANDLE_TABLE pGdiSharedHandleTable;
+extern PGDI_SHARED_HANDLE_TABLE pGdiSharedMemory;
 extern HANDLE hProcessHeap;
 extern HANDLE CurrentProcessId;
-extern DWORD GDI_BatchLimit;
-extern PDEVCAPS GdiDevCaps;
+extern DWORD GdiBatchLimit;
+extern PDEVCAPS pGdiDevCaps;
 
 typedef INT
 (CALLBACK* EMFPLAYPROC)(

Modified: branches/win32k-gdi-dx/dll/win32/gdi32/main/dllmain.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/main/dllmain.c?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/main/dllmain.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/main/dllmain.c [iso-8859-1] Sat May 24 12:02:55 2008
@@ -11,8 +11,18 @@
 
 extern HGDIOBJ stock_objects[];
 BOOL SetStockObjects = FALSE;
-PDEVCAPS GdiDevCaps = NULL;
+
+PGDI_TABLE_ENTRY GdiHandleTable = NULL;
+HANDLE CurrentProcessId = NULL;
+
+/* Note match vista */
+PDEVCAPS pGdiDevCaps = NULL;
 PGDIHANDLECACHE GdiHandleCache = NULL;
+PGDI_SHARED_HANDLE_TABLE pGdiSharedHandleTable = NULL;
+PGDI_SHARED_HANDLE_TABLE pGdiSharedMemory = NULL;
+DWORD GdiBatchLimit = 20;
+
+
 
 /*
  * GDI32.DLL does have an entry point for disable threadlibrarycall,. The initialization is done by a call
@@ -37,20 +47,33 @@
     return TRUE;
 }
 
-
 VOID
 WINAPI
 GdiProcessSetup (VOID)
 {
+
     hProcessHeap = GetProcessHeap();
+    CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess;
 
-        /* map the gdi handle table to user space */
-        GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
-        GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
-        GdiDevCaps = &GdiSharedHandleTable->DevCaps;
-        CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess;
-        GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
-        GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
+    /* map the gdi handle table to user space */
+    pGdiSharedMemory = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
+    pGdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
+    GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
+    pGdiDevCaps = &pGdiSharedMemory->DevCaps;
+    GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
+
+    /* why does vista send down 0x400 to GetAppCompatFlags2 no doc in msdn found 
+     * 0x200 GdiBatchLimit is ON if this is not set in AppCompatFlags2 no GdiBatchLimit is active */
+
+    if ((GetAppCompatFlags2( (HTASK) 0x400) & 0x200) == 0x200)
+    {
+        GdiBatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
+    }
+    else
+    {
+        /* GdiBatchLimit set to 0 */
+        GdiBatchLimit = 0;
+    }
 }
 
 

Modified: branches/win32k-gdi-dx/dll/win32/gdi32/misc/gdientry.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/misc/gdientry.c?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/misc/gdientry.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/misc/gdientry.c [iso-8859-1] Sat May 24 12:02:55 2008
@@ -2022,7 +2022,7 @@
 STDCALL
 DdQueryDisplaySettingsUniqueness()
 {
- return GdiSharedHandleTable->flDeviceUniq;
+ return pGdiSharedMemory->flDeviceUniq;
 }
 
 /*

Modified: branches/win32k-gdi-dx/dll/win32/gdi32/misc/misc.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/misc/misc.c?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/misc/misc.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/misc/misc.c [iso-8859-1] Sat May 24 12:02:55 2008
@@ -28,10 +28,7 @@
 
 #include "precomp.h"
 
-PGDI_TABLE_ENTRY GdiHandleTable = NULL;
-PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable = NULL;
-HANDLE CurrentProcessId = NULL;
-DWORD GDI_BatchLimit = 1;
+
 
 
 BOOL
@@ -171,7 +168,7 @@
 STDCALL
 GdiSetBatchLimit(DWORD	Limit)
 {
-    DWORD OldLimit = GDI_BatchLimit;
+    DWORD OldLimit = GdiBatchLimit;
 
     if ( (!Limit) ||
          (Limit >= GDI_BATCH_LIMIT))
@@ -180,7 +177,7 @@
     }
 
     GdiFlush();
-    GDI_BatchLimit = Limit;
+    GdiBatchLimit = Limit;
     return OldLimit;
 }
 
@@ -192,7 +189,7 @@
 STDCALL
 GdiGetBatchLimit()
 {
-    return GDI_BatchLimit;
+    return GdiBatchLimit;
 }
 
 /*

Modified: branches/win32k-gdi-dx/dll/win32/gdi32/objects/brush.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/objects/brush.c?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/objects/brush.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/objects/brush.c [iso-8859-1] Sat May 24 12:02:55 2008
@@ -344,7 +344,7 @@
        pTeb->GdiBatchCount++;
        DPRINT("Loading the Flush!! COUNT-> %d\n", pTeb->GdiBatchCount);
 
-       if (pTeb->GdiBatchCount >= GDI_BatchLimit)
+       if (pTeb->GdiBatchCount >= GdiBatchLimit)
        {
        DPRINT("Call GdiFlush!!\n");
        NtGdiFlush();

Modified: branches/win32k-gdi-dx/dll/win32/gdi32/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/objects/dc.c?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/objects/dc.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/objects/dc.c [iso-8859-1] Sat May 24 12:02:55 2008
@@ -347,7 +347,7 @@
 
              pTeb->GdiTebBatch.Offset += sizeof(GDIBSOBJECT);
              pTeb->GdiBatchCount++;
-             if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
+             if (pTeb->GdiBatchCount >= GdiBatchLimit) NtGdiFlush();
              return TRUE;
           }
        break;
@@ -1404,7 +1404,7 @@
               pTeb->GdiTebBatch.Offset += sizeof(GDIBSOBJECT);
               pTeb->GdiTebBatch.HDC = (ULONG)hDC;
               pTeb->GdiBatchCount++;
-              if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
+              if (pTeb->GdiBatchCount >= GdiBatchLimit) NtGdiFlush();
               return pDc_Attr->hlfntNew;
             }
 #endif

Modified: branches/win32k-gdi-dx/dll/win32/user32/misc/stubs.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/user32/misc/stubs.c?rev=33673&r1=33672&r2=33673&view=diff
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/user32/misc/stubs.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/user32/misc/stubs.c [iso-8859-1] Sat May 24 12:02:55 2008
@@ -118,6 +118,7 @@
     return ti->AppCompatFlags;
 }
 
+
 /*
  * @implemented
  */
@@ -129,6 +130,10 @@
 
     /* If there is no threadinfo (?!), then return 0 */
     if (!ti) return 0;
+
+    /* return value for bit
+     * 0x200 GdiBatchLimit is Activate in gdi32
+     */
 
     return ti->AppCompatFlags2;
 }

Added: branches/win32k-gdi-dx/include/reactos/dll/user32/user32_ros.h
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/include/reactos/dll/user32/user32_ros.h?rev=33673&view=auto
==============================================================================
--- branches/win32k-gdi-dx/include/reactos/dll/user32/user32_ros.h (added)
+++ branches/win32k-gdi-dx/include/reactos/dll/user32/user32_ros.h [iso-8859-1] Sat May 24 12:02:55 2008
@@ -1,0 +1,1 @@
+DWORD STDCALL GetAppCompatFlags2(HTASK hTask);

Propchange: branches/win32k-gdi-dx/include/reactos/dll/user32/user32_ros.h
------------------------------------------------------------------------------
    svn:eol-style = native



More information about the Ros-diffs mailing list