aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand/rand_win.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2005-08-02 11:58:39 +0000
committerAndy Polyakov <appro@openssl.org>2005-08-02 11:58:39 +0000
commit8a35fb3beaf3caf3ee2ce6e78bac96950d7d4d67 (patch)
tree587b76b7a7078d3f50de9b06bf5c986c65dfa7b6 /crypto/rand/rand_win.c
parente85d67af9f029204c9aadf58d15c58214103d6b4 (diff)
downloadopenssl-8a35fb3beaf3caf3ee2ce6e78bac96950d7d4d67.zip
openssl-8a35fb3beaf3caf3ee2ce6e78bac96950d7d4d67.tar.gz
openssl-8a35fb3beaf3caf3ee2ce6e78bac96950d7d4d67.tar.bz2
Eliminate bogus #if WCEPLATFORM!=MS_HPC_PRO [which by the way unconditionally
invalidated the whole clause] and replace it with #if _WIN32_WCE>=210.
Diffstat (limited to 'crypto/rand/rand_win.c')
-rw-r--r--crypto/rand/rand_win.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c
index 47bf758..e609cc1 100644
--- a/crypto/rand/rand_win.c
+++ b/crypto/rand/rand_win.c
@@ -217,21 +217,22 @@ int RAND_poll(void)
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO) ;
GetVersionEx( &osverinfo ) ;
-#if defined(OPENSSL_SYS_WINCE) && WCEPLATFORM!=MS_HPC_PRO
-#ifndef CryptAcquireContext
-#define CryptAcquireContext CryptAcquireContextW
-#endif
+#if defined(OPENSSL_SYS_WINCE)
+# if defined(_WIN32_WCE) && _WIN32_WCE>=210
+# ifndef CryptAcquireContext
+ /* reserve for broken header... */
+# define CryptAcquireContext CryptAcquireContextW
+# endif
/* poll the CryptoAPI PRNG */
/* The CryptoAPI returns sizeof(buf) bytes of randomness */
- if (CryptAcquireContext(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
+ if (CryptAcquireContext(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
{
if (CryptGenRandom(hProvider, sizeof(buf), buf))
RAND_add(buf, sizeof(buf), sizeof(buf));
CryptReleaseContext(hProvider, 0);
}
-#endif
-
-#ifndef OPENSSL_SYS_WINCE
+# endif
+#else /* OPENSSL_SYS_WINCE */
/*
* None of below libraries are present on Windows CE, which is
* why we #ifndef the whole section. This also excuses us from
@@ -361,7 +362,7 @@ int RAND_poll(void)
{
/* poll the CryptoAPI PRNG */
/* The CryptoAPI returns sizeof(buf) bytes of randomness */
- if (acquire(&hProvider, 0, 0, PROV_RSA_FULL,
+ if (acquire(&hProvider, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
{
if (gen(hProvider, sizeof(buf), buf) != 0)