1 /* $Id: message.c,v 1.4 2002/01/27 01:11:24 dwelch Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
6 * FILE: subsys/win32k/ntuser/message.c
7 * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
9 * 06-06-2001 CSH Created
12 /* INCLUDES ******************************************************************/
14 #include <ddk/ntddk.h>
15 #include <win32k/win32k.h>
16 #include <include/guicheck.h>
17 #include <include/msgqueue.h>
18 #include <include/window.h>
19 #include <include/class.h>
20 #include <include/error.h>
21 #include <include/object.h>
22 #include <include/winsta.h>
23 #include <include/callback.h>
28 /* FUNCTIONS *****************************************************************/
31 W32kInitMessageImpl(VOID
)
33 return(STATUS_SUCCESS
);
37 W32kCleanupMessageImpl(VOID
)
39 return(STATUS_SUCCESS
);
44 NtUserDispatchMessage(LPMSG lpMsg
)
48 /* Process timer messages. */
49 if (lpMsg
->message
== WM_TIMER
)
53 /* FIXME: Call hooks. */
55 /* FIXME: Check for continuing validity of timer. */
57 return(W32kCallWindowProc((WNDPROC
)lpMsg
->lParam
,
61 0 /* GetTickCount() */));
66 * FIXME: Check for valid window handle, valid window and valid window
70 /* FIXME: Check for paint message. */
72 Result
= W32kCallWindowProc(NULL
/* WndProc */,
78 /* FIXME: Check for paint message. */
84 NtUserGetMessage(LPMSG lpMsg
,
89 * FUNCTION: Get a message from the calling thread's message queue.
91 * lpMsg - Pointer to the structure which receives the returned message.
92 * hWnd - Window whose messages are to be retrieved.
93 * wMsgFilterMin - Integer value of the lowest message value to be
95 * wMsgFilterMax - Integer value of the highest message value to be
99 PUSER_MESSAGE_QUEUE ThreadQueue
;
101 PUSER_MESSAGE Message
;
104 /* Initialize the thread's win32 state if necessary. */
107 ThreadQueue
= (PUSER_MESSAGE_QUEUE
)PsGetWin32Thread()->MessageQueue
;
111 /* FIXME: Dispatch sent messages here. */
113 /* Now look for a quit message. */
114 /* FIXME: WINE checks the message number filter here. */
115 if (ThreadQueue
->QuitPosted
)
118 lpMsg
->message
= WM_QUIT
;
119 lpMsg
->wParam
= ThreadQueue
->QuitExitCode
;
121 ThreadQueue
->QuitPosted
= FALSE
;
125 /* Now check for normal messages. */
126 Present
= MsqFindMessage(ThreadQueue
,
135 RtlCopyMemory(lpMsg
, &Message
->Msg
, sizeof(MSG
));
140 /* Check for hardware events. */
141 Present
= MsqFindMessage(ThreadQueue
,
150 RtlCopyMemory(lpMsg
, &Message
->Msg
, sizeof(MSG
));
155 /* FIXME: Check for sent messages again. */
157 /* FIXME: Check for paint messages. */
159 /* Nothing found so far. Wait for new messages. */
160 Status
= MsqWaitForNewMessages(ThreadQueue
);
162 while (Status
== STATUS_WAIT_0
);
163 return((BOOLEAN
)(-1));
183 NtUserPeekMessage(LPMSG lpMsg
,
195 NtUserPostMessage(HWND hWnd
,
206 NtUserPostThreadMessage(DWORD idThread
,
217 NtUserQuerySendMessage(DWORD Unknown0
)
225 NtUserSendMessageCallback(HWND hWnd
,
229 SENDASYNCPROC lpCallBack
,
238 NtUserSendNotifyMessage(HWND hWnd
,
249 NtUserWaitMessage(VOID
)