- 论坛徽章:
- 0
|
我调用的是GetAdaptersInfo,编译通过,可以调用,但是总返回#define ERROR_INVALID_PARAMETER 87L怎么办??
BOOL那里,网上有2种说法,但是bool, int 都test了,都不对
#define ERROR_NO_DATA 232L
#define ERROR_NOT_SUPPORTED 50L
#define ERROR_BUFFER_OVERFLOW 111L
#define ERROR_INVALID_PARAMETER 87L
#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
#define MAX_ADAPTER_NAME_LENGTH 256 // arb.
#define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
#define DEFAULT_MINIMUM_ENTITIES 32 // arb.
#define MAX_HOSTNAME_LEN 128 // arb.
#define MAX_DOMAIN_NAME_LEN 128 // arb.
#define MAX_SCOPE_ID_LEN 256 // arb.
///////////////////////////////////////////////
//#define DWORD quint32 //typedef unsigned long DWORD
//#define UINT unsigned int
//#define BYTE quint8 //byte是字节型,范围是0-255。
//#define BOOL bool // bool or int
typedef qint32 DWORD;
typedef quint32 *PULONG; //OK
typedef quint16 UINT; //may be ok
typedef unsigned char BYTE;
typedef int BOOL;
//typedef qint32 time_t;
typedef struct {
char String[4 * 4];
} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
typedef struct _IP_ADDR_STRING {
struct _IP_ADDR_STRING* Next;
IP_ADDRESS_STRING IpAddress;
IP_MASK_STRING IpMask;
DWORD Context;
} IP_ADDR_STRING, *PIP_ADDR_STRING;
typedef struct _IP_ADAPTER_INFO
{
struct _IP_ADAPTER_INFO* Next;
DWORD ComboIndex; //#define DWORD unsigned long -> quint32
char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
UINT AddressLength; //无符号整形 -> quint16
BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]; //byte是字节型,范围是0-255 -> quint8
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;
time_t LeaseObtained;
time_t LeaseExpires;
}IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
[ 本帖最后由 aaniao999 于 2007-5-25 00:56 编辑 ] |
|