Commit Xavier's fix for #6032.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13750 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
997e739fd5
commit
4ae200a678
1
Changes
1
Changes
|
@ -130,6 +130,7 @@ Bug fixes:
|
|||
- PR#6010: Big_int.extract_big_int gives wrong results on negative arguments
|
||||
- PR#6024: Format syntax for printing @ is incompatible with 3.12.1
|
||||
- PR#6001: Reduce the memory used by compiling Camlp4
|
||||
- PR#6032: better Random.self_init under Windows
|
||||
|
||||
Internals:
|
||||
- Moved debugger/envaux.ml to typing/envaux.ml to publish env_of_only_summary
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue