aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rand/rand_win.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2009-09-20 12:39:32 +0000
committerDr. Stephen Henson <steve@openssl.org>2009-09-20 12:39:32 +0000
commit44c8b81eea16ab0d46bce0050178de160ee72abb (patch)
tree2e92dda37b5de0e20855c3e77dac3917ed104137 /crypto/rand/rand_win.c
parent23129dec6fe8e978a1fb3c8aa818d0a2f5b3b879 (diff)
downloadopenssl-44c8b81eea16ab0d46bce0050178de160ee72abb.tar.gz
Don't use __try+__except unless on VC++
Diffstat (limited to 'crypto/rand/rand_win.c')
-rw-r--r--crypto/rand/rand_win.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c
index 25a76cf1ec..efe0f89070 100644
--- a/crypto/rand/rand_win.c
+++ b/crypto/rand/rand_win.c
@@ -497,6 +497,7 @@ int RAND_poll(void)
ZeroMemory(&hlist, sizeof(HEAPLIST32));
hlist.dwSize = sizeof(HEAPLIST32);
if (good) stoptime = GetTickCount() + MAXDELAY;
+#ifdef _MSC_VER
if (heaplist_first(handle, &hlist))
{
/*
@@ -539,6 +540,29 @@ int RAND_poll(void)
&& ex_cnt_limit > 0);
}
+#else
+ if (heaplist_first(handle, &hlist))
+ {
+ do
+ {
+ RAND_add(&hlist, hlist.dwSize, 3);
+ hentry.dwSize = sizeof(HEAPENTRY32);
+ if (heap_first(&hentry,
+ hlist.th32ProcessID,
+ hlist.th32HeapID))
+ {
+ int entrycnt = 80;
+ do
+ RAND_add(&hentry,
+ hentry.dwSize, 5);
+ while (heap_next(&hentry)
+ && --entrycnt > 0);
+ }
+ } while (heaplist_next(handle, &hlist)
+ && GetTickCount() < stoptime);
+ }
+#endif
+
/* process walking */
/* PROCESSENTRY32 contains 9 fields that will change
* with each entry. Consider each field a source of