Click to Rate and Give Feedback
MSDN
MSDN Library
Networking
Network Protocols
IP Helper
IP Helper Reference
IP Helper Functions
 GetPerAdapterInfo Function
GetPerAdapterInfo Function

The GetPerAdapterInfo function retrieves information about the adapter corresponding to the specified interface.

Syntax

DWORD GetPerAdapterInfo(
  __in   ULONG IfIndex,
  __out  PIP_PER_ADAPTER_INFO pPerAdapterInfo,
  __in   PULONG pOutBufLen
);

Parameters

IfIndex [in]

Index of an interface. The GetPerAdapterInfo function retrieves information for the adapter corresponding to this interface.

pPerAdapterInfo [out]

Pointer to an IP_PER_ADAPTER_INFO structure that receives information about the adapter.

pOutBufLen [in]

Pointer to a ULONG variable that specifies the size of the IP_PER_ADAPTER_INFO structure. If this size is insufficient to hold the information, GetPerAdapterInfo fills in this variable with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW.

Return Value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes.

Return codeDescription

ERROR_BUFFER_OVERFLOW

The buffer size indicated by the pOutBufLen parameter is too small to hold the adapter information. The pOutBufLen parameter points to the required size.

ERROR_INVALID_PARAMETER

The pOutBufLen parameter is NULL, or the calling process does not have read/write access to the memory pointed to by pOutBufLen, or the calling process does not have write access to the memory pointed to by the pAdapterInfo parameter.

ERROR_NOT_SUPPORTED

GetPerAdapterInfo is not supported by the operating system running on the local computer.

Other

If the function fails, use FormatMessage to obtain the message string for the returned error.


Remarks

An adapter index may change when the adapter is disabled and then enabled, or under other circumstances, and should not be considered persistent.

Requirements

ClientRequires Windows Vista, Windows XP, or Windows 2000 Professional.
ServerRequires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
HeaderDeclared in Iphlpapi.h.
LibraryUse Iphlpapi.lib.
DLLRequires Iphlpapi.dll.

See Also

IP Helper Start Page
IP Helper Function Reference
IP_PER_ADAPTER_INFO


Send comments about this topic to Microsoft

Build date: 9/25/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker