Typo.
[openssl.git] / crypto / rand / rand_win.c
index e1beef622e4f2dfa7b77ed95b09ea2ef7b2eaf7d..5f71d2da2600eee32f5440bf3c6cfa3473f489ea 100644 (file)
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
-#if defined(WINDOWS) || defined(WIN32)
+#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
 #include <windows.h>
 #ifndef _WIN32_WINNT
 # define _WIN32_WINNT 0x0400
@@ -254,6 +254,10 @@ int RAND_poll(void)
          * at random times on Windows 2000.  Reported by Jeffrey Altman.  
          * Only use it on NT.
         */
+       /* Wolfgang Marczy <WMarczy@topcall.co.at> reports that
+        * the RegQueryValueEx call below can hang on NT4.0 (SP6).
+        * So we don't use this at all for now. */
+#if 0
         if ( osverinfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
                osverinfo.dwMajorVersion < 5)
                {
@@ -290,6 +294,7 @@ int RAND_poll(void)
                if (buf)
                        free(buf);
                }
+#endif
 
        if (advapi)
                {
@@ -577,7 +582,8 @@ static void readtimer(void)
        if (have_tsc) {
          __try {
            __asm {
-             rdtsc
+             _emit 0x0f
+             _emit 0x31
              mov cyclecount, eax
              }
            RAND_add(&cyclecount, sizeof(cyclecount), 1);