Platform SDK: Windows Sockets

NSPStartup

The NSPStartup function retrieves the dynamic information about a provider, such as the list of the DLL entry points.

This function is called by the client upon initialization. NSPStartup and NSPCleanup must be called as pairs. All the NSP functions must be called from within an NSPStartup/NSPCleanup pair. WSC functions do not need to be called from within an NSPStartup/NSPCleanup pair either.

int NSPStartup (
  LPGUID           lpProviderId,          
  LPNSP_ROUTINE    lpnspRoutines   
);

Parameters

lpProviderId
[in] Indicates the desired provider for which to return the entry points.
lpnspRoutines
[out] Pointer to all the provider entry points.

Data Types

The following data types are needed for this call.

NSP_ROUTINE
The NSP_ROUTINE structure contains information regarding all the functions implemented by a given provider.
typedef struct _NSP_ROUTINE { 
    DWORD        cbSize;
    DWORD        dwMajorVersion;
    DWORD        dwMinorVersion;
    INT ( *NSPCleanup) ;
    INT ( *NSPLookupServiceBegin) ;
    INT ( *NSPLookupServiceNext) ;
    INT ( *NSPLookupServiceEnd) ;
    INT ( *NSPSetService) ;
    INT ( *NSPInstallServiceClass) ;
    INT ( *NSPRemoveServiceClass) ;
    INT ( *NSPGetServiceClassInfo) ;
} NSP_ROUTINE, *PNSP_ROUTINE, *LPNSP_ROUTINE; 
cbSize
Size of this structure.
dwMajorVersion
Major version of the service provider specification supported by this provider.
dwMinorVersion
Minor version of the service provider specification supported by this provider.
*NSP*.*
Pointers to the various NSP functions. Every entry must point to a valid function. If the provider does not implement this function, it should simply return WSAENOTIMPLEMENTED.

Note  In the header file this structure contains complete prototypes for all the NSP pointers.

Return Values

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

WSAEINVAL One or more parameters were invalid or missing for this provider.
WSA_NOT_ENOUGH_MEMORY Not enough free memory available to perform this operation.

Requirements

  Version: Requires Windows Sockets 2.0.
  Header: Declared in Ws2spi.h.