|
WSAEnumProtocols
The Windows Sockets WSAEnumProtocols function retrieves information about available transport protocols.
int WSAEnumProtocols (
LPINT lpiProtocols,
|
| LPWSAPROTOCOL_INFO lpProtocolBuffer,
|
| ILPDWORD lpdwBufferLength
|
| );
|
|
Parameters
lpiProtocols
[in] A NULL-terminated array of iProtocol values. This parameter is optional;
if lpiProtocols is NULL, information on all available protocols is returned. Otherwise,
information is retrieved only for those protocols listed in the array.
lpProtocolBuffer
[out] A buffer which is filled with WSAPROTOCOL_INFO structures. See below for
a detailed description of the contents of the WSAPROTOCOL_INFO structure.
lpdwBufferLength
[in/out] On input, the count of bytes in the lpProtocolBuffer buffer passed to WSAEnumProtocols. On output, the minimum buffer size that can be passed to WSAEnumProtocols to retrieve all the requested information. This routine has no ability to
enumerate over multiple calls; the passed-in buffer must be large enough to hold
all entries in order for the routine to succeed. This reduces the complexity of
the API and should not pose a problem because the number of protocols loaded on
a machine is typically small.
Remarks
This function is used to discover information about the collection of
transport protocols and protocol chains installed on the local machine. Since layered
protocols are only usable by applications when installed in protocol chains,
information on layered protocols is not included in lpProtocolBuffer. The lpiProtocols parameter can be used as a filter to constrain the amount of information
provided. Normally it will be supplied as a NULL pointer which will cause the
routine to return information on all available transport protocols and protocol
chains.
A WSAPROTOCOL_INFO structure is provided in the buffer pointed to by lpProtocolBuffer for each requested protocol. If the supplied buffer is not large enough (as
indicated by the input value of lpdwBufferLength ), the value pointed to by lpdwBufferLength will be updated to indicate the required buffer size. The application should
then obtain a large enough buffer and call this function again.
The order in which the WSAPROTOCOL_INFO structures appear in the buffer
coincides with the order in which the protocol entries were registered by the service
provider with the Windows Sockets DLL, or with any subsequent re-ordering that
may have occurred through the Windows Sockets applet supplied for establishing
default TCP/IP providers.
Return Values
If no error occurs, WSAEnumProtocols returns the number of protocols to be reported on. Otherwise, a value of
SOCKET_ERROR is returned and a specific error code may be retrieved by calling WSAGetLastError.
Error Codes
WSANOTINITIALISED
| A successful WSAStartup must occur before using this function.
| WSAENETDOWN
| The network subsystem has failed.
| WSAEINPROGRESS
| A blocking Windows Sockets 1.1 call is in progress.
| WSAEINVAL
| Indicates that one of the specified parameters was invalid.
| WSAENOBUFS
| The buffer length was too small to receive all the relevant WSAPROTOCOL_INFO
structures and associated information. Pass in a buffer at least as large as the
value returned in lpdwBufferLength.
|
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|