n4r1b / ferrisetw

Basically a KrabsETW rip-off written in Rust
Other
64 stars 23 forks source link

De-duplicate code between user and kernel traces #56

Closed daladim closed 2 years ago

daladim commented 2 years ago

In ferrisetw 0.x, there was a macro doing most of the work.

It has been removed in ferrisetw 1.0 because of the different UserTraceBuilder and KernelTraceBuilder. I tried to de-duplicate them, using a TraceBuilder<T: TraceTrait>, but that is hard because I've ended up needing to make NativeEtw pub because they would otherwise be private types leaking to public interfaces. So I gave up.

But there should be a way, one just has to find the correct balance between traits, macros and dedicated impl ... for .... Also, do we need to have separate types after all? There is only one Provider, we may be OK with a single Trace type

daladim commented 2 years ago

Never mind, I finally managed it, this will be included in an MR to come