From fb53b5e9f6a42474604e5008356c6ab15d2a178c Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 29 May 2008 13:16:07 +0000 Subject: [PATCH] * GetRandomBytes calls random only once git-svn-id: trunk@11123 - --- rtl/objpas/sysutils/sysutils.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rtl/objpas/sysutils/sysutils.inc b/rtl/objpas/sysutils/sysutils.inc index babd559b86..afbe0e13fb 100644 --- a/rtl/objpas/sysutils/sysutils.inc +++ b/rtl/objpas/sysutils/sysutils.inc @@ -569,6 +569,9 @@ begin Result := DoForceDirectories(SetDirSeparators(Dir)); end; +Var + GUIDCalledRandomize : Boolean = False; + Procedure GetRandomBytes(Var Buf; NBytes : Integer); Var @@ -577,7 +580,11 @@ Var begin P:=@Buf; - Randomize; + If Not GUIDCalledRandomize then + begin + GUIDCalledRandomize:=True; + Randomize; + end; For I:=0 to NBytes-1 do P[i]:=Random(256); end;