mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-08-29 13:26:51 -04:00
Some new upcoming changes require us to use Go 1.23. However, if we switch to Go 1.23 some new linter errors are showing up. This commit fixes most of the errors and adds an exclusion for integer overflow errors. Signed-off-by: Amit <ambarve@microsoft.com>
64 lines
1.5 KiB
Go
64 lines
1.5 KiB
Go
//go:build windows && (amd64 || arm64)
|
|
|
|
package etw
|
|
|
|
import (
|
|
"github.com/Microsoft/go-winio/pkg/guid"
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
func eventUnregister(providerHandle providerHandle) (win32err error) {
|
|
return eventUnregister_64(providerHandle)
|
|
}
|
|
|
|
func eventWriteTransfer(
|
|
providerHandle providerHandle,
|
|
descriptor *eventDescriptor,
|
|
activityID *windows.GUID,
|
|
relatedActivityID *windows.GUID,
|
|
dataDescriptorCount uint32,
|
|
dataDescriptors *eventDataDescriptor) (win32err error) {
|
|
return eventWriteTransfer_64(
|
|
providerHandle,
|
|
descriptor,
|
|
activityID,
|
|
relatedActivityID,
|
|
dataDescriptorCount,
|
|
dataDescriptors)
|
|
}
|
|
|
|
func eventSetInformation(
|
|
providerHandle providerHandle,
|
|
class eventInfoClass,
|
|
information uintptr,
|
|
length uint32) (win32err error) {
|
|
return eventSetInformation_64(
|
|
providerHandle,
|
|
class,
|
|
information,
|
|
length)
|
|
}
|
|
|
|
// providerCallbackAdapter acts as the first-level callback from the C/ETW side
|
|
// for provider notifications. Because Go has trouble with callback arguments of
|
|
// different size, it has only pointer-sized arguments, which are then cast to
|
|
// the appropriate types when calling providerCallback.
|
|
func providerCallbackAdapter(
|
|
sourceID *guid.GUID,
|
|
state uintptr,
|
|
level uintptr,
|
|
matchAnyKeyword uintptr,
|
|
matchAllKeyword uintptr,
|
|
filterData uintptr,
|
|
i uintptr,
|
|
) uintptr {
|
|
providerCallback(*sourceID,
|
|
ProviderState(state),
|
|
Level(level),
|
|
uint64(matchAnyKeyword),
|
|
uint64(matchAllKeyword),
|
|
filterData,
|
|
i)
|
|
return 0
|
|
}
|