From 269944002fcd2f48cda25d564068a14159d179e2 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 4 Feb 2019 07:50:30 +0100 Subject: Add support for setupapi.SetupDiCallClassInstaller() Signed-off-by: Simon Rozman --- setupapi/zsetupapi_windows.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'setupapi/zsetupapi_windows.go') diff --git a/setupapi/zsetupapi_windows.go b/setupapi/zsetupapi_windows.go index d09c8dd..a8c61ad 100644 --- a/setupapi/zsetupapi_windows.go +++ b/setupapi/zsetupapi_windows.go @@ -48,6 +48,7 @@ var ( procSetupDiSetDeviceInstallParamsW = modsetupapi.NewProc("SetupDiSetDeviceInstallParamsW") procSetupDiGetClassInstallParamsW = modsetupapi.NewProc("SetupDiGetClassInstallParamsW") procSetupDiSetClassInstallParamsW = modsetupapi.NewProc("SetupDiSetClassInstallParamsW") + procSetupDiCallClassInstaller = modsetupapi.NewProc("SetupDiCallClassInstaller") ) func setupDiGetClassDevsEx(ClassGUID *windows.GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, DeviceInfoSet DevInfo, MachineName *uint16, reserved uintptr) (handle DevInfo, err error) { @@ -159,3 +160,15 @@ func SetupDiSetClassInstallParams(DeviceInfoSet DevInfo, DeviceInfoData *SP_DEVI } return } + +func SetupDiCallClassInstaller(InstallFunction DI_FUNCTION, DeviceInfoSet DevInfo, DeviceInfoData *SP_DEVINFO_DATA) (err error) { + r1, _, e1 := syscall.Syscall(procSetupDiCallClassInstaller.Addr(), 3, uintptr(InstallFunction), uintptr(DeviceInfoSet), uintptr(unsafe.Pointer(DeviceInfoData))) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} -- cgit v1.2.3