ws2_32.go 735 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //go:build windows
  2. package yu_win
  3. import "syscall"
  4. var Select Address
  5. var Send Address
  6. var Recv Address
  7. var Gethostbyname Address
  8. func init() {
  9. j_mod, _ := syscall.LoadLibrary("ws2_32.dll")
  10. j_h, _ := syscall.GetProcAddress(j_mod, "select")
  11. Select = Address(j_h)
  12. j_h, _ = syscall.GetProcAddress(j_mod, "send")
  13. Send = Address(j_h)
  14. j_h, _ = syscall.GetProcAddress(j_mod, "recv")
  15. Recv = Address(j_h)
  16. j_h, _ = syscall.GetProcAddress(j_mod, "gethostbyname")
  17. Gethostbyname = Address(j_h)
  18. }
  19. type FDSET struct {
  20. Count uintptr
  21. Fds uintptr // []uintptr
  22. }
  23. type TIMEVAL struct {
  24. TvSec int32
  25. TvUsec int32
  26. }
  27. type Hostent struct {
  28. Name *byte
  29. Aliases **byte
  30. AddrType uint16
  31. Length uint16
  32. AddrList uintptr // **byte
  33. }