diff --git a/apps/apps.c b/apps/apps.c index d501eebd767cf6f33bfdd6f59d63d50809f4160c..c49c1c3bb70b05b640b8bfe4f4048256b476bcd0 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -3114,7 +3114,7 @@ double app_tminterval(int stop,int usertime) if (proc==NULL) { - if (GetVersion() < 0x80000000) + if (check_winnt()) proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE, GetCurrentProcessId()); if (proc==NULL) proc = (HANDLE)-1; diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index b7dce5c1a27b18ad49a38eca6d5160ffe6a8b93b..2227b2b52d475509af4401d24870884cab5268ac 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -245,7 +245,7 @@ static int MS_CALLBACK slg_puts(BIO *bp, const char *str) static void xopenlog(BIO* bp, char* name, int level) { - if (GetVersion() < 0x80000000) + if (check_winnt()) bp->ptr = RegisterEventSourceA(NULL,name); else bp->ptr = NULL; diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 8d16a9e0c86aa26f53b62c43d8a32d063a0ca4ca..be61a9da3f55b45c8bc372de908a1c14b1305565 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -909,7 +909,7 @@ void OPENSSL_showfatal (const char *fmta,...) #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 /* this -------------v--- guards NT-specific calls */ - if (GetVersion() < 0x80000000 && OPENSSL_isservice() > 0) + if (check_winnt() && OPENSSL_isservice() > 0) { HANDLE h = RegisterEventSource(0,_T("OPENSSL")); const TCHAR *pmsg=buf; ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0); diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 5d134e186bb03025b8b6ad718d74ff8dff2e6b7e..34ffcd23f9a0979176a8293d95a64a353b040a74 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -750,7 +750,7 @@ static void readscreen(void) int y; /* y-coordinate of screen lines to grab */ int n = 16; /* number of screen lines to grab at a time */ - if (GetVersion() < 0x80000000 && OPENSSL_isservice()>0) + if (check_winnt() && OPENSSL_isservice()>0) return; /* Create a screen DC and a memory DC compatible to screen DC */ diff --git a/e_os.h b/e_os.h index 3688c4e0f9e2ce64fea57ec712b477db4fcb9991..a1e77e7488c70666fe34c600c2c075ad04ffdbef 100644 --- a/e_os.h +++ b/e_os.h @@ -371,6 +371,13 @@ static unsigned int _strlen31(const char *str) # define DEFAULT_HOME "C:" # endif +/* Avoid Windows 8 SDK GetVersion deprecated problems */ +#if defined(_MSC_VER) && _MSC_VER>=1800 +# define check_winnt() (1) +#else +# define check_winnt() (GetVersion() < 0x80000000) +#endif + #else /* The non-microsoft world */ # ifdef OPENSSL_SYS_VMS