新手求助

k782411998 · · 1433 次点击
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
更多评论
你这是要 go 调用 C++?
#1
是的,刚才用py调用成功了,想改成用go
#2