diff options
author | Simon Rozman <simon@rozman.si> | 2019-02-07 22:23:03 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-02-07 23:49:50 +0100 |
commit | 05d25fd1b71aaad8f542999851d472d63b724ae2 (patch) | |
tree | 4d9d20b7e5ed80a154d8c522b4338e267c58de84 /tun/wintun/setupapi/setupapi_windows.go | |
parent | 6d2729dcccc7d02a2578ee28580b351769868b03 (diff) |
setupapi: Merge _SP_DEVINFO_LIST_DETAIL_DATA and DevInfoListDetailData
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.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tun/wintun/setupapi/setupapi_windows.go b/tun/wintun/setupapi/setupapi_windows.go index 7bbda42..d195ba4 100644 --- a/tun/wintun/setupapi/setupapi_windows.go +++ b/tun/wintun/setupapi/setupapi_windows.go @@ -29,19 +29,14 @@ func SetupDiCreateDeviceInfoListEx(classGUID *windows.GUID, hwndParent uintptr, return setupDiCreateDeviceInfoListEx(classGUID, hwndParent, machineNameUTF16, 0) } -//sys setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *_SP_DEVINFO_LIST_DETAIL_DATA) (err error) = setupapi.SetupDiGetDeviceInfoListDetailW +//sys setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) = setupapi.SetupDiGetDeviceInfoListDetailW // SetupDiGetDeviceInfoListDetail function retrieves information associated with a device information set including the class GUID, remote computer handle, and remote computer name. func SetupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo) (deviceInfoSetDetailData *DevInfoListDetailData, err error) { - var _data _SP_DEVINFO_LIST_DETAIL_DATA - _data.Size = uint32(unsafe.Sizeof(_data)) - - err = setupDiGetDeviceInfoListDetail(deviceInfoSet, &_data) - if err != nil { - return - } + data := &DevInfoListDetailData{} + data.size = uint32(unsafe.Sizeof(*data)) - return _data.toGo(), nil + return data, setupDiGetDeviceInfoListDetail(deviceInfoSet, data) } // GetDeviceInfoListDetail method retrieves information associated with a device information set including the class GUID, remote computer handle, and remote computer name. |