![image.png](https://static.studygolang.com/171211/df3862720caed09a2c52cefcf016a37e.png)
求助大神,这个接口如何调用?
package main
import (
"fmt"
"syscall"
"unsafe"
)
var (
WlanOpenHandle32,_ = syscall.LoadLibrary("Wlanapi.dll")
WlanOpenHandle,_ = syscall.GetProcAddress(WlanOpenHandle32,"WlanOpenHandle")
)
func abort(funcname string, err error) {
panic(fmt.Sprintf("%s failed: %v", funcname, err))
}
func main() {
negotiated_version := uint32(0)
client_handle := uint32(0)
dwClientVersion := uint32(2)
var nargs uintptr = 4
ret,_,callErr := syscall.Syscall6(uintptr(WlanOpenHandle),
nargs,
uintptr(dwClientVersion),
0,
uintptr(unsafe.Pointer(&negotiated_version)),
uintptr(unsafe.Pointer(&client_handle)),
0,
0,
)
if client_handle != 0{
abort("StartWLANHandle", callErr)
}
result = int(ret)
return
}
#4
更多评论