Message System Rework

From ReactOS Wiki
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

Introduction

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.

http://www.fofx.org/ReactOs/Message_Diagram1.png

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;
} GUITHREADINFO, *PGUITHREADINFO;

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.