适配器网卡信息获取软件

易语言 2020-02-24 20:52:57

适配器网卡信息获取软件

难度还可以,应该没BUG~各位凑合看吧。

.如果真 (GetAdaptersInfo (AdapterInfo, SizePointer) ≠ #ERROR_BUFFER_OVERFLOW)
返回 ()
.如果真结束
AdapterInfo = HeapAlloc (GetProcessHeap (), #HEAP_ZERO_MEMORY, SizePointer)
' 创建一块SizePointer大的内存
.如果真 (AdapterInfo = 0)
' 创建失败
返回 ()
.如果真结束
dwRetVal = GetAdaptersInfo (AdapterInfo, SizePointer)
.如果真 (dwRetVal ≠ #ERROR_SUCCESS)
' 错误
返回 ()
.如果真结束
AdapterInfoNext = AdapterInfo
.循环判断首 ()
RtlMoveMemory (AdapterInfoStruct, AdapterInfoNext, 648) ' sizeof(IP_ADAPTER_INFO)=648
AdapterInfoNext = AdapterInfoStruct.Next
.循环判断尾 (AdapterInfoNext ≠ 0)
HeapFree (GetProcessHeap (), 0, AdapterInfo)