]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fix DataHubGetNextRecord bug
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Dec 2007 09:31:03 +0000 (09:31 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Dec 2007 09:31:03 +0000 (09:31 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4441 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c

index 75c1addb0981348c9658060b30027dfcd4e9dd60..386c31c921a44a506376e148c1329cac7326d3f2 100644 (file)
@@ -140,7 +140,10 @@ Returns:
   CopyMem (&Record->ProducerName, ProducerName, sizeof (EFI_GUID));\r
   Record->DataRecordClass   = DataRecordClass;\r
 \r
-  Record->LogMonotonicCount = Private->GlobalMonotonicCount++;\r
+  //\r
+  // Ensure LogMonotonicCount is not zero\r
+  //\r
+  Record->LogMonotonicCount = ++Private->GlobalMonotonicCount;\r
 \r
   gRT->GetTime (&Record->LogTime, NULL);\r
 \r
@@ -258,8 +261,7 @@ Returns:
       if (FilterMonotonicCount != 0) {\r
         //\r
         // The GetNextMonotonicCount field remembers the last value from the previous time.\r
-        // But we already processed this vaule, so we need to find the next one. So if\r
-        // It is not the first time get the new record entry.\r
+        // But we already processed this vaule, so we need to find the next one.\r
         //\r
         *Record         = GetNextDataRecord (&Private->DataListHead, ClassFilter, &FilterMonotonicCount);\r
         *MonotonicCount = FilterMonotonicCount;\r
@@ -286,12 +288,10 @@ Returns:
     // If MonotonicCount is zero No more reacords left.\r
     //\r
     if (*MonotonicCount == 0) {\r
-      if (FilterMonotonicCount != 0) {\r
-        //\r
-        // Return the result of our extra GetNextDataRecord.\r
-        //\r
-        FilterDriver->GetNextMonotonicCount = FilterMonotonicCount;\r
-      }\r
+      //\r
+      // Save the current Record MonotonicCount.\r
+      //\r
+      FilterDriver->GetNextMonotonicCount = (*Record)->LogMonotonicCount;\r
     } else {\r
       //\r
       // Point to next undread record\r