NSPCleanup

The NSPCleanup function terminates the use of a particular Windows Sockets name space service provider.

int NSPCleanup (
  LPGUID lpProviderId  
);
 

Parameters

lpProviderId
[in] A pointer to the GUID of the name space provider that is to be terminated.

Remarks

The NSPCleanup function is called when an application is finished using a Windows Sockets name space service provider. The NSPCleanup function deregisters a particular name space provider and allows the transport service provider to free any of the the name space provider's allocated resources.

The NSPStartup function must be called successfully before using any name space providers. It is permissible to make more than one NSPStartup call. However, for each NSPStartup call, a corresponding NSPCleanup call must also be issued. Only the final NSPCleanup for the service provider does the actual cleanup; the preceding calls simply decrement an internal reference count in the service provider.

This function should not return until the name space service provider DLL can be unloaded from memory.

Return Values

If no error occurs, NSPCleanup returns a value of NO_ERROR (zero). Otherwise, SOCKET_ERROR (-1) is returned and the provider must set the appropriate error code using SetLastError.

Error Codes

WSAEINVAL The lpProviderId does not specify a valid provider.
WSA_NOT_ENOUGH_MEMORY Not enough free memory available to perform this operation.