Author: gadamopoulos
Date: Sun Dec 5 23:10:03 2010
New Revision: 49957
URL:
http://svn.reactos.org/svn/reactos?rev=49957&view=rev
Log:
[win32k]
-Amend to r41772. Allow PostMessage to handle DDE messages
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sun Dec 5
23:10:03 2010
@@ -977,10 +977,42 @@
LPARAM lParam )
{
PTHREADINFO pti;
- MSG Message;
+ MSG Message, KernelModeMsg;
LARGE_INTEGER LargeTickCount;
-
- if (FindMsgMemory(Msg) != 0)
+ PMSGMEMORY MsgMemoryEntry;
+
+ Message.hwnd = Wnd;
+ Message.message = Msg;
+ Message.wParam = wParam;
+ Message.lParam = lParam;
+ Message.pt = gpsi->ptCursor;
+ KeQueryTickCount(&LargeTickCount);
+ Message.time = MsqCalculateMessageTime(&LargeTickCount);
+
+ MsgMemoryEntry = FindMsgMemory(Message.message);
+
+ if( Msg >= WM_DDE_FIRST && Msg <= WM_DDE_LAST )
+ {
+ NTSTATUS Status;
+
+ Status = CopyMsgToKernelMem(&KernelModeMsg, &Message, MsgMemoryEntry);
+ if (! NT_SUCCESS(Status))
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ co_IntSendMessageNoWait(KernelModeMsg.hwnd,
+ KernelModeMsg.message,
+ KernelModeMsg.wParam,
+ KernelModeMsg.lParam);
+
+ if(MsgMemoryEntry)
+ ExFreePool((PVOID) KernelModeMsg.lParam);
+
+ return TRUE;
+ }
+
+ if (MsgMemoryEntry)
{
SetLastWin32Error(ERROR_MESSAGE_SYNC_ONLY );
return FALSE;
@@ -1035,20 +1067,13 @@
/* FIXME - last error code? */
return FALSE;
}
-
+
if (WM_QUIT == Msg)
{
MsqPostQuitMessage(Window->head.pti->MessageQueue, wParam);
}
else
{
- Message.hwnd = Wnd;
- Message.message = Msg;
- Message.wParam = wParam;
- Message.lParam = lParam;
- Message.pt = gpsi->ptCursor;
- KeQueryTickCount(&LargeTickCount);
- Message.time = MsqCalculateMessageTime(&LargeTickCount);
MsqPostMessage(Window->head.pti->MessageQueue, &Message, FALSE,
QS_POSTMESSAGE);
}
}