WskCaptureProviderNPI function

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

Syntax


NTSTATUS WskCaptureProviderNPI(
  _In_   PWSK_REGISTRATION WskRegistration,
  _In_   ULONG WaitTimeout,
  _Out_  PWSK_PROVIDER_NPI WskProviderNpi
);

Parameters

WskRegistration [in]

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

WaitTimeout [in]

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

WSK_NO_WAIT

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

WSK_INFINITE_WAIT

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.

WskProviderNpi [out]

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 codeDescription
STATUS_SUCCESS

The provider NPI capture completed successfully.

STATUS_DEVICE_NOT_READY

The provider NPI was not yet available.

STATUS_NOINTERFACE

The version requested by the WSK client is not supported by the WSK subsystem.

Other status codes

The provider NPI capture failed.

 

Remarks

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.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Wsk.h (include Wsk.h)

Library

Netio.lib

IRQL

PASSIVE_LEVEL (see Remarks section)

See also

WskDeregister
WskRegister
WskReleaseProviderNPI

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.