more stuff
Modified: branches/win32k rewrite attempt/win32k/eng/driverobj.c
Modified: branches/win32k rewrite attempt/win32k/include/desktop.h
Modified: branches/win32k rewrite attempt/win32k/include/input.h
Modified: branches/win32k rewrite attempt/win32k/include/msgqueue.h
Modified: branches/win32k rewrite attempt/win32k/include/ntuser.h
Modified: branches/win32k rewrite attempt/win32k/include/painting.h
Modified: branches/win32k rewrite attempt/win32k/include/prop.h
Modified: branches/win32k rewrite attempt/win32k/include/timer.h
Modified: branches/win32k rewrite attempt/win32k/include/userfuncs.h
Modified: branches/win32k rewrite attempt/win32k/include/vis.h
Added: branches/win32k rewrite attempt/win32k/include/win32.h
Modified: branches/win32k rewrite attempt/win32k/include/win32k.h
Modified: branches/win32k rewrite attempt/win32k/include/window.h
Modified: branches/win32k rewrite attempt/win32k/main/dllmain.c
Modified: branches/win32k rewrite attempt/win32k/misc/copy.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/caret.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/desktop.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/focus.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/hook.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/hotkey.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/input.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/keyboard.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/message.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/misc.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/msgqueue.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/painting.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/timer.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/vis.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/window.c
Modified: branches/win32k rewrite attempt/win32k/ntuser/winpos.c
Modified: branches/win32k rewrite attempt/win32k/w32k.h

Modified: branches/win32k rewrite attempt/win32k/eng/driverobj.c
--- branches/win32k rewrite attempt/win32k/eng/driverobj.c	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/eng/driverobj.c	2005-08-10 19:52:35 UTC (rev 17267)
@@ -1,174 +1,174 @@
-/*
- *  ReactOS W32 Subsystem
- *  Copyright (C) 2005 ReactOS Team
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-/*
- * COPYRIGHT:         See COPYING in the top level directory
- * PROJECT:           ReactOS kernel
- * PURPOSE:           GDI DRIVEROBJ Functions
- * FILE:              subsys/win32k/eng/driverobj.c
- * PROGRAMER:         Gregor Anich
- * REVISION HISTORY:
- *                 04/01/2005: Created
- */
-
-#include <w32k.h>
-
-#define NDEBUG
-#include <debug.h>
-
-/*!\brief Called when the process is terminated.
- *
- * Calls the free-proc for each existing DRIVEROBJ.
- *
- * \param Process  Pointer to the EPROCESS struct for the process beeing terminated.
- * \param Win32Process  Pointer to the W32PROCESS
- */
-VOID FASTCALL
-IntEngCleanupDriverObjs(struct _EPROCESS *Process,
-                        PW32PROCESS Win32Process)
-{
-  PDRIVERGDI DrvObjInt;
-
-  IntEngLockProcessDriverObjs(PsGetWin32Process());
-  while (!IsListEmpty(&Win32Process->DriverObjListHead))
-    {
-      DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink,
-                                    DRIVERGDI, ListEntry);
-      IntEngUnLockProcessDriverObjs(PsGetWin32Process());
-      EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE);
-      IntEngLockProcessDriverObjs(PsGetWin32Process());
-    }
-  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
-}
-
-
-/*
- * @implemented
- */
-HDRVOBJ
-STDCALL
-EngCreateDriverObj(
-	IN PVOID        pvObj,
-	IN FREEOBJPROC  pFreeObjProc,
-	IN HDEV         hdev
-	)
-{
-  PDRIVERGDI DrvObjInt;
-  PDRIVEROBJ DrvObjUser;
-
-  /* Create DRIVEROBJ */
-  DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ);
-  if (DrvObjInt == NULL)
-    {
-      DPRINT1("Failed to allocate memory for a DRIVERGDI structure!\n");
-      return NULL;
-    }
-
-  /* fill user object */
-  DrvObjUser = GDIToObj(DrvObjInt, DRIVER);
-  DrvObjUser->pvObj = pvObj;
-  DrvObjUser->pFreeProc = pFreeObjProc;
-  DrvObjUser->hdev = hdev;
-  DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev;
-
-  /* fill internal object */
-  ExInitializeFastMutex(&DrvObjInt->Lock);
-  IntEngLockProcessDriverObjs(PsGetWin32Process());
-  InsertTailList(&PsGetWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry);
-  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
-
-  return (HDRVOBJ)DrvObjUser;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-EngDeleteDriverObj(
-	IN HDRVOBJ  hdo,
-	IN BOOL  bCallBack,
-	IN BOOL  bLocked
-	)
-{
-  PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
-  PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
-  
-  /* Make sure the obj is locked */
-  if (!bLocked)
-    {
-      if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
-        {
-          return FALSE;
-        }
-    }
-    
-  /* Call the free-proc */
-  if (bCallBack)
-    {
-      if (!DrvObjUser->pFreeProc(DrvObjUser))
-        {
-          return FALSE;
-        }
-    }
-  
-  /* Free the DRIVEROBJ */
-  IntEngLockProcessDriverObjs(PsGetWin32Process());
-  RemoveEntryList(&DrvObjInt->ListEntry);
-  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
-  EngFreeMem(DrvObjInt);
-  
-  return TRUE;
-}
-
-
-/*
- * @implemented
- */
-PDRIVEROBJ
-STDCALL
-EngLockDriverObj( IN HDRVOBJ hdo )
-{
-  PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
-  PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
-  
-  if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
-    {
-      return NULL;
-    }
-
-  return DrvObjUser;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-EngUnlockDriverObj ( IN HDRVOBJ hdo )
-{
-  PDRIVERGDI DrvObjInt = ObjToGDI((PDRIVEROBJ)hdo, DRIVER);
-
-  ExReleaseFastMutex(&DrvObjInt->Lock);
-  return TRUE;
-}
-
-/* EOF */
-
+/*
+ *  ReactOS W32 Subsystem
+ *  Copyright (C) 2005 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ * COPYRIGHT:         See COPYING in the top level directory
+ * PROJECT:           ReactOS kernel
+ * PURPOSE:           GDI DRIVEROBJ Functions
+ * FILE:              subsys/win32k/eng/driverobj.c
+ * PROGRAMER:         Gregor Anich
+ * REVISION HISTORY:
+ *                 04/01/2005: Created
+ */
+
+#include <w32k.h>
+
+#define NDEBUG
+#include <debug.h>
+
+/*!\brief Called when the process is terminated.
+ *
+ * Calls the free-proc for each existing DRIVEROBJ.
+ *
+ * \param Process  Pointer to the EPROCESS struct for the process beeing terminated.
+ * \param Win32Process  Pointer to the W32PROCESS
+ */
+VOID FASTCALL
+IntEngCleanupDriverObjs(struct _EPROCESS *Process,
+                        PW32PROCESS Win32Process)
+{
+  PDRIVERGDI DrvObjInt;
+
+  IntEngLockProcessDriverObjs(PsGetWin32Process());
+  while (!IsListEmpty(&Win32Process->DriverObjListHead))
+    {
+      DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink,
+                                    DRIVERGDI, ListEntry);
+      IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+      EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE);
+      IntEngLockProcessDriverObjs(PsGetWin32Process());
+    }
+  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+}
+
+
+/*
+ * @implemented
+ */
+HDRVOBJ
+STDCALL
+EngCreateDriverObj(
+	IN PVOID        pvObj,
+	IN FREEOBJPROC  pFreeObjProc,
+	IN HDEV         hdev
+	)
+{
+  PDRIVERGDI DrvObjInt;
+  PDRIVEROBJ DrvObjUser;
+
+  /* Create DRIVEROBJ */
+  DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ);
+  if (DrvObjInt == NULL)
+    {
+      DPRINT1("Failed to allocate memory for a DRIVERGDI structure!\n");
+      return NULL;
+    }
+
+  /* fill user object */
+  DrvObjUser = GDIToObj(DrvObjInt, DRIVER);
+  DrvObjUser->pvObj = pvObj;
+  DrvObjUser->pFreeProc = pFreeObjProc;
+  DrvObjUser->hdev = hdev;
+  DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev;
+
+  /* fill internal object */
+  ExInitializeFastMutex(&DrvObjInt->Lock);
+  IntEngLockProcessDriverObjs(PsGetWin32Process());
+  InsertTailList(&PsGetWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry);
+  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+
+  return (HDRVOBJ)DrvObjUser;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+EngDeleteDriverObj(
+	IN HDRVOBJ  hdo,
+	IN BOOL  bCallBack,
+	IN BOOL  bLocked
+	)
+{
+  PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
+  PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
+  
+  /* Make sure the obj is locked */
+  if (!bLocked)
+    {
+      if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
+        {
+          return FALSE;
+        }
+    }
+    
+  /* Call the free-proc */
+  if (bCallBack)
+    {
+      if (!DrvObjUser->pFreeProc(DrvObjUser))
+        {
+          return FALSE;
+        }
+    }
+  
+  /* Free the DRIVEROBJ */
+  IntEngLockProcessDriverObjs(PsGetWin32Process());
+  RemoveEntryList(&DrvObjInt->ListEntry);
+  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+  EngFreeMem(DrvObjInt);
+  
+  return TRUE;
+}
+
+
+/*
+ * @implemented
+ */
+PDRIVEROBJ
+STDCALL
+EngLockDriverObj( IN HDRVOBJ hdo )
+{
+  PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
+  PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
+  
+  if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
+    {
+      return NULL;
+    }
+
+  return DrvObjUser;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+EngUnlockDriverObj ( IN HDRVOBJ hdo )
+{
+  PDRIVERGDI DrvObjInt = ObjToGDI((PDRIVEROBJ)hdo, DRIVER);
+
+  ExReleaseFastMutex(&DrvObjInt->Lock);
+  return TRUE;
+}
+
+/* EOF */
+

Modified: branches/win32k rewrite attempt/win32k/include/desktop.h
--- branches/win32k rewrite attempt/win32k/include/desktop.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/desktop.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -16,7 +16,7 @@
     /* Pointer to the associated window station. */
     struct _WINSTATION_OBJECT *WindowStation;
     /* Pointer to the active queue. */
-    PVOID ActiveMessageQueue;
+    PW32THREAD ActiveWThread;
     /* Rectangle of the work area */
     RECT WorkArea;
     /* Handle of the desktop window. */
@@ -70,11 +70,11 @@
 HWND FASTCALL
 IntGetCurrentThreadDesktopWindow(VOID);
 
-PUSER_MESSAGE_QUEUE FASTCALL
-UserGetFocusMessageQueue(VOID);
+PW32THREAD FASTCALL
+UserGetFocusThread(VOID);
 
 VOID FASTCALL
-IntSetFocusMessageQueue(PUSER_MESSAGE_QUEUE NewQueue);
+IntSetFocusThread(PW32THREAD Thread);
 
 PDESKTOP_OBJECT FASTCALL
 UserGetActiveDesktop(VOID);

Modified: branches/win32k rewrite attempt/win32k/include/input.h
--- branches/win32k rewrite attempt/win32k/include/input.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/input.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -7,8 +7,8 @@
 InitInputImpl(VOID);
 NTSTATUS FASTCALL
 InitKeyboardImpl(VOID);
-PUSER_MESSAGE_QUEUE W32kGetPrimitiveMessageQueue(VOID);
-VOID W32kUnregisterPrimitiveMessageQueue(VOID);
+PW32THREAD W32kGetPrimitiveWThread(VOID);
+VOID W32kUnregisterPrimitiveWThread(VOID);
 PKBDTABLES W32kGetDefaultKeyLayout(VOID);
 VOID FASTCALL W32kKeyProcessMessage(LPMSG Msg, PKBDTABLES KeyLayout, BYTE Prefix);
 BOOL FASTCALL IntBlockInput(PW32THREAD W32Thread, BOOL BlockIt);

Modified: branches/win32k rewrite attempt/win32k/include/msgqueue.h
--- branches/win32k rewrite attempt/win32k/include/msgqueue.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/msgqueue.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -74,11 +74,6 @@
 
 typedef struct _USER_MESSAGE_QUEUE
 {
-  /* Reference counter, only access this variable with interlocked functions! */
-  LONG References;
-
-  /* Owner of the message queue */
-  struct _ETHREAD *Thread;
   /* Queue of messages sent to the queue. */
   LIST_ENTRY SentMessagesListHead;
   /* Queue of messages posted to the queue. */
@@ -87,8 +82,7 @@
   LIST_ENTRY NotifyMessagesListHead;
   /* Queue for hardware messages for the queue. */
   LIST_ENTRY HardwareMessagesListHead;
-  /* List of expired timers */
-  //LIST_ENTRY ExpiredTimersList;
+  /* Number of expired timers for this thread */
   ULONG TimerCount;
   /* Lock for the hardware message list. */
   KMUTEX HardwareLock;
@@ -130,149 +124,16 @@
   /* Desktop that the message queue is attached to */
   struct _DESKTOP_OBJECT *Desktop;
   
-  PUSER_THREAD_INPUT Input;
   
 } USER_MESSAGE_QUEUE, *PUSER_MESSAGE_QUEUE;
 
-BOOL FASTCALL
-MsqIsHung(PUSER_MESSAGE_QUEUE MessageQueue);
-NTSTATUS FASTCALL
-MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
-	       HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam,
-               UINT uTimeout, BOOL Block, BOOL HookMessage,
-               ULONG_PTR *uResult);
-PUSER_MESSAGE FASTCALL
-MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam);
-VOID FASTCALL
-MsqDestroyMessage(PUSER_MESSAGE Message);
-VOID FASTCALL
-MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue,
-	       MSG* Msg, BOOLEAN FreeLParam, DWORD MessageBits);
-VOID FASTCALL
-MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
-BOOLEAN STDCALL
-MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
-	       IN BOOLEAN Hardware,
-	       IN BOOLEAN Remove,
-	       IN HWND Wnd,
-	       IN UINT MsgFilterLow,
-	       IN UINT MsgFilterHigh,
-	       OUT PUSER_MESSAGE* Message);
-BOOLEAN FASTCALL
-MsqInitializeMessageQueue(struct _ETHREAD *Thread, PUSER_MESSAGE_QUEUE MessageQueue);
-VOID FASTCALL
-MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
-PUSER_MESSAGE_QUEUE FASTCALL
-MsqCreateMessageQueue(struct _ETHREAD *Thread);
-PUSER_MESSAGE_QUEUE FASTCALL
-MsqGetHardwareMessageQueue(VOID);
-NTSTATUS FASTCALL
-MsqInitializeImpl(VOID);
-BOOLEAN FASTCALL
-MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
-NTSTATUS FASTCALL
-MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, HWND WndFilter,
-                      UINT MsgFilterMin, UINT MsgFilterMax);
-VOID FASTCALL
-MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
-		     PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
-VOID FASTCALL
-MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
-VOID FASTCALL
-MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
 
