summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun/setupapi/setupapi_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-02-07 22:35:03 +0100
committerSimon Rozman <simon@rozman.si>2019-02-07 23:50:30 +0100
commitbd963497da908d3910668dab9dab4ac7654a638a (patch)
treeaa723b40561155fff5bdaf9c6d07c9a891c0930c /tun/wintun/setupapi/setupapi_windows.go
parent05d25fd1b71aaad8f542999851d472d63b724ae2 (diff)
setupapi: Merge _SP_DEVINSTALL_PARAMS and DevInstallParams
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun/wintun/setupapi/setupapi_windows.go')
-rw-r--r--tun/wintun/setupapi/setupapi_windows.go27
1 files changed, 6 insertions, 21 deletions
diff --git a/tun/wintun/setupapi/setupapi_windows.go b/tun/wintun/setupapi/setupapi_windows.go
index d195ba4..ca944f1 100644
--- a/tun/wintun/setupapi/setupapi_windows.go
+++ b/tun/wintun/setupapi/setupapi_windows.go
@@ -332,19 +332,14 @@ func (deviceInfoSet DevInfo) SetDeviceRegistryProperty(deviceInfoData *DevInfoDa
return SetupDiSetDeviceRegistryProperty(deviceInfoSet, deviceInfoData, property, propertyBuffers)
}
-//sys setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *_SP_DEVINSTALL_PARAMS) (err error) = setupapi.SetupDiGetDeviceInstallParamsW
+//sys setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) = setupapi.SetupDiGetDeviceInstallParamsW
// SetupDiGetDeviceInstallParams function retrieves device installation parameters for a device information set or a particular device information element.
-func SetupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (deviceInstallParams *DevInstallParams, err error) {
- var _data _SP_DEVINSTALL_PARAMS
- _data.Size = uint32(unsafe.Sizeof(_data))
+func SetupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (*DevInstallParams, error) {
+ params := &DevInstallParams{}
+ params.size = uint32(unsafe.Sizeof(*params))
- err = setupDiGetDeviceInstallParams(deviceInfoSet, deviceInfoData, &_data)
- if err != nil {
- return
- }
-
- return _data.toGo(), nil
+ return params, setupDiGetDeviceInstallParams(deviceInfoSet, deviceInfoData, params)
}
// GetDeviceInstallParams method retrieves device installation parameters for a device information set or a particular device information element.
@@ -360,17 +355,7 @@ func (deviceInfoSet DevInfo) GetClassInstallParams(deviceInfoData *DevInfoData,
return SetupDiGetClassInstallParams(deviceInfoSet, deviceInfoData, classInstallParams, classInstallParamsSize, requiredSize)
}
-//sys setupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *_SP_DEVINSTALL_PARAMS) (err error) = setupapi.SetupDiSetDeviceInstallParamsW
-
-// SetupDiSetDeviceInstallParams function sets device installation parameters for a device information set or a particular device information element.
-func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) {
- _data, err := deviceInstallParams.toWindows()
- if err != nil {
- return
- }
-
- return setupDiSetDeviceInstallParams(deviceInfoSet, deviceInfoData, _data)
-}
+//sys SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) = setupapi.SetupDiSetDeviceInstallParamsW
// SetDeviceInstallParams member sets device installation parameters for a device information set or a particular device information element.
func (deviceInfoSet DevInfo) SetDeviceInstallParams(deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) error {