Commit in reactos/ntoskrnl/ex on MAIN
uuid.c+16-41.3 -> 1.4
NtAllocateUuids(): Improve randomness of initial sequence count.

reactos/ntoskrnl/ex
uuid.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- uuid.c	19 Dec 2004 12:52:42 -0000	1.3
+++ uuid.c	20 Dec 2004 14:07:34 -0000	1.4
@@ -1,4 +1,4 @@
-/* $Id: uuid.c,v 1.3 2004/12/19 12:52:42 ekohl Exp $
+/* $Id: uuid.c,v 1.4 2004/12/20 14:07:34 ekohl Exp $
  *
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -152,8 +152,16 @@
 static VOID
 ExpGetRandomUuidSequence(PULONG Sequence)
 {
-  /* FIXME */
-  *Sequence = 0x70615243;
+  LARGE_INTEGER Counter;
+  LARGE_INTEGER Frequency;
+  ULONG Value;
+
+  Counter = KeQueryPerformanceCounter(&Frequency);
+  Value = Counter.u.LowPart ^ Counter.u.HighPart;
+
+  *Sequence = *Sequence ^ Value;
+
+  DPRINT("Sequence %lx\n", *Sequence);
 }
 
 
@@ -219,7 +227,11 @@
   if (!UuidSequenceInitialized)
   {
     Status = ExpLoadUuidSequence(&UuidSequence);
-    if (!NT_SUCCESS(Status))
+    if (NT_SUCCESS(Status))
+    {
+      UuidSequence++;
+    }
+    else
     {
       ExpGetRandomUuidSequence(&UuidSequence);
     }
CVSspam 0.2.8