File tree Expand file tree Collapse file tree 4 files changed +29
-11
lines changed
Expand file tree Collapse file tree 4 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 223223 v1.87, 3 February, 2019:
224224 some hooked functions are not imported, so myimport wasn't set;
225225 add missing SetCurrentConsoleFontEx to list of hooks.
226+
227+ v1.88, 1 March, 2019:
228+ a detached process has no console handle (fixes set_ansicon).
226229*/
227230
228231#include "ansicon.h"
@@ -3874,8 +3877,20 @@ void set_ansicon( PCONSOLE_SCREEN_BUFFER_INFO pcsbi )
38743877 hConOut = CreateFile ( L"CONOUT$" , GENERIC_READ | GENERIC_WRITE ,
38753878 FILE_SHARE_READ | FILE_SHARE_WRITE ,
38763879 NULL , OPEN_EXISTING , 0 , NULL );
3877- GetConsoleScreenBufferInfo ( hConOut , & csbi );
3878- CloseHandle ( hConOut );
3880+ if (hConOut == INVALID_HANDLE_VALUE )
3881+ {
3882+ csbi .dwSize .X =
3883+ csbi .dwSize .Y =
3884+ csbi .srWindow .Left =
3885+ csbi .srWindow .Top =
3886+ csbi .srWindow .Right =
3887+ csbi .srWindow .Bottom = 0 ;
3888+ }
3889+ else
3890+ {
3891+ GetConsoleScreenBufferInfo ( hConOut , & csbi );
3892+ CloseHandle ( hConOut );
3893+ }
38793894 pcsbi = & csbi ;
38803895 }
38813896
Original file line number Diff line number Diff line change 9999 add log level 32 to log CreateFile.
100100*/
101101
102- #define PDATE L"3 February , 2019"
102+ #define PDATE L"1 March , 2019"
103103
104104#include "ansicon.h"
105105#include "version.h"
Original file line number Diff line number Diff line change 33
44 Copyright 2005-2019 Jason Hood
55
6- Version 1.87 . Freeware
6+ Version 1.88 . Freeware
77
88
99Description
@@ -340,6 +340,9 @@ Version History
340340
341341 Legend: + added, - bug-fixed, * changed.
342342
343+ 1.88 - 1 March, 2019:
344+ - fix ANSICON environment variable when there is no console.
345+
343346 1.87 - 3 February, 2019:
344347 - fix crash when some programs start (bug during hooking);
345348 - properly hook SetCurrentConsoleFontEx.
@@ -644,5 +647,5 @@ Distribution
644647 in LICENSE.txt.
645648
646649
647- =============================
648- Jason Hood, 3 February , 2019.
650+ ==========================
651+ Jason Hood, 1 March , 2019.
Original file line number Diff line number Diff line change 22 version.h - Version defines.
33*/
44
5- #define PVERS L"1.87 " // wide string
6- #define PVERSA "1.87 " // ANSI string (windres 2.16.91 didn't like L)
7- #define PVERE L"187 " // wide environment string
8- #define PVEREA "187 " // ANSI environment string
9- #define PVERB 1,8,7 ,0 // binary (resource)
5+ #define PVERS L"1.88 " // wide string
6+ #define PVERSA "1.88 " // ANSI string (windres 2.16.91 didn't like L)
7+ #define PVERE L"188 " // wide environment string
8+ #define PVEREA "188 " // ANSI environment string
9+ #define PVERB 1,8,8 ,0 // binary (resource)
1010
1111#ifdef _WIN64
1212# define BITS L"64"
You can’t perform that action at this time.
0 commit comments