-void cp(char* f, int l);
-//#define IntSendMessage(a,b,c,d) (cp(__FILE__,__LINE__), IIntSendMessage(a,b,c,d)) 
 
 
-LRESULT FASTCALL
-IntSendMessage(HWND hWnd,
-		UINT Msg,
-		WPARAM wParam,
-		LPARAM lParam);
-LRESULT FASTCALL
-IntPostOrSendMessage(HWND hWnd,
-		     UINT Msg,
-		     WPARAM wParam,
-		     LPARAM lParam);
-LRESULT FASTCALL
-IntSendMessageTimeout(HWND hWnd,
-                      UINT Msg,
-                      WPARAM wParam,
-                      LPARAM lParam,
-                      UINT uFlags,
-                      UINT uTimeout,
-                      ULONG_PTR *uResult);
-LRESULT FASTCALL
-IntDispatchMessage(MSG* Msg);
-BOOL FASTCALL
-IntTranslateKbdMessage(LPMSG lpMsg, HKL dwhkl);
 
-VOID FASTCALL
-MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
-VOID FASTCALL
-MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
-VOID FASTCALL
-MsqInsertSystemMessage(MSG* Msg);
-BOOL FASTCALL
-MsqIsDblClk(LPMSG Msg, BOOL Remove);
 
