File: eventdatadescriptor.go

package info (click to toggle)
golang-github-microsoft-go-winio 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 764 kB
  • sloc: makefile: 3
file content (31 lines) | stat: -rw-r--r-- 622 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//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,
	}
}