aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/cryptlib.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-16 16:17:11 +0000
committermarha <marha@users.sourceforge.net>2010-06-16 16:17:11 +0000
commitfef0b61e18b9c7475e4d6e67ddfc55db46573f4e (patch)
treed4c68ba5b80ca0748fb23f1c344e859efd79503f /openssl/crypto/cryptlib.c
parent243edb24f5179d93c849ea326fb489d3f846db71 (diff)
downloadvcxsrv-fef0b61e18b9c7475e4d6e67ddfc55db46573f4e.tar.gz
vcxsrv-fef0b61e18b9c7475e4d6e67ddfc55db46573f4e.tar.bz2
vcxsrv-fef0b61e18b9c7475e4d6e67ddfc55db46573f4e.zip
Switched to openssl-1.0.0a
Diffstat (limited to 'openssl/crypto/cryptlib.c')
-rw-r--r--openssl/crypto/cryptlib.c12
1 files changed, 12 insertions, 0 deletions
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 */