NPI_CLIENT_DETACH_PROVIDER_FN callback function (netioddk.h)

A client module's ClientDetachProvider callback function detaches the client module from a provider module.

Syntax

NPI_CLIENT_DETACH_PROVIDER_FN NpiClientDetachProviderFn;

NTSTATUS NpiClientDetachProviderFn(
  [in] PVOID ClientBindingContext
)
{...}

Parameters

[in] ClientBindingContext

A pointer to the client module's context for the binding between the client module and the provider module from which it is detaching. The client module passes this pointer to the NMR when it calls the NmrClientAttachProvider function to attach to the provider module.

Return value

A client module's ClientDetachProvider callback function returns one of the following NTSTATUS codes:

Return code Description
STATUS_SUCCESS
The client module successfully detached from the provider module.
STATUS_PENDING
The client module could not detach from the provider module immediately.

Remarks

The NMR calls a client module's ClientDetachProvider callback function whenever the binding between the client module and a provider module needs to be terminated. Detachment is initiated by either the client module calling the NmrDeregisterClient function or the provider module calling the NmrDeregisterProvider function.

After its ClientDetachProvider callback function has been called, a client module should not make any more calls to any of the provider module's NPI functions. If there are no in-progress calls to any of the provider module's NPI functions when the client module's ClientDetachProvider callback function is called, the client module's ClientDetachProvider callback function returns STATUS_SUCCESS.

If there are in-progress calls to one or more of the provider module's NPI functions when the client module's ClientDetachProvider callback function is called, then the client module's ClientDetachProvider callback function returns STATUS_PENDING. In this situation, the client module must call the NmrClientDetachProviderComplete function after all in-progress calls to the provider module's NPI functions have completed. The call to the NmrClientDetachProviderComplete function notifies the NMR that detachment from the provider module is complete.

The NMR calls the client module's ClientCleanupBindingContext callback function and the provider module's ProviderCleanupBindingContext callback function after both the client module and the provider module have completed detachment from each other.

The NMR calls a client module's ClientDetachProvider callback function at any IRQL <= DISPATCH_LEVEL.

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Target Platform Windows
Header netioddk.h (include Wsk.h)
IRQL <= DISPATCH_LEVEL

See also

ClientCleanupBindingContext

NPI_CLIENT_CHARACTERISTICS

NmrClientAttachProvider

NmrClientDetachProviderComplete

NmrDeregisterClient

NmrDeregisterProvider

ProviderCleanupBindingContext