NDK_FN_LISTEN callback function (ndkpi.h)

The NdkListen (NDK_FN_LISTEN) function puts an NDK listener object into listening mode.

Syntax

NDK_FN_LISTEN NdkFnListen;

NTSTATUS NdkFnListen(
  [in]           NDK_LISTENER *pNdkListener,
                 const PSOCKADDR pAddress,
  [in]           ULONG AddressLength,
  [in]           NDK_FN_REQUEST_COMPLETION RequestCompletion,
  [in, optional] PVOID RequestContext
)
{...}

Parameters

[in] pNdkListener

A pointer to an NDK listener object (NDK_LISTENER).

pAddress

A local address to listen on. For AF_INET or AF_INET6 pAddress contains the local IP address and local ND port.

[in] AddressLength

The size, in bytes, of local address data at the pAddress parameter.

[in] RequestCompletion

A pointer to a request completion callback routine NdkRequestCompletion (NDK_FN_REQUEST_COMPLETION).

[in, optional] RequestContext

A context value to pass to the Context parameter of the callback function that is specified in the RequestCompletion parameter.

Return value

The NdkListen function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS
The listen request succeeded.
STATUS_PENDING
The operation is pending and will be completed later. The driver will call the specified RequestCompletion (NDK_FN_REQUEST_COMPLETION) function to complete the pending operation.
STATUS_INSUFFICIENT_RESOURCES
The request failed due to insufficient resources.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_SHARING_VIOLATION
The request failed because the specified local address is already in use.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_INVALID_ADDRESS
The request failed because the specified local address is not a valid address for the adapter.
Important  The request can fail inline as well as asynchronously with this status code.
 
STATUS_TOO_MANY_ADDRESSES
The request failed because the consumer specified a local port number of zero, and the Network Direct provider was unable to allocate a port from the ephemeral port space (ports 49152-65535.)
Other status codes
An error occurred.

Remarks

NdkListen puts a listener object into listening mode on the specified local address.

Requirements

Requirement Value
Minimum supported client None supported,Supported in NDIS 6.30 and later.
Minimum supported server Windows Server 2012
Target Platform Windows
Header ndkpi.h (include Ndkpi.h)
IRQL <=DISPATCH_LEVEL

See also

NDKPI Object Lifetime Requirements

NDK_FN_REQUEST_COMPLETION

NDK_LISTENER