olreader

package
v0.0.0-...-487e2cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package olreader (OverlappedReader) provides a generic interface for doing overlapped reads from a particular handle. The handle is assumed to be a DataDog driver handle.

Index

Constants

View Source
const (
	// ERROR_INVALID_PARAMETER this error isn't in the windows package for some reason
	ERROR_INVALID_PARAMETER windows.Errno = 87 //nolint:revive // use windows error naming convention
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OverlappedCallback

type OverlappedCallback interface {
	OnData([]uint8)
	OnError(err error)
}

OverlappedCallbackFunc is called every time a read completes. if err is not nil, it will be set to

type OverlappedReader

type OverlappedReader struct {
	// contains filtered or unexported fields
}

OverlappedReader is the manager object for doing overlapped reads for a particular handle

func NewOverlappedReader

func NewOverlappedReader(cbfn OverlappedCallback, bufsz, count int) (*OverlappedReader, error)

func (*OverlappedReader) Open

func (olr *OverlappedReader) Open(name string) error

func (*OverlappedReader) Read

func (olr *OverlappedReader) Read() error

func (*OverlappedReader) Stop

func (olr *OverlappedReader) Stop()

func (*OverlappedReader) SynchronousDeviceIoControl

func (olr *OverlappedReader) SynchronousDeviceIoControl(ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32) (uint32, error)

SynchronousDeviceIoControl issues a synchronous IOCTL on the underlying handle. The OverlappedReader's handle is always opened with FILE_FLAG_OVERLAPPED and bound to an IOCP (see Open), so this delegates unconditionally to winutil.SynchronousOverlappedDeviceIoControl -- which arranges for the IOCTL's completion to bypass the IOCP (otherwise the IOCP read loop in Read() could receive an IOCTL completion where it expects a *readbuffer). See that function for the full rationale and the WINA-2669 hang it exists to prevent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL