sysinfoapi

package
v0.30.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetComputerName

func GetComputerName(f WinComputerNameFormat) (string, error)

GetComputerName wraps the GetComputerNameW function in a more Go-like way https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getcomputernameexw

Types

type MemoryStatus

type MemoryStatus struct {
	MemoryLoad           uint32
	TotalPhys            uint64
	AvailPhys            uint64
	TotalPageFile        uint64
	AvailPageFile        uint64
	TotalVirtual         uint64
	AvailVirtual         uint64
	AvailExtendedVirtual uint64
}

MemoryStatus is an idiomatic wrapper for MemoryStatusEx.

func GlobalMemoryStatusEx

func GlobalMemoryStatusEx() (MemoryStatus, error)

GlobalMemoryStatusEx retrieves information about the system's current usage of both physical and virtual memory. https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex

type ProcessorArchitecture

type ProcessorArchitecture uint16

ProcessorArchitecture is an idiomatic wrapper for wProcessorArchitecture.

Idiomatic values for wProcessorArchitecture.

type SystemInfo

type SystemInfo struct {
	Arch                      ProcessorArchitecture
	PageSize                  uint32
	MinimumApplicationAddress uintptr
	MaximumApplicationAddress uintptr
	ActiveProcessorMask       uint
	NumberOfProcessors        uint32
	ProcessorType             uint32
	AllocationGranularity     uint32
	ProcessorLevel            uint16
	ProcessorRevision         uint16
}

SystemInfo is an idiomatic wrapper for LpSystemInfo.

func GetSystemInfo

func GetSystemInfo() SystemInfo

GetSystemInfo is an idiomatic wrapper for the GetSystemInfo function from sysinfoapi https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsysteminfo

type WinComputerNameFormat

type WinComputerNameFormat int

WinComputerNameFormat is a wrapper for COMPUTER_NAME_FORMAT.

const (
	ComputerNameNetBIOS WinComputerNameFormat = iota
	ComputerNameDNSHostname
	ComputerNameDNSDomain
	ComputerNameDNSFullyQualified
	ComputerNamePhysicalNetBIOS
	ComputerNamePhysicalDNSHostname
	ComputerNamePhysicalDNSDomain
	ComputerNamePhysicalDNSFullyQualified
	ComputerNameMax
)

Definitions for WinComputerNameFormat constants.

Jump to

Keyboard shortcuts

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