WSCEnumNameSpaceProvidersEx32 function (ws2spi.h)

The WSCEnumNameSpaceProvidersEx32 function retrieves information on available 32-bit namespace providers.


INT WSAAPI WSCEnumNameSpaceProvidersEx32(
  [in, out] LPDWORD                lpdwBufferLength,
  [out]     LPWSANAMESPACE_INFOEXW lpnspBuffer


[in, out] lpdwBufferLength

On input, the number of bytes contained in the buffer pointed to by lpnspBuffer. On output (if the function fails, and the error is WSAEFAULT), the minimum number of bytes to allocate for the lpnspBuffer buffer to allow it to retrieve all the requested information. The buffer passed to WSCEnumNameSpaceProvidersEx32 must be sufficient to hold all of the namespace information.

[out] lpnspBuffer

A buffer that is filled with WSANAMESPACE_INFOEXW structures. The returned structures are located consecutively at the head of the buffer. Variable sized information referenced by pointers in the structures point to locations within the buffer located between the end of the fixed sized structures and the end of the buffer. The number of structures filled in is the return value of WSCEnumNameSpaceProvidersEx32.

Return value

The WSCEnumNameSpaceProvidersEx32 function returns the number of WSANAMESPACE_INFOEXW structures copied into lpnspBuffer. Otherwise, the value SOCKET_ERROR is returned, and a specific error number can be retrieved by calling WSAGetLastError.

Error code Meaning
The buffer length was too small to receive all the relevant WSANAMESPACE_INFOEXW structures and associated information or the lpnspBuffer parameter was a **NULL** pointer. When this error is returned, the buffer length required is returned in the lpdwBufferLength parameter.
The WS2_32.DLL has not been initialized. The application must first call WSAStartup before calling any Windows Sockets functions.
There was insufficient memory to perform the operation.


WSCEnumNameSpaceProvidersEx32 is a strictly 32-bit version of WSAEnumNameSpaceProvidersEx. On a 64-bit computer, all calls not specifically 32-bit (for example, all functions that do not end in "32") operate on the native 64-bit catalog. Processes that execute on a 64-bit computer must use the specific 32-bit function calls to operate on a strictly 32-bit catalog and preserve compatibility. The definitions and semantics of the specific 32-bit calls are the same as their native counterparts.

Currently, the only namespace included with Windows that uses information in the ProviderSpecific member of the WSANAMESPACE_INFOEXW structure are namespace providers for the NS_EMAIL namespace. The format of the ProviderSpecific member for an NS_EMAIL namespace provider is a NAPI_PROVIDER_INSTALLATION_BLOB structure.

The 32-bit SPI function is equivalent to the native API function (WSAEnumNameSpaceProvidersEx) because there is no concept of a "hidden" namespace provider.

The provider-specific data blob associated with namespace entry passed in the lpProviderInfo parameter to the WSCInstallNameSpaceEx32 function can be queried using WSCEnumNameSpaceProvidersEx32 function.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header ws2spi.h
Library Ws2_32.lib
DLL Ws2_32.dll

See also