LPNSPV2CLIENTSESSIONRUNDOWN callback function (ws2spi.h)

The NSPv2ClientSessionRundown function notifies a namespace service provider version-2 (NSPv2) provider that the client session is terminating.

Syntax

LPNSPV2CLIENTSESSIONRUNDOWN Lpnspv2clientsessionrundown;

void Lpnspv2clientsessionrundown(
  [in] LPGUID lpProviderId,
  [in] LPVOID pvClientSessionArg
)
{...}

Parameters

[in] lpProviderId

A pointer to the GUID of the specific namespace provider to notify.

[in] pvClientSessionArg

A pointer to the client session that is terminating.

Return value

The function should return NO_ERROR (zero) if the routine succeeds. It should return SOCKET_ERROR (that is, 1) if the routine fails and it must set the appropriate error code using WSASetLastError.

Error code Meaning
WSA_NOT_ENOUGH_MEMORY
There is not enough memory available to perform this operation.
WSAEACCES
The calling routine does not have sufficient privileges to install the service.
WSAEINVAL
One or more parameters were invalid, or missing, for this provider.
WSAEOPNOTSUPP
The operation is not supported. This error is returned if the namespace provider does not implement this function. This error can also be returned if the specified dwControlCode is an unrecognized command.
WSASERVICE_NOT_FOUND
Service is unknown. The service cannot be found in the specified namespace.

Remarks

The NSPv2ClientSessionRundown function is used as part of the namespace service provider version-2 (NSPv2) architecture available on Windows Vista and later.

On Windows Vista and Windows Server 2008, the NSPv2ClientSessionRundown function can only be used for operations on NS_EMAIL namespace providers.

The NSPv2Startup function is called each time a new client process begins using namespace provider. Providers may use the client session argument pointed to by the ppvClientSessionArg parameter to store information about this session. If a value was specified for the client session argument in the call to the NSPv2Startup function, then this same client session argument is passed in the pvClientSessionArg parameter to the NSPv2ClientSessionRundown function.

The NSPv2Startup, NSPv2ClientSessionRundown, and NSPv2Cleanup functions are optional, dependent on the requirements of the NSPv2 provider.

If the NSPv2ClientSessionRundown function isn't implemented, then calls to that function should be intercepted by a stub function that returns WSAEOPNOTSUPP. The NSPv2 function pointer to the unimplemented NSPv2ClientSessionRundown function in the NSPV2_ROUTINE structure should point be to the stub function.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header ws2spi.h

See also

NSPV2_ROUTINE

NSPv2Cleanup

NSPv2LookupServiceBegin

NSPv2LookupServiceEnd

NSPv2LookupServiceNextEx

NSPv2SetServiceEx

NSPv2Startup

WSAQUERYSET2

WSASetLastError