summaryrefslogtreecommitdiffhomepage
path: root/setupapi/zsetupapi_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-02-04 08:39:31 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-05 12:59:42 +0100
commit3e0e61dd26d900eb6eaf826200241cbf84cd068d (patch)
tree595494972fecaaa0e714fc42c281a6e153443986 /setupapi/zsetupapi_windows.go
parent9635a0b3a69272aac998fad700344fac392d2adf (diff)
Replace SetupDiClassNameFromGuid() with SetupDiClassNameFromGuidEx()
The former is only a subset of the later. To minimize future maintenance, we'll provide support for extended version only. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'setupapi/zsetupapi_windows.go')
-rw-r--r--setupapi/zsetupapi_windows.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/setupapi/zsetupapi_windows.go b/setupapi/zsetupapi_windows.go
index 082bde4..33d8fb0 100644
--- a/setupapi/zsetupapi_windows.go
+++ b/setupapi/zsetupapi_windows.go
@@ -39,7 +39,7 @@ func errnoErr(e syscall.Errno) error {
var (
modsetupapi = windows.NewLazySystemDLL("setupapi.dll")
- procSetupDiClassNameFromGuidW = modsetupapi.NewProc("SetupDiClassNameFromGuidW")
+ procSetupDiClassNameFromGuidExW = modsetupapi.NewProc("SetupDiClassNameFromGuidExW")
procSetupDiGetClassDevsExW = modsetupapi.NewProc("SetupDiGetClassDevsExW")
procSetupDiDestroyDeviceInfoList = modsetupapi.NewProc("SetupDiDestroyDeviceInfoList")
procSetupDiGetDeviceInfoListDetailW = modsetupapi.NewProc("SetupDiGetDeviceInfoListDetailW")
@@ -52,8 +52,8 @@ var (
procSetupDiCallClassInstaller = modsetupapi.NewProc("SetupDiCallClassInstaller")
)
-func setupDiClassNameFromGuid(ClassGUID *windows.GUID, ClassName *uint16, ClassNameSize uint32, RequiredSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetupDiClassNameFromGuidW.Addr(), 4, uintptr(unsafe.Pointer(ClassGUID)), uintptr(unsafe.Pointer(ClassName)), uintptr(ClassNameSize), uintptr(unsafe.Pointer(RequiredSize)), 0, 0)
+func setupDiClassNameFromGuidEx(ClassGUID *windows.GUID, ClassName *uint16, ClassNameSize uint32, RequiredSize *uint32, MachineName *uint16, Reserved uintptr) (err error) {
+ r1, _, e1 := syscall.Syscall6(procSetupDiClassNameFromGuidExW.Addr(), 6, uintptr(unsafe.Pointer(ClassGUID)), uintptr(unsafe.Pointer(ClassName)), uintptr(ClassNameSize), uintptr(unsafe.Pointer(RequiredSize)), uintptr(unsafe.Pointer(MachineName)), uintptr(Reserved))
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)