| 276 | } |
| 277 | |
| 278 | void CEtwView::DoSort(const SortInfo* si) { |
| 279 | auto compare = [&](auto& i1, auto& i2) { |
| 280 | switch (si->SortColumn) |
| 281 | { |
| 282 | case 0: return SortHelper::SortNumbers(i1->GetIndex(), i2->GetIndex(), si->SortAscending); |
| 283 | case 1: return SortHelper::SortNumbers(i1->GetTimeStamp(), i2->GetTimeStamp(), si->SortAscending); |
| 284 | case 2: return SortHelper::SortStrings(i1->GetEventName(), i2->GetEventName(), si->SortAscending); |
| 285 | case 3: return SortHelper::SortNumbers(i1->GetProcessId(), i2->GetProcessId(), si->SortAscending); |
| 286 | case 4: return SortHelper::SortStrings(i1->GetProcessName(), i2->GetProcessName(), si->SortAscending); |
| 287 | case 5: return SortHelper::SortNumbers(i1->GetThreadId(), i2->GetThreadId(), si->SortAscending); |
| 288 | case 6: return SortHelper::SortNumbers(i1->GetEventDescriptor().Opcode, i2->GetEventDescriptor().Opcode, si->SortAscending); |
| 289 | } |
| 290 | return false; |
| 291 | }; |
| 292 | |
| 293 | if (m_Events.size() < 20000) |
| 294 | std::sort(m_Events.begin(), m_Events.end(), compare); |
| 295 | else { |
| 296 | // C++ 17������ִ�в��� |
| 297 | // std::execution::parʹ�㷨�ڶ���߳���ִ�У������̸߳��Ծ����Լ���˳���������е��������� |
| 298 | // �����ڲ���ϵͳ����ָ��һ��������첽���ٶ�ִ�У�������ʱ���ϵ��ص���ͬһ��ʱ�̷������� |
| 299 | // ������ָ����ͬһ��ʱ����ڣ�������������ִ�У���ʱ���ϵ��ص����������ͬʱ����������˳��ִ�У��� |
| 300 | std::sort(std::execution::par, m_Events.begin(), m_Events.end(), compare); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | BOOL CEtwView::PreTransalteMessage(MSG* pMsg) { |
| 305 | pMsg; |
nothing calls this directly
no test coverage detected