NSPV2_ROUTINE structure (ws2spi.h)

The NSPV2_ROUTINE structure contains information on the functions implemented by a namespace service provider version-2 (NSPv2) provider.

Note  The Ws2spi.h header file structure contains complete prototypes for all the NSPV2 function pointers.

 

Syntax

typedef struct _NSPV2_ROUTINE {
  DWORD                       cbSize;
  DWORD                       dwMajorVersion;
  DWORD                       dwMinorVersion;
  LPNSPV2STARTUP              NSPv2Startup;
  LPNSPV2CLEANUP              NSPv2Cleanup;
  LPNSPV2LOOKUPSERVICEBEGIN   NSPv2LookupServiceBegin;
  LPNSPV2LOOKUPSERVICENEXTEX  NSPv2LookupServiceNextEx;
  LPNSPV2LOOKUPSERVICEEND     NSPv2LookupServiceEnd;
  LPNSPV2SETSERVICEEX         NSPv2SetServiceEx;
  LPNSPV2CLIENTSESSIONRUNDOWN NSPv2ClientSessionRundown;
} NSPV2_ROUTINE, *PNSPV2_ROUTINE, *LPNSPV2_ROUTINE;

Members

cbSize

Type: DWORD

The size, in bytes, of the structure.

dwMajorVersion

Type: DWORD

The major version of the service provider specification supported by this provider.

dwMinorVersion

Type: DWORD

The minor version of the service provider specification supported by this provider.

NSPv2Startup

Type: ** LPNSPV2STARTUP**

A pointer to the NSPv2Startup function for this NSPv2 provider.

NSPv2Cleanup

Type: LPNSPV2CLEANUP

A pointer to the NSPv2Cleanup function for this NSPv2 provider.

NSPv2LookupServiceBegin

Type: LPNSPV2LOOKUPSERVICEBEGIN

A pointer to the NSPv2LookupServiceBegin function for this NSPv2 provider.

NSPv2LookupServiceNextEx

Type: LPNSPV2LOOKUPSERVICENEXTEX

A pointer to the NSPv2LookupServiceNextEx function for this NSPv2 provider.

NSPv2LookupServiceEnd

Type: LPNSPV2LOOKUPSERVICEEND

A pointer to the NSPv2LookupServiceEnd function for this NSPv2 provider.

NSPv2SetServiceEx

Type: LPNSPV2SETSERVICEEX

A pointer to the NSPv2SetServiceEx function for this NSPv2 provider.

NSPv2ClientSessionRundown

Type: LPNSPV2CLIENTSESSIONRUNDOWN

A pointer to the NSPv2ClientSessionRundown function for this NSPv2 provider.

Remarks

The NSPV2_ROUTINE structure 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 NSPV2_ROUTINE structure can only be used for operations on NS_EMAIL namespace providers.

The WSAAdvertiseProvider function advertises an instance of a NSPv2 provider for clients to find. The WSAAdvertiseProvider caller passes a pointer to an NSPV2_ROUTINE structure in the pNSPv2Routine parameter with the NSPv2 entry points supported by the provider.

A NSPv2 provider is required to implement the following functions:

NSPv2LookupServiceBegin

- NSPv2LookupServiceNextEx

- NSPv2LookupServiceEnd

All other functions are optional, dependent on the requirements of the NSPv2 provider.

If a 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 function in the NSPV2_ROUTINE structure should point be to the stub function.

In general, NSPv2 providers are implemented in processes other than the calling applications. NSPv2 providers are not activated as a result of client activity. Each provider hosting application decides when to make a specific provider available or unavailable by calling the WSAAdvertiseProvider and WSAUnadvertiseProvider functions. The client activity only results in attempts to contact the provider, when available (when the namespace provider is advertised).

A process can implement and advertise multiple providers at the same time. Windows Sockets will manage the namespace providers by dispatching calls to the correct one. It will also hide RPC interface details and translates cross-process calls into in-process calls. So that the NSPv2 provider has only to implement a table of entry point functions similar to the NSP_ROUTINE structure used by an NSPv1 provider. A NSPv2 provider does not have to worry about RPC specific requirements (data marshalling and serialization, for example).

The WSAUnadvertiseProvider function makes a specific namespace provider no longer available for clients.

Requirements

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

See also

NSP_ROUTINE

NSPv2Cleanup

NSPv2ClientSessionRundown

NSPv2LookupServiceBegin

NSPv2LookupServiceEnd

NSPv2LookupServiceNextEx

NSPv2SetServiceEx

NSPv2Startup

WSAAdvertiseProvider

WSAProviderCompleteAsyncCall

WSAQUERYSET2

WSAUnadvertiseProvider