WskRegister function (wsk.h)

The WskRegister function registers a WSK application, given the application's WSK client Network Programming Interface (NPI).

Syntax

NTSTATUS WskRegister(
  [in]  PWSK_CLIENT_NPI   WskClientNpi,
  [out] PWSK_REGISTRATION WskRegistration
);

Parameters

[in] WskClientNpi

A pointer to the client NPI implemented by the WSK application.

[out] WskRegistration

A pointer to a memory location that identifies a WSK application's registration instance. This memory location will be initialized by the WskRegister call and will be used by the other WSK registration functions. The WSK application should never change the contents of this memory location directly.

Return value

WskRegister returns one of the following NTSTATUS codes:

Return code Description
STATUS_SUCCESS
The registration succeeded.
Other status codes
The registration failed.

Remarks

A WSK client object can call this function multiple times, but a different WskRegistration parameter must be used for each call in order to create multiple registration instances.

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

The block of memory pointed to by WskRegistration must be kept allocated (must not be freed or go out of scope) as long as there are outstanding calls to other WSK registration functions.

Using the WskRegister and WskDeregister functions is the preferred method for registering and unregistering WSK applications. The Network Module Registrar remains available for compatibility.

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

Requirements

Requirement Value
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 also

WSK_CLIENT_NPI

WSK_REGISTRATION

WskDeregister