Commit in reactos/subsys/win32k on win32k_user_rewrite
.cvsignore+11.6 -> 1.6.18.1
w32k.h-11.4.4.1 -> 1.4.4.2
eng/xlate.c+15-11.41 -> 1.41.2.1
include/internal.h+6-31.1.4.1 -> 1.1.4.2
       /csr.h-181.1 removed
misc/driver.c+81-701.40 -> 1.40.8.1
ntuser/csr.c+25-21.2 -> 1.2.2.1
      /desktop.c+18-261.17.2.1 -> 1.17.2.2
      /input.c+5-41.36.4.1 -> 1.36.4.2
      /ntuser.c+2-21.1.4.1 -> 1.1.4.2
      /window.c+2-21.244.2.1 -> 1.244.2.2
      /winsta.c+4-21.64.8.1 -> 1.64.8.2
objects/dc.c+7-71.144 -> 1.144.2.1
       /print.c+4-11.20 -> 1.20.2.1
+170-139
1 removed + 13 modified, total 14 files
little fixes and merges

reactos/subsys/win32k
.cvsignore 1.6 -> 1.6.18.1
diff -u -r1.6 -r1.6.18.1
--- .cvsignore	6 Dec 2003 23:10:50 -0000	1.6
+++ .cvsignore	18 Jul 2004 23:44:00 -0000	1.6.18.1
@@ -1,5 +1,6 @@
 temp.exp
 *.tmp
+*.gch
 *.sys
 *.coff
 *.sym

reactos/subsys/win32k
w32k.h 1.4.4.1 -> 1.4.4.2
diff -u -r1.4.4.1 -r1.4.4.2
--- w32k.h	15 Jul 2004 20:07:17 -0000	1.4.4.1
+++ w32k.h	18 Jul 2004 23:44:00 -0000	1.4.4.2
@@ -36,7 +36,6 @@
 
 #include <include/misc.h>
 #include <include/color.h>
-#include <include/csr.h>
 #include <include/dib.h>
 #include <include/eng.h>
 #include <include/error.h>

reactos/subsys/win32k/eng
xlate.c 1.41 -> 1.41.2.1
diff -u -r1.41 -r1.41.2.1
--- xlate.c	14 Jul 2004 20:48:57 -0000	1.41
+++ xlate.c	18 Jul 2004 23:44:00 -0000	1.41.2.1
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: xlate.c,v 1.41 2004/07/14 20:48:57 navaraf Exp $
+/* $Id: xlate.c,v 1.41.2.1 2004/07/18 23:44:00 weiden Exp $
  * 
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -375,6 +375,20 @@
    XlateGDI->translationTable[0] = ShiftAndMask(XlateGDI, BackgroundColor);
    XlateGDI->translationTable[1] = ShiftAndMask(XlateGDI, ForegroundColor);
 
+   if (XlateObj->iDstType == PAL_INDEXED)
+   {
+      XlateGDI->translationTable[0] =
+         ClosestColorMatch(XlateGDI,
+                           (LPPALETTEENTRY)&XlateGDI->translationTable[0],
+                           DestPalGDI->IndexedColors,
+                           DestPalGDI->NumColors);
+      XlateGDI->translationTable[1] = 
+         ClosestColorMatch(XlateGDI,
+                           (LPPALETTEENTRY)&XlateGDI->translationTable[1],
+                           DestPalGDI->IndexedColors,
+                           DestPalGDI->NumColors);
+   }
+
    PALETTE_UnlockPalette(PaletteDest);
 
    return XlateObj;

reactos/subsys/win32k/include
internal.h 1.1.4.1 -> 1.1.4.2
diff -u -r1.1.4.1 -r1.1.4.2
--- internal.h	15 Jul 2004 20:07:16 -0000	1.1.4.1
+++ internal.h	18 Jul 2004 23:44:01 -0000	1.1.4.2
@@ -273,8 +273,6 @@
 
 /* DESKTOPS *******************************************************************/
 
-extern PDESKTOP_OBJECT InputDesktop;
-extern HDESK InputDesktopHandle; 
 extern PCLASS_OBJECT DesktopWindowClass;
 extern HDC ScreenDeviceContext;
 
@@ -289,7 +287,7 @@
 PWINDOW_OBJECT      FASTCALL IntGetCurrentThreadDesktopWindow(VOID);
 PUSER_MESSAGE_QUEUE FASTCALL IntGetActiveMessageQueue(VOID);
 PUSER_MESSAGE_QUEUE FASTCALL IntSetActiveMessageQueue(PUSER_MESSAGE_QUEUE NewQueue);
-PDESKTOP_OBJECT     FASTCALL IntGetActiveDesktop(VOID);
+PDESKTOP_OBJECT     FASTCALL IntGetInputDesktop(VOID);
 NTSTATUS            FASTCALL IntShowDesktop(PDESKTOP_OBJECT Desktop, ULONG Width, ULONG Height);
 NTSTATUS            FASTCALL IntHideDesktop(PDESKTOP_OBJECT Desktop);
 HDESK               FASTCALL IntGetDesktopObjectHandle(PDESKTOP_OBJECT DesktopObject);
@@ -1001,6 +999,11 @@
 
 /* MISC FUNCTIONS *************************************************************/
 
+NTSTATUS  FASTCALL CsrInit(VOID);
+NTSTATUS  FASTCALL CsrNotify(PCSRSS_API_REQUEST Request, PCSRSS_API_REPLY Reply);
+PEPROCESS FASTCALL CsrAttachToCsrss(VOID);
+VOID      FASTCALL CsrDetachFromCsrss(PEPROCESS PrevProcess);
+
 INT   FASTCALL IntGetSystemMetrics(INT nIndex);
 BOOL  FASTCALL IntSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
 BOOL  FASTCALL IntRegisterLogonProcess(DWORD dwProcessId, BOOL bRegister);

reactos/subsys/win32k/include
csr.h removed after 1.1
diff -N csr.h
--- csr.h	28 May 2004 21:33:41 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-/* $Id: csr.h,v 1.1 2004/05/28 21:33:41 gvg Exp $
- *
- * COPYRIGHT:        See COPYING in the top level directory
- * PROJECT:          ReactOS kernel
- * PURPOSE:          Interface to csrss
- * FILE:             subsys/win32k/include/csr.h
- * PROGRAMER:        Ge van Geldorp (ge@gse.nl)
- */
-
-#ifndef CSR_H_INCLUDED
-#define CSR_H_INCLUDED
-
-extern NTSTATUS FASTCALL CsrInit(void);
-extern NTSTATUS FASTCALL CsrNotify(PCSRSS_API_REQUEST Request, PCSRSS_API_REPLY Reply);
-
-#endif /* CSR_H_INCLUDED */
-
-/* EOF */

reactos/subsys/win32k/misc
driver.c 1.40 -> 1.40.8.1
diff -u -r1.40 -r1.40.8.1
--- driver.c	20 Jun 2004 00:45:36 -0000	1.40
+++ driver.c	18 Jul 2004 23:44:01 -0000	1.40.8.1
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: driver.c,v 1.40 2004/06/20 00:45:36 navaraf Exp $
+/* $Id: driver.c,v 1.40.8.1 2004/07/18 23:44:01 weiden Exp $
  * 
  * GDI Driver support routines
  * (mostly swiped from Wine)
@@ -157,79 +157,90 @@
   return (PGD_ENABLEDRIVER)GdiDriverInfo.EntryPoint;
 }
 
+#define BEGIN_FUNCTION_MAP() \
+  ULONG i; \
+  for (i = 0; i < DED->c; i++) \
+  { \
+    switch(DED->pdrvfn[i].iFunc) \
+    {
+
+#define DRIVER_FUNCTION(function) \
+      case INDEX_Drv##function: \
+        *(PVOID*)&DF->function = DED->pdrvfn[i].pfn; \
+        break
+
+#define END_FUNCTION_MAP() \
+      default: \
+        DPRINT1("Unsupported DDI function 0x%x\n", DED->pdrvfn[i].iFunc); \
+        break; \
+    } \
+  }
+
 BOOL DRIVER_BuildDDIFunctions(PDRVENABLEDATA  DED, 
                                PDRIVER_FUNCTIONS  DF)
 {
-  ULONG i;
+  BEGIN_FUNCTION_MAP();
 
-  for (i=0; i<DED->c; i++)
-  {
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvEnablePDEV)      DF->EnablePDev = (PGD_ENABLEPDEV)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvCompletePDEV)    DF->CompletePDev = (PGD_COMPLETEPDEV)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDisablePDEV)     DF->DisablePDev = (PGD_DISABLEPDEV)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvEnableSurface)   DF->EnableSurface = (PGD_ENABLESURFACE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDisableSurface)  DF->DisableSurface = (PGD_DISABLESURFACE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvAssertMode)      DF->AssertMode = (PGD_ASSERTMODE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvResetPDEV)       DF->ResetPDev = (PGD_RESETPDEV)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvCreateDeviceBitmap)
-      DF->CreateDeviceBitmap = (PGD_CREATEDEVICEBITMAP)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDeleteDeviceBitmap)
-      DF->DeleteDeviceBitmap = (PGD_DELETEDEVICEBITMAP)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvRealizeBrush)    DF->RealizeBrush = (PGD_REALIZEBRUSH)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDitherColor)     DF->DitherColor = (PGD_DITHERCOLOR)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvStrokePath)      DF->StrokePath = (PGD_STROKEPATH)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvFillPath)        DF->FillPath = (PGD_FILLPATH)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvStrokeAndFillPath)
-      DF->StrokeAndFillPath = (PGD_STROKEANDFILLPATH)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvPaint)           DF->Paint = (PGD_PAINT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvBitBlt)          DF->BitBlt = (PGD_BITBLT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvTransparentBlt)  DF->TransparentBlt = (PGD_TRANSPARENTBLT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvCopyBits)        DF->CopyBits = (PGD_COPYBITS)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvStretchBlt)      DF->StretchBlt = (PGD_STRETCHBLT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSetPalette)      DF->SetPalette = (PGD_SETPALETTE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvTextOut)         DF->TextOut = (PGD_TEXTOUT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvEscape)          DF->Escape = (PGD_ESCAPE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDrawEscape)      DF->DrawEscape = (PGD_DRAWESCAPE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryFont)       DF->QueryFont = (PGD_QUERYFONT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryFontTree)   DF->QueryFontTree = (PGD_QUERYFONTTREE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryFontData)   DF->QueryFontData = (PGD_QUERYFONTDATA)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSetPointerShape) DF->SetPointerShape = (PGD_SETPOINTERSHAPE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvMovePointer)     DF->MovePointer = (PGD_MOVEPOINTER)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvLineTo)          DF->LineTo = (PGD_LINETO)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSendPage)        DF->SendPage = (PGD_SENDPAGE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvStartPage)       DF->StartPage = (PGD_STARTPAGE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvEndDoc)          DF->EndDoc = (PGD_ENDDOC)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvStartDoc)        DF->StartDoc = (PGD_STARTDOC)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvGetGlyphMode)    DF->GetGlyphMode = (PGD_GETGLYPHMODE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSynchronize)     DF->Synchronize = (PGD_SYNCHRONIZE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSaveScreenBits)  DF->SaveScreenBits = (PGD_SAVESCREENBITS)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvGetModes)        DF->GetModes = (PGD_GETMODES)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvFree)            DF->Free = (PGD_FREE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDestroyFont)     DF->DestroyFont = (PGD_DESTROYFONT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryFontCaps)   DF->QueryFontCaps = (PGD_QUERYFONTCAPS)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvLoadFontFile)    DF->LoadFontFile = (PGD_LOADFONTFILE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvUnloadFontFile)  DF->UnloadFontFile = (PGD_UNLOADFONTFILE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvFontManagement)  DF->FontManagement = (PGD_FONTMANAGEMENT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryTrueTypeTable)
-      DF->QueryTrueTypeTable = (PGD_QUERYTRUETYPETABLE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryTrueTypeOutline)
-      DF->QueryTrueTypeOutline = (PGD_QUERYTRUETYPEOUTLINE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvGetTrueTypeFile) DF->GetTrueTypeFile = (PGD_GETTRUETYPEFILE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryFontFile)   DF->QueryFontFile = (PGD_QUERYFONTFILE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQueryAdvanceWidths)
-      DF->QueryAdvanceWidths = (PGD_QUERYADVANCEWIDTHS)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSetPixelFormat)  DF->SetPixelFormat = (PGD_SETPIXELFORMAT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDescribePixelFormat)
-      DF->DescribePixelFormat = (PGD_DESCRIBEPIXELFORMAT)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvSwapBuffers)     DF->SwapBuffers = (PGD_SWAPBUFFERS)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvStartBanding)    DF->StartBanding = (PGD_STARTBANDING)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvNextBand)        DF->NextBand = (PGD_NEXTBAND)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvGetDirectDrawInfo) DF->GetDirectDrawInfo = (PGD_GETDIRECTDRAWINFO)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvEnableDirectDraw)  DF->EnableDirectDraw = (PGD_ENABLEDIRECTDRAW)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvDisableDirectDraw) DF->DisableDirectDraw = (PGD_DISABLEDIRECTDRAW)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvQuerySpoolType)  DF->QuerySpoolType = (PGD_QUERYSPOOLTYPE)DED->pdrvfn[i].pfn;
-    if(DED->pdrvfn[i].iFunc == INDEX_DrvGradientFill) DF->GradientFill = (PGD_GRADIENTFILL)DED->pdrvfn[i].pfn;
-  }
+    DRIVER_FUNCTION(EnablePDEV);
+    DRIVER_FUNCTION(CompletePDEV);
+    DRIVER_FUNCTION(DisablePDEV);
+    DRIVER_FUNCTION(EnableSurface);
+    DRIVER_FUNCTION(DisableSurface);
+    DRIVER_FUNCTION(AssertMode);
+    DRIVER_FUNCTION(ResetPDEV);
+    DRIVER_FUNCTION(CreateDeviceBitmap);
+    DRIVER_FUNCTION(DeleteDeviceBitmap);
+    DRIVER_FUNCTION(RealizeBrush);
+    DRIVER_FUNCTION(DitherColor);
+    DRIVER_FUNCTION(StrokePath);
+    DRIVER_FUNCTION(FillPath);
+    DRIVER_FUNCTION(StrokeAndFillPath);
+    DRIVER_FUNCTION(Paint);
+    DRIVER_FUNCTION(BitBlt);
+    DRIVER_FUNCTION(TransparentBlt);
+    DRIVER_FUNCTION(CopyBits);
+    DRIVER_FUNCTION(StretchBlt);
+    DRIVER_FUNCTION(SetPalette);
+    DRIVER_FUNCTION(TextOut);
+    DRIVER_FUNCTION(Escape);
+    DRIVER_FUNCTION(DrawEscape);
+    DRIVER_FUNCTION(QueryFont);
+    DRIVER_FUNCTION(QueryFontTree);
+    DRIVER_FUNCTION(QueryFontData);
+    DRIVER_FUNCTION(SetPointerShape);
+    DRIVER_FUNCTION(MovePointer);
+    DRIVER_FUNCTION(LineTo);
+    DRIVER_FUNCTION(SendPage);
+    DRIVER_FUNCTION(StartPage);
+    DRIVER_FUNCTION(EndDoc);
+    DRIVER_FUNCTION(StartDoc);
+    DRIVER_FUNCTION(GetGlyphMode);
+    DRIVER_FUNCTION(Synchronize);
+    DRIVER_FUNCTION(SaveScreenBits);
+    DRIVER_FUNCTION(GetModes);
+    DRIVER_FUNCTION(Free);
+    DRIVER_FUNCTION(DestroyFont);
+    DRIVER_FUNCTION(QueryFontCaps);
+    DRIVER_FUNCTION(LoadFontFile);
+    DRIVER_FUNCTION(UnloadFontFile);
+    DRIVER_FUNCTION(FontManagement);
+    DRIVER_FUNCTION(QueryTrueTypeTable);
+    DRIVER_FUNCTION(QueryTrueTypeOutline);
+    DRIVER_FUNCTION(GetTrueTypeFile);
+    DRIVER_FUNCTION(QueryFontFile);
+    DRIVER_FUNCTION(QueryAdvanceWidths);
+    DRIVER_FUNCTION(SetPixelFormat);
+    DRIVER_FUNCTION(DescribePixelFormat);
+    DRIVER_FUNCTION(SwapBuffers);
+    DRIVER_FUNCTION(StartBanding);
+    DRIVER_FUNCTION(NextBand);
+    DRIVER_FUNCTION(GetDirectDrawInfo);
+    DRIVER_FUNCTION(EnableDirectDraw);
+    DRIVER_FUNCTION(DisableDirectDraw);
+    DRIVER_FUNCTION(QuerySpoolType);
+    DRIVER_FUNCTION(GradientFill);
+
+  END_FUNCTION_MAP();
 
   return TRUE;
 }

reactos/subsys/win32k/ntuser
csr.c 1.2 -> 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- csr.c	12 Jul 2004 20:09:35 -0000	1.2
+++ csr.c	18 Jul 2004 23:44:01 -0000	1.2.2.1
@@ -1,4 +1,4 @@
-/* $Id: csr.c,v 1.2 2004/07/12 20:09:35 gvg Exp $
+/* $Id: csr.c,v 1.2.2.1 2004/07/18 23:44:01 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -13,7 +13,7 @@
 static PEPROCESS CsrProcess = NULL;
 
 NTSTATUS FASTCALL
-CsrInit(void)
+CsrInit(VOID)
 {
   NTSTATUS Status;
   UNICODE_STRING PortName;
@@ -76,4 +76,27 @@
   return Status;
 }
 
+PEPROCESS FASTCALL
+CsrAttachToCsrss(VOID)
+{
+  PEPROCESS OldProcess;
+  
+  OldProcess = PsGetCurrentProcess();
+  if(OldProcess != CsrProcess)
+  {
+    KeAttachProcess(CsrProcess);
+  }
+
+  return OldProcess;
+}
+
+VOID FASTCALL
+CsrDetachFromCsrss(PEPROCESS PrevProcess)
+{
+  if(PrevProcess != PsGetCurrentProcess())
+  {
+    KeDetachProcess();
+  }
+}
+
 /* EOF */

