Make the use of perl more consistent
[openssl.git] / crypto / rand / rand_win.c
index 06670ae017ad84f1d1a08872738b950a4523cd89..bf85d37aeca4e5f92d895edf50dab30b47fe5369 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/rand/rand_win.c */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  *
  */
 
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
 
 /*
  * Limit the time spent walking through the heap, processes, threads and
- * modules to a maximum of 1000 miliseconds each, unless CryptoGenRandom
+ * modules to a maximum of 1000 milliseconds each, unless CryptoGenRandom
  * failed
  */
 # define MAXDELAY 1000
@@ -182,7 +181,6 @@ typedef BOOL(WINAPI *MODULE32) (HANDLE, LPMODULEENTRY32);
 
 #  include <lmcons.h>
 #  include <lmstats.h>
-#  if 1
 /*
  * The NET API is Unicode only.  It requires the use of the UNICODE macro.
  * When UNICODE is defined LPTSTR becomes LPWSTR.  LMSTR was was added to the
@@ -193,12 +191,11 @@ typedef BOOL(WINAPI *MODULE32) (HANDLE, LPMODULEENTRY32);
 typedef NET_API_STATUS(NET_API_FUNCTION *NETSTATGET)
  (LPWSTR, LPWSTR, DWORD, DWORD, LPBYTE *);
 typedef NET_API_STATUS(NET_API_FUNCTION *NETFREE) (LPBYTE);
-#  endif                        /* 1 */
 # endif                         /* !OPENSSL_SYS_WINCE */
 
 int RAND_poll(void)
 {
-    MEMORYSTATUS m;
+    MEMORYSTATUS mst;
     HCRYPTPROV hProvider = 0;
     DWORD w;
     int good = 0;
@@ -303,9 +300,6 @@ int RAND_poll(void)
                 if (gen(hProvider, sizeof(buf), buf) != 0) {
                     RAND_add(buf, sizeof(buf), 0);
                     good = 1;
-#  if 0
-                    printf("randomness from PROV_RSA_FULL\n");
-#  endif
                 }
                 release(hProvider, 0);
             }
@@ -315,9 +309,6 @@ int RAND_poll(void)
                 if (gen(hProvider, sizeof(buf), buf) != 0) {
                     RAND_add(buf, sizeof(buf), sizeof(buf));
                     good = 1;
-#  if 0
-                    printf("randomness from PROV_INTEL_SEC\n");
-#  endif
                 }
                 release(hProvider, 0);
             }
@@ -566,17 +557,13 @@ int RAND_poll(void)
     readtimer();
 
     /* memory usage statistics */
-    GlobalMemoryStatus(&m);
-    RAND_add(&m, sizeof(m), 1);
+    GlobalMemoryStatus(&mst);
+    RAND_add(&mst, sizeof(mst), 1);
 
     /* process ID */
     w = GetCurrentProcessId();
     RAND_add(&w, sizeof(w), 1);
 
-# if 0
-    printf("Exiting RAND_poll\n");
-# endif
-
     return (1);
 }
 
@@ -724,7 +711,7 @@ static void readscreen(void)
     bi.biClrImportant = 0;
 
     bmbits = OPENSSL_malloc(size);
-    if (bmbits) {
+    if (bmbits != NULL) {
         /* Now go through the whole screen, repeatedly grabbing n lines */
         for (y = 0; y < h - n; y += n) {
             unsigned char md[MD_DIGEST_LENGTH];