From 039497736848db65f76259b2006e83a589ec6f3f Mon Sep 17 00:00:00 2001 From: Jason Hood Date: Fri, 20 Sep 2013 03:15:05 +1000 Subject: [PATCH] Improve 32-bit detecting 64-bit; release v1.66. --- ansicon.c | 2 +- proctype.c | 6 +++--- readme.txt | 9 ++++++--- version.h | 10 +++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ansicon.c b/ansicon.c index 59321c6..09eb3d8 100644 --- a/ansicon.c +++ b/ansicon.c @@ -78,7 +78,7 @@ don't write the reset sequence if output is redirected. */ -#define PDATE L"4 September, 2013" +#define PDATE L"20 September, 2013" #include "ansicon.h" #include "version.h" diff --git a/proctype.c b/proctype.c index 27399cd..01d5273 100644 --- a/proctype.c +++ b/proctype.c @@ -85,9 +85,9 @@ int ProcessType( LPPROCESS_INFORMATION pinfo, BOOL* gui ) } } #ifdef _WIN32 - // If a 32-bit process manages to load a 64-bit one, we may miss the base - // address. If the pointer overflows, assume 64-bit and abort. - if (ptr > ptr + minfo.RegionSize) + // If a 32-bit process loads a 64-bit one, we may miss the base + // address. If the pointer overflows, assume 64-bit. + if (((DWORD)ptr >> 12) + ((DWORD)minfo.RegionSize >> 12) > 0x80000) { #ifdef W32ON64 DEBUGSTR( 1, L" Pointer overflow: assuming 64-bit console" ); diff --git a/readme.txt b/readme.txt index 4882b3b..c088d82 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Copyright 2005-2013 Jason Hood - Version 1.65. Freeware + Version 1.66. Freeware Description @@ -270,6 +270,9 @@ Version History Legend: + added, - bug-fixed, * changed. + 1.66 - 20 September, 2013: + - fix 32-bit process trying to detect 64-bit process. + 1.65 - 4 September, 2013: - fix finding 32-bit LoadLibraryW address from 64-bit; - fix \e[K (was using window, not buffer). @@ -458,5 +461,5 @@ Distribution in LICENSE.txt. -============================== -Jason Hood, 4 September, 2013. +=============================== +Jason Hood, 20 September, 2013. diff --git a/version.h b/version.h index 32ce093..4627c14 100644 --- a/version.h +++ b/version.h @@ -2,11 +2,11 @@ version.h - Version defines. */ -#define PVERS L"1.65" // wide string -#define PVERSA "1.65" // ANSI string (windres 2.16.91 didn't like L) -#define PVERE L"165" // wide environment string -#define PVEREA "165" // ANSI environment string -#define PVERB 1,6,5,0 // binary (resource) +#define PVERS L"1.66" // wide string +#define PVERSA "1.66" // ANSI string (windres 2.16.91 didn't like L) +#define PVERE L"166" // wide environment string +#define PVEREA "166" // ANSI environment string +#define PVERB 1,6,6,0 // binary (resource) #ifdef _WIN64 # define BITS L"64"