WSAData.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. namespace Microsoft.Win32
  3. {
  4. /// <summary>
  5. /// WSAData定义
  6. /// </summary>
  7. public static partial class NativeMethods
  8. {
  9. /// <summary>
  10. /// The WSADATA structure contains information about the Windows Sockets implementation.
  11. /// </summary>
  12. public struct WSADATA
  13. {
  14. /// <summary>
  15. /// The version of the Windows Sockets specification that the Ws2_32.dll expects the caller to use. The high-order byte specifies the minor version number; the low-order byte specifies the major version number.
  16. /// </summary>
  17. public short wVersion;
  18. /// <summary>
  19. /// The highest version of the Windows Sockets specification that the Ws2_32.dll can support. The high-order byte specifies the minor version number; the low-order byte specifies the major version number.This is the same value as the wVersion member when the version requested in the wVersionRequested parameter passed to the WSAStartup function is the highest version of the Windows Sockets specification that the Ws2_32.dll can support.
  20. /// </summary>
  21. public short wHighVersion;
  22. /// <summary>
  23. /// A NULL-terminated ASCII string into which the Ws2_32.dll copies a description of the Windows Sockets implementation. The text (up to 256 characters in length) can contain any characters except control and formatting characters. The most likely use that an application would have for this member is to display it (possibly truncated) in a status message.
  24. /// </summary>
  25. public string szDescription;
  26. /// <summary>
  27. /// A NULL-terminated ASCII string into which the Ws2_32.dll copies relevant status or configuration information. The Ws2_32.dll should use this parameter only if the information might be useful to the user or support staff. This member should not be considered as an extension of the szDescription parameter.
  28. /// </summary>
  29. public string szSystemStatus;
  30. /// <summary>
  31. /// The maximum number of sockets that may be opened. This member should be ignored for Windows Sockets version 2 and later.The iMaxSockets member is retained for compatibility with Windows Sockets specification 1.1, but should not be used when developing new applications. No single value can be appropriate for all underlying service providers. The architecture of Windows Sockets changed in version 2 to support multiple providers, and the WSADATA structure no longer applies to a single vendor's stack.
  32. /// </summary>
  33. public short iMaxSockets;
  34. /// <summary>
  35. /// The maximum datagram message size. This member is ignored for Windows Sockets version 2 and later.The iMaxUdpDg member is retained for compatibility with Windows Sockets specification 1.1, but should not be used when developing new applications. The architecture of Windows Sockets changed in version 2 to support multiple providers, and the WSADATA structure no longer applies to a single vendor's stack. For the actual maximum message size specific to a particular Windows Sockets service provider and socket type, applications should use getsockopt to retrieve the value of option SO_MAX_MSG_SIZE after a socket has been created.
  36. /// </summary>
  37. public short iMaxUdpDg;
  38. /// <summary>
  39. /// A pointer to vendor-specific information. This member should be ignored for Windows Sockets version 2 and later.The lpVendorInfo member is retained for compatibility with Windows Sockets specification 1.1. The architecture of Windows Sockets changed in version 2 to support multiple providers, and the WSADATA structure no longer applies to a single vendor's stack. Applications needing to access vendor-specific configuration information should use getsockopt to retrieve the value of option PVD_CONFIG for vendor-specific information.
  40. /// </summary>
  41. public IntPtr lpVendorInfo;
  42. }
  43. }
  44. }