package process

import "github.com/Microsoft/go-winio/pkg/process"

Index

Constants

const (
	// ImageNameFormatWin32Path indicates to format the name as a Win32 path.
	ImageNameFormatWin32Path = iota
	// ImageNameFormatNTPath indicates to format the name as a NT path.
	ImageNameFormatNTPath
)

These constants are used with QueryFullProcessImageName's flags.

Functions

func EnumProcesses

func EnumProcesses() ([]uint32, error)

EnumProcesses returns a slice containing the process IDs of all processes currently running on the system.

func QueryFullProcessImageName

func QueryFullProcessImageName(process windows.Handle, flags uint32) (string, error)

QueryFullProcessImageName returns the full process image name for the given process. The process handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. The flags can be either `ImageNameFormatWin32Path` or `ImageNameFormatNTPath`.

Types

type ProcessMemoryCountersEx

type ProcessMemoryCountersEx struct {
	Cb                         uint32
	PageFaultCount             uint32
	PeakWorkingSetSize         uint
	WorkingSetSize             uint
	QuotaPeakPagedPoolUsage    uint
	QuotaPagedPoolUsage        uint
	QuotaPeakNonPagedPoolUsage uint
	QuotaNonPagedPoolUsage     uint
	PagefileUsage              uint
	PeakPagefileUsage          uint
	PrivateUsage               uint
}

ProcessMemoryCountersEx is the PROCESS_MEMORY_COUNTERS_EX struct from Windows: https://docs.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-process_memory_counters_ex

func GetProcessMemoryInfo

func GetProcessMemoryInfo(process windows.Handle) (*ProcessMemoryCountersEx, error)

GetProcessMemoryInfo returns the memory usage information for the given process. The process handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION, and the PROCESS_VM_READ access rights.

Source Files

process.go syscall.go zsyscall_windows.go

Version
v0.6.2 (latest)
Published
Apr 9, 2024
Platform
windows/amd64
Imports
3 packages
Last checked
13 hours ago

Tools for package owners.