
Some minor improvements, but biggest for here is ErrPipeListenerClosed is no longer an errors.New where the string matches the text of the now exported net.ErrClosed in the stdlib, but is just assigned to net.ErrClosed directly. This should allow us to get rid of the string check for "use of closed network connection" here now.. Signed-off-by: Daniel Canter <dcanter@microsoft.com>
32 lines
622 B
Go
32 lines
622 B
Go
//go:build windows
|
|
|
|
package etw
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
type eventDataDescriptorType uint8
|
|
|
|
const (
|
|
eventDataDescriptorTypeUserData eventDataDescriptorType = iota
|
|
eventDataDescriptorTypeEventMetadata
|
|
eventDataDescriptorTypeProviderMetadata
|
|
)
|
|
|
|
type eventDataDescriptor struct {
|
|
ptr ptr64
|
|
size uint32
|
|
dataType eventDataDescriptorType
|
|
_ uint8
|
|
_ uint16
|
|
}
|
|
|
|
func newEventDataDescriptor(dataType eventDataDescriptorType, buffer []byte) eventDataDescriptor {
|
|
return eventDataDescriptor{
|
|
ptr: ptr64{ptr: unsafe.Pointer(&buffer[0])},
|
|
size: uint32(len(buffer)),
|
|
dataType: dataType,
|
|
}
|
|
}
|