reactos/subsys/win32k/ntuser
desktop.c 1.17.2.1 -> 1.17.2.2
diff -u -r1.17.2.1 -r1.17.2.2
--- desktop.c	15 Jul 2004 20:07:17 -0000	1.17.2.1
+++ desktop.c	18 Jul 2004 23:44:01 -0000	1.17.2.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- *  $Id: desktop.c,v 1.17.2.1 2004/07/15 20:07:17 weiden Exp $
+ *  $Id: desktop.c,v 1.17.2.2 2004/07/18 23:44:01 weiden Exp $
  *
  *  COPYRIGHT:        See COPYING in the top level directory
  *  PROJECT:          ReactOS kernel
@@ -48,9 +48,6 @@
 
 /* GLOBALS *******************************************************************/
 
-/* Currently active desktop */
-PDESKTOP_OBJECT InputDesktop = NULL;
-HDESK InputDesktopHandle = NULL; 
 HDC ScreenDeviceContext = NULL;
 
 /* INITALIZATION FUNCTIONS ****************************************************/
@@ -132,9 +129,12 @@
 }
 
 PDESKTOP_OBJECT FASTCALL
-IntGetActiveDesktop(VOID)
+IntGetInputDesktop(VOID)
 {
-  return InputDesktop;
+  PWINSTATION_OBJECT WinSta;
+  WinSta = PsGetWin32Process()->WindowStation;
+  DbgPrint("IntGetInputDesktop (id 0x%x, winsta 0x%x, desktop 0x%x)\n", PsGetCurrentProcessId(), WinSta, (WinSta != NULL ? WinSta->InputDesktop : NULL));
+  return (WinSta != NULL ? WinSta->InputDesktop : NULL);
 }
 
 PWINDOW_OBJECT FASTCALL
