From a304f69e0dde3984b131d1cf29d22f19b4e5e083 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 10 Jun 2019 11:02:18 +0200 Subject: wintun: fix comments and remove hwnd param This now looks more idiomatic. --- tun/tun_windows.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tun/tun_windows.go') diff --git a/tun/tun_windows.go b/tun/tun_windows.go index 1881e5b..4850bb5 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -72,24 +72,24 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (TUN var wt *wintun.Wintun // Does an interface with this name already exist? - wt, err = wintun.GetInterface(ifname, 0) + wt, err = wintun.GetInterface(ifname) if err == nil { // If so, we delete it, in case it has weird residual configuration. - _, err = wt.DeleteInterface(0) + _, err = wt.DeleteInterface() if err != nil { return nil, fmt.Errorf("Unable to delete already existing Wintun interface: %v", err) } } else if err == windows.ERROR_ALREADY_EXISTS { return nil, fmt.Errorf("Foreign network interface with the same name exists") } - wt, _, err = wintun.CreateInterface("WireGuard Tunnel Adapter", requestedGUID, 0) + wt, _, err = wintun.CreateInterface("WireGuard Tunnel Adapter", requestedGUID) if err != nil { return nil, fmt.Errorf("Unable to create Wintun interface: %v", err) } err = wt.SetInterfaceName(ifname) if err != nil { - wt.DeleteInterface(0) + wt.DeleteInterface() return nil, fmt.Errorf("Unable to set name of Wintun interface: %v", err) } @@ -214,7 +214,7 @@ func (tun *NativeTun) Close() error { close(tun.events) } - _, err2 := tun.wt.DeleteInterface(0) + _, err2 := tun.wt.DeleteInterface() if err1 == nil { err1 = err2 } -- cgit v1.2.3-59-g8ed1b