Closed pathtofile closed 3 years ago
The EventTrace library has this feature - and it's very useful. :-)
Implementing a per-trace "catch all" callback is pretty straight forward - but I don't think it meets your entire requirement? i.e. it'll be called for all events, not just unhandled ones?
Note - I already use GUID_NULL
as a valid guid to match when handling WPP events...this is what TDH returns when a schema lookup fails. :-) See WppTrace001.cs
I have a quick poc for this here - is this approach "good enough"?
The middle option is really the most useful - a callback to call only if no callbacks handle the event. However, I think this is an API breaking change. The callbacks are currently blindly called if the provider guid matches. They'll all need to return a (bool) indicator of whether they have handled the event or not.
Actually, I misread your options. A callback to call if no providers are registered for that guid is more straightforward. I've updated the poc.
(I was originally envisioning checking to see if any filters for a given provider matched etc).
Tidied it up and submitted a PR.
PR looks to provide what I was looking for (ha), lgtm
Resolved by #151. Thanks for submitting this @jdu2600!
Sometimes you can subscribe to a provider, but the events received are for a different GUID. For example if you subscribe to a Provider Group. This currently can be annoying to debug, as Krabs will just silently drop these events.
It would be very useful to have some sort of 'catch-all' callback for a session, to receive events that aren't handled by the specified Krabs::Providers. Otherwise, it would be very useful for Krabs to print/log that there are events from a particular Provider GUID that are being dropped.
Possible Options could be:
GUID_NULL
Provider to mean 'match all events'If this is already sort possibly great, I'd love to know how :-)