projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97a6a01
)
cryptlib.c: allow application to override OPENSSL_isservice.
author
Andy Polyakov
<appro@openssl.org>
Mon, 29 Mar 2010 10:06:01 +0000
(10:06 +0000)
committer
Andy Polyakov
<appro@openssl.org>
Mon, 29 Mar 2010 10:06:01 +0000
(10:06 +0000)
PR: 2194
crypto/cryptlib.c
patch
|
blob
|
history
diff --git
a/crypto/cryptlib.c
b/crypto/cryptlib.c
index 62bc495d3dd8318beee1b6dc793e3d3d7b6af466..af1dbfb81d7ecaa091044cda15eeb94363db3e04 100644
(file)
--- a/
crypto/cryptlib.c
+++ b/
crypto/cryptlib.c
@@
-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 */