阅读:894回复:1
关于IoSetCompletionRoutine的问题,50分!
小弟想做一个包过滤程序,
过滤函数如下: NTSTATUS Pass( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp ) { DbgPrint(\"get Package!!!\\n\"); PIO_STACK_LOCATION pIrpStack; pIrpStack = IoGetCurrentIrpStackLocation( Irp ); IoCopyCurrentIrpStackLocationToNext(Irp); IoSetCompletionRoutine( Irp, GenericCompletion, 0, TRUE, TRUE, TRUE ); return IoCallDriver( m_TcpgetDevice, Irp); } NTSTATUS GenericCompletion( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context ) { if(Irp->PendingReturned) { IoMarkIrpPending(Irp); } return STATUS_SUCCESS; } 但是发现一个问题,第一次调用IoSetCompletionRoutine没有问题, 当接到第二个irp时,再调用IoSetCompletionRoutine,就会蓝屏, 希望有经验的大虾多指教! 谢谢! |
|
沙发#
发布于:2002-05-23 21:01
请检查是否
Irp->CurrentLocation > 1 估计你在IoCopyCurrentIrpStackLocationToNext(Irp); 时你的Irp->CurrentLocation = 1了。 |
|
|