[ros-diffs] [gadamopoulos] 49115: [win32k] - Remove the FreeLParam 'feature' from win32k. This hack allowed us to post messages that contain pointers. However we don't do it anymore so we can also remove this ...

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Mon Oct 11 13:01:47 UTC 2010


Author: gadamopoulos
Date: Mon Oct 11 13:01:46 2010
New Revision: 49115

URL: http://svn.reactos.org/svn/reactos?rev=49115&view=rev
Log:
[win32k]
- Remove the FreeLParam 'feature' from win32k. This hack allowed us to post messages that contain pointers. However we don't do it anymore so we can also remove this as well
- Add keyboard messages to the list with Hardware messages and not in the list with post messages

Modified:
    trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
    trunk/reactos/subsystems/win32/win32k/ntuser/message.c
    trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c

Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/msgqueue.h?rev=49115&r1=49114&r2=49115&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Mon Oct 11 13:01:46 2010
@@ -11,7 +11,6 @@
 typedef struct _USER_MESSAGE
 {
   LIST_ENTRY ListEntry;
-  BOOLEAN FreeLParam;
   MSG Msg;
 } USER_MESSAGE, *PUSER_MESSAGE;
 
@@ -116,12 +115,12 @@
                UINT uTimeout, BOOL Block, INT HookMessage,
                ULONG_PTR *uResult);
 PUSER_MESSAGE FASTCALL
-MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam);
+MsqCreateMessage(LPMSG Msg);
 VOID FASTCALL
 MsqDestroyMessage(PUSER_MESSAGE Message);
 VOID FASTCALL
 MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue,
-	       MSG* Msg, BOOLEAN FreeLParam, DWORD MessageBits);
+	       MSG* Msg, BOOLEAN HardwareMessage, DWORD MessageBits);
 VOID FASTCALL
 MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
 BOOLEAN APIENTRY

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/message.c?rev=49115&r1=49114&r2=49115&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Mon Oct 11 13:01:46 2010
@@ -810,7 +810,6 @@
       Msg->Msg.message = WM_QUIT;
       Msg->Msg.wParam = ThreadQueue->QuitExitCode;
       Msg->Msg.lParam = 0;
-      Msg->FreeLParam = FALSE;
       if (RemoveMessages)
       {
          ThreadQueue->QuitPosted = FALSE;
@@ -866,7 +865,6 @@
                             &Msg->Msg,
                             RemoveMessages))
    {
-      Msg->FreeLParam = FALSE;
       goto MsgExit;
    }
 
@@ -2143,10 +2141,6 @@
                RETURN( (BOOL) -1);
             }
             Info.Msg.lParam = (LPARAM) UserMem;
-         }
-         if (Msg.FreeLParam && 0 != Msg.Msg.lParam)
-         {
-            ExFreePool((void *) Msg.Msg.lParam);
          }
          Status = MmCopyToCaller(UnsafeInfo, &Info, sizeof(NTUSERGETMESSAGEINFO));
          if (! NT_SUCCESS(Status))
@@ -2299,10 +2293,6 @@
             RETURN( (BOOL) -1);
          }
          Info.Msg.lParam = (LPARAM) UserMem;
-      }
-      if (RemoveMsg && Msg.FreeLParam && 0 != Msg.Msg.lParam)
-      {
-         ExFreePool((void *) Msg.Msg.lParam);
       }
       Status = MmCopyToCaller(UnsafeInfo, &Info, sizeof(NTUSERGETMESSAGEINFO));
       if (! NT_SUCCESS(Status))

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c?rev=49115&r1=49114&r2=49115&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Mon Oct 11 13:01:46 2010
@@ -591,7 +591,7 @@
 
    if (DesktopWindow)
    {
-       UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL?
+       UserRefObjectCo(DesktopWindow, &Ref);
        Desk = DesktopWindow->head.pti->pDeskInfo;
    }
 
@@ -628,6 +628,18 @@
          }
 
       }
+      else
+      {
+         if (Remove)
+         {
+            RemoveEntryList(&Current->ListEntry);
+         }
+         IntUnLockHardwareMessageQueue(MessageQueue);
+         IntUnLockSystemHardwareMessageQueueLock(FALSE);
+         *Message = Current;
+
+         RETURN(TRUE);
+      }
    }
    IntUnLockHardwareMessageQueue(MessageQueue);
 
@@ -650,7 +662,6 @@
       UserMsg = ExAllocateFromPagedLookasideList(&MessageLookasideList);
       /* What to do if out of memory? For now we just panic a bit in debug */
       ASSERT(UserMsg);
-      UserMsg->FreeLParam = FALSE;
       UserMsg->Msg = Msg;
       InsertTailList(&HardwareMessageQueueHead, &UserMsg->ListEntry);
 
@@ -808,7 +819,7 @@
          FocusMessageQueue->Desktop->pDeskInfo->LastInputWasKbd = TRUE;
 
          Msg.pt = gpsi->ptCursor;
-         MsqPostMessage(FocusMessageQueue, &Msg, FALSE, QS_KEY);
+         MsqPostMessage(FocusMessageQueue, &Msg, TRUE, QS_KEY);
    }
    else
    {
@@ -866,7 +877,7 @@
 }
 
 PUSER_MESSAGE FASTCALL
-MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam)
+MsqCreateMessage(LPMSG Msg)
 {
    PUSER_MESSAGE Message;
 
@@ -876,7 +887,6 @@
       return NULL;
    }
 
-   Message->FreeLParam = FreeLParam;
    RtlMoveMemory(&Message->Msg, Msg, sizeof(MSG));
 
    return Message;
@@ -1302,17 +1312,26 @@
 }
 
 VOID FASTCALL
-MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN FreeLParam,
+MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN HardwareMessage,
                DWORD MessageBits)
 {
    PUSER_MESSAGE Message;
 
-   if(!(Message = MsqCreateMessage(Msg, FreeLParam)))
+   if(!(Message = MsqCreateMessage(Msg)))
    {
       return;
    }
-   InsertTailList(&MessageQueue->PostedMessagesListHead,
-                  &Message->ListEntry);
+
+   if(!HardwareMessage)
+   {
+       InsertTailList(&MessageQueue->PostedMessagesListHead,
+                      &Message->ListEntry);
+   }
+   else
+   {
+       InsertTailList(&MessageQueue->HardwareMessagesListHead,
+                      &Message->ListEntry);
+   }
    MessageQueue->QueueBits |= MessageBits;
    MessageQueue->ChangedBits |= MessageBits;
    if (MessageQueue->WakeMask & MessageBits)




More information about the Ros-diffs mailing list