阅读:1534回复:8
中间层驱动imd中怎样取所绑定网卡的MAC值?
中间层驱动imd中怎样取所绑定网卡的MAC值?
谢 |
|
最新喜欢:baoyib... |
沙发#
发布于:2003-06-27 14:11
老大我! 找了 一个小时才找到这段话啊,谢谢我吧
不过是因为我自己也要用这个东东, in NDIS there have two mac address can be read if the NIC is ethernetne is OID_802_3_PERMANENT_ADDRESS in NdisRequest another is OID_802_3_CURRENT_ADDRESS in NdisReques. and the first way you can get the mac address encoded in the hardware! the mac address you got by second way is the the current using mac address that can be change in registry,but it is the really mac address your NIC used currently. [编辑 - 6/28/03 by antspower] |
|
|
板凳#
发布于:2003-06-27 14:28
antspower谢谢:
========= 这断话的意思是在MPRequestQueryInfomation()函数中得到? 这断话你是哪弄来的? |
|
地板#
发布于:2003-06-27 15:03
antspower谢谢:
========= 虽然你给了这断话,但我还是不知道NDIS中 怎样从硬件和注册表中读MAC,你给我一断代码吧? |
|
地下室#
发布于:2003-06-27 17:44
antspower:
--------- 用NdisRequest();向下层网卡发送OID_WAN_CURRENT_ADDRESS你说 行不行? |
|
5楼#
发布于:2003-06-27 18:13
我也没有啊,
呵呵,你自己漫漫找啊.我精神上支持你, |
|
|
6楼#
发布于:2003-06-27 20:04
to antspower:
==== ... //取所绑定网卡的MAC NDIS_REQUEST Request; NDIS_WAN_FRAGMENT Fragment; Request.RequestType = NdisRequestQueryInformation; Request.DATA.QUERY_INFORMATION.Oid = OID_WAN_CURRENT_ADDRESS; Request.DATA.QUERY_INFORMATION.InformationBuffer=&Fragment; Request.DATA.QUERY_INFORMATION.InformationBufferLength=sizeof(Fragment); //向下层的网卡发Request NdisRequest(&Status,pAdapt->BindingHandle,&Request); //返回值在 Request.DATA.QUERY_INFORMATION.InformationBuffer; 你说有点对吗,你试试看?你搞对了一定告诉我. |
|
7楼#
发布于:2003-06-27 20:38
to antspower:
-------- 这次估计是对了 //取所绑定网卡的MAC NDIS_REQUEST Request; char addr[6]; Request.RequestType = NdisRequestQueryInformation; Request.DATA.QUERY_INFORMATION.Oid = OID_802_3_CURRENT_ADDRESS; //或OID_802_3_PERMANENT_ADDRESS; Request.DATA.QUERY_INFORMATION.InformationBuffer=addr; Request.DATA.QUERY_INFORMATION.InformationBufferLength=6; //向下层的网卡发Request NdisRequest(&Status,pAdapt->BindingHandle,&Request); //返回值在addr |
|
8楼#
发布于:2003-06-28 22:05
to antspower:
========== 这个函数大概也对: NdisReadNetworkAddress( OUT PNDIS_STATUS Status, OUT PVOID *NetworkAddress, OUT PUINT NetworkAddressLength, IN NDIS_HANDLE ConfigurationHandle ); |
|