Paolo Bonzini wrote:
> #define IsHandleConsole(h) (((long) (h) & 3) == 3)

Where have you seen a documentation of the bit patterns of handles?
This will not necessarily work in all implementations (Windows, Wine,
ReactOS).

The documented way to test for a console handle is like this:

static BOOL
IsHandleConsole(HANDLE h)
{
  DWORD mode;
  return GetConsoleMode (h, &mode);
}

Bruno


Reply via email to