]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/inspircd_win32wrapper.cpp
Add support for per-DNSBL timeouts.
[user/henk/code/inspircd.git] / win / inspircd_win32wrapper.cpp
index c6f5d8232923c7ae1c8f27a93669927d02723ec8..f2562020dc7469f69819f4e32aeb8e7e4439c532 100644 (file)
@@ -2,11 +2,12 @@
  * InspIRCd -- Internet Relay Chat Daemon
  *
  *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
- *   Copyright (C) 2013, 2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013, 2019, 2021 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2013 ChrisTX <xpipe@hotmail.de>
  *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2011 Adam <Adam@anope.org>
  *   Copyright (C) 2007-2008 Craig Edwards <brain@inspircd.org>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
@@ -55,3 +56,16 @@ DWORD CWin32Exception::GetErrorCode()
 {
        return dwErrorCode;
 }
+
+WindowsStream::WindowsStream(DWORD handle)
+       : BackgroundColor(0)
+       , ForegroundColor(FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN)
+{
+       this->Handle = GetStdHandle(handle);
+       CONSOLE_SCREEN_BUFFER_INFO bufinf;
+       if (GetConsoleScreenBufferInfo(this->Handle, &bufinf))
+       {
+               this->BackgroundColor = bufinf.wAttributes & 0x00F0;
+               this->ForegroundColor = bufinf.wAttributes & 0x00FF;
+       }
+}