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
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
// 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