github.com/Serizao/go-winio@v0.0.0-20230906082528-f02f7f4ad6e8/pkg/etw/wrapper_64.go (about) 1 //go:build windows && (amd64 || arm64) 2 // +build windows 3 // +build amd64 arm64 4 5 package etw 6 7 import ( 8 "github.com/Serizao/go-winio/pkg/guid" 9 "golang.org/x/sys/windows" 10 ) 11 12 func eventUnregister(providerHandle providerHandle) (win32err error) { 13 return eventUnregister_64(providerHandle) 14 } 15 16 func eventWriteTransfer( 17 providerHandle providerHandle, 18 descriptor *eventDescriptor, 19 activityID *windows.GUID, 20 relatedActivityID *windows.GUID, 21 dataDescriptorCount uint32, 22 dataDescriptors *eventDataDescriptor) (win32err error) { 23 return eventWriteTransfer_64( 24 providerHandle, 25 descriptor, 26 activityID, 27 relatedActivityID, 28 dataDescriptorCount, 29 dataDescriptors) 30 } 31 32 func eventSetInformation( 33 providerHandle providerHandle, 34 class eventInfoClass, 35 information uintptr, 36 length uint32) (win32err error) { 37 return eventSetInformation_64( 38 providerHandle, 39 class, 40 information, 41 length) 42 } 43 44 // providerCallbackAdapter acts as the first-level callback from the C/ETW side 45 // for provider notifications. Because Go has trouble with callback arguments of 46 // different size, it has only pointer-sized arguments, which are then cast to 47 // the appropriate types when calling providerCallback. 48 func providerCallbackAdapter( 49 sourceID *guid.GUID, 50 state uintptr, 51 level uintptr, 52 matchAnyKeyword uintptr, 53 matchAllKeyword uintptr, 54 filterData uintptr, 55 i uintptr, 56 ) uintptr { 57 providerCallback(*sourceID, 58 ProviderState(state), 59 Level(level), 60 uint64(matchAnyKeyword), 61 uint64(matchAllKeyword), 62 filterData, 63 i) 64 return 0 65 }