aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun/setupapi/zsetupapi_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'tun/wintun/setupapi/zsetupapi_windows.go')
-rw-r--r--tun/wintun/setupapi/zsetupapi_windows.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/tun/wintun/setupapi/zsetupapi_windows.go b/tun/wintun/setupapi/zsetupapi_windows.go
index 375862d..d1cedde 100644
--- a/tun/wintun/setupapi/zsetupapi_windows.go
+++ b/tun/wintun/setupapi/zsetupapi_windows.go
@@ -57,6 +57,7 @@ var (
procSetupDiOpenDevRegKey = modsetupapi.NewProc("SetupDiOpenDevRegKey")
procSetupDiGetDeviceRegistryPropertyW = modsetupapi.NewProc("SetupDiGetDeviceRegistryPropertyW")
procSetupDiSetDeviceRegistryPropertyW = modsetupapi.NewProc("SetupDiSetDeviceRegistryPropertyW")
+ procSetupDiSetDevicePropertyW = modsetupapi.NewProc("SetupDiSetDevicePropertyW")
procSetupDiGetDeviceInstallParamsW = modsetupapi.NewProc("SetupDiGetDeviceInstallParamsW")
procSetupDiGetDeviceInstanceIdW = modsetupapi.NewProc("SetupDiGetDeviceInstanceIdW")
procSetupDiGetClassInstallParamsW = modsetupapi.NewProc("SetupDiGetClassInstallParamsW")
@@ -277,6 +278,18 @@ func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev
return
}
+func setupDiSetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DevPropKey, propertyType DevPropType, propertyBuffer *byte, propertyBufferSize uint32, flags uint32) (err error) {
+ r1, _, e1 := syscall.Syscall9(procSetupDiSetDevicePropertyW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(propertyType), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(flags), 0, 0)
+ if r1 == 0 {
+ if e1 != 0 {
+ err = errnoErr(e1)
+ } else {
+ err = syscall.EINVAL
+ }
+ }
+ return
+}
+
func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) {
r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams)))
if r1 == 0 {