Expand Minimize

WSAEnumNameSpaceProvidersEx function

The WSAEnumNameSpaceProvidersEx function retrieves information on available namespace providers.

Syntax


INT WSPAPI WSAEnumNameSpaceProvidersEx(
  _Inout_  LPDWORD lpdwBufferLength,
  _Out_    LPWSANAMESPACE_INFOEX lpnspBuffer
);

Parameters

lpdwBufferLength [in, out]

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 WSAEnumNameSpaceProvidersEx must be sufficient to hold all of the namespace information.

lpnspBuffer [out]

A buffer that is filled with WSANAMESPACE_INFOEX 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 WSAEnumNameSpaceProvidersEx.

Return value

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

Error codeMeaning
WSAEFAULT

The lpnspBuffer parameter was a NULL pointer or the buffer length, lpdwBufferLength, was too small to receive all the relevant WSANAMESPACE_INFOEX structures and associated information. When this error is returned, the buffer length required is returned in the lpdwBufferLength parameter.

WSANOTINITIALISED

The WS2_32.DLL has not been initialized. The application must first call WSAStartup before calling any Windows Sockets functions.

WSA_NOT_ENOUGH_MEMORY

There was insufficient memory to perform the operation.

 

Remarks

The WSAEnumNameSpaceProvidersEx function is an enhanced version of the WSAEnumNameSpaceProviders function. The provider-specific data blob associated with the namespace entry passed in the lpProviderInfo parameter to the WSCInstallNameSpaceEx function can be queried using WSAEnumNameSpaceProvidersEx function.

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

When UNICODE or _UNICODE is defined, WSAEnumNameSpaceProvidersEx is defined to WSAEnumNameSpaceProvidersExW, the Unicode version of this function. The lpnspBuffer parameter is defined to the LPSAWSANAMESPACE_INFOEXW data type and WSANAMESPACE_INFOEXW structures are returned on success.

When UNICODE or _UNICODE is not defined, WSAEnumNameSpaceProvidersEx is defined to WSAEnumNameSpaceProvidersExA, the ANSI version of this function. The lpnspBuffer parameter is defined to the LPSAWSANAMESPACE_INFOEXA data type and WSANAMESPACE_INFOEXA structures are returned on success.

Windows 8.1 and Windows Server 2012 R2: The WSAEnumNameSpaceProvidersExW function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

Requirements

Minimum supported client

Windows 8.1, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Winsock2.h

Library

Ws2_32.lib

DLL

Ws2_32.dll

Unicode and ANSI names

WSAEnumNameSpaceProvidersExW (Unicode) and WSAEnumNameSpaceProvidersExA (ANSI)

See also

NAPI_PROVIDER_INSTALLATION_BLOB
WSAEnumNameSpaceProviders
WSANAMESPACE_INFOEX
WSCEnumNameSpaceProvidersEx32
WSCInstallNameSpaceEx32

 

 

Community Additions

ADD
Show:
© 2014 Microsoft