NmrRegisterClient function (netioddk.h)

The NmrRegisterClient function registers a client module with the NMR.

Syntax

NTSTATUS NmrRegisterClient(
  [in]  PNPI_CLIENT_CHARACTERISTICS ClientCharacteristics,
  [in]  __drv_aliasesMem PVOID      ClientContext,
  [out] PHANDLE                     NmrClientHandle
);

Parameters

[in] ClientCharacteristics

A pointer to an NPI_CLIENT_CHARACTERISTICS structure that describes the characteristics of the client module. The client module must make sure that this structure remains valid and resident in memory as long as the client module is registered with the NMR.

[in] ClientContext

A pointer to a caller-supplied context for the registration. The client module uses this context to keep track of the state of the client registration. The contents of the client module's registration context are opaque to the NMR. The NMR passes this pointer to the client module whenever it calls the client module's ClientAttachProvider callback function. The client module must make sure that its registration context remains valid and resident in memory as long as the client module is registered with the NMR.

[out] NmrClientHandle

A pointer to a variable that receives a handle used by the NMR to represent the registration of the client module. The client module must save this handle and pass it as a parameter to the NmrDeregisterClient function when it deregisters from the NMR.

Return value

The NmrRegisterClient function returns one of the following NTSTATUS codes:

Return code Description
STATUS_SUCCESS
The NMR successfully registered the client module.
STATUS_INSUFFICIENT_RESOURCES
The NMR did not have sufficient system resources to register the client module.
Other status codes
An error occurred.

Remarks

A client module calls the NmrRegisterClient function to register as a client of an NPI so that it can attach to provider modules that register as providers of the same NPI.

A client module typically calls the NmrRegisterClient function from its DriverEntry function after it has completed all other initialization tasks. The call to the NmrRegisterClient function indicates to the NMR that the client module is ready to attach to any provider modules that have registered or will register as providers of the same NPI for which the client module has registered as a client.

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Target Platform Desktop
Header netioddk.h (include Wsk.h)
Library Netio.lib
IRQL PASSIVE_LEVEL

See also

DriverEntry

NPI_CLIENT_CHARACTERISTICS

NmrDeregisterClient