PFN_WSK_SEND - NtDoc

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

PFN_WSK_SEND PfnWskSend;

NTSTATUS PfnWskSend(
  [in]      PWSK_SOCKET Socket,
  [in]      PWSK_BUF Buffer,
  [in]      ULONG Flags,
  [in, out] PIRP Irp
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-wsk-pfn_wsk_send)

PFN_WSK_SEND callback function

Description

The WskSend function sends data over a connection-oriented or stream socket to a remote transport address.

Parameters

Socket [in]

A pointer to a WSK_SOCKET structure that specifies the socket object for the socket over which to send the data.

Buffer [in]

A pointer to an initialized WSK_BUF structure that describes the data buffer that contains the data that is being sent over the socket.

Flags [in]

A ULONG value that contains a bitwise OR of a combination of the following flags:

WSK_FLAG_NODELAY

Directs the underlying transport to immediately send the data, and any previously queued data, to the remote application without delay.

This flag is supported by the Microsoft TCP/IP transport protocol. This flag might not be supported by other transport protocols.

Irp [in, out]

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

Return value

WskSend returns one of the following NTSTATUS codes:

Return code Description
STATUS_SUCCESS Data was successfully sent over the socket. The IRP will be completed with success status. The IoStatus.Information field of the IRP contains the number of bytes that were sent.
STATUS_PENDING The WSK subsystem could not send the data over the socket immediately. The WSK subsystem will complete the IRP after it has sent the data over the socket. The status of the send operation will be returned in the IoStatus.Status field of the IRP. If the operation succeeds, the IoStatus.Information field of the IRP will contain the number of bytes that were sent.
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.
STATUS_NOT_SUPPORTED A specified flag is not supported by the underlying network transport.
Other status codes An error occurred. The IRP will be completed with failure status.

Remarks

A WSK application can call the WskSend function only on a connection-oriented or stream socket that has been previously connected to a remote transport address. A connection-oriented socket is connected to a remote transport address by one of the following methods:

If the WskSend function returns STATUS_PENDING, the MDL chain that is described in the WSK_BUF structure that is pointed to by the Buffer parameter must remain locked in memory until the IRP is completed.

The WSK subsystem does not perform any buffering of data when it sends data over a socket. Therefore, a call to the WskSend function will not be completed by the WSK subsystem until all of the data has actually been sent.

See also

WSK_BUF

WSK_PROVIDER_CONNECTION_DISPATCH

WSK_PROVIDER_STREAM_DISPATCH

WSK_SOCKET

WskCloseSocket

WskReceive

WskReceiveEvent