-inline BOOL MsqIsSignaled( PUSER_MESSAGE_QUEUE queue );
-inline VOID MsqSetQueueBits( PUSER_MESSAGE_QUEUE queue, WORD bits );
-inline VOID MsqClearQueueBits( PUSER_MESSAGE_QUEUE queue, WORD bits );
-BOOL STDCALL IntInitMessagePumpHook();
-BOOL STDCALL IntUninitMessagePumpHook();
-#define MAKE_LONG(x, y) ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))
 
-PHOOKTABLE FASTCALL MsqGetHooks(PUSER_MESSAGE_QUEUE Queue);
-VOID FASTCALL MsqSetHooks(PUSER_MESSAGE_QUEUE Queue, PHOOKTABLE Hooks);
 
-LPARAM FASTCALL MsqSetMessageExtraInfo(LPARAM lParam);
-LPARAM FASTCALL MsqGetMessageExtraInfo(VOID);
-
-#define IntLockHardwareMessageQueue(MsgQueue) \
-  KeWaitForMutexObject(&(MsgQueue)->HardwareLock, UserRequest, KernelMode, FALSE, NULL)
-
-#define IntUnLockHardwareMessageQueue(MsgQueue) \
-  KeReleaseMutex(&(MsgQueue)->HardwareLock, FALSE)
-
-#define IntReferenceMessageQueue(MsgQueue) \
-  InterlockedIncrement(&(MsgQueue)->References)
-
-
-
-#define IS_BTN_MESSAGE(message,code) \
-  ((message) == WM_LBUTTON##code || \
-   (message) == WM_MBUTTON##code || \
-   (message) == WM_RBUTTON##code || \
-   (message) == WM_XBUTTON##code || \
-   (message) == WM_NCLBUTTON##code || \
-   (message) == WM_NCMBUTTON##code || \
-   (message) == WM_NCRBUTTON##code || \
-   (message) == WM_NCXBUTTON##code )
-
-HANDLE FASTCALL
-IntMsqSetWakeMask(DWORD WakeMask);
-
-BOOL FASTCALL
-IntMsqClearWakeMask(VOID);
-
-BOOLEAN FASTCALL
-MsqSetTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
-            UINT_PTR IDEvent, UINT Period, TIMERPROC TimerFunc,
-            UINT Msg);
-BOOLEAN FASTCALL
-MsqKillTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
-             UINT_PTR IDEvent, UINT Msg);
-BOOLEAN FASTCALL
-MsqGetTimerMessage(PUSER_MESSAGE_QUEUE MessageQueue,
-                   HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
-                   MSG *Msg, BOOLEAN Restart);
-BOOLEAN FASTCALL
-MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
-                       HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
-                       PLARGE_INTEGER FirstTimerExpiry);
-
 #endif /* _WIN32K_MSGQUEUE_H */
 
 /* EOF */

Modified: branches/win32k rewrite attempt/win32k/include/ntuser.h
--- branches/win32k rewrite attempt/win32k/include/ntuser.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/ntuser.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -113,13 +113,13 @@
 
 /*
 typedef enum {
-  otUnknown = 0,
+  otFree = 0,
   otClass,
-  otWindow,
+  otWnd,
   otMenu,
-  otAcceleratorTable,
-  otCursorIcon,
-  otHookProc,
+  otAccel,
+  otCursor,
+  otHook,
   otMonitor
 } USER_OBJECT_TYPE;
 */
@@ -134,6 +134,7 @@
   USER_CURSOR_ICON,
   USER_HOOK_PROC,
   USER_MONITOR
+  
 } USER_OBJECT_TYPE;
 
 

Modified: branches/win32k rewrite attempt/win32k/include/painting.h
--- branches/win32k rewrite attempt/win32k/include/painting.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/painting.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -1,28 +0,0 @@
-#ifndef _WIN32K_PAINTING_H
-#define _WIN32K_PAINTING_H
-
-#include <include/class.h>
-#include <include/msgqueue.h>
-#include <include/window.h>
-
-VOID FASTCALL
-IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion);
-BOOL FASTCALL
-UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags);
-BOOL FASTCALL
-IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, PW32THREAD Thread,
-                   MSG *Message, BOOL Remove);
-//BOOL STDCALL
-//NtUserValidateRgn(HWND hWnd, HRGN hRgn);
-
-
-BOOL FASTCALL UserValidateRgn(PWINDOW_OBJECT hWnd, HRGN hRgn);
-
-
-#define IntLockWindowUpdate(Window) \
-  ExAcquireFastMutex(&Window->UpdateLock)
-
-#define IntUnLockWindowUpdate(Window) \
-  ExReleaseFastMutex(&Window->UpdateLock)
-
-#endif /* _WIN32K_PAINTING_H */

Modified: branches/win32k rewrite attempt/win32k/include/prop.h
--- branches/win32k rewrite attempt/win32k/include/prop.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/prop.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -8,17 +8,6 @@
   ATOM Atom;
 } PROPERTY, *PPROPERTY;
 
