--- mstools/samples/console/create.c 2018/08/09 18:20:36 1.1 +++ mstools/samples/console/create.c 2018/08/09 18:23:17 1.1.1.3 @@ -1,3 +1,14 @@ + +/******************************************************************************\ +* This is a part of the Microsoft Source Code Samples. +* Copyright (C) 1993 Microsoft Corporation. +* All rights reserved. +* This source code is only intended as a supplement to +* Microsoft Development Tools and/or WinHelp documentation. +* See these sources for detailed information regarding the +* Microsoft samples programs. +\******************************************************************************/ + #include #include #include "console.h" @@ -42,7 +53,7 @@ void demoCreate(HANDLE hConOld) hConHelp = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CONSOLE_TEXTMODE_BUFFER, NULL); - PERR((int) hConHelp != -1, "CreateConsoleScreenBuffer"); + PERR(hConHelp != INVALID_HANDLE_VALUE, "CreateConsoleScreenBuffer"); /* change the color of the help screen */ bSuccess = FillConsoleOutputAttribute(hConHelp, BACKGROUND_BLUE, getConX(hConHelp) * getConY(hConHelp), dwWriteCoord, &cCharsWritten); @@ -59,7 +70,7 @@ void demoCreate(HANDLE hConOld) " F5: execute F10: explode\n" " ESC: exit help"); hStdIn = GetStdHandle(STD_INPUT_HANDLE); - PERR((int) hStdIn != -1, "GetStdHandle"); + PERR(hStdIn != INVALID_HANDLE_VALUE, "GetStdHandle"); /* keep track of the currently visible console */ hConCurrent = hConOld; /* switch between the help and previous buffer when user hits F1 or ESC */