...
1
2
3
4
5 package etw
6
7 import (
8 "github.com/Microsoft/go-winio/pkg/guid"
9 "golang.org/x/sys/windows"
10 )
11
12 func low(v providerHandle) uint32 {
13 return uint32(v & 0xffffffff)
14 }
15
16 func high(v providerHandle) uint32 {
17 return low(v >> 32)
18 }
19
20 func eventUnregister(providerHandle providerHandle) (win32err error) {
21 return eventUnregister_32(low(providerHandle), high(providerHandle))
22 }
23
24 func eventWriteTransfer(
25 providerHandle providerHandle,
26 descriptor *eventDescriptor,
27 activityID *windows.GUID,
28 relatedActivityID *windows.GUID,
29 dataDescriptorCount uint32,
30 dataDescriptors *eventDataDescriptor) (win32err error) {
31
32 return eventWriteTransfer_32(
33 low(providerHandle),
34 high(providerHandle),
35 descriptor,
36 activityID,
37 relatedActivityID,
38 dataDescriptorCount,
39 dataDescriptors)
40 }
41
42 func eventSetInformation(
43 providerHandle providerHandle,
44 class eventInfoClass,
45 information uintptr,
46 length uint32) (win32err error) {
47
48 return eventSetInformation_32(
49 low(providerHandle),
50 high(providerHandle),
51 class,
52 information,
53 length)
54 }
55
56
57
58
59
60
61
62
63 func providerCallbackAdapter(sourceID *guid.GUID, state uint32, level uint32, matchAnyKeyword_low uint32, matchAnyKeyword_high uint32, matchAllKeyword_low uint32, matchAllKeyword_high uint32, filterData uintptr, i uintptr) uintptr {
64 matchAnyKeyword := uint64(matchAnyKeyword_high)<<32 | uint64(matchAnyKeyword_low)
65 matchAllKeyword := uint64(matchAllKeyword_high)<<32 | uint64(matchAllKeyword_low)
66 providerCallback(*sourceID, ProviderState(state), Level(level), uint64(matchAnyKeyword), uint64(matchAllKeyword), filterData, i)
67 return 0
68 }
69
View as plain text