1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-09-03 01:21:16 +03:00

Create console and attach stdin/stdout/stderr

This commit is contained in:
bel
2014-09-12 23:20:47 +02:00
parent 1a4d6f2cfb
commit ec902803d5
2 changed files with 7 additions and 11 deletions

View File

@@ -1500,20 +1500,16 @@ static int MakeConsole() {
ok = (GetConsoleWindow() != NULL);
if (ok) {
freopen("CON", "a", stdin);
freopen("CON", "a", stdout);
freopen("CON", "a", stderr);
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
}
if (ok) {
CONSOLE_SCREEN_BUFFER_INFO coninfo;
SetConsoleTitle(server_name);
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
if (coninfo.dwSize.Y<500) coninfo.dwSize.Y = 500;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
}
return ok;
}