Documentation ¶
Overview ¶
Package windevice provides access to windows device management APIs.
Index ¶
- func Install(id deviceid.Hardware, path, description string, flags installflag.Value) (instance deviceid.DeviceInstance, needReboot bool, err error)
- func Update(id deviceid.Hardware, path string, flags installflag.Value) (needReboot bool, err error)
- type Device
- func (device Device) Characteristics() (uint32, error)
- func (device Device) Class() (string, error)
- func (device Device) ClassGUID() (string, error)
- func (device Device) CompatibleID() ([]deviceid.Compatible, error)
- func (device Device) ConfigFlags() (uint32, error)
- func (device Device) Description() (string, error)
- func (device Device) DevType() (uint32, error)
- func (device Device) DeviceInstanceID() (deviceid.DeviceInstance, error)
- func (device Device) DriverRegName() (string, error)
- func (device Device) Drivers(q DriverQuery) DriverSet
- func (device Device) EnumeratorName() (string, error)
- func (device Device) FriendlyName() (string, error)
- func (device Device) HardwareID() ([]deviceid.Hardware, error)
- func (device Device) InstallState() (installstate.State, error)
- func (device Device) InstalledDriver() DriverSet
- func (device Device) LocationInformation() (string, error)
- func (device Device) Manufacturer() (string, error)
- func (device Device) NetCfgInstance() (id string, err error)
- func (device Device) PhysicalDeviceObjectName() (string, error)
- func (device Device) Properties() ([]deviceproperty.Property, error)
- func (device Device) Remove(scope hwprofile.Scope, profile hwprofile.ID) (needReboot bool, err error)
- func (device Device) Service() (string, error)
- func (device Device) Sys() (devices syscall.Handle, data setupapi.DevInfoData)
- type DeviceActor
- type DeviceQuery
- type DeviceSelector
- type Driver
- func (driver Driver) Date() time.Time
- func (driver Driver) Description() string
- func (driver Driver) ManufacturerName() string
- func (driver Driver) ProviderName() string
- func (driver Driver) Sys() (devices syscall.Handle, device setupapi.DevInfoData, data setupapi.DrvInfoData)
- func (driver Driver) Version() driverversion.Value
- type DriverActor
- type DriverQuery
- type DriverSet
- type NamedClass
- type StringMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device provides access to Windows device information while executing a query. It can be copied by value.
Device stores a system handle internally and shouldn't be used outside of a query callback.
func (Device) Characteristics ¶
Characteristics returns the characteristics of the device.
func (Device) ClassGUID ¶
ClassGUID returns a string representation of the globally unique identifier of the device's class.
func (Device) CompatibleID ¶
func (device Device) CompatibleID() ([]deviceid.Compatible, error)
CompatibleID returns the set of compatible IDs associated with the device.
func (Device) ConfigFlags ¶
ConfigFlags returns the configuration flags for the device.
func (Device) Description ¶
Description returns the description of the device.
func (Device) DeviceInstanceID ¶
func (device Device) DeviceInstanceID() (deviceid.DeviceInstance, error)
DeviceInstanceID returns the device instance ID of the device.
func (Device) DriverRegName ¶
DriverRegName returns the registry name of the device's driver.
func (Device) Drivers ¶
func (device Device) Drivers(q DriverQuery) DriverSet
Drivers returns a driver set that contains drivers affiliated with the device.
func (Device) EnumeratorName ¶
EnumeratorName returns the name of the device's enumerator.
func (Device) FriendlyName ¶
FriendlyName returns the friendly name of the device.
func (Device) HardwareID ¶
HardwareID returns the set of hardware IDs associated with the device.
func (Device) InstallState ¶
func (device Device) InstallState() (installstate.State, error)
InstallState returns the installation state of the device.
func (Device) InstalledDriver ¶
InstalledDriver returns a driver set that contains the device's currently installed driver.
func (Device) LocationInformation ¶
LocationInformation returns the location information for the device.
func (Device) Manufacturer ¶
Manufacturer returns the manufacturer of the device.
func (Device) NetCfgInstance ¶
NetCfgInstance returns the NetCfgInstance of the device.
func (Device) PhysicalDeviceObjectName ¶
PhysicalDeviceObjectName returns the physical object name of the device.
func (Device) Properties ¶
func (device Device) Properties() ([]deviceproperty.Property, error)
Properties returns all of the properties of the device instance.
func (Device) Remove ¶
func (device Device) Remove(scope hwprofile.Scope, profile hwprofile.ID) (needReboot bool, err error)
Remove removes the device.
When called with a global scope, all hardware profiles will be affected.
When called with a config-specific scope, only the given hardware profile will be affected.
A hardware profile of zero indicates the current hardware profile.
type DeviceActor ¶
type DeviceActor func(Device)
DeviceActor is a function that can take action on a device.
type DeviceQuery ¶
type DeviceQuery struct { Class windows.GUID Enumerator string Flags uint32 Machine string // TODO: Consider removing this if it's not well supported Selector DeviceSelector }
DeviceQuery holds device query information. Its zero value is a valid query for all devices.
func (DeviceQuery) Count ¶
func (q DeviceQuery) Count() (int, error)
Count returns the number of devices matching the query.
func (DeviceQuery) Each ¶
func (q DeviceQuery) Each(action DeviceActor) error
Each performs an action on each device that matches the query.
type DeviceSelector ¶
DeviceSelector is an interface capable of selecting devices in a device list.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver provides access to Windows driver information while executing a query. It can be copied by value.
Driver stores a system handle internally and shouldn't be used outside of a query callback.
func (Driver) Description ¶
Description returns the description of the driver.
func (Driver) ManufacturerName ¶
ManufacturerName returns the name of the driver's manufacturer.
func (Driver) ProviderName ¶
ProviderName returns the name of the driver provider.
func (Driver) Sys ¶
func (driver Driver) Sys() (devices syscall.Handle, device setupapi.DevInfoData, data setupapi.DrvInfoData)
Sys returns low-level information about the driver.
func (Driver) Version ¶
func (driver Driver) Version() driverversion.Value
Version returns the version of the driver.
type DriverActor ¶
type DriverActor func(Driver)
DriverActor is a function that can take action on a driver.
type DriverQuery ¶
type DriverQuery struct { Type drivertype.Value FlagsEx diflagex.Value }
DriverQuery holds driver query information. Its zero value is not a valid query.
For the query to be valid, its type must specify either drivertype.ClassDriver or drivertype.CompatDriver.
type DriverSet ¶
type DriverSet struct {
// contains filtered or unexported fields
}
DriverSet accesses driver information while executing a device query. It can be copied by value.
DriverSet stores a system handle internally and shouldn't be used outside of a device query callback.
func (DriverSet) Each ¶
func (ds DriverSet) Each(action DriverActor) error
Each performs an action on each driver in the driver set.
type NamedClass ¶
NamedClass is a named device class.
func NewNamedClass ¶
func NewNamedClass(name string) (NamedClass, error)
NewNamedClass returns a NamedClass entry for the given class name.
type StringMatcher ¶
StringMatcher is an interface capable of matching strings.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package deviceid defines various kinds of device identification strings used by the windows device and driver system.
|
Package deviceid defines various kinds of device identification strings used by the windows device and driver system. |
Package strmatch performs string matching.
|
Package strmatch performs string matching. |