ReadConsole is failing with error code 6, ERROR_INVALID_HANDLE, but I can print to the console fine :/
c = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
ReadConsole(c, gpb, 1, (DWORD *)tmp, NULL)
your handle is not valid.
I don't see why it shouldn't be, considering the fact I CAN WRITE TO IT
I'm being really really lazy, but can you just run that and see if it works and how that applys with relation to your program.