]> git.proxmox.com Git - mirror_edk2.git/commitdiff
GetNextMonotonicCount may not be available when GenerateRandomGuid is called. Add...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Aug 2008 01:53:37 +0000 (01:53 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Aug 2008 01:53:37 +0000 (01:53 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5752 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c

index a8676892525ab68db6391f54679d7c3d3f501ec4..6e2c9dfd34ca8625fd24fea853bec8e08fadf2d6 100644 (file)
@@ -184,19 +184,13 @@ GenerateRandomGuid (
   OUT           EFI_GUID * Guid\r
   )\r
 {\r
-  EFI_STATUS      Status;\r
-  static EFI_GUID GuidBase = { 0x14f95e01, 0xd562, 0x432e, { 0x84, 0x4a, 0x95, 0xa4, 0x39, 0x5, 0x10, 0x7e }};\r
-  UINT64          MonotonicCount;\r
+  EFI_GUID        GuidBase = { 0x14f95e01, 0xd562, 0x432e, { 0x84, 0x4a, 0x95, 0xa4, 0x39, 0x5, 0x10, 0x7e }};\r
+  static  UINT64  Count = 0;\r
 \r
   CopyGuid (Guid, &GuidBase);\r
-  \r
-  Status = gBS->GetNextMonotonicCount (&MonotonicCount);\r
-  ASSERT_EFI_ERROR (Status);\r
-  \r
-  //\r
-  // Use Monotonic Count as a psedo random number generator.\r
-  //\r
-  *((UINT64 *) Guid) = *((UINT64 *) Guid) + MonotonicCount;\r
+\r
+  Count++;  \r
+  *((UINT64 *) Guid) = *((UINT64 *) Guid) + Count;\r
 }\r
 \r
 EFI_STATUS\r