Add support for setupapi.SetupDi(Get|Set)SelectedDevice()

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman
2019-02-04 15:50:59 +01:00
committed by Jason A. Donenfeld
parent c15cbefc12
commit 35f72239ac
3 changed files with 78 additions and 0 deletions

View File

@@ -227,3 +227,16 @@ func SetupDiClassGuidsFromNameEx(ClassName string, MachineName string) (ClassGui
return
}
//sys setupDiGetSelectedDevice(DeviceInfoSet DevInfo, DeviceInfoData *SP_DEVINFO_DATA) (err error) = setupapi.SetupDiGetSelectedDevice
// SetupDiGetSelectedDevice function retrieves the selected device information element in a device information set.
func SetupDiGetSelectedDevice(DeviceInfoSet DevInfo) (DeviceInfoData *SP_DEVINFO_DATA, err error) {
data := SP_DEVINFO_DATA{}
data.Size = uint32(unsafe.Sizeof(data))
return &data, setupDiGetSelectedDevice(DeviceInfoSet, &data)
}
// SetupDiSetSelectedDevice function sets a device information element as the selected member of a device information set. This function is typically used by an installation wizard.
//sys SetupDiSetSelectedDevice(DeviceInfoSet DevInfo, DeviceInfoData *SP_DEVINFO_DATA) (err error) = setupapi.SetupDiSetSelectedDevice