NDK_FN_ACCEPT - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ndkpi.h

NDK_FN_ACCEPT NdkFnAccept;

NTSTATUS NdkFnAccept(
  [in]                                      NDK_CONNECTOR *pNdkConnector,
  [in]                                      NDK_QP *pNdkQp,
  [in]                                      ULONG InboundReadLimit,
  [in]                                      ULONG OutboundReadLimit,
  [_In_reads_bytes_opt_(PrivateDataLength)] const PVOID pPrivateData,
  [in]                                      ULONG PrivateDataLength,
  [in, optional]                            NDK_FN_DISCONNECT_EVENT_CALLBACK DisconnectEvent,
  [in, optional]                            PVOID DisconnectEventContext,
  [in]                                      NDK_FN_REQUEST_COMPLETION RequestCompletion,
  [in, optional]                            PVOID RequestContext
)
{...}

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-ndkpi-ndk_fn_accept)

NDK_FN_ACCEPT callback function

Description

The NdkAccept (NDK_FN_ACCEPT) function accepts an incoming connection request over a listener object.

Parameters

pNdkConnector [in]

A pointer to an NDK connector object (NDK_CONNECTOR).

pNdkQp [in]

A pointer to an NDK queue pair (QP) object (NDK_QP) to associate with the connection.

InboundReadLimit [in]

The consumer-supplied maximum number of incoming in-progress read operations to allow on the QP. If the underlying provider has a lower MaxInboundReadLimit value in the NDK_ADAPTER_INFO structure, then the provider will cap the consumer-supplied value to the provider maximum. If the peer has a lower OutboundReadLimit value, then the provider will use that value as the effective InboundReadLimit. The consumer can retrieve the effective InboundReadLimit by calling the NdkGetConnectionData function (NDK_FN_GET_CONNECTION_DATA).

OutboundReadLimit [in]

The consumer-supplied maximum number of outgoing in-progress read operations to allow on the QP. If the underlying provider has a lower MaxOutboundReadLimit value in the NDK_ADAPTER_INFO structure, then the provider will cap the consumer supplied value to the provider maximum. If the peer has a lower InboundReadLimit, then the provider will use that value as the effective OutboundReadLimit. The consumer can retrieve the effective OutboundReadLimit by calling the NdkGetConnectionData function (NDK_FN_GET_CONNECTION_DATA).

pPrivateData [_In_reads_bytes_opt_(PrivateDataLength)]

A pointer to private data that is sent back with the accept request.

PrivateDataLength [in]

The length, in bytes, of the private data that is provided in the pPrivateData parameter.

DisconnectEvent [in, optional]

An entry point for an optional disconnect notification callback function NdkDisconnectEventCallback (NDK_FN_DISCONNECT_EVENT_CALLBACK). The provider calls this callback function when the peer disconnects.

DisconnectEventContext [in, optional]

A context value to pass to the DisconnectEventContext parameter of the callback function that is specified in the DisconnectEvent parameter.

RequestCompletion [in]

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

RequestContext [in, optional]

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

Return value

The NDK_FN_ACCEPT function returns one of the following NTSTATUS codes.

Return code Description
STATUS_SUCCESS The operation completed successfully.
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_CONNECTION_ABORTED The connecting peer abandoned the pending connection establishment.
STATUS_IO_TIMEOUT The peer did not call the CompleteConnect (NDK_FN_COMPLETE_CONNECT) function to complete the pending connection request.
Other status codes An error occurred.

Remarks

The NDK consumer calls NdkAccept to accept an incoming connection request over a listener object.

The NdkCreateListener (NDK_FN_CREATE_LISTENER) function creates an NDK listener object and provides an NdkConnectEventCallback function (NDK_FN_CONNECT_EVENT_CALLBACK).

The NdkConnectEventCallback function is used by the NDK provider to notify the consumer about each incoming connection request.

See also

NDKPI Object Lifetime Requirements

NDK_ADAPTER_INFO

NDK_CONNECTOR

NDK_CONNECTOR_DISPATCH

NDK_FN_COMPLETE_CONNECT

NDK_FN_CONNECT_EVENT_CALLBACK

NDK_FN_CREATE_LISTENER

NDK_FN_DISCONNECT_EVENT_CALLBACK

NDK_FN_GET_CONNECTION_DATA

NDK_FN_REJECT

NDK_FN_REQUEST_COMPLETION

NDK_QP