a couple of comments:
* please read and conform to [Wine Coding style](https://gitlab.winehq.org/wine/wine/-/wikis/Wine-Developer%27s-Guide/Coding-...) * AFAICT ReadConsoleInputEx[AW] isn't defined in Windows SDK so header files shouldn't be changed * tests must reflect what Windows does, not what your implementation does (hence the generated failures in CI pipeline) * this should be implemented using proper (new or modified) IOCTL:s; there's no way this API can be implemented on top of kernel32's one without being racy (as your proposal is). That's the reason why MS introduced this new API.