Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with determining the size of the property #182

Open
kaaleksandr opened this issue Sep 28, 2021 · 6 comments
Open

Problem with determining the size of the property #182

kaaleksandr opened this issue Sep 28, 2021 · 6 comments

Comments

@kaaleksandr
Copy link
Contributor

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
...

@kaaleksandr
Copy link
Contributor Author

kaaleksandr commented Sep 28, 2021

OS: Windows 7 x64

@kaaleksandr
Copy link
Contributor Author

For example:
Property fid_USBPORT_HC have type 3 (TDH_INTYPE_INT8), but func TdhGetPropertySize returned 20. 1b != 20.

@kaaleksandr
Copy link
Contributor Author

@kaaleksandr
Copy link
Contributor Author

kaaleksandr commented Oct 4, 2021

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();

@kaaleksandr
Copy link
Contributor Author

Krabs_unh_exception

@kaaleksandr
Copy link
Contributor Author

Krabs_unh_exception_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant