thread

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx unsafe.Pointer, cb uintptr) (handle.Handle, uint32, error)

Create creates a thread to execute within the virtual address space of the calling process.

func Open

func Open(access DesiredAccess, inheritHandle bool, threadID uint32) (handle.Handle, error)

Open opens an existing thread object.

func Terminate

func Terminate(handle handle.Handle, exitCode uint32) error

Terminate terminates the specified thread.

Types

type DesiredAccess

type DesiredAccess uint32

DesiredAccess defines the type alias for thread's access modifiers

const (
	// TerminateThread is required to terminate a thread using `TerminateThread`
	TerminateThread DesiredAccess = 0x0001
	// SuspendResume is required to suspend or resume a thread
	SuspendResume DesiredAccess = 0x0002
	// GetContext is required to read the context of a thread using `GetThreadContext`
	GetContext DesiredAccess = 0x0008
	// SetContext is required to write the context of a thread
	SetContext DesiredAccess = 0x0010
	// SetInformation is required to set certain information in the thread object
	SetInformation DesiredAccess = 0x0020
	// QueryInformation is required to read certain information from the thread object
	QueryInformation DesiredAccess = 0x0040
	// SetThreadToken is required to set the impersonation token for a thread
	SetThreadToken DesiredAccess = 0x0080
	// Impersonate is required to use a thread's security information directly without calling it by using a communication mechanism that provides impersonation services
	Impersonate DesiredAccess = 0x0100
	// DirectImpersonation is required for a server thread that impersonates a client
	DirectImpersonation DesiredAccess = 0x0200
	// SetLimitedInformation is required to set certain information in the thread object
	SetLimitedInformation DesiredAccess = 0x0400
	// QueryLimitedInformation is required to get certain information from the thread objects (e.g. PID to which pertains some thread)
	QueryLimitedInformation DesiredAccess = 0x0800

	// AllAccess grants all possible access rights for a thread object
	AllAccess DesiredAccess = 0x000F0000 | 0x00100000 | 0xFFFF
)

func (DesiredAccess) Flags added in v1.5.0

func (access DesiredAccess) Flags() []string

Flags returns a list of thread access right flags.

func (DesiredAccess) String added in v1.5.0

func (access DesiredAccess) String() string

String returns the human-readable representation of the thread access rights.

Jump to

Keyboard shortcuts

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