如果pc有很多适配器或者网卡,则一般应先得到大小即用
DWORD GetAdaptersInfo(
PIP_ADAPTER_INFO pAdapterInfo, // buffer to receive data
PULONG pOutBufLen // size of data returned
);
其中pOutBufLen是DWORD或者无符号整型
然后根据
动态分配内存,之后HGLOBAL GlobalAlloc( UINT uFlags, // allocation attributes SIZE_T dwBytes // number of bytes to allocate );
获得网卡信息即可DWORD GetAdaptersInfo( PIP_ADAPTER_INFO pAdapterInfo, // buffer to receive data PULONG pOutBufLen // size of data returned );