diff options
author | marha <marha@users.sourceforge.net> | 2010-06-17 08:30:55 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-06-17 08:30:55 +0000 |
commit | eb8e32daea99b6e3ebf134efeeba184c23817f08 (patch) | |
tree | ffbda57952ba3f40612e6409bd9a95f9a0a892dc /openssl/crypto/cryptlib.c | |
parent | ed16af1abc515d7cc3ff9c5794aef89551fe7494 (diff) | |
parent | fef0b61e18b9c7475e4d6e67ddfc55db46573f4e (diff) | |
download | vcxsrv-eb8e32daea99b6e3ebf134efeeba184c23817f08.tar.gz vcxsrv-eb8e32daea99b6e3ebf134efeeba184c23817f08.tar.bz2 vcxsrv-eb8e32daea99b6e3ebf134efeeba184c23817f08.zip |
svn merge ^/branches/released .
Diffstat (limited to 'openssl/crypto/cryptlib.c')
-rw-r--r-- | openssl/crypto/cryptlib.c | 12 |
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 */ |