cryptlib.c: allow application to override OPENSSL_isservice.
PR: 2194
This commit is contained in:
parent
97a6a01f0f
commit
471d0eb397
1 changed files with 12 additions and 0 deletions
|
@ -762,6 +762,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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue