All the per-API message structure unpacking and console validation done
with ConSrvGetConsole() is now automatically generated using the macros,
so that the actual implementation of each API can be done independently
of how the console object is obtained.
This could also allow reusing these API implementations with a different
mechanism for obtaining the console without changing anything in them.
It retrieves the handle to the desktop assigned to the specified
thread belonging to a console application, which is going to be
where the input thread of this console is.