From: Andy Polyakov Date: Tue, 19 Jan 2010 21:45:45 +0000 (+0000) Subject: rand_win.c: handel GetTickCount wrap-around [from HEAD]. X-Git-Tag: OpenSSL_0_9_8m-beta1~4 X-Git-Url: https://git.openssl.org/gitweb/?a=commitdiff_plain;h=b86ebb55ffdd5207df752376bbba19ff551df3e4;p=openssl.git rand_win.c: handel GetTickCount wrap-around [from HEAD]. --- diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index efe0f89070..9bad067f43 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -463,7 +463,7 @@ int RAND_poll(void) PROCESSENTRY32 p; THREADENTRY32 t; MODULEENTRY32 m; - DWORD stoptime = 0; + DWORD starttime = 0; snap = (CREATETOOLHELP32SNAPSHOT) GetProcAddress(kernel, "CreateToolhelp32Snapshot"); @@ -496,7 +496,7 @@ int RAND_poll(void) */ ZeroMemory(&hlist, sizeof(HEAPLIST32)); hlist.dwSize = sizeof(HEAPLIST32); - if (good) stoptime = GetTickCount() + MAXDELAY; + if (good) starttime = GetTickCount(); #ifdef _MSC_VER if (heaplist_first(handle, &hlist)) { @@ -536,7 +536,7 @@ int RAND_poll(void) ex_cnt_limit--; } } while (heaplist_next(handle, &hlist) - && GetTickCount() < stoptime + && (!good || (GetTickCount()-starttime) 0); } @@ -559,7 +559,7 @@ int RAND_poll(void) && --entrycnt > 0); } } while (heaplist_next(handle, &hlist) - && GetTickCount() < stoptime); + && (!good || (GetTickCount()-starttime)