次の方法で共有


WSHEnumProtocols function

[ This function is obsolete for Windows Server 2003, Windows Vista, and later, and is no longer supported. ]

The WSHEnumProtocols function returns a set of PROTOCOL_INFO structures that inform the caller of the Win32 function EnumProtocols about protocols supported by this helper DLL.

Syntax

INT WSHEnumProtocols(
  _In_opt_ LPINT   lpiProtocols,
  _In_     LPWSTR  lpTransportKeyName,
  _Inout_  LPVOID  lpProtocolBuffer,
  _Inout_  LPDWORD lpdwBufferLength
);

Parameters

  • lpiProtocols [in, optional]
    Optionally specifies a filter that selects 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 null-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 [in]
    Pointer 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 [in, out]
    Pointer 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 [in, out]
    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.

Requirements

Target platform

Desktop

Header

Wsahelp.h (include Wsahelp.h)

Library

Wshisotp.lib

 

 

Send comments about this topic to Microsoft