Skip to content

Commit

Permalink
Handle Win8.1 SCHEDULE_SURFACEUPDATE::PresentCount renaming
Browse files Browse the repository at this point in the history
See issue #124
  • Loading branch information
JeffersonMontgomery-Intel committed Mar 8, 2023
1 parent ab7df41 commit e1a9dd9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PresentData/PresentMonTraceConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>();
auto PresentCount = desc[1].GetData<uint64_t>();
auto bindId = desc[2].GetData<uint64_t>();
auto PresentCount = (desc[1].status_ & PROP_STATUS_FOUND) ? desc[1].GetData<uint64_t>()
: desc[2].GetData<uint64_t>();
auto bindId = desc[3].GetData<uint64_t>();

Win32KPresentHistoryToken key(luidSurface, PresentCount, bindId);
auto eventIter = mPresentByWin32KPresentHistoryToken.find(key);
Expand Down

0 comments on commit e1a9dd9

Please sign in to comment.