新手求助

k782411998 · 2017-12-11 04:10:30 · 1539 次点击

是的,刚才用py调用成功了,想改成用go

#2
更多评论

你这是要 go 调用 C++?

#1

wlan, := syscall.LoadLibrary("Wlanapi.dll") wlanOpenHandle, := syscall.GetProcAddress(wlan,"WlanOpenHandle") negotiatedversion := uint32(0) dwClientVersion := uint32(2) kernel32 := syscall.NewLazyDLL("kernel32.dll"); CreateToolhelp32Snapshot := kernel32.NewProc("CreateToolhelp32Snapshot"); pHandle,,_ := CreateToolhelp32Snapshot.Call(uintptr(0x2),uintptr(0x0));

ret,ret1,err := syscall.Syscall6(uintptr(wlanOpenHandle),
    4,
    uintptr(unsafe.Pointer(&dwClientVersion)),
    uintptr(0),
    uintptr(unsafe.Pointer(&negotiated_version)),
    uintptr(pHandle),
    0,
    0,
)
fmt.Println("ret:",ret)

写到现在,报错50,到微软官方文档上查了一下

#3