X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=56b8178d235b733bb6c289b434d6b253c2a4a9a9;hb=e2b0f3dc9ef4d56c71d7abda13e6139ca092e387;hp=8cbb83d6fcab2b561de23cd41aacd34a10bda47a;hpb=aa4c7489b708eb54856871ecdf2bbde99fde92bc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8cbb83d6f..56b8178d2 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -3,19 +3,19 @@ * * Copyright (C) 2020 Matt Schatz * Copyright (C) 2018 Chris Novakovic - * Copyright (C) 2013, 2017-2020 Sadie Powell + * Copyright (C) 2013, 2017-2021 Sadie Powell * Copyright (C) 2013 Adam * Copyright (C) 2012-2014, 2016, 2018 Attila Molnar - * Copyright (C) 2012 William Pitcock + * Copyright (C) 2012-2013 ChrisTX * Copyright (C) 2012 Robby - * Copyright (C) 2012 ChrisTX + * Copyright (C) 2012 Ariadne Conill * Copyright (C) 2009-2010 Daniel De Graaf - * Copyright (C) 2009 Uli Schlachter + * Copyright (C) 2008-2009 Uli Schlachter * Copyright (C) 2008 Thomas Stagner - * Copyright (C) 2007-2008, 2010 Craig Edwards * Copyright (C) 2007-2008 Robin Burchell - * Copyright (C) 2007 Oliver Lupton * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006-2007 Oliver Lupton + * Copyright (C) 2005-2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -41,9 +41,11 @@ #include // setuid #include // setgid #else - WORD g_wOriginalColors; - WORD g_wBackgroundColor; - HANDLE g_hStdout; + /** Manages formatting lines written to stderr on Windows. */ + WindowsStream StandardError(STD_ERROR_HANDLE); + + /** Manages formatting lines written to stdout on Windows. */ + WindowsStream StandardOutput(STD_OUTPUT_HANDLE); #endif #include @@ -492,22 +494,6 @@ InspIRCd::InspIRCd(int argc, char** argv) this->Config->cmdline.argc = argc; ParseOptions(); -#ifdef _WIN32 - // Initialize the console values - g_hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - CONSOLE_SCREEN_BUFFER_INFO bufinf; - if(GetConsoleScreenBufferInfo(g_hStdout, &bufinf)) - { - g_wOriginalColors = bufinf.wAttributes & 0x00FF; - g_wBackgroundColor = bufinf.wAttributes & 0x00F0; - } - else - { - g_wOriginalColors = FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN; - g_wBackgroundColor = 0; - } -#endif - { ServiceProvider* provs[] = {