windows

package
Version: v0.30.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	ERROR_SUCCESS        = 0
	ERROR_FILE_NOT_FOUND = 2
	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
	PDH_INVALID_HANDLE   = 0xC0000bbc
	PDH_NO_DATA          = 0x800007d5
)

windows system const

Variables

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

windows procs

Functions

func BytePtrToString

func BytePtrToString(p *uint8) string

BytePtrToString XXX

func CollectFilesystemValues added in v0.14.3

func CollectFilesystemValues() (map[string]FilesystemInfo, error)

CollectFilesystemValues XXX

func CreateQuery

func CreateQuery() (syscall.Handle, error)

CreateQuery XXX

func ExecPath added in v0.14.3

func ExecPath() (string, error)

ExecPath returns path of executable file (self).

func GetAdapterList

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

GetAdapterList XXX

func GetCounterValue added in v0.20.1

func GetCounterValue(counter syscall.Handle) (float64, error)

GetCounterValue get counter value from handle

func RegGetInt

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

RegGetInt XXX

func RegGetString

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

RegGetString XXX

Types

type CounterInfo

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

CounterInfo XXX

func CreateCounter

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

CreateCounter XXX

type FilesystemInfo added in v0.14.3

type FilesystemInfo struct {
	PercentUsed string
	KbUsed      float64
	KbSize      float64
	KbAvailable float64
	Mount       string
	Label       string
	VolumeName  string
	FsType      string
}

FilesystemInfo XXX

type MEMORY_STATUS_EX added in v0.14.3

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

MEMORY_STATUS_EX XXX

type PDH_FMT_COUNTERVALUE_DOUBLE

type PDH_FMT_COUNTERVALUE_DOUBLE struct {
	CStatus     uint32
	DoubleValue float64
}

PDH_FMT_COUNTERVALUE_DOUBLE XXX

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
}

SYSTEM_INFO XXX

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL