hmm I did not expect GetConsoleMode to fail: another shell console quirk :-(
maybe would this work better: ``` #include "condrv.h"
.... /* detect shell console handle, and don't return an error */ if (status == STATUS_OBJECT_TYPE_MISMATCH) { IO_STATUS_BLOCK io; if (!NtDeviceIoControlFile( handle, NULL, NULL, NULL, &io, IOCTL_CONDRV_IS_UNIX, NULL, 0, NULL, 0 )) { WARN("Workaround for redirection at unix side.\n"); memset(info, 0, sizeof(*info)); return TRUE; } } ```