阅读:2675回复:1
video class lower filter
我写了一个video class的lower filter,现在能拦截到URB_FUNCTION_ISOCH_TRANSFER命令,我现在想在这里自己填充urb里面的数据直接返回给上层驱动,代码如下
ULONG NumberOfPackets = pUrb->UrbIsochronousTransfer.NumberOfPackets; USBD_ISO_PACKET_DESCRIPTOR *pIsoPacket = pUrb->UrbIsochronousTransfer.IsoPacket; PUCHAR pData = (PUCHAR)pUrb->UrbIsochronousTransfer.TransferBuffer; for(i=0; i<(int)NumberOfPackets; i++) { ptr = pData + pIsoPacket->Offset; pIsoPacket->Length = SendLen + 2; pIsoPacket->Status = USBD_STATUS_SUCCESS; .... TransCount += (SendLen+2); pIsoPacket++; } pUrb->UrbIsochronousTransfer.NumberOfPackets = i; pUrb->UrbIsochronousTransfer.TransferBufferLength = TransCount; pUrb->UrbHeader.Status = USBD_STATUS_SUCCESS; Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); 结果会导致蓝屏发生在usbvideo.sys驱动里 但如果我设置了完成例程,在完成例程里更改Urb中的数据内容,上层驱动就可以正确的收到更改后的内容了 我上面的代码哪里出错了,该怎么来完成这个功能 |
|
|
沙发#
发布于:2010-12-08 21:03
用户被禁言,该主题自动屏蔽! |
|