阅读:2878回复:0
获取网卡得ip地址,参考了相关帖子已经成功获取ip,但是我现在要获取一个Modem拨号连接得ip却无法获得。
我已经添加了 NdisMediumWan类型,使passthru支持Modem得拨号连接,这个已经成功了。(已经成功获取了modem拨号连接得MAC地址。说明绑定成功了)
但是下面的case,在NdisMediumWan这个类型下,始终没有发现有Oid == OID_GEN_NETWORK_LAYER_ADDRESSES得传入,导致查询modem拨号 连接得ip地址无法进行。 case NdisRequestSetInformation: ASSERT( Oid != OID_PNP_SET_POWER); if((Oid == OID_GEN_NETWORK_LAYER_ADDRESSES)/* && (Status == NDIS_STATUS_SUCCESS)*/) { if (pAdapt->IpAddress == (ULONG)NULL) { DbgPrint("=>OID_GEN_NETWORK_LAYER_ADDRESSES\n"); pAddrList = (PNETWORK_ADDRESS_LIST)NdisRequest->DATA.SET_INFORMATION.InformationBuffer; if (pAddrList->AddressCount <= 0) break; pAddr = (PNETWORK_ADDRESS)&pAddrList->Address[0]; if (pAddr->AddressType != NDIS_PROTOCOL_ID_TCP_IP) break; pIpAddr = (NETWORK_ADDRESS_IP UNALIGNED *)&pAddr->Address[0]; pAdapt->IpAddress = pIpAddr->in_addr; 请高手解惑,谢谢拉!!! |
|