阅读:1610回复:0
在XP和2K下的USB驱动在Vista下拔掉会蓝屏---超级菜鸟提问
在Vista下面运行,WInDbg输出,拔掉USB的时候
一步一步看下来,发现程序走到KeWaitForSingleObject那里就死掉了。请各位高手看一下到底是哪里出了问题??? 代码如下: NTSTATUS FBA_ProcessPnPIrp( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp ) { PIO_STACK_LOCATION irpStack; PDEVICE_EXTENSION dx; PDEVICE_EXTENSION thread_dx; NTSTATUS ntStatus = STATUS_SUCCESS; NTSTATUS waitStatus; PDEVICE_OBJECT stackDeviceObject; KEVENT startDeviceEvent; dx = DeviceObject->DeviceExtension; stackDeviceObject = dx->TopOfStackDeviceObject; FBA_IncrementIoCount(DeviceObject); switch ( irpStack->MinorFunction ) { case IRP_MN_START_DEVICE: break; case IRP_MN_QUERY_REMOVE_DEVICE: break; case IRP_MN_REMOVE_DEVICE: break; case IRP_MN_QUERY_INTERFACE: break; case IRP_MN_QUERY_DEVICE_RELATIONS: break; case IRP_MN_QUERY_CAPABILITIES: break; case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: break; case IRP_MN_QUERY_PNP_DEVICE_STATE: break; default: } switch (irpStack->MinorFunction) { case IRP_MN_REMOVE_DEVICE: dx->ThreadStarted = FALSE; KeSetEvent( &dx->ThreadEvent, 0, FALSE); DbgPrintEx(DPFLTR_IHVDRIVER_ID ,DPFLTR_ERROR_LEVEL, "case_IRP_MN_REMOVE_2\n" ); KeWaitForSingleObject( &dx->ThreadExiting, Executive, KernelMode, FALSE, NULL); // 走到这里就蓝屏了 |
|