-BOOL FASTCALL
-IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data);
 
-PPROPERTY FASTCALL
-IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
-
-#define IntLockWindowProperties(Window) \
-  ExAcquireFastMutex(&Window->PropListLock)
-
-#define IntUnLockWindowProperties(Window) \
-  ExReleaseFastMutex(&Window->PropListLock)
-
 #endif /* _WIN32K_PROP_H */
 

Modified: branches/win32k rewrite attempt/win32k/include/timer.h
--- branches/win32k rewrite attempt/win32k/include/timer.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/timer.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -7,7 +7,7 @@
    LIST_ENTRY     ListEntry;
    LARGE_INTEGER  ExpiryTime;
    PWINDOW_OBJECT  Wnd;
-   PUSER_MESSAGE_QUEUE Queue;
+   PW32THREAD      WThread;
    UINT_PTR       IDEvent;
    UINT           Period;
    TIMERPROC      TimerFunc;

Modified: branches/win32k rewrite attempt/win32k/include/userfuncs.h
--- branches/win32k rewrite attempt/win32k/include/userfuncs.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/userfuncs.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -6,6 +6,10 @@
 DWORD FASTCALL 
 UserGetKeyState(DWORD key);
 
+BOOL FASTCALL
+IntTranslateKbdMessage(LPMSG lpMsg, HKL dwhkl);
+
+
 /******************** HANDLE.C ***************/
 
 VOID UserInitHandleTable(PUSER_HANDLE_TABLE ht, PVOID mem, ULONG bytes);
@@ -14,7 +18,15 @@
 PVOID UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle );
 PVOID UserGetNextHandle(PUSER_HANDLE_TABLE ht, HANDLE* handle, USER_OBJECT_TYPE type );
 
+/************* PROP.C *****************/
 
+BOOL FASTCALL
+IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data);
+
+PPROPERTY FASTCALL
+IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
+
+
 /************* DESKTOP.C *****************/
 
 inline PDESKTOP_OBJECT FASTCALL UserGetCurrentDesktop();
@@ -47,7 +59,25 @@
 UserSetFocus(PWINDOW_OBJECT Wnd OPTIONAL);
 
 
-/* painting.c */
+/******************** PAINTING.C ********************************/
+
+VOID FASTCALL
+IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion);
+BOOL FASTCALL
+UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags);
+BOOL FASTCALL
+IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, PW32THREAD Thread,
+                   MSG *Message, BOOL Remove);
+
+BOOL FASTCALL UserValidateRgn(PWINDOW_OBJECT hWnd, HRGN hRgn);
+
+
+#define IntLockWindowUpdate(Window) \
+  ExAcquireFastMutex(&Window->UpdateLock)
+
+#define IntUnLockWindowUpdate(Window) \
+  ExReleaseFastMutex(&Window->UpdateLock)
+
 DWORD FASTCALL 
 UserInvalidateRect(PWINDOW_OBJECT Wnd, CONST RECT *Rect, BOOL Erase);
 
@@ -58,10 +88,37 @@
 INT FASTCALL
 UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase);
 
-/* message.c */
+/******************** MESSAGE.C ********************************/
+
 BOOL FASTCALL 
 UserPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 
+LRESULT FASTCALL
+IntSendMessage(HWND hWnd,
+      UINT Msg,
+      WPARAM wParam,
+      LPARAM lParam);
+      
+LRESULT FASTCALL
+IntPostOrSendMessage(HWND hWnd,
+           UINT Msg,
+           WPARAM wParam,
+           LPARAM lParam);
+           
+LRESULT FASTCALL
+IntSendMessageTimeout(HWND hWnd,
+                      UINT Msg,
+                      WPARAM wParam,
+                      LPARAM lParam,
+                      UINT uFlags,
+                      UINT uTimeout,
+                      ULONG_PTR *uResult);
+                      
+LRESULT FASTCALL
+IntDispatchMessage(MSG* Msg);
+
+
+
 /************************ WINDOW.C *****************************/
 
 inline VOID FASTCALL UserFreeWindowObject(PWINDOW_OBJECT Wnd);
@@ -126,8 +183,9 @@
 DWORD FASTCALL
 UserShowScrollBar(PWINDOW_OBJECT Wnd, int wBar, DWORD bShow);
 
