https://bugs.winehq.org/show_bug.cgi?id=57442
--- Comment #8 from RĂ©mi Bernon rbernon@codeweavers.com --- You can see wineserver as the core of Wine NT kernel implementation, it implements various bits that need to work across processes, although the delimitation is not very well defined.
Input that is received from X server is sent through wineserver because it implements the Win32 hardware input dispatching logic, that might differ from the host dispatching, and because there's plenty of things that can and is supposed to happen to an input, in relation to other processes, like hooks, capture, or rawinput.
This is done through NtUserSendHardwareMessage calls, which is a generic function to send "hardware" input to be processed and dispatched. Later on, the input is going to be received back by applications through the expected Win32 calls, which can be window messages (through NtUserPeekMessage / NtUserGetMessage), rawinput buffers (NtUserGetRawinputData / NtUserGetRawinputBuffer), low level hooks (through the ll-hook registered procedures), etc...