阅读:2023回复:1
WDM USB 禁用驱动怎么在 IRP_MJ_PNP中调用IRP
主要是调用这两个"IRP_MN_QUERY_REMOVE_DEVICE", "IRP_MN_REMOVE_DEVICE",因为我的U盘驱动禁用卸载不完全
if (myidVendor ==VID&&myidProduct == PID) { KdPrint((DRIVERNAME "RMOVE Drive - \n")); status = IoAcquireRemoveLock(&pdx->RemoveLock, Irp); if (!NT_SUCCESS (status)) { Irp->IoStatus.Status = status; IoCompleteRequest (Irp, IO_NO_INCREMENT); KdPrint((DRIVERNAME "RMOVEsfsdfsd Drive - \n")); } else { KdPrint((DRIVERNAME "RMOVEsfsdfsd Drive - \n")); IoSkipCurrentIrpStackLocation(Irp); status = IoCallDriver(pdx->LowerDeviceObject, Irp); IoReleaseRemoveLock(&pdx->RemoveLock, Irp); RemoveDevice(fido);//移除驱动 return status; }这是在 NTSTATUS DispatchPnp(IN PDEVICE_OBJECT fido, IN PIRP Irp)里的部分代码 U盘能禁用但是禁用相符合的U盘后其他U盘也无法进入Create IRP了希望高手能解答这个问题 我是新手最好有代码 |
|
沙发#
发布于:2010-07-03 20:33
有高手帮个忙呀
|
|