diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-06-25 10:41:48 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-06-25 10:41:48 +0000 |
commit | 705c3dec2c5a2194dc5678d71416a678a7467dc9 (patch) | |
tree | e6752fd640f8380b4e6fe01bb638bcd1ba349dcb /engines | |
parent | 4afcee8b4b9d2837796d4f663086eb5a99bb7204 (diff) |
Changes to allow capi ENGINE to compile with older headers on e.g. VC6.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/e_capi.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/engines/e_capi.c b/engines/e_capi.c index c2e5e64458..7a7064c216 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -62,12 +62,27 @@ #ifdef OPENSSL_SYS_WIN32 #ifndef OPENSSL_NO_CAPIENG + #include <windows.h> + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0400 +#endif + #include <wincrypt.h> #undef X509_EXTENSIONS #undef X509_CERT_PAIR +/* Definitions which may be missing from earlier version of headers */ +#ifndef CERT_STORE_OPEN_EXISTING_FLAG +#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000 +#endif + +#ifndef CERT_STORE_CREATE_NEW_FLAG +#define CERT_STORE_CREATE_NEW_FLAG 0x00002000 +#endif + #include <openssl/engine.h> #include <openssl/pem.h> #include <openssl/x509v3.h> @@ -1670,8 +1685,14 @@ static int cert_select_simple(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs) * CryptUIDlgSelectCertificateFromStore() to produce a dialog box. */ -#include <PrSht.h> -#include <cryptuiapi.h> +/* Definitions which are in cryptuiapi.h but this is not present in older + * versions of headers. + */ + +#ifndef CRYPTUI_SELECT_LOCATION_COLUMN +#define CRYPTUI_SELECT_LOCATION_COLUMN 0x000000010 +#define CRYPTUI_SELECT_INTENDEDUSE_COLUMN 0x000000004 +#endif #define dlg_title L"OpenSSL Application SSL Client Certificate Selection" #define dlg_prompt L"Select a certificate to use for authentication" @@ -1714,7 +1735,9 @@ static int cert_select_dialog(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs) } } - hwnd = GetActiveWindow(); + hwnd = GetForegroundWindow(); + if (!hwnd) + hwnd = GetActiveWindow(); if (!hwnd && ctx->getconswindow) hwnd = ctx->getconswindow(); /* Call dialog to select one */ |