Open kaaleksandr opened 3 years ago
OS: Windows 7 x64
For example: Property fid_USBPORT_HC have type 3 (TDH_INTYPE_INT8), but func TdhGetPropertySize returned 20. 1b != 20.
example code:
krabs::user_trace trace{ L"TestUsbSession_1234" };
// see: https://github.com/repnz/etw-providers-docs/blob/master/Manifests-Win10-18990/Microsoft-Windows-USB-UCX.xml
krabs::provider<> provider(krabs::guid(L"{36da592d-e43a-4e28-af6f-4bc57c5a11e8}"));
provider.add_on_event_callback([](const EVENT_RECORD &record, const krabs::trace_context &trace_context) {
krabs::schema schema(record, trace_context.schema_locator);
std::wcout << L"Event " << schema.event_id();
std::wcout << L"(" << schema.event_name() << L") received." << std::endl;
krabs::parser parser(schema);
for(auto elem : parser.properties())
{
switch (elem.type())
{
case TDH_INTYPE_UINT8:
{
auto usbPort = parser.parse<uint8_t>(elem.name());
int bp = 1;
}
}
}
});
trace.enable(provider);
trace.start();
Manifests itself on the provider Microsoft-Windows-USB-USBPORT.
Part of my log:
... ETW PropertyName: fid_USBPORT_HC, Type: 3. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_HC_Idle_Status, Type: 9. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_HC, Type: 6. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device, Type: 12. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device_Descriptor, Type: 19. Exception: Failed to get a SID from a property ETW PropertyName: fid_USBPORT_HC, Type: 6. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device, Type: 12. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device_Descriptor, Type: 19. Exception: Failed to get a SID from a property ETW PropertyName: fid_USBPORT_HC, Type: 6. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device, Type: 12. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device_Descriptor, Type: 19. Exception: Failed to get a SID from a property ETW PropertyName: fid_USBPORT_HC, Type: 4. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Device, Type: 10. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Endpoint, Type: 17. Exception: Property size doesn't match requested size ETW PropertyName: fid_USBPORT_Endpoint_Descriptor, Type: 20. Exception: Property size doesn't match requested size ...