WskRegister function

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

WskClientNpi [in]

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

WskRegistration [out]

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

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 also

WskDeregister
WSK_CLIENT_NPI
WSK_REGISTRATION

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft