/*
* Copyright (c) 2005 ~ 2006 , ice_bird.studio
* All rights reserved.
*
* 文件名称: driphlpapi.h
* 摘要:
* 无
*
* 当前版本: 1.0
* 作者: draren
* 完成日期:2004.3.27-28
*
*/
#define MAX_ADAPTER_DESCRIPTION_LENGTH 128
#define MAX_ADAPTER_NAME_LENGTH 256
#define MAX_ADAPTER_ADDRESS_LENGTH 8
typedef struct _IP_ADDR_STRING {
struct _IP_ADDR_STRING* Next;
char IpAddress[16];
CHAR IpMask[16];
DWORD Context;
} IP_ADDR_STRING, *PIP_ADDR_STRING;
typedef struct _IP_ADAPTER_INFO {
struct _IP_ADAPTER_INFO* Next;
DWORD ComboIndex;
char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
UINT AddressLength;
BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
DWORD Index;
UINT Type;
UINT DhcpEnabled;
PIP_ADDR_STRING CurrentIpAddress;
IP_ADDR_STRING IpAddressList;
IP_ADDR_STRING GatewayList;
IP_ADDR_STRING DhcpServer;
BOOL HaveWins;
IP_ADDR_STRING PrimaryWinsServer;
IP_ADDR_STRING SecondaryWinsServer;
DWORD LeaseObtained;
DWORD LeaseExpires;
} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen);
//需要自己定义调用函数类型 GAI (主要是压栈顺序 __stdcall)
typedef DWORD (__stdcall *GAI) (PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen);
GAI lpGetAdaptersInfo;