diff options
author | Simon Rozman <simon@rozman.si> | 2019-02-04 15:50:59 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-05 12:59:42 +0100 |
commit | 35f72239ac428c41e9e3bba9f06c67d0eff3de8a (patch) | |
tree | 99b5230cbd1b0834486cff31a9e8f3eda4190264 /setupapi/setupapi_windows.go | |
parent | c15cbefc1283ce630d35573856fed2bf71eb0292 (diff) |
Add support for setupapi.SetupDi(Get|Set)SelectedDevice()
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'setupapi/setupapi_windows.go')
-rw-r--r-- | setupapi/setupapi_windows.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/setupapi/setupapi_windows.go b/setupapi/setupapi_windows.go index a48042f..43d0d28 100644 --- a/setupapi/setupapi_windows.go +++ b/setupapi/setupapi_windows.go @@ -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 |