wmiext

package
v0.0.0-...-c7dcc3a Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	WmiPathKey = "__PATH"
)

Variables

View Source
var (
	WindowsEpoch = time.Date(1601, 1, 1, 0, 0, 0, 0, time.UTC)
)

Functions

func CloneInstance

func CloneInstance(instance *wmi.Instance) (*wmi.Instance, error)

func ConvertToPath

func ConvertToPath(instance *wmi.Instance) (string, error)

func CreateInstance

func CreateInstance(service *wmi.Service, className string, src interface{}) (*wmi.Instance, error)

func CreateNumericArrayVariant

func CreateNumericArrayVariant(array interface{}, itemType ole.VT) (ole.VARIANT, error)

func CreateStringArrayVariant

func CreateStringArrayVariant(array []string) (ole.VARIANT, error)

func FindFirstInstance

func FindFirstInstance(service *wmi.Service, wql string) (*wmi.Instance, error)

func FindFirstObject

func FindFirstObject(service *wmi.Service, wql string, target interface{}) error

func FindFirstRelatedInstance

func FindFirstRelatedInstance(service *wmi.Service, objPath string, className string) (*wmi.Instance, error)

func GetCimText

func GetCimText(item *wmi.Instance) string

func GetClassInstance

func GetClassInstance(service *wmi.Service, obj *wmi.Instance) (*wmi.Instance, error)

func GetObjectAsObject

func GetObjectAsObject(service *wmi.Service, objPath string, target interface{}) error

func GetPropertyAsUint

func GetPropertyAsUint(instance *wmi.Instance, name string) (uint, error)

func GetSingletonInstance

func GetSingletonInstance(service *wmi.Service, className string) (*wmi.Instance, error)

func InstanceGetAll

func InstanceGetAll(instance *wmi.Instance, target interface{}) error

func InstancePut

func InstancePut(i *wmi.Instance, name string, value interface{}) (err error)

Alternative impl of instance.Put that supports direct passing of variants Once this is contributed back to wmi, this func can go

func InstancePutAll

func InstancePutAll(instance *wmi.Instance, src interface{}) error

func IsReferenceProperty

func IsReferenceProperty(instance *wmi.Instance, name string) (bool, error)

func NewAutomationVariant

func NewAutomationVariant(value interface{}) (ole.VARIANT, error)

func NextObjectWithPath

func NextObjectWithPath(enum *wmi.Enum, target interface{}) (bool, error)

Variant of Enum.NextObject that also sets object and class paths if present

func RefetchObject

func RefetchObject(service *wmi.Service, instance *wmi.Instance) (*wmi.Instance, error)

func SpawnInstance

func SpawnInstance(service *wmi.Service, className string) (*wmi.Instance, error)

func WaitJob

func WaitJob(service *wmi.Service, job *wmi.Instance) error

Types

type JobError

type JobError struct {
	ErrorCode int
}

func (*JobError) Error

func (err *JobError) Error() string

type MethodExecutor

type MethodExecutor struct {
	// contains filtered or unexported fields
}

func BeginInvoke

func BeginInvoke(service *wmi.Service, obj *wmi.Instance, method string) *MethodExecutor

func (*MethodExecutor) End

func (e *MethodExecutor) End() error

func (*MethodExecutor) Error

func (e *MethodExecutor) Error() error

func (*MethodExecutor) Execute

func (e *MethodExecutor) Execute() *MethodExecutor

func (*MethodExecutor) Get

func (e *MethodExecutor) Get(name string, value interface{}) *MethodExecutor

func (*MethodExecutor) Set

func (e *MethodExecutor) Set(name string, value interface{}) *MethodExecutor

Jump to

Keyboard shortcuts

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