diff options
author | Andy Polyakov <appro@openssl.org> | 2005-05-21 13:19:27 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2005-05-21 13:19:27 +0000 |
commit | e476f9421288aedee52a65ec813c7683ff0ccf5f (patch) | |
tree | 05d8d5a11805f4e738d4eaf15d025dda2860024a /crypto | |
parent | bbbd67108f6cb6224b0725095a69bfc391011411 (diff) |
Move _WIN32_WINNT definition from command line to e_os.h. The change is
inspired by VC6 failure report. In addition abstain from taking screen
snapshots when running in NT service context.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/cryptlib.c | 5 | ||||
-rw-r--r-- | crypto/cryptlib.h | 1 | ||||
-rw-r--r-- | crypto/rand/rand_win.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 6f8b0ff4e5..e73d086eed 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -624,7 +624,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, #include <tchar.h> #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 -static int IsService(void) +int OPENSSL_isservice(void) { HWINSTA h; DWORD len; WCHAR *name; @@ -722,7 +722,7 @@ void OPENSSL_showfatal (const char *fmta,...) #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 /* this -------------v--- guards NT-specific calls */ - if (GetVersion() < 0x80000000 && IsService()) + if (GetVersion() < 0x80000000 && OPENSSL_isservice()) { HANDLE h = RegisterEventSource(0,_T("OPENSSL")); const TCHAR *pmsg=buf; ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0); @@ -754,6 +754,7 @@ void OPENSSL_showfatal (const char *fmta,...) vfprintf (stderr,fmta,ap); va_end (ap); } +int OPENSSL_isservice (void) { return 0; } #endif void OpenSSLDie(const char *file,int line,const char *assertion) diff --git a/crypto/cryptlib.h b/crypto/cryptlib.h index fc249c57f3..5ceaa964b5 100644 --- a/crypto/cryptlib.h +++ b/crypto/cryptlib.h @@ -103,6 +103,7 @@ extern unsigned long OPENSSL_ia32cap_P; void OPENSSL_showfatal(const char *,...); void *OPENSSL_stderr(void); extern int OPENSSL_NONPIC_relocated; +int OPENSSL_isservice(void); #ifdef __cplusplus } diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 39523d3005..47bf758282 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -632,7 +632,8 @@ int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam) void RAND_screen(void) /* function available for backward compatibility */ { RAND_poll(); - readscreen(); + if (GetVersion() >= 0x80000000 || !OPENSSL_isservice()) + readscreen(); } |