process

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
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.

Variables

This section is empty.

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.

Jump to

Keyboard shortcuts

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