Skip to content

Latest commit

 

History

History
203 lines (148 loc) · 6.34 KB

nc-wsk-pfn_wsk_bind.md

File metadata and controls

203 lines (148 loc) · 6.34 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NC:wsk.PFN_WSK_BIND
PFN_WSK_BIND (wsk.h)
The WskBind function binds a socket to a local transport address.
netvista\wskbind.htm
netvista
05/02/2018
PFN_WSK_BIND callback function
PFN_WSK_BIND, PFN_WSK_BIND callback, WskBind, WskBind callback function [Network Drivers Starting with Windows Vista], netvista.wskbind, wsk/WskBind, wskref_5d411257-ce57-4331-913a-c195e71a1138.xml
wsk.h
Wsk.h
Universal
Available in Windows Vista and later versions of the Windows operating systems.
<= DISPATCH_LEVEL
Windows
PFN_WSK_BIND
wsk/PFN_WSK_BIND
APIRef
kbSyntax
UserDefined
wsk.h
PFN_WSK_BIND

PFN_WSK_BIND callback function

-description

The WskBind function binds a socket to a local transport address.

-parameters

-param Socket [in]

A pointer to a WSK_SOCKET structure that specifies the socket object for the socket that is being bound.

-param LocalAddress [in]

A pointer to a structure that specifies the local transport address to which to bind the socket. This pointer must be a pointer to the specific SOCKADDR structure type that corresponds to the address family that the WSK application specified when it created the socket.

-param Flags

This parameter is reserved for system use. A WSK application must set this parameter to zero.

-param Irp [in, out]

A pointer to a caller-allocated IRP that the WSK subsystem uses to complete the bind operation asynchronously. For more information about using IRPs with WSK functions, see Using IRPs with Winsock Kernel Functions.

-returns

WskBind returns one of the following NTSTATUS codes:

Return code Description
STATUS_SUCCESS
The socket was successfully bound to the local transport address. The IRP will be completed with success status.
STATUS_PENDING
The WSK subsystem could not bind the socket immediately. The WSK subsystem will complete the IRP after it has bound the socket to the local transport address. The status of the bind operation will be returned in the IoStatus.Status field of the IRP.
STATUS_FILE_FORCED_CLOSED
The socket is no longer functional. The IRP will be completed with failure status. The WSK application must call the WskCloseSocket function to close the socket as soon as possible.
Other status codes
An error occurred. The IRP will be completed with failure status.

-remarks

For a listening socket, calling the WskBind function prepares the socket to listen for incoming connection requests on the specified local transport address. If a WSK application specifies a local wildcard address, the socket will listen for incoming connection requests on all local transport addresses.

For a datagram socket, calling the WskBind function prepares the socket to send and receive datagrams on the specified local transport address. If a WSK application specifies a local wildcard address, the socket will receive datagrams on all local transport addresses and will send datagrams from the appropriate local transport address that is determined by the system's routing information.

For a connection-oriented socket, calling the WskBind function binds the socket to the specified local transport address. WskBind must be called prior to calling the WskConnect function. If a WSK application specifies a local wildcard address, the network stack binds the socket to the appropriate local transport address when the application calls WskConnect to connect the socket to a remote transport address. In such a situation, the local transport address is determined by the system's routing information.

For a stream socket, calling the WskBind function binds the socket to the specified local transport address. If a WSK application specifies a local wildcard address, the network stack binds the socket to an available local transport address. WskBind must be called prior to calling the WskListen or the WskConnect functions.

-see-also

SOCKADDR

WSK_PROVIDER_CONNECTION_DISPATCH WSK_PROVIDER_DATAGRAM_DISPATCH

WSK_PROVIDER_LISTEN_DISPATCH

WSK_PROVIDER_STREAM_DISPATCH

WSK_SOCKET

WskCloseSocket

WskConnect

WskSocket