判断是无线网卡

KeInitializeEvent(&Event,NotificationEvent,FALSE);
MyIrp = IoBuildDeviceIoControlRequest(IOCTL_NDIS_QUERY_GLOBAL_STATS, 
   deviceExtension->NextLowerDriver,
   &OIDCode,   //OID_GEN_PHYSICAL_MEDIUM
   sizeof(ULONG),
   OutBuff,
   0x1000,
   FALSE,
   &Event,
   &IoStatus); //向下层发irp获得信息
if (!MyIrp )
{
   DbgPrint("MyIrp NULL false ! \n");
   goto Err;
}
//调试发现这些必须设置
irpStack = IoGetNextIrpStackLocation( MyIrp );
irpStack->FileObject = pFileObject;
MyIrp->Tail.Overlay.Thread = (PETHREAD)KeGetCurrentThread();
status = IoCallDriver(deviceExtension->NextLowerDriver, MyIrp);
if (status == STATUS_PENDING)
{
   KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL);
   status = IoStatus.Status;
}
if(!NT_SUCCESS(status))
{
   goto err;
}
for(i = 0;i < IoStatus.Information;i++)
{
   if( OutBuff[i] == NdisPhysicalMediumWirelessLan ||
    OutBuff[i] == NdisPhysicalMediumWirelessWan ||
    OutBuff[i] == NdisPhysicalMediumNative802_11 ||
    OutBuff[i] == NdisPhysicalMediumBluetooth ||
    OutBuff[i] == NdisPhysicalMediumWiMax )
   {
    DbgPrint("是无线网卡 ! \n");
....................   
   }
}

你可能感兴趣的:(判断是无线网卡)