Message System Rework

From ReactOS Wiki
Revision as of 06:46, 2 March 2012 by BrentNewland (talk | contribs) (Categories)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This page is probably outdated

The information on this page might not be valid for the current state of ReactOS.
A Wiki Administrator should look at this page and decide or discuss what to do with it.

We are currently reworking the windows message portion of ROS.

This heavily affects win32k/ntuser/message.c and win32k/ntuser/msgqueue.c


Windows Messages are the primary means of communication for user process and windows.

(I'm sure more should be said here)

The System Event Queue

The system event queue is managed by a thread running in kernel space. That thread is responsible for dispatching events from the system event queue to message queues for user processes and windows.

Current (Re)Design Issues

Q: Is the focus message queue stored in window station structures or is it local per message queue?

A: The GUITHREADINFO structure defined in the MS platform SDK gives us the answer:

typedef struct tagGUITHREADINFO 
  DWORD cbSize;
  DWORD flags;
  HWND hwndActive;
  HWND hwndFocus;
  HWND hwndCapture;
  HWND hwndMenuOwner;
  HWND hwndMoveSize;
  HWND hwndCaret;
  RECT rcCaret;

So the message queue contains these values.

The Winstation must only keep a reference to the active message queue.

note from Filip: The special windows are stored inside message queue and the actual active queue (used for redirecting the keybord messages to the right queues) is set using SetForegroundWindow. This implementation is very similar to the Wine's one, so I think it's at least one possibility.