diff options
author | Simon Rozman <simon@rozman.si> | 2019-02-07 22:37:14 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-02-07 23:50:43 +0100 |
commit | 9d830826c53d9b8cd14cf0fcd43fdf4183de4c47 (patch) | |
tree | d24f8a43b46f93b236bbf41bf99c2b87e2164ed5 /tun/wintun/setupapi/types_windows.go | |
parent | setupapi: Merge _SP_DEVINSTALL_PARAMS and DevInstallParams (diff) | |
download | wireguard-go-9d830826c53d9b8cd14cf0fcd43fdf4183de4c47.tar.xz wireguard-go-9d830826c53d9b8cd14cf0fcd43fdf4183de4c47.zip |
setupapi: Rename SP_CLASSINSTALL_HEADER to ClassInstallHeader
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.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tun/wintun/setupapi/types_windows.go b/tun/wintun/setupapi/types_windows.go index ae60bd0..7994f3c 100644 --- a/tun/wintun/setupapi/types_windows.go +++ b/tun/wintun/setupapi/types_windows.go @@ -255,12 +255,18 @@ const ( DI_FLAGSEX_SEARCH_PUBLISHED_INFS DI_FLAGSEX = 0x80000000 // Tell SetupDiBuildDriverInfoList to do a "published INF" search ) -// SP_CLASSINSTALL_HEADER is the first member of any class install parameters structure. It contains the device installation request code that defines the format of the rest of the install parameters structure. -type SP_CLASSINSTALL_HEADER struct { - Size uint32 +// ClassInstallHeader is the first member of any class install parameters structure. It contains the device installation request code that defines the format of the rest of the install parameters structure. +type ClassInstallHeader struct { + size uint32 InstallFunction DI_FUNCTION } +func MakeClassInstallHeader(installFunction DI_FUNCTION) *ClassInstallHeader { + hdr := &ClassInstallHeader{InstallFunction: installFunction} + hdr.size = uint32(unsafe.Sizeof(*hdr)) + return hdr +} + // DICS_FLAG specifies the scope of a device property change type DICS_FLAG uint32 @@ -280,7 +286,7 @@ const ( // SP_REMOVEDEVICE_PARAMS is a structure corresponding to a DIF_REMOVE install function. type SP_REMOVEDEVICE_PARAMS struct { - ClassInstallHeader SP_CLASSINSTALL_HEADER + ClassInstallHeader ClassInstallHeader Scope DI_REMOVEDEVICE HwProfile uint32 } |