func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu int) (Device, error) {
	wt, err := wintun.CreateAdapter(ifname, WintunTunnelType, requestedGUID)
	if err != nil {
		return nil, fmt.Errorf("Error creating interface: %w", err)
	}
	forcedMTU := 1420
	if mtu > 0 {
		forcedMTU = mtu
	}
	tun := &NativeTun{
		wt:        wt,
		name:      ifname,
		handle:    windows.InvalidHandle,
		events:    make(chan Event, 10),
		forcedMTU: forcedMTU,
	}
	tun.session, err = wt.StartSession(0x800000)  
	if err != nil {
		tun.wt.Close()
		close(tun.events)
		return nil, fmt.Errorf("Error starting session: %w", err)
	}
	tun.readWait = tun.session.ReadWaitEvent()
	return tun, nil
}
CreateTUNWithRequestedGUID creates a Wintun interface with the given name and
a requested GUID. Should a Wintun interface with the same name exist, it is reused.
package tun
import (
	"errors"
	"fmt"
	"os"
	"sync"
	"sync/atomic"
	"time"
	_ "unsafe"
	"golang.org/x/sys/windows"
	"golang.zx2c4.com/wireguard/tun/wintun"
)
const (
	rateMeasurementGranularity = uint64((time.Second / 2) / time.Nanosecond)
	spinloopRateThreshold      = 800000000 / 8                                    
	spinloopDuration           = uint64(time.Millisecond / 80 / time.Nanosecond)  
)
type rateJuggler struct {
	current       uint64
	nextByteCount uint64
	nextStartTime int64
	changing      int32
}
type NativeTun struct {
	wt        *wintun.Adapter
	name      string
	handle    windows.Handle
	rate      rateJuggler
	session   wintun.Session
	readWait  windows.Handle
	events    chan Event
	running   sync.WaitGroup
	closeOnce sync.Once
	close     int32
	forcedMTU int
}
var WintunTunnelType = "WireGuard"
var WintunStaticRequestedGUID *windows.GUID
func procyield(cycles uint32)
func nanotime() int64
func CreateTUN(ifname string, mtu int) (Device, error) {
	return CreateTUNWithRequestedGUID(ifname, WintunStaticRequestedGUID, mtu)
}