[ros-diffs] [gadamopoulos] 55749: [win32k] - There is no need to cache the current window station in SystemParametersInfo. Query it directly when needed

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Mon Feb 20 11:35:14 UTC 2012


Author: gadamopoulos
Date: Mon Feb 20 11:35:14 2012
New Revision: 55749

URL: http://svn.reactos.org/svn/reactos?rev=55749&view=rev
Log:
[win32k]
- There is no need to cache the current window station in SystemParametersInfo. Query it directly when needed

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c?rev=55749&r1=55748&r2=55749&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Mon Feb 20 11:35:14 2012
@@ -16,7 +16,6 @@
 
 SPIVALUES gspv;
 BOOL gbSpiInitialized = FALSE;
-PWINSTATION_OBJECT gpwinstaCurrent = NULL;
 BOOL g_PaintDesktopVersion = FALSE;
 
 // HACK! We initialize SPI before we have a proper surface to get this from.
@@ -26,7 +25,7 @@
 #define METRIC2REG(met) (-((((met) * 1440)- 0) / dpi))
 
 #define REQ_INTERACTIVE_WINSTA(err) \
-    if (gpwinstaCurrent != InputWindowStation) \
+    if ( GetW32ProcessInfo()->prpwinsta != InputWindowStation) \
     { \
         ERR("NtUserSystemParametersInfo requires interactive window station\n"); \
         EngSetLastError(err); \
@@ -592,6 +591,7 @@
     HBITMAP hbmp, hOldBitmap;
     SURFACE *psurfBmp;
     ULONG ulTile, ulStyle;
+    PWINSTATION_OBJECT gpwinstaCurrent = GetW32ProcessInfo()->prpwinsta;
 
     REQ_INTERACTIVE_WINSTA(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION);
 
@@ -1541,6 +1541,9 @@
     UINT fWinIni)
 {
     ULONG_PTR ulResult;
+    PPROCESSINFO ppi = PsGetCurrentProcessWin32Process();
+
+    ASSERT(ppi);
 
     if (!gbSpiInitialized)
     {
@@ -1550,9 +1553,7 @@
     }
 
     /* Get a pointer to the current Windowstation */
-    gpwinstaCurrent = IntGetWinStaObj();
-
-    if (!gpwinstaCurrent)
+    if (!ppi->prpwinsta)
     {
         ERR("UserSystemParametersInfo called without active windowstation.\n");
         //ASSERT(FALSE);
@@ -1584,14 +1585,7 @@
         }
         ulResult = 1;
     }
-
-    /* Dereference the windowstation */
-    if (gpwinstaCurrent)
-    {
-        ObDereferenceObject(gpwinstaCurrent);
-        gpwinstaCurrent = NULL;
-    }
-
+    
     return ulResult;
 }
 




More information about the Ros-diffs mailing list