Output error text when event information retrieval fails
In some cases Event Monitor reported blank event text. I am suspecting the TdhGetEventInformation() fails for some reason resulting in a silent failure to return event text. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
d113388a69
commit
dd9cd83400
@ -608,7 +608,9 @@ wxString wxETWListCtrl::OnGetItemText(const winstd::event_rec &rec, long column)
|
|||||||
// Get event meta-info.
|
// Get event meta-info.
|
||||||
unique_ptr<TRACE_EVENT_INFO> info;
|
unique_ptr<TRACE_EVENT_INFO> info;
|
||||||
ULONG ulResult;
|
ULONG ulResult;
|
||||||
if ((ulResult = TdhGetEventInformation((PEVENT_RECORD)&rec, 0, NULL, info)) == ERROR_SUCCESS) {
|
if ((ulResult = TdhGetEventInformation((PEVENT_RECORD)&rec, 0, NULL, info)) != ERROR_SUCCESS)
|
||||||
|
return tstring_printf(_T("(Error getting event information (error %u))"), ulResult).c_str();
|
||||||
|
|
||||||
if (info->DecodingSource != DecodingSourceWPP) {
|
if (info->DecodingSource != DecodingSourceWPP) {
|
||||||
if (rec.EventHeader.Flags & EVENT_HEADER_FLAG_STRING_ONLY) {
|
if (rec.EventHeader.Flags & EVENT_HEADER_FLAG_STRING_ONLY) {
|
||||||
// This is a string-only event. Print it.
|
// This is a string-only event. Print it.
|
||||||
@ -637,7 +639,6 @@ wxString wxETWListCtrl::OnGetItemText(const winstd::event_rec &rec, long column)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
@ -1059,7 +1060,7 @@ static tstring PropertyToString(PEVENT_RECORD pEvent, PTRACE_EVENT_INFO pInfo, U
|
|||||||
// Get the size of the array if the property is an array.
|
// Get the size of the array if the property is an array.
|
||||||
ULONG ulArraySize = 0;
|
ULONG ulArraySize = 0;
|
||||||
if ((ulResult = GetArraySize(pEvent, pInfo, ulPropIndex, &ulArraySize)) != ERROR_SUCCESS)
|
if ((ulResult = GetArraySize(pEvent, pInfo, ulPropIndex, &ulArraySize)) != ERROR_SUCCESS)
|
||||||
return tstring_printf(_T("(Error getting array size (error %u))"), ulResult);;
|
return tstring_printf(_T("(Error getting array size (error %u))"), ulResult);
|
||||||
|
|
||||||
tstring out;
|
tstring out;
|
||||||
bool out_nonfirst = false;
|
bool out_nonfirst = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user