Documentation ¶
Rendered for windows/amd64
Overview ¶
Some utility functions from SetupAPI. (see "Public Device Installation Functions",
http://msdn.microsoft.com/en-us/library/ff549791.aspx)
Index ¶
- Constants
- Variables
- func SetupDiCallClassInstaller(installFn uintptr, devInfoSet syscall.Handle, data *SpDevinfoData) (err error)
- func SetupDiCreateDeviceInfo(devInfoSet syscall.Handle, devName *uint16, g *Guid, devDesc *uint16, ...) (err error)
- func SetupDiCreateDeviceInfoList(g *Guid, hwnd uintptr) (devInfoSet syscall.Handle, err error)
- func SetupDiDestroyDeviceInfoList(devInfoSet syscall.Handle) (err error)
- func SetupDiEnumDeviceInfo(devInfoSet syscall.Handle, index uint32, diData *SpDevinfoData) (err error)
- func SetupDiGetClassDevs(class *Guid, enum *uint16, parent syscall.Handle, flags uint32) (devInfoSet syscall.Handle, err error)
- func SetupDiGetDeviceInstanceId(devInfoSet syscall.Handle, diData *SpDevinfoData, id []uint16, reqSz *uint32) (err error)
- func SetupDiGetDeviceProperty(devInfoSet syscall.Handle, diData *SpDevinfoData, pKey *DevPropKey, ...) (err error)
- func SetupDiGetDeviceRegistryProperty(devInfoSet syscall.Handle, diData *SpDevinfoData, prop uint32, ...) (err error)
- func SetupDiGetINFClass(infPath *uint16, guid *Guid, className []uint16, reqSz *uint32) (err error)
- func SetupDiOpenDevRegKey(devInfoSet syscall.Handle, diData *SpDevinfoData, scope uint32, ...) (h syscall.Handle, err error)
- func SetupDiOpenDeviceInfo(devInfoSet syscall.Handle, deviceInstanceId *uint16, hwndParent syscall.Handle, ...) (err error)
- func SetupDiSetDeviceRegistryProperty(devInfoSet syscall.Handle, data *SpDevinfoData, prop uint32, buf *byte, ...) (err error)
- type DevPropKey
- type DevPropType
- type DevinfoSet
- type Guid
- type Property
- type SpDevinfoData
Constants ¶
View Source
const ( DICD_GENERATE_ID = 0x1 DICD_INHERIT_CLASSDRVS = 0x2 DIOD_INHERIT_CLASSDRVS = 0x2 DIGCF_PRESENT = 0x2 DICS_FLAG_GLOBAL = 0x1 DICS_FLAG_CONFIGSPECIFIC = 0x2 DIREG_DEV = 0x1 DIREG_DRV = 0x2 SPDRP_HARDWAREID = 0x1 SPDRP_DEVICEDESC = 0x0 SPDRP_FRIENDLYNAME = 0xc SPDRP_ENUMERATOR_NAME = 0x16 SPDRP_PHYSICAL_DEVICE_OBJECT_NAME = 0xe SPDRP_BUSTYPEGUID = 0x13 SPDRP_BUSNUMBER = 0x15 SPDRP_CLASS = 0x7 SPDRP_CLASSGUID = 0x8 SPDRP_MFG = 0xb DIF_REGISTERDEVICE = 0x19 DEVPROP_TYPEMOD_ARRAY = 0x1000 DEVPROP_TYPEMOD_LIST = 0x2000 DEVPROP_TYPE_EMPTY = 0x0 DEVPROP_TYPE_NULL = 0x1 DEVPROP_TYPE_SBYTE = 0x2 DEVPROP_TYPE_BYTE = 0x3 DEVPROP_TYPE_INT16 = 0x4 DEVPROP_TYPE_UINT16 = 0x5 DEVPROP_TYPE_INT32 = 0x6 DEVPROP_TYPE_UINT32 = 0x7 DEVPROP_TYPE_INT64 = 0x8 DEVPROP_TYPE_UINT64 = 0x9 DEVPROP_TYPE_FLOAT = 0xa DEVPROP_TYPE_DOUBLE = 0xb DEVPROP_TYPE_DECIMAL = 0xc DEVPROP_TYPE_GUID = 0xd DEVPROP_TYPE_CURRENCY = 0xe DEVPROP_TYPE_DATE = 0xf DEVPROP_TYPE_FILETIME = 0x10 DEVPROP_TYPE_BOOLEAN = 0x11 DEVPROP_TYPE_STRING = 0x12 DEVPROP_TYPE_STRING_LIST = 0x2012 DEVPROP_TYPE_SECURITY_DESCRIPTOR = 0x13 DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING = 0x14 DEVPROP_TYPE_DEVPROPKEY = 0x15 DEVPROP_TYPE_DEVPROPTYPE = 0x16 DEVPROP_TYPE_BINARY = 0x1003 DEVPROP_TYPE_ERROR = 0x17 DEVPROP_TYPE_NTSTATUS = 0x18 DEVPROP_TYPE_STRING_INDIRECT = 0x19 )
View Source
const (
SpDevinfoDataSz = 0x20
)
Variables ¶
View Source
var GuidSerialPorts = &Guid{ Data1: 0x4D36E978, Data2: 0xE325, Data3: 0x11CE, Data4: [8]uint8{ 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18, }, }
Functions ¶
func SetupDiCallClassInstaller ¶
func SetupDiCallClassInstaller(installFn uintptr, devInfoSet syscall.Handle, data *SpDevinfoData) (err error)
func SetupDiCreateDeviceInfo ¶
func SetupDiEnumDeviceInfo ¶
func SetupDiEnumDeviceInfo(devInfoSet syscall.Handle, index uint32, diData *SpDevinfoData) (err error)
func SetupDiGetClassDevs ¶
func SetupDiGetDeviceProperty ¶ added in v0.5.0
func SetupDiGetDeviceProperty(devInfoSet syscall.Handle, diData *SpDevinfoData, pKey *DevPropKey, pType *DevPropType, buf []byte, size *uint32, flags uint32) (err error)
func SetupDiGetINFClass ¶
func SetupDiOpenDevRegKey ¶
func SetupDiOpenDeviceInfo ¶ added in v0.5.0
Types ¶
type DevPropKey ¶ added in v0.5.0
func NewDevPropKey ¶ added in v0.5.0
func NewDevPropKey(guid *Guid, pid uint32) *DevPropKey
type DevPropType ¶ added in v0.5.0
type DevPropType uint32
type DevinfoSet ¶
type DevinfoSet struct {
// contains filtered or unexported fields
}
func NewDevinfoSet ¶
func NewDevinfoSet(h syscall.Handle) *DevinfoSet
func (*DevinfoSet) DeviceInstanceID ¶
func (di *DevinfoSet) DeviceInstanceID() (id string, err error)
func (*DevinfoSet) DeviceRegistryProperty ¶
func (di *DevinfoSet) DeviceRegistryProperty(prop uint32) Property
func (*DevinfoSet) Enum ¶
func (di *DevinfoSet) Enum(i int) bool
func (*DevinfoSet) OpenDevRegKey ¶
func (di *DevinfoSet) OpenDevRegKey() (k *registry.Key, err error)
type SpDevinfoData ¶
func NewDevinfoData ¶
func NewDevinfoData() *SpDevinfoData
Click to show internal directories.
Click to hide internal directories.