VC编程获取网卡物理地址MAC的几种方法

2012-03-04 17:52:57|?次阅读|上传:wustguangh【已有?条评论】发表评论

关键词:C/C++, 操作系统, 网络通信|来源:唯设编程网

重要API回顾:

GetAdaptersInfo

This function retrieves adapter information for the local computer.

函数原型:


DWORD GetAdaptersInfo(
  PIP_ADAPTER_INFO pAdapterInfo,
  PULONG pOutBufLen
);

参数:


pAdapterInfo
[out] Pointer to a buffer containing a linked list of IP_ADAPTER_INFO structures.
pOutBufLen
[in, out] Pointer to the size, in bytes, of the buffer indicated by the pAdapterInfo parameter. If this size is insufficient to hold the adapter information, this function fills in the buffer with the required size, and returns an error code of ERROR_BUFFER_OVERFLOW.

返回值:

Returns NO_ERROR if successful. If the function fails, it returns an error code. For a complete list of error codes, see Error Values or the SDK header file Winerror.h.

基本环境

OS Versions: Windows CE 3.0 and later.
Header: Iphlpapi.h.
Link Library: Iphlpapi.lib.

 

<123>
发表评论0条 】
网友评论(共?条评论)..
VC编程获取网卡物理地址MAC的几种方法