WSAStartup

From aldeid
Jump to navigation Jump to search

Description

The WSAStartup function initiates use of the Winsock DLL by a process.

Finding calls to WSAStartup can often be an easy way to locate the start of network-related functionality.

Syntax

int WSAStartup(
  _In_  WORD      wVersionRequested,
  _Out_ LPWSADATA lpWSAData
);

Parameters

wVersionRequested [in]
The highest version of Windows Sockets specification that the caller can use. The high-order byte specifies the minor version number; the low-order byte specifies the major version number.
lpWSAData [out]
A pointer to the WSADATA data structure that is to receive details of the Windows Sockets implementation.

Return value

If successful, the WSAStartup function returns zero. Otherwise, it returns one of the error codes listed below.

The WSAStartup function directly returns the extended error code in the return value for this function. A call to the WSAGetLastError function is not needed and should not be used.

Error code Meaning
WSASYSNOTREADY
10091
The underlying network subsystem is not ready for network communication.
WSAVERNOTSUPPORTED
10092
The version of Windows Sockets support requested is not provided by this particular Windows Sockets implementation.
WSAEINPROGRESS
10036
A blocking Windows Sockets 1.1 operation is in progress.
WSAEPROCLIM
10067
A limit on the number of tasks supported by the Windows Sockets implementation has been reached.
WSAEFAULT
10014
The lpWSAData parameter is not a valid pointer.