-/* timer.c */
 
+/************************* TIMER.C ****************************/
+
 inline VOID FASTCALL 
 UserFreeTimer(PTIMER_ENTRY Timer);
 
@@ -141,16 +199,20 @@
 UserSetNextPendingTimer();
 
 VOID FASTCALL
-UserRemoveTimersQueue(PUSER_MESSAGE_QUEUE Queue);
+UserRemoveTimersThread(PW32THREAD W32Thread);
 
-/* hook.c*/
+
+/********************* HOOK.C *****************/
+
 PHOOK FASTCALL
 HookCreate(HHOOK* hHook);
 
 PHOOK FASTCALL HookGet(HHOOK hHook);
 
-/* class.c */
 
+/********************* CLASS.C *****************/
+
+
 VOID FASTCALL
 ClassReferenceClass(PWNDCLASS_OBJECT Class);
 
@@ -185,7 +247,7 @@
 CursorGet(HCURSOR hCursor);
 
 
-/* monitor.c */
+/******************* MONITOR.C ********************/
 
 PMONITOR_OBJECT FASTCALL UserCreateMonitorObject(HANDLE* h);
 
@@ -219,7 +281,7 @@
 
 PTIMER_ENTRY FASTCALL
 UserFindExpiredTimer(   
-   PUSER_MESSAGE_QUEUE Queue,
+   PW32THREAD W32Thread,
    PWINDOW_OBJECT Wnd OPTIONAL, 
    UINT MsgFilterMin, 
    UINT MsgFilterMax,
@@ -233,6 +295,138 @@
    UINT Message
    );
 
