mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
6bed781259
Well, goimports actually (which adds the normal import grouping order we do) Change-Id: I0ce1b1c03185f3741aad67c14a7ec91a838de389 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
28 lines
570 B
Go
28 lines
570 B
Go
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package winnet
|
|
|
|
import (
|
|
"fmt"
|
|
"syscall"
|
|
"unsafe"
|
|
|
|
"github.com/go-ole/go-ole"
|
|
)
|
|
|
|
func (v *INetworkConnection) GetAdapterId() (string, error) {
|
|
buf := ole.GUID{}
|
|
hr, _, _ := syscall.Syscall(
|
|
v.VTable().GetAdapterId,
|
|
2,
|
|
uintptr(unsafe.Pointer(v)),
|
|
uintptr(unsafe.Pointer(&buf)),
|
|
0)
|
|
if hr != 0 {
|
|
return "", fmt.Errorf("GetAdapterId failed: %08x", hr)
|
|
}
|
|
return buf.String(), nil
|
|
}
|