aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun/setupapi/types_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-06-03 14:12:50 +0200
committerSimon Rozman <simon@rozman.si>2019-06-04 14:45:23 +0200
commit014f736480dae2dc8b81a7206831058c2c451ccd (patch)
treedc6329179e77a75393523f53c2e4e973d9254226 /tun/wintun/setupapi/types_windows.go
parentdevice: remove redundant return statements (diff)
downloadwireguard-go-014f736480dae2dc8b81a7206831058c2c451ccd.tar.xz
wireguard-go-014f736480dae2dc8b81a7206831058c2c451ccd.zip
setupapi: define PropChangeParams struct
This structure is required for calling DIF_PROPERTYCHANGE installer class. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun/wintun/setupapi/types_windows.go')
-rw-r--r--tun/wintun/setupapi/types_windows.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/tun/wintun/setupapi/types_windows.go b/tun/wintun/setupapi/types_windows.go
index 287ea52..cf2b718 100644
--- a/tun/wintun/setupapi/types_windows.go
+++ b/tun/wintun/setupapi/types_windows.go
@@ -268,15 +268,34 @@ func MakeClassInstallHeader(installFunction DI_FUNCTION) *ClassInstallHeader {
return hdr
}
+// DICS_STATE specifies values indicating a change in a device's state
+type DICS_STATE uint32
+
+const (
+ DICS_ENABLE DICS_STATE = 0x00000001 // The device is being enabled.
+ DICS_DISABLE DICS_STATE = 0x00000002 // The device is being disabled.
+ DICS_PROPCHANGE DICS_STATE = 0x00000003 // The properties of the device have changed.
+ DICS_START DICS_STATE = 0x00000004 // The device is being started (if the request is for the currently active hardware profile).
+ DICS_STOP DICS_STATE = 0x00000005 // The device is being stopped. The driver stack will be unloaded and the CSCONFIGFLAG_DO_NOT_START flag will be set for the device.
+)
+
// DICS_FLAG specifies the scope of a device property change
type DICS_FLAG uint32
const (
DICS_FLAG_GLOBAL DICS_FLAG = 0x00000001 // make change in all hardware profiles
DICS_FLAG_CONFIGSPECIFIC DICS_FLAG = 0x00000002 // make change in specified profile only
- DICS_FLAG_CONFIGGENERAL DICS_FLAG = 0x00000004 // 1 or more hardware profile-specific changes to follow
+ DICS_FLAG_CONFIGGENERAL DICS_FLAG = 0x00000004 // 1 or more hardware profile-specific changes to follow (obsolete)
)
+// PropChangeParams is a structure corresponding to a DIF_PROPERTYCHANGE install function.
+type PropChangeParams struct {
+ ClassInstallHeader ClassInstallHeader
+ StateChange DICS_STATE
+ Scope DICS_FLAG
+ HwProfile uint32
+}
+
// DI_REMOVEDEVICE specifies the scope of the device removal
type DI_REMOVEDEVICE uint32