+
+BOOL FASTCALL
+MsqIsHung(PUSER_MESSAGE_QUEUE MessageQueue);
+NTSTATUS FASTCALL
+MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
+          HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam,
+               UINT uTimeout, BOOL Block, BOOL HookMessage,
+               ULONG_PTR *uResult);
+PUSER_MESSAGE FASTCALL
+MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam);
+VOID FASTCALL
+MsqDestroyMessage(PUSER_MESSAGE Message);
+VOID FASTCALL
+MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue,
+          MSG* Msg, BOOLEAN FreeLParam, DWORD MessageBits);
+VOID FASTCALL
+MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
+BOOLEAN STDCALL
+MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
+          IN BOOLEAN Hardware,
+          IN BOOLEAN Remove,
+          IN HWND Wnd,
+          IN UINT MsgFilterLow,
+          IN UINT MsgFilterHigh,
+          OUT PUSER_MESSAGE* Message);
+BOOLEAN FASTCALL
+MsqInitializeMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
+VOID FASTCALL
+MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
+BOOLEAN FASTCALL
+MsqCreateMessageQueue(PW32THREAD WThread);
+PUSER_MESSAGE_QUEUE FASTCALL
+MsqGetHardwareMessageQueue(VOID);
+NTSTATUS FASTCALL
+MsqInitializeImpl(VOID);
+BOOLEAN FASTCALL
+MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
+NTSTATUS FASTCALL
+MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, HWND WndFilter,
+                      UINT MsgFilterMin, UINT MsgFilterMax);
+VOID FASTCALL
+MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
+           PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
+VOID FASTCALL
+MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
+VOID FASTCALL
+MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
+
+void cp(char* f, int l);
+//#define IntSendMessage(a,b,c,d) (cp(__FILE__,__LINE__), IIntSendMessage(a,b,c,d)) 
+
+
+
+VOID FASTCALL
+MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+VOID FASTCALL
+MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
+VOID FASTCALL
+MsqInsertSystemMessage(MSG* Msg);
+BOOL FASTCALL
+MsqIsDblClk(LPMSG Msg, BOOL Remove);
+
+inline BOOL MsqIsSignaled( PUSER_MESSAGE_QUEUE queue );
+inline VOID MsqSetQueueBits( PUSER_MESSAGE_QUEUE queue, WORD bits );
+inline VOID MsqClearQueueBits( PUSER_MESSAGE_QUEUE queue, WORD bits );
+
+BOOL STDCALL IntInitMessagePumpHook();
+BOOL STDCALL IntUninitMessagePumpHook();
+
+#define MAKE_LONG(x, y) ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))
+
+PHOOKTABLE FASTCALL MsqGetHooks(PUSER_MESSAGE_QUEUE Queue);
+VOID FASTCALL MsqSetHooks(PUSER_MESSAGE_QUEUE Queue, PHOOKTABLE Hooks);
+
+LPARAM FASTCALL MsqSetMessageExtraInfo(LPARAM lParam);
+LPARAM FASTCALL MsqGetMessageExtraInfo(VOID);
+
+#define IntLockHardwareMessageQueue(MsgQueue) \
+  KeWaitForMutexObject(&(MsgQueue)->HardwareLock, UserRequest, KernelMode, FALSE, NULL)
+
+#define IntUnLockHardwareMessageQueue(MsgQueue) \
+  KeReleaseMutex(&(MsgQueue)->HardwareLock, FALSE)
+
+#define IntReferenceMessageQueue(MsgQueue) \
+  InterlockedIncrement(&(MsgQueue)->References)
+
+
+
+#define IS_BTN_MESSAGE(message,code) \
+  ((message) == WM_LBUTTON##code || \
+   (message) == WM_MBUTTON##code || \
+   (message) == WM_RBUTTON##code || \
+   (message) == WM_XBUTTON##code || \
+   (message) == WM_NCLBUTTON##code || \
+   (message) == WM_NCMBUTTON##code || \
+   (message) == WM_NCRBUTTON##code || \
+   (message) == WM_NCXBUTTON##code )
+
+HANDLE FASTCALL
+IntMsqSetWakeMask(DWORD WakeMask);
+
+BOOL FASTCALL
+IntMsqClearWakeMask(VOID);
+
+BOOLEAN FASTCALL
+MsqSetTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
+            UINT_PTR IDEvent, UINT Period, TIMERPROC TimerFunc,
+            UINT Msg);
+BOOLEAN FASTCALL
+MsqKillTimer(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd,
+             UINT_PTR IDEvent, UINT Msg);
+BOOLEAN FASTCALL
+MsqGetTimerMessage(PW32THREAD W32Thread,
+                   HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+                   MSG *Msg, BOOLEAN Restart);
+BOOLEAN FASTCALL
+MsqGetFirstTimerExpiry(PUSER_MESSAGE_QUEUE MessageQueue,
+                       HWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax,
+                       PLARGE_INTEGER FirstTimerExpiry);
+
+
+
+/**************************** VIS.C ************************/
+
+HRGN FASTCALL
+VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window, BOOLEAN ClientArea,
+   BOOLEAN ClipChildren, BOOLEAN ClipSiblings);
+
+VOID FASTCALL
+VIS_WindowLayoutChanged(PWINDOW_OBJECT Window, HRGN UncoveredRgn);
+
+
 /**************************** NTUSER.C ************************/
 
 inline PVOID FASTCALL UserAlloc(SIZE_T bytes);
@@ -241,6 +435,8 @@
 inline PVOID FASTCALL UserAllocZeroTag(SIZE_T bytes, ULONG tag);
 inline VOID FASTCALL UserFree(PVOID mem);
 
+VOID FASTCALL
+DestroyThreadWindows(PW32THREAD W32Thread);
 
 
 /* windc.c */
@@ -256,7 +452,7 @@
 
 /* div */
 #define UserGetCurrentQueue() \
-((PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue)
+((PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->Queue)
 
 
 

Modified: branches/win32k rewrite attempt/win32k/include/vis.h
--- branches/win32k rewrite attempt/win32k/include/vis.h	2005-08-10 19:52:19 UTC (rev 17266)
+++ branches/win32k rewrite attempt/win32k/include/vis.h	2005-08-10 19:52:35 UTC (rev 17267)
@@ -1,26 +0,0 @@
-/* $Id$
- *
- * COPYRIGHT:        See COPYING in the top level directory
- * PROJECT:          ReactOS Win32k subsystem
- * PURPOSE:          Visibility computations interface definition
- * FILE:             include/win32k/vis.h
- * PROGRAMMER:       Ge van Geldorp (ge@gse.nl)
- *
- */
-
-#ifndef _WIN32K_VIS_H
-#define _WIN32K_VIS_H
-
-#include <include/window.h>
-
-HRGN FASTCALL
-VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window, BOOLEAN ClientArea,
[truncated at 1000 lines; 2592 more skipped]