Where have you seen a documentation of the bit patterns of handles?
This will not necessarily work in all implementations (Windows, Wine,
ReactOS).
In Wine's source code and in http://www.winehq.org/docs/winedev-guide/x3500:
Console handles, on the other hand, are not multiple of four, but have
the two lower bit set (being a multiple of four means having the two
lower bits reset). When KERNEL32 sees a handle with the two lower bits
set, it then knows it's a console handle and takes appropriate
decisions. For example, in the various kernel32!WaitFor*() functions, it
transforms any console handle (input and output - strangely enough
handles to console's screen buffers are waitable) into a dedicated wait
event for the targetted console. There's an (undocumented) KERNEL32
function GetConsoleInputWaitHandle() which returns the handle to this
event in case you need it. Another interesting handling of those
console's handles is in ReadFile() (resp. WriteFile()), which behavior,
for console's handles, is transferred to ReadConsole() (resp.
WriteConsole()). Note that's always the ANSI version of ReadConsole() /
WriteConsole() which is called, hence using the default console's code
page. There are some other spots affected, but you can look in
dlls/kernel to find them all. All of this is implemented in Wine.
Paolo