Documentation
¶
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 ¶
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 ¶
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.