From fef0b61e18b9c7475e4d6e67ddfc55db46573f4e Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 16 Jun 2010 16:17:11 +0000 Subject: Switched to openssl-1.0.0a --- openssl/crypto/cryptlib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'openssl/crypto/cryptlib.c') diff --git a/openssl/crypto/cryptlib.c b/openssl/crypto/cryptlib.c index 9a39d7e17..b4449b86d 100644 --- a/openssl/crypto/cryptlib.c +++ b/openssl/crypto/cryptlib.c @@ -749,6 +749,18 @@ int OPENSSL_isservice(void) { HWINSTA h; DWORD len; WCHAR *name; + static union { void *p; int (*f)(void); } _OPENSSL_isservice = { NULL }; + + if (_OPENSSL_isservice.p == NULL) { + HANDLE h = GetModuleHandle(NULL); + if (h != NULL) + _OPENSSL_isservice.p = GetProcAddress(h,"_OPENSSL_isservice"); + if (_OPENSSL_isservice.p == NULL) + _OPENSSL_isservice.p = (void *)-1; + } + + if (_OPENSSL_isservice.p != (void *)-1) + return (*_OPENSSL_isservice.f)(); (void)GetDesktopWindow(); /* return value is ignored */ -- cgit v1.2.3