aboutsummaryrefslogtreecommitdiffstats
path: root/tun/wintun/setupapi/types_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-04-18 10:37:04 +0200
committerSimon Rozman <simon@rozman.si>2019-04-18 10:39:22 +0200
commit5811447b382ce1197e9c76d676a65515309a5b60 (patch)
treeb0a5ed9d7d8faa6cc5edf7b2d6c05d265125b8a2 /tun/wintun/setupapi/types_windows.go
parentwindows: use proper constants from updated x/sys (diff)
downloadwireguard-go-5811447b382ce1197e9c76d676a65515309a5b60.tar.xz
wireguard-go-5811447b382ce1197e9c76d676a65515309a5b60.zip
setupapi: Revise DrvInfoDetailData struct size calculation
Go adds trailing padding to DrvInfoDetailData struct in GOARCH=386 which confuses SetupAPI expecting exactly sizeof(SP_DRVINFO_DETAIL_DATA). 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.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/tun/wintun/setupapi/types_windows.go b/tun/wintun/setupapi/types_windows.go
index 8acb31b..a04237d 100644
--- a/tun/wintun/setupapi/types_windows.go
+++ b/tun/wintun/setupapi/types_windows.go
@@ -28,6 +28,7 @@ const (
// Define maximum string length constants
//
const (
+ ANYSIZE_ARRAY = 1
LINE_LEN = 256 // Windows 9x-compatible maximum for displayable strings coming from a device INF.
MAX_INF_STRING_LENGTH = 4096 // Actual maximum size of an INF string (including string substitutions).
MAX_INF_SECTION_NAME_LENGTH = 255 // For Windows 9x compatibility, INF section names should be constrained to 32 characters.
@@ -378,7 +379,7 @@ type DrvInfoDetailData struct {
sectionName [LINE_LEN]uint16
infFileName [windows.MAX_PATH]uint16
drvDescription [LINE_LEN]uint16
- hardwareID [1]uint16
+ hardwareID [ANYSIZE_ARRAY]uint16
}
func (data *DrvInfoDetailData) GetSectionName() string {