]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/inspircd_win32wrapper.cpp
Implement support for saving filters.
[user/henk/code/inspircd.git] / win / inspircd_win32wrapper.cpp
index 1a7be09fe710ba7eedb262fdfc6ec2e953616fef..f2562020dc7469f69819f4e32aeb8e7e4439c532 100644 (file)
@@ -1,13 +1,14 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
+ *   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, 2009 Dennis Friis <peavey@inspircd.org>
- *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007-2009 Craig Edwards <craigedwards@brainbox.cc>
- *   Copyright (C) 2008 John Brooks <john.brooks@dereferenced.net>
- *   Copyright (C) 2007 Burlex <???@???>
+ *   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
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -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;
+       }
+}