@@ -25,18 +25,34 @@ import (
2525 "golang.org/x/sys/windows"
2626)
2727
28+ // ProvidersCount designates the number of interesting providers.
29+ // Remember to increment if a new event source is introduced.
30+ const ProvidersCount = 10
31+
2832// Ktype identifies an event type. It comprises the event GUID + hook ID to uniquely identify the event
2933type Ktype [18 ]byte
3034
3135var (
32- // ProcessEventGUID represents process event GUID
36+ // ProcessEventGUID represents process provider event GUID
3337 ProcessEventGUID = windows.GUID {Data1 : 0x3d6fa8d0 , Data2 : 0xfe05 , Data3 : 0x11d0 , Data4 : [8 ]byte {0x9d , 0xda , 0x0 , 0xc0 , 0x4f , 0xd7 , 0xba , 0x7c }}
34- // ThreadEventGUID represents thread evens GUID
38+ // ThreadEventGUID represents thread provider event GUID
3539 ThreadEventGUID = windows.GUID {Data1 : 0x3d6fa8d1 , Data2 : 0xfe05 , Data3 : 0x11d0 , Data4 : [8 ]byte {0x9d , 0xda , 0x0 , 0xc0 , 0x4f , 0xd7 , 0xba , 0x7c }}
36- // FileEventGUID represents file event GUID
40+ // ImageEventGUID represents image provider event GUID
41+ ImageEventGUID = windows.GUID {Data1 : 0x2cb15d1d , Data2 : 0x5fc1 , Data3 : 0x11d2 , Data4 : [8 ]byte {0xab , 0xe1 , 0x0 , 0xa0 , 0xc9 , 0x11 , 0xf5 , 0x18 }}
42+ // FileEventGUID represents file provider event GUID
3743 FileEventGUID = windows.GUID {Data1 : 0x90cbdc39 , Data2 : 0x4a3e , Data3 : 0x11d1 , Data4 : [8 ]byte {0x84 , 0xf4 , 0x0 , 0x0 , 0xf8 , 0x04 , 0x64 , 0xe3 }}
38- // RegistryEventGUID represents registry event GUID
44+ // RegistryEventGUID represents registry provider event GUID
3945 RegistryEventGUID = windows.GUID {Data1 : 0xae53722e , Data2 : 0xc863 , Data3 : 0x11d2 , Data4 : [8 ]byte {0x86 , 0x59 , 0x0 , 0xc0 , 0x4f , 0xa3 , 0x21 , 0xa1 }}
46+ // NetworkEventGUID represents network provider event GUID
47+ NetworkEventGUID = windows.GUID {Data1 : 0x9a280ac0 , Data2 : 0xc8e0 , Data3 : 0x11d1 , Data4 : [8 ]byte {0x84 , 0xe2 , 0x0 , 0xc0 , 0x4f , 0xb9 , 0x98 , 0xa2 }}
48+ // HandleEventGUID represents handle provider event GUID
49+ HandleEventGUID = windows.GUID {Data1 : 0x89497f50 , Data2 : 0xeffe , Data3 : 0x4440 , Data4 : [8 ]byte {0x8c , 0xf2 , 0xce , 0x6b , 0x1c , 0xdc , 0xac , 0xa7 }}
50+ // MemEventGUID represents memory provider event GUID
51+ MemEventGUID = windows.GUID {Data1 : 0x3d6fa8d3 , Data2 : 0xfe05 , Data3 : 0x11d0 , Data4 : [8 ]byte {0x9d , 0xda , 0x00 , 0xc0 , 0x4f , 0xd7 , 0xba , 0x7c }}
52+ // AuditAPIEventGUID represents audit API calls event GUID
53+ AuditAPIEventGUID = windows.GUID {Data1 : 0xe02a841c , Data2 : 0x75a3 , Data3 : 0x4fa7 , Data4 : [8 ]byte {0xaf , 0xc8 , 0xae , 0x09 , 0xcf , 0x9b , 0x7f , 0x23 }}
54+ // DNSEventGUID represents DNS provider event GUID
55+ DNSEventGUID = windows.GUID {Data1 : 0x1c95126e , Data2 : 0x7eea , Data3 : 0x49a9 , Data4 : [8 ]byte {0xa3 , 0xfe , 0xa3 , 0x78 , 0xb0 , 0x3d , 0xdb , 0x4d }}
4056)
4157
4258var (
@@ -183,12 +199,7 @@ var (
183199
184200// NewFromEventRecord creates a new event type from ETW event record.
185201func NewFromEventRecord (ev * etw.EventRecord ) Ktype {
186- switch ev .Header .ProviderID {
187- case etw .KernelAuditAPICallsGUID , etw .DNSClientGUID :
188- return pack (ev .Header .ProviderID , ev .Header .EventDescriptor .ID )
189- default :
190- return pack (ev .Header .ProviderID , uint16 (ev .Header .EventDescriptor .Opcode ))
191- }
202+ return pack (ev .Header .ProviderID , ev .HookID ())
192203}
193204
194205// String returns the string representation of the event type. Returns an empty string
0 commit comments