Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
IP Helper provides capabilities for managing network adapters. The functions described following are used to retrieve information about the network adapters in the local computer.
Interfaces are related to adapters in that there is a one-to-one correspondence between the interfaces and adapters on a given computer. An interface is an IP-level abstraction, whereas an adapter is a datalink-level abstraction.
The GetAdaptersInfofunction returns an array of IP_ADAPTER_INFOstructures, one for each adapter in the local computer. The GetPerAdapterInfofunction returns additional information about a specific adapter. The GetPerAdapterInfofunction requires the caller to specify the index of the adapter. To obtain the adapter index from the adapter name, use the GetAdapterIndexfunction.
The following table describes each GetAdaptersInfovariable and IP_ADAPTER_INFOmember.
Value | Description |
---|---|
pAdapterInfo |
(Read-only) Pointer to a buffer that, on successful return, receives a linked list of IP_ADAPTER_INFOstructures. |
pOutBufLen |
(Read-only) Pointer to a ULONGvariable that contains the size of the buffer pointed to by the pAdapterInfoparameter. If this size is insufficient to hold the adapter information, GetAdaptersInfofills this variable with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW. |
IP_ADAPTER_INFO (All fields are read-only, they cannot be changed by the API user.) |
Next Pointer to the next adapter in the linked list of adapters. ComboIndex This member is unused. AdapterName[MAX_ADAPTER_NAME_LENGTH + 4] Specifies the name of the adapter. Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4] Specifies a description for the adapter. AddressLength Specifies the length of hardware address for the adapter. Address[MAX_ADAPTER_ADDRESS_LENGTH] Specifies the hardware address for the adapter. Index Specifies the adapter index. Type Specifies the adapter type. DhcpEnabled Specifies whether dynamic host configuration protocol (DHCP) is enabled for this adapter. CurrentIpAddress Specifies the current IP address for this adapter. In Windows Embedded CE, the CurrentIpAddressvalue is defined as the first address assigned to the specified adapter. IpAddressList Specifies the list of IP addresses associated with this adapter. GatewayList Specifies the IP address of the default gateway for this adapter. DhcpServer Specifies the IP address of the DHCP server for this adapter. HaveWins Specifies whether this adapter uses Windows Internet Name Service (WINS). PrimaryWinsServer Specifies the IP address of the primary WINS server. SecondaryWinsServer Specifies the IP address of the secondary WINS server. LeaseObtained Specifies the time when the current DHCP lease was obtained. LeaseExpires Specifies the time when the current DHCP lease will expire. |
The following table describes each GetPerAdapterInfovariable and IP_PER_ADAPTER_INFOmember.
Value | Description |
---|---|
IfIndex |
Specifies the index of an interface. GetPerAdapterInfowill retrieve information for the adapter corresponding to this interface. |
pPerAdapterInfo |
Pointer to an IP_PER_ADAPTER_INFOstructure that, on successful return, contains information about the adapter. |
pOutBufLen |
Pointer to a ULONGvariable that specifies the size of the IP_PER_ADAPTER_INFOstructure. If this size is insufficient to hold the information, GetPerAdapterInfofills in this variable with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW. |
IP_PER_ADAPTER_INFO (All fields are read-only, they cannot be changed by the API user.) |
AutoconfigEnabled Specifies whether auto-configuration is enabled on this adapter. AutoconfigActive Specifies whether auto-configuration is active on this adapter. CurrentDnsServer Not used. DnsServerList Specifies the list of possible DNS servers for this adapter. |
The following table describes each GetAdapterIndexvariable.
Value | Description |
---|---|
AdapterName |
Pointer to a Unicode string that contains the name of the adapter. |
IfIndex |
Pointer to a ULONGvariable that, on successful return, points to the index of the adapter. |