summaryrefslogtreecommitdiffstats
path: root/byterun/win32.c
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-06-06 11:39:51 +0000
committerAlain Frisch <alain@frisch.fr>2013-06-06 11:39:51 +0000
commit4ae200a6788a4125da63ecfbf793640f2d35319d (patch)
tree547198798e910205707a1e791e5d6c4d3c0eba11 /byterun/win32.c
parent997e739fd568bcf7a8221f4808056f80c046c5f9 (diff)
Commit Xavier's fix for #6032.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13750 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/win32.c')
-rw-r--r--byterun/win32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/byterun/win32.c b/byterun/win32.c
index 2b4aacced..d807f6900 100644
--- a/byterun/win32.c
+++ b/byterun/win32.c
@@ -469,13 +469,18 @@ int caml_win32_random_seed (intnat data[16])
{
/* For better randomness, consider:
http://msdn.microsoft.com/library/en-us/seccrypto/security/rtlgenrandom.asp
+ http://blogs.msdn.com/b/michael_howard/archive/2005/01/14/353379.aspx
*/
FILETIME t;
+ LARGE_INTEGER pc;
GetSystemTimeAsFileTime(&t);
+ QueryPerformanceCounter(&pc); /* PR#6032 */
data[0] = t.dwLowDateTime;
data[1] = t.dwHighDateTime;
data[2] = GetCurrentProcessId();
- return 3;
+ data[3] = pc.LowPart;
+ data[4] = pc.HighPart;
+ return 5;
}