Open jstarink opened 1 year ago
Update: If it may be of any help, when I inspect errors using add_on_error_callback
, I get the following message for every duplicate handle event (34):
Could not find the schema: status_code=1168 provider_id=89497f50-effe-4440-8cf2-ce6b1cdcaca7 event_id=0
I suppose 1168 refers to ERROR_NOT_FOUND
. It seems krabs cannot obtain the schema for this type of event.
Summary
I am trying to track object creation, destruction and duplication on a live Windows 10 machine. According to the MOF definitions on MSDN, these events correspond to opcodes 32, 33 and 34 respectively:
According to the examples,
object_manager_provider
is the struct to go for when tracking these events. And indeed, I can receive and parse events with opcode 32 and 33. However, events with opcode 34 seem to never be reported by the callback. Am I missing something, should I enable some extra flags/options, or could this be a bug?To Reproduce
I use the following source code, which is heavily inspired by the provided examples:
krabstest.cpp
```cpp #includeAs a test application, I have a basic program that creates a new file object, duplicates it 10 times, then closes all duplicated handles, and finally closes the main handle.
testerapp.cpp
```cpp #includeWhen running this with admin rights on a Windows 10 Pro N x64 machine, version 22H2, build 19045.3086, I only get the following output:
Notice how a single file object creation (
12c
) is directly followed up by 11 handle closure events, without any report of the file handle being duplicated.Additional Context
It is maybe worth mentioning that other libraries that consume ETW events do seem to be able to report on object duplication. For example, using
Microsoft.Diagnostics.Tracing.TraceEvent
of the perfview project, reporting on handle duplication works fine: