windows

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2014 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	ERROR_SUCCESS      = 0
	DRIVE_REMOVABLE    = 2
	DRIVE_FIXED        = 3
	HKEY_LOCAL_MACHINE = 0x80000002
	RRF_RT_REG_SZ      = 0x00000002
	RRF_RT_REG_DWORD   = 0x00000010
	PDH_FMT_DOUBLE     = 0x00000200
	PDH_INVALID_DATA   = 0xc0000bc6
)

Variables

View Source
var (
	RegGetValue                 = modadvapi32.NewProc("RegGetValueW")
	GetSystemInfo               = modkernel32.NewProc("GetSystemInfo")
	GetTickCount                = modkernel32.NewProc("GetTickCount")
	GetDiskFreeSpaceEx          = modkernel32.NewProc("GetDiskFreeSpaceExW")
	GetLogicalDriveStrings      = modkernel32.NewProc("GetLogicalDriveStringsW")
	GetDriveType                = modkernel32.NewProc("GetDriveTypeW")
	QueryDosDevice              = modkernel32.NewProc("QueryDosDeviceW")
	GetVolumeInformationW       = modkernel32.NewProc("GetVolumeInformationW")
	GlobalMemoryStatusEx        = modkernel32.NewProc("GlobalMemoryStatusEx")
	PdhOpenQuery                = modpdh.NewProc("PdhOpenQuery")
	PdhAddCounter               = modpdh.NewProc("PdhAddCounterW")
	PdhCollectQueryData         = modpdh.NewProc("PdhCollectQueryData")
	PdhGetFormattedCounterValue = modpdh.NewProc("PdhGetFormattedCounterValue")
	PdhCloseQuery               = modpdh.NewProc("PdhCloseQuery")
)

Functions

func BytePtrToString

func BytePtrToString(p *uint8) string

func CreateQuery

func CreateQuery() (syscall.Handle, error)

func GetAdapterList

func GetAdapterList() (*syscall.IpAdapterInfo, error)

func RegGetInt

func RegGetInt(hKey uint32, subKey string, value string) (uint32, error)

func RegGetString

func RegGetString(hKey uint32, subKey string, value string) (string, error)

Types

type CounterInfo

type CounterInfo struct {
	PostName    string
	CounterName string
	Counter     syscall.Handle
}

func CreateCounter

func CreateCounter(query syscall.Handle, k, v string) (*CounterInfo, error)

type MEMORYSTATUSEX

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

type PDH_FMT_COUNTERVALUE_DOUBLE

type PDH_FMT_COUNTERVALUE_DOUBLE struct {
	CStatus     uint32
	DoubleValue float64
}

type PDH_FMT_COUNTERVALUE_ITEM_DOUBLE

type PDH_FMT_COUNTERVALUE_ITEM_DOUBLE struct {
	Name     *uint16
	FmtValue PDH_FMT_COUNTERVALUE_DOUBLE
}

type SYSTEM_INFO

type SYSTEM_INFO struct {
	ProcessorArchitecture     uint16
	PageSize                  uint32
	MinimumApplicationAddress *byte
	MaximumApplicationAddress *byte
	ActiveProcessorMask       *byte
	NumberOfProcessors        uint32
	ProcessorType             uint32
	AllocationGranularity     uint32
	ProcessorLevel            uint16
	ProcessorRevision         uint16
}

Jump to

Keyboard shortcuts

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