阅读:1503回复:0
PCI驱动卸载,“扫描检测硬件改动”时引起PC死屏一个视频采集卡驱动程序,当卸载驱动后(此时PC不会死屏),“扫描检测硬件改动”时,PC会死屏。用逻分抓取 PCI数据,得知系统不停地向某一硬件发送写命令。驱动卸载程序如下: NTSTATUS DefaultPnpHandler(PDEVICE_EXTENSION pdx, PIRP Irp) { IoSkipCurrentIrpStackLocation(Irp); return IoCallDriver(pdx->NextStackDevice, Irp); } NTSTATUS HandleRemoveDevice(PDEVICE_EXTENSION pdx, PIRP Irp) { NTSTATUS status; Irp->IoStatus.Status = STATUS_SUCCESS; EC_HW_DeInitVideoDevice(pdx->hDevice);//free DMA memory pdx->pDmaAdapter->DmaOperations->FreeCommonBuffer( pdx->pDmaAdapter, DMA_MEM_SIZE, pdx->dmaPhy, pdx->dmaMemAddrVir, FALSE); pdx->pDmaAdapter->DmaOperations->PutDmaAdapter(pdx->pDmaAdapter); IoDisconnectInterrupt(pdx->pInterruptObject); MmUnmapIoSpace(pdx->regBaseAddr, pdx->regMemLength); IoSetDeviceInterfaceState(&pdx->interfaceName, FALSE); RtlFreeUnicodeString(&pdx->interfaceName); status = DefaultPnpHandler(pdx, Irp); if (pdx->NextStackDevice) IoDetachDevice(pdx->NextStackDevice); IoDeleteDevice(pdx->fdo); return status; } 请教各位,这个卸载程序是否有问题;在卸载驱动的程序里,什么操作会导致系统在“扫描检测硬件改动”时疯狂的向某一硬件发送写指令;debug的方法。 还有,我的电脑PCI插槽连的是FPGA平台,不知道是会因为电器特性产生了这个bug |
|