@@ -185,7 +185,7 @@
 PUSER_MESSAGE_QUEUE FASTCALL
 IntGetActiveMessageQueue(VOID)
 {
-   PDESKTOP_OBJECT pdo = IntGetActiveDesktop();
+   PDESKTOP_OBJECT pdo = PsGetWin32Thread()->Desktop;
    if (!pdo)
    {
       DPRINT1("No active desktop\n");
@@ -207,7 +207,7 @@
    PUSER_MESSAGE_QUEUE Prev;
    PDESKTOP_OBJECT pdo;
    
-   if (!(pdo = IntGetActiveDesktop()))
+   if (!(pdo = PsGetWin32Thread()->Desktop))
    {
       DPRINT1("No active desktop\n");
       return NULL;
@@ -231,10 +231,10 @@
 PWINDOW_OBJECT FASTCALL
 IntGetDesktopWindow(VOID)
 {
-   PDESKTOP_OBJECT pdo = IntGetActiveDesktop();
+   PDESKTOP_OBJECT pdo = PsGetWin32Thread()->Desktop;
    if (!pdo)
    {
-      DPRINT("No active desktop\n");
+      DPRINT1("No desktop assigned to thread (process 0x%x)\n", PsGetCurrentProcessId());
       return NULL;
    }
   return pdo->DesktopWindow;
@@ -575,13 +575,9 @@
 
    /* Get a pointer to the desktop object */
 
-   Status = IntValidateDesktopHandle(
-      InputDesktopHandle,
-      UserMode,
-      0,
-      &Object);
+   Object = IntGetInputDesktop();
 
-   if (!NT_SUCCESS(Status))
+   if (Object == NULL)
    {
       DPRINT("Validation of input desktop handle (0x%X) failed\n", InputDesktop);
       return (HDESK)0;
@@ -598,16 +594,14 @@
       UserMode,
       (HANDLE*)&Desktop);
 
-   ObDereferenceObject(Object);
-
-   if (NT_SUCCESS(Status))
+   if (!NT_SUCCESS(Status))
    {
-      DPRINT("Successfully opened input desktop\n");
-      return (HDESK)Desktop;
+      DPRINT1("Failed to open the input desktop\n");
+      SetLastNtError(Status);
    }
 
-   SetLastNtError(Status);
-   return (HDESK)0;
+
+   return (HDESK)Desktop;
 }
 
 /*
@@ -763,11 +757,9 @@
    /* FIXME: Connect to input device */
 
    /* Set the active desktop in the desktop's window station. */
-   DesktopObject->WindowStation->ActiveDesktop = DesktopObject;
+   DesktopObject->WindowStation->InputDesktop = DesktopObject;
 
    /* Set the global state. */
-   InputDesktop = DesktopObject;
-   InputDesktopHandle = hDesktop;
    InputWindowStation = DesktopObject->WindowStation;
 
    ObDereferenceObject(DesktopObject);

reactos/subsys/win32k/ntuser
input.c 1.36.4.1 -> 1.36.4.2
diff -u -r1.36.4.1 -r1.36.4.2
--- input.c	15 Jul 2004 20:07:17 -0000	1.36.4.1
+++ input.c	18 Jul 2004 23:44:01 -0000	1.36.4.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: input.c,v 1.36.4.1 2004/07/15 20:07:17 weiden Exp $
+/* $Id: input.c,v 1.36.4.2 2004/07/18 23:44:01 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -517,7 +517,7 @@
       MousePos.y += mi->dy;
     }
     
-    DesktopWindow = WinSta->ActiveDesktop->DesktopWindow;
+    DesktopWindow = WinSta->InputDesktop->DesktopWindow;
     if (DesktopWindow != NULL)
     {
       if(MousePos.x >= DesktopWindow->ClientRect.right)
@@ -713,7 +713,8 @@
    *         e.g. services running in the service window station cannot block input
    */
   if(!ThreadHasInputAccess(W32Thread) ||
-     !IntIsActiveDesktop(W32Thread->Desktop))
+     !W32Thread->Desktop ||
+     W32Thread->Desktop->WindowStation->InputDesktop != W32Thread->Desktop)
   {
     SetLastWin32Error(ERROR_ACCESS_DENIED);
     return 0;
@@ -753,7 +754,7 @@
 BOOL FASTCALL
 IntBlockInput(PW32THREAD W32Thread, BOOL BlockIt)
 {
-  UNIMPLEMENTED;
+  //UNIMPLEMENTED;
   return FALSE;
 }
 

reactos/subsys/win32k/ntuser
ntuser.c 1.1.4.1 -> 1.1.4.2
diff -u -r1.1.4.1 -r1.1.4.2
--- ntuser.c	15 Jul 2004 20:12:55 -0000	1.1.4.1
+++ ntuser.c	18 Jul 2004 23:44:01 -0000	1.1.4.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: ntuser.c,v 1.1.4.1 2004/07/15 20:12:55 weiden Exp $
+/* $Id: ntuser.c,v 1.1.4.2 2004/07/18 23:44:01 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -903,7 +903,7 @@
     if(!(Window = IntGetDesktopWindow()))
     {
       LEAVE_CRITICAL();
-      DPRINT1("GetWindowDC(): Unable to get desktop window!\n");
+      DPRINT1("GetWindowDC(): Unable to get desktop window (process 0x%x)!\n", PsGetCurrentProcessId());
       NTUSER_FAIL_ERROR(ERROR_ACCESS_DENIED);
     }
   }

reactos/subsys/win32k/ntuser
window.c 1.244.2.1 -> 1.244.2.2
diff -u -r1.244.2.1 -r1.244.2.2
--- window.c	15 Jul 2004 20:07:18 -0000	1.244.2.1
+++ window.c	18 Jul 2004 23:44:01 -0000	1.244.2.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: window.c,v 1.244.2.1 2004/07/15 20:07:18 weiden Exp $
+/* $Id: window.c,v 1.244.2.2 2004/07/18 23:44:01 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -790,7 +790,7 @@
   DPRINT1("Created object with handle %X on Desktop 0x%x\n", Handle, PsGetWin32Thread()->Desktop);
   
   /* If there is no desktop window yet, we must be creating it */
-  InterlockedCompareExchange((LONG*)&PsGetWin32Thread()->Desktop->DesktopWindow, 0, (LONG)WindowObject);
+  InterlockedCompareExchange((LONG*)&PsGetWin32Thread()->Desktop->DesktopWindow, (LONG)WindowObject, 0);
 
   /*
    * Fill out the structure describing it.

reactos/subsys/win32k/ntuser
winsta.c 1.64.8.1 -> 1.64.8.2
diff -u -r1.64.8.1 -r1.64.8.2
--- winsta.c	15 Jul 2004 20:07:18 -0000	1.64.8.1
+++ winsta.c	18 Jul 2004 23:44:01 -0000	1.64.8.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- *  $Id: winsta.c,v 1.64.8.1 2004/07/15 20:07:18 weiden Exp $
+ *  $Id: winsta.c,v 1.64.8.2 2004/07/18 23:44:01 weiden Exp $
  *
  *  COPYRIGHT:        See COPYING in the top level directory
  *  PROJECT:          ReactOS kernel
@@ -184,10 +184,12 @@
 IntInitializeDesktopGraphics(VOID)
 {
   UNICODE_STRING DriverName;
+
   if (! IntCreatePrimarySurface())
     {
       return FALSE;
     }
+  
   RtlInitUnicodeString(&DriverName, L"DISPLAY");
   ScreenDeviceContext = IntGdiCreateDC(&DriverName, NULL, NULL, NULL);
   if (NULL == ScreenDeviceContext)
@@ -215,7 +217,7 @@
       NtGdiDeleteDC(ScreenDeviceContext);
       ScreenDeviceContext = NULL;
     }
-  IntHideDesktop(IntGetActiveDesktop());
+  IntHideDesktop(IntGetInputDesktop());
   IntDestroyPrimarySurface();
 }
 

reactos/subsys/win32k/objects
dc.c 1.144 -> 1.144.2.1
diff -u -r1.144 -r1.144.2.1
--- dc.c	14 Jul 2004 20:48:58 -0000	1.144
+++ dc.c	18 Jul 2004 23:44:01 -0000	1.144.2.1
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.144 2004/07/14 20:48:58 navaraf Exp $
+/* $Id: dc.c,v 1.144.2.1 2004/07/18 23:44:01 weiden Exp $
  *
  * DC.C - Device context functions
  *
@@ -560,7 +560,7 @@
       /* Allocate a phyical device handle from the driver */
       if (SetupDevMode(&PrimarySurface.DMW, DisplayNumber))
       {
-         PrimarySurface.PDev = PrimarySurface.DriverFunctions.EnablePDev(
+         PrimarySurface.PDev = PrimarySurface.DriverFunctions.EnablePDEV(
             &PrimarySurface.DMW,
             L"",
             HS_DDI_MAX,
@@ -586,7 +586,7 @@
       if (DoDefault)
       {
          RtlZeroMemory(&(PrimarySurface.DMW), sizeof(DEVMODEW));
-         PrimarySurface.PDev = PrimarySurface.DriverFunctions.EnablePDev(
+         PrimarySurface.PDev = PrimarySurface.DriverFunctions.EnablePDEV(
             &PrimarySurface.DMW,
             L"",
             HS_DDI_MAX,
@@ -623,7 +623,7 @@
       DPRINT("calling completePDev\n");
 
       /* Complete initialization of the physical device */
-      PrimarySurface.DriverFunctions.CompletePDev(
+      PrimarySurface.DriverFunctions.CompletePDEV(
          PrimarySurface.PDev,
 	 (HDEV)&PrimarySurface);
 
@@ -639,7 +639,7 @@
       if (NULL == PrimarySurface.Handle)
       {
 /*         PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.PDev, FALSE);*/
-         PrimarySurface.DriverFunctions.DisablePDev(PrimarySurface.PDev);
+         PrimarySurface.DriverFunctions.DisablePDEV(PrimarySurface.PDev);
          ObDereferenceObject(PrimarySurface.VideoFileObject);
          DPRINT1("DrvEnableSurface failed\n");
          /* return FALSE; */
@@ -650,7 +650,7 @@
       SurfObj->dhpdev = PrimarySurface.PDev;
       SurfSize = SurfObj->sizlBitmap;
       EngUnlockSurface(SurfObj);
-      IntShowDesktop(IntGetActiveDesktop(), SurfSize.cx, SurfSize.cy);
+      IntShowDesktop(IntGetInputDesktop(), SurfSize.cx, SurfSize.cy);
       break;
    }
 
@@ -670,7 +670,7 @@
     DPRINT("Reseting display\n" );
     PrimarySurface.DriverFunctions.AssertMode(PrimarySurface.PDev, FALSE);
     PrimarySurface.DriverFunctions.DisableSurface(PrimarySurface.PDev);
-    PrimarySurface.DriverFunctions.DisablePDev(PrimarySurface.PDev);
+    PrimarySurface.DriverFunctions.DisablePDEV(PrimarySurface.PDev);
 
     DceEmptyCache();
 

reactos/subsys/win32k/objects
print.c 1.20 -> 1.20.2.1
diff -u -r1.20 -r1.20.2.1
--- print.c	14 Jul 2004 20:48:58 -0000	1.20
+++ print.c	18 Jul 2004 23:44:01 -0000	1.20.2.1
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: print.c,v 1.20 2004/07/14 20:48:58 navaraf Exp $ */
+/* $Id: print.c,v 1.20.2.1 2004/07/18 23:44:01 weiden Exp $ */
 #include <w32k.h>
 
 INT
@@ -65,6 +65,9 @@
    INT      OutSize,
    LPVOID   OutData)
 {
+   if (Escape == 0x1101)
+      return 0;
+
    UNIMPLEMENTED;
    return -1;
 }
CVSspam 0.2.8