Help us shape the future of Go! Take the 2026 Go Developer Survey

winevtapi

package
v0.78.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package winevtapi implements the evtapi.API interface with the Windows Event Log API

Index

Constants

View Source
const (
	EvtRpcLogin = 1
)

EVT_LOGIN_CLASS https://learn.microsoft.com/en-us/windows/win32/api/winevt/ne-winevt-evt_login_class

View Source
const (
	EvtVariantTypeMask = 0x7f // EvtVariantTypeMask is not exposed on all buildchains
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct{}

API implements Golang wrappers for Windows Event Log API methods https://learn.microsoft.com/en-us/windows/win32/wes/windows-event-log-functions

func New

func New() *API

New returns a new Windows Event Log API

func (*API) EvtClearLog

func (api *API) EvtClearLog(ChannelPath string) error

EvtClearLog wrapper https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtclearlog

func (*API) EvtCreateRenderContext

func (api *API) EvtCreateRenderContext(ValuePaths []string, Flags uint) (evtapi.EventRenderContextHandle, error)

EvtCreateRenderContext wrapper https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtcreaterendercontext

func (*API) EvtNext

func (api *API) EvtNext(
	Session evtapi.EventResultSetHandle,
	EventsArray []evtapi.EventRecordHandle,
	EventsSize uint,
	Timeout uint) ([]evtapi.EventRecordHandle, error)

EvtNext wrapper. Must pass on every handle returned to EvtClose when finished using the handle. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtnext

func (*API) EvtOpenPublisherMetadata

func (api *API) EvtOpenPublisherMetadata(
	PublisherID string,
	LogFilePath string) (evtapi.EventPublisherMetadataHandle, error)

EvtOpenPublisherMetadata wrapper https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtopenpublishermetadata

func (*API) EvtOpenSession

func (api *API) EvtOpenSession(
	Server string,
	User string,
	Domain string,
	Password string,
	Flags uint,
) (evtapi.EventSessionHandle, error)

EvtOpenSession wrapper

NOTE: The connection is not made and the creds are not validated at the time of this call. Those operations occur when the session is first used (e.g. EvtSubscribe)

https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtopensession

func (*API) EvtQuery added in v0.70.0

func (api *API) EvtQuery(
	Session evtapi.EventSessionHandle,
	Path string,
	Query string,
	Flags uint) (evtapi.EventResultSetHandle, error)

EvtQuery wrapper. Must pass the returned handle to EvtClose when finished using the handle. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtquery

func (*API) EvtRenderBookmark

func (api *API) EvtRenderBookmark(Fragment evtapi.EventBookmarkHandle) ([]uint16, error)

EvtRenderBookmark wraps EvtRender with EvtRenderBookmark https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtrender

func (*API) EvtRenderEventValues

func (api *API) EvtRenderEventValues(Context evtapi.EventRenderContextHandle, Fragment evtapi.EventRecordHandle) (evtapi.EvtVariantValues, error)

EvtRenderEventValues renders EvtRenderEventValues https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtrender

func (*API) EvtRenderEventXml

func (api *API) EvtRenderEventXml(Fragment evtapi.EventRecordHandle) ([]uint16, error)

EvtRenderEventXml wraps EvtRender with EvtRenderEventXml https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtrender

func (*API) EvtSubscribe

func (api *API) EvtSubscribe(
	Session evtapi.EventSessionHandle,
	SignalEvent evtapi.WaitEventHandle,
	ChannelPath string,
	Query string,
	Bookmark evtapi.EventBookmarkHandle,
	Flags uint) (evtapi.EventResultSetHandle, error)

EvtSubscribe wrapper. Must pass the returned handle to EvtClose when finished using the handle. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtsubscribe

func (*API) ReportEvent

func (api *API) ReportEvent(
	EventLog evtapi.EventSourceHandle,
	Type uint,
	Category uint,
	EventID uint,
	UserSID *windows.SID,
	Strings []string,
	RawData []uint8) error

ReportEvent wrapper https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventw

type EVT_RPC_LOGIN

type EVT_RPC_LOGIN struct {
	Server   *uint16
	User     *uint16
	Domain   *uint16
	Password *uint16
	Flags    uint
}

EVT_RPC_LOGIN is a C struct used when calling EvtOpenSession https://learn.microsoft.com/en-us/windows/win32/api/winevt/ns-winevt-evt_rpc_login

Jump to

Keyboard shortcuts

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