INT
WSHEnumProtocols(
IN LPINT lpiProtocols OPTIONAL,
IN LPWSTR lpTransportKeyName,
IN OUT LPVOID lpProtocolBuffer,
IN OUT LPDWORD lpdwBufferLength
);
WSHEnumProtocols returns a set of PROTOCOL_INFO structures that inform the caller of the Win32 function EnumProtocols about protocols supported by this helper DLL.
Parameters
lpiProtocols
Optionally specifies a filter selecting information to be returned about the protocols supported by the helper DLL. If this is NULL, the helper DLL should return information for all protocols it supports.
Otherwise, lpiProtocols points to a zero-terminated array of protocol ID numbers. WSHEnumProtocols should return information only on protocols whose ID appears in the lpiProtocols array. Protocol ID numbers are the third parameter to the socket call (for example, IPPROTO_TCP).
lpTransportKeyName
Points to a buffer that contains the name of the registry key that Windows Sockets uses to access this helper DLL. This parameter can be irrelevant; it is useful only if the helper DLL supports protocols that set up several registry keys.
lpProtocolBuffer
Points to the output buffer in which WSHEnumProtocols returns the requested set of PROTOCOL_INFO structures. The PROTOCOL_INFO structures must be copied into this buffer as a contiguous array starting at the beginning of the buffer. Variable-length data, such as the protocol name pointed to by the PROTOCOL_INFO structure’s lpProtocol member must be written at the end of the buffer.
lpdwBufferLength
On input, points to a variable specifying the total length in bytes of the buffer at lpProtocolBuffer. On output, this variable is set to the number of bytes of information returned or available from WSHEnumProtocols for this call. If the given input buffer is too small, WSHEnumProtocols sets the value at lpdwBufferLength to the number of bytes of available information before it returns control.
Return Value
WSHEnumProtocols either returns a count of PROTOCOL_INFO structures written to the buffer at lpProtocolBuffer, or it returns SOCKET_ERROR if there was an error. If -1 is returned, WSHEnumProtocols must call SetLastError to set the Windows Sockets error code of the error which occurred.