| 19 | } |
| 20 | |
| 21 | LRESULT CEventPropertiesDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) { |
| 22 | m_List.Attach(GetDlgItem(IDC_LIST)); |
| 23 | m_List.SetExtendedListViewStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP | LVS_EX_INFOTIP); |
| 24 | |
| 25 | GetDlgItem(IDC_STACK).EnableWindow(m_pData->GetStackEventData() != nullptr); |
| 26 | |
| 27 | DlgResize_Init(true); |
| 28 | |
| 29 | CString text; |
| 30 | text.Format(L"Event #%u (%s)", m_pData->GetIndex(), m_pData->GetEventName().c_str()); |
| 31 | SetWindowText(text); |
| 32 | |
| 33 | m_List.InsertColumn(0, L"Name", LVCFMT_LEFT, 120); |
| 34 | m_List.InsertColumn(1, L"Value", LVCFMT_LEFT, 300); |
| 35 | |
| 36 | auto ts = m_pData->GetTimeStamp(); |
| 37 | text.Format(L".%06u", (ts / 10) % 1000000); |
| 38 | |
| 39 | auto& desc = m_pData->GetEventDescriptor(); |
| 40 | InsertItem(L"Time Stamp", CTime(*(FILETIME*)&ts).Format(L"%x %X") + text); |
| 41 | InsertItem(L"Event Name", m_pData->GetEventName().c_str()); |
| 42 | ::StringFromGUID2(m_pData->GetProviderId(), (PWSTR)text.GetBufferSetLength(64), 64); |
| 43 | InsertItem(L"Provider Id", text); |
| 44 | text.Format(L"%d (0x%X)", desc.Opcode, desc.Opcode); |
| 45 | InsertItem(L"Opcode", text); |
| 46 | |
| 47 | auto pid = m_pData->GetProcessId(); |
| 48 | if (pid != (DWORD)-1 && pid != 0) { |
| 49 | text.Format(L"%u (0x%X)", pid, pid); |
| 50 | InsertItem(L"Process Id", text); |
| 51 | InsertItem(L"Process Name", m_pData->GetProcessName().c_str()); |
| 52 | } |
| 53 | auto tid = m_pData->GetThreadId(); |
| 54 | if (tid != (DWORD)-1 && tid != 0) { |
| 55 | text.Format(L"%u (0x%X)", tid, tid); |
| 56 | InsertItem(L"Thread Id", text); |
| 57 | } |
| 58 | |
| 59 | for (auto& prop : m_pData->GetProperties()) { |
| 60 | if (prop.Name.substr(0, 8) == L"Reserved") |
| 61 | continue; |
| 62 | auto value = FormatHelper::FormatProperty(m_pData, prop); |
| 63 | if (value.empty()) |
| 64 | value = m_pData->FormatProperty(prop); |
| 65 | InsertItem(prop.Name.c_str(), value.c_str()); |
| 66 | } |
| 67 | |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | LRESULT CEventPropertiesDlg::OnCloseCmd(WORD, WORD wID, HWND, BOOL&) { |
| 72 | EndDialog(wID); |
nothing calls this directly
no test coverage detected