Skip to content

Commit

Permalink
Don't use __try+__except unless on VC++
Browse files Browse the repository at this point in the history
  • Loading branch information
snhenson committed Sep 20, 2009
1 parent ca26ccb commit 5e56584
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions crypto/rand/rand_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
/*
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5e56584

Please sign in to comment.