Documentation ¶
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.
Variables ¶
This section is empty.
Functions ¶
func EnumProcesses ¶
EnumProcesses returns a slice containing the process IDs of all processes currently running on the system.
func QueryFullProcessImageName ¶
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.