diff --git a/PresentData/PresentMonTraceConsumer.cpp b/PresentData/PresentMonTraceConsumer.cpp index f20001b7..a6e7679c 100644 --- a/PresentData/PresentMonTraceConsumer.cpp +++ b/PresentData/PresentMonTraceConsumer.cpp @@ -1526,15 +1526,20 @@ void PMTraceConsumer::HandleDWMEvent(EVENT_RECORD* pEventRecord) } case Microsoft_Windows_Dwm_Core::SCHEDULE_SURFACEUPDATE_Info::Id: { + // On Windows 8.1 PresentCount is named + // OutOfFrameDirectFlipPresentCount, so we look up both allowing one to + // be optional and then check which one we found. EventDataDesc desc[] = { { L"luidSurface" }, { L"PresentCount" }, + { L"OutOfFrameDirectFlipPresentCount" }, { L"bindId" }, }; - mMetadata.GetEventData(pEventRecord, desc, _countof(desc)); + mMetadata.GetEventData(pEventRecord, desc, _countof(desc), 1); auto luidSurface = desc[0].GetData(); - auto PresentCount = desc[1].GetData(); - auto bindId = desc[2].GetData(); + auto PresentCount = (desc[1].status_ & PROP_STATUS_FOUND) ? desc[1].GetData() + : desc[2].GetData(); + auto bindId = desc[3].GetData(); Win32KPresentHistoryToken key(luidSurface, PresentCount, bindId); auto eventIter = mPresentByWin32KPresentHistoryToken.find(key);