// wsk.h
PFN_WSK_CONTROL_CLIENT PfnWskControlClient;
NTSTATUS PfnWskControlClient(
[in] PWSK_CLIENT Client,
[in] ULONG ControlCode,
[in] SIZE_T InputSize,
[in, optional] PVOID InputBuffer,
[in] SIZE_T OutputSize,
[out, optional] PVOID OutputBuffer,
[out, optional] SIZE_T *OutputSizeReturned,
[in, out] PIRP Irp
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The WskControlClient function performs control operations on a WSK client object.
Client [in]A pointer to a WSK_CLIENT structure that was returned through the WskProviderNpi parameter of the WskCaptureProviderNPI function.
ControlCode [in]The control operation that is being performed. A WSK application can specify one of the following control codes:
Retrieve a list of available network transports.
Receive notification of a change to the list of available network transports.
Obtain a cached copy of a security descriptor.
Release a cached copy of a security descriptor.
Enable specified event callback functions automatically on all sockets.
Map combinations of address family, socket type, and protocol to device names of TDI transports.
Control whether the WSK subsystem will divert network I/O to TDI transports.
InputSize [in]The number of bytes of data in the buffer that is pointed to by the InputBuffer parameter.
InputBuffer [in, optional]A caller-allocated buffer that supplies any input data that is required to perform the specified control operation. If no input data is required for the specified control operation, the WSK application should set this parameter to NULL and set the InputSize parameter to zero.
OutputSize [in]The size, in bytes, of the buffer that is pointed to by the OutputBuffer parameter.
OutputBuffer [out, optional]A caller-allocated buffer that receives any output data that is returned by the specified control operation. If no output data is returned by the specified control operation, the WSK application should set this parameter to NULL and set the OutputSize parameter to zero.
OutputSizeReturned [out, optional]A pointer to a ULONG-typed variable that receives the number of bytes of data that is returned in the buffer that is pointed to by the OutputBuffer parameter. A WSK application should set this pointer to NULL except when all of the following are true:
Irp [in, out]A pointer to a caller-allocated IRP that the WSK subsystem uses to complete the control operation asynchronously. For more information about using IRPs with WSK functions, see Using IRPs with Winsock Kernel Functions.
This parameter is required, is optional, or must be NULL, depending on the particular client control operation that is being performed. For more information about the requirements for this parameter for each of the supported client control operations, see WSK Client Control Operations.
WskControlClient returns one of the following NTSTATUS codes:
| Return code | Description |
|---|---|
| STATUS_SUCCESS | The control operation completed successfully. If the WSK application specified a pointer to an IRP in the _Irp_ parameter, the IRP will be completed with success status. |
| STATUS_PENDING | The WSK subsystem could not complete the control operation immediately. The WSK subsystem will complete the IRP after it has completed the control operation. The status of the control operation will be returned in the IoStatus.Status field of the IRP. |
| STATUS_BUFFER_OVERFLOW | The output buffer is not large enough to contain the returned data. The variable that is pointed to by the _OutputSizeReturned_ parameter contains the required buffer size. |
| Other status codes | An error occurred. The IRP will be completed with failure status. |
For more information about how the input and output buffers are used for each client control operation, see WSK Client Control Operations.
If the WskControlClient function returns STATUS_PENDING, any buffers that are pointed to by the InputBuffer parameter or the OutputBuffer parameter must remain valid until the IRP is completed. If the WSK application allocated the buffers with one of the ExAllocate*Xxx* functions, it cannot free the memory with the corresponding ExFree*Xxx* function until after the IRP is completed. If the WSK application allocated the buffers on the stack, it cannot return from the function that calls the WskControlClient function until after the IRP is completed.
Note TDI will not be supported in Microsoft Windows versions after Windows Vista. Use Windows Filtering Platform or Winsock Kernel instead.