WskCaptureProviderNPI function

The WskCaptureProviderNPI function captures a provider Network Programming Interface (NPI) when it becomes available from the WSK subsystem.


NTSTATUS WskCaptureProviderNPI(
  PWSK_REGISTRATION WskRegistration,
  ULONG             WaitTimeout,



A pointer to the memory location initialized by WskRegister that identifies a WSK application's registration instance. For more information, see WSK_REGISTRATION.


The time, in milliseconds, that the WskCaptureProviderNPI function can wait until the WSK provider NPI becomes available. Alternately, the following can be specified:


Return from this function immediately if the provider NPI is not available.


Wait until the provider NPI is available from the WSK subsystem.

For more information about how this parameter is used, see Registering a Winsock Kernel Application.


A pointer to the NPI returned by the WSK provider. This WSK_PROVIDER_NPI structure contains a pointer to the WSK provider dispatch table of WSK functions that the WSK application can call.

Return Value

WskCaptureProviderNPI returns one of the following NTSTATUS codes:

Return code Description
The provider NPI capture completed successfully.
The provider NPI was not yet available.
The version requested by the WSK client is not supported by the WSK subsystem.
Other status codes
The provider NPI capture failed.


For each call to WskCaptureProviderNPI that returns a success code, there must be exactly one corresponding WskReleaseProviderNPI call that uses the same WskRegistration parameter that was passed to WskCaptureProviderNPI.

WskCaptureProviderNPI can be called after a call is made to WskDeregister only if the WskRegistration block is not freed or overwritten. After WskDeregister is called, any further calls to WskCaptureProviderNPI will fail with status code STATUS_DEVICE_NOT_READY, and, unless the provider NPI becomes available concurrently, any existing WskCaptureProviderNPI calls that are blocked in other threads waiting for the WSK provider NPI to become available will also return immediately with status code STATUS_DEVICE_NOT_READY.

For more information about attaching a WSK application to the WSK subsystem, see Registering a Winsock Kernel Application.

Callers of the WskCaptureProviderNPI function must be running at IRQL = PASSIVE_LEVEL if WaitTimeout is not set to WSK_NO_WAIT; otherwise, callers must be running at IRQL <= DISPATCH_LEVEL.


Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Target Platform Universal
Header wsk.h (include Wsk.h)
Library Netio.lib
IRQL PASSIVE_LEVEL (see Remarks section)

See Also