// netioddk.h
NPI_CLIENT_ATTACH_PROVIDER_FN NpiClientAttachProviderFn;
NTSTATUS NpiClientAttachProviderFn(
[in] HANDLE NmrBindingHandle,
[in] PVOID ClientContext,
[in] PNPI_REGISTRATION_INSTANCE ProviderRegistrationInstance
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
A client module's ClientAttachProvider callback function attaches the client module to a provider module.
NmrBindingHandle [in]A handle used by the NMR to represent the binding between the client module and the provider module.
ClientContext [in]A pointer to the client module's registration context. The client module passes this pointer to the NMR when it calls the NmrRegisterClient function to register itself with the NMR.
ProviderRegistrationInstance [in]A pointer to an NPI_REGISTRATION_INSTANCE structure. This structure contains the provider module's registration data.
A client module's ClientAttachProvider callback function returns one of the following NTSTATUS codes:
| Return code | Description |
|---|---|
| STATUS_SUCCESS | The client module and the provider module successfully attached to each other. |
| STATUS_NOINTERFACE | Either the client module did not attach to the provider module or the provider module did not attach to the client module. |
| Other status codes | An error occurred. |
After a client module has registered with the NMR, the NMR calls the client module's ClientAttachProvider callback function, once for each provider module that is registered as a provider of the same NPI for which the client module has registered as a client.
The NMR also calls a client module's ClientAttachProvider callback function whenever a new network module registers as a provider of the same NPI for which the client module has registered as a client.
A client module can examine the provider module's registration data. This data is in the structure pointed to by the ProviderRegistrationInstance parameter. The client module uses this data to determine whether it will attach to the provider module:
If the client module successfully attaches to the provider module, it must save the handle provided in the NmrBindingHandle parameter. The client module passes this handle as a parameter to the NmrClientDetachProviderComplete function when it detaches from the provider module.
The NMR calls a client module's ClientAttachProvider callback function at IRQL = PASSIVE_LEVEL.
NmrClientDetachProviderComplete