aboutsummaryrefslogtreecommitdiffstats
path: root/setupapi/types_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-02-01 13:00:44 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-05 12:59:42 +0100
commitdce5192d860888e6af3e7fa8a7e4b2c776274e69 (patch)
tree08c7889ba624b1738efc50de9a458dc21d6c0635 /setupapi/types_windows.go
parentAdd support for setupapi.SetupDiEnumDeviceInfo() (diff)
downloadwireguard-go-dce5192d860888e6af3e7fa8a7e4b2c776274e69.tar.xz
wireguard-go-dce5192d860888e6af3e7fa8a7e4b2c776274e69.zip
Add support for setupapi.SetupDiOpenDevRegKey()
Furthermore setupapi.DevInfoData has been obsoleted. SetupDiEnumDeviceInfo() fills existing SP_DEVINFO_DATA structure now. As other functions of SetupAPI use SP_DEVINFO_DATA, converting it to DevInfoData and back would hurt performance. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'setupapi/types_windows.go')
-rw-r--r--setupapi/types_windows.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/setupapi/types_windows.go b/setupapi/types_windows.go
index e94d112..ef0725a 100644
--- a/setupapi/types_windows.go
+++ b/setupapi/types_windows.go
@@ -51,15 +51,28 @@ type DevInfoListDetailData struct {
RemoteMachineName string
}
-type _SP_DEVINFO_DATA struct {
+// SP_DEVINFO_DATA is a device information structure (references a device instance that is a member of a device information set)
+type SP_DEVINFO_DATA struct {
Size uint32
ClassGUID windows.GUID
DevInst uint32 // DEVINST handle
_ uintptr
}
-// DevInfoData is a device information structure (references a device instance that is a member of a device information set)
-type DevInfoData struct {
- ClassGUID windows.GUID
- DevInst uint32 // DEVINST handle
-}
+// 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
+)
+
+// DIREG specifies values for SetupDiCreateDevRegKey, SetupDiOpenDevRegKey, and SetupDiDeleteDevRegKey.
+type DIREG uint32
+
+const (
+ DIREG_DEV DIREG = 0x00000001 // Open/Create/Delete device key
+ DIREG_DRV DIREG = 0x00000002 // Open/Create/Delete driver key
+ DIREG_BOTH DIREG = 0x00000004 // Delete both driver and Device key
+)