阅读:1507回复:12
IoCallDriver函数提问,急啊。
IoCallDriver函数提问,这个函数是调用Windows 自带的USB驱动程序吗?可以自己写代码实现这个功能吗?谢谢了,请高手指点。在线等
|
|
|
沙发#
发布于:2005-06-30 09:27
看DDK文档去 。 不能。
|
|
板凳#
发布于:2005-06-30 09:47
An IRP passed in a call to IoCallDriver becomes inaccessible to the higher-level driver
是这个吗?要是这样的话,如何速度就是因为这个函数可能要等待时间,所以速度慢下来,也就是使用这个函数已经不能在提高速度了吗?那该用什么,请指点一下啊。给个方向。谢谢了。 |
|
|
地板#
发布于:2005-06-30 10:31
在windows nt/2k系列中,对于这种分层的驱动程序,如果要把irp往下传,必须调用IoCallDriver。
你能选择的就是采用同步,还是异步的方式。 |
|
地下室#
发布于:2005-06-30 11:20
那用上中断应该可以提高点速度吧,谢谢了。理论上可以是吧。
|
|
|
5楼#
发布于:2005-06-30 12:05
usb client不会自己直接控制硬件,比如处理中断,都要构造urb,call IoCallDriver往下传
|
|
6楼#
发布于:2005-06-30 13:05
io*******函数一般都是ddk中的函数,在ntddk.h或wdm.h中声明
msdn中是这样写的: IoCallDriver The IoCallDriver routine sends an IRP to the driver associated with a specified device object. NTSTATUS IoCallDriver( IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp ); Parameters DeviceObject Pointer to a device object, representing the target device for the requested I/O operation. Irp Pointer to the IRP. Return Value IoCallDriver returns the NTSTATUS value that a lower driver set in the I/O status block for the given request, or STATUS_PENDING if the request was queued for additional processing. Headers Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h. Comments Before a calling IoCallDriver, the calling driver must set up the I/O stack location in the IRP for the target driver. For more information, see Passing IRPs Down the Driver Stack. IoCallDriver assigns the DeviceObject input parameter to the DeviceObject member of the IO_STACK_LOCATION structure for the driver being called. An IRP passed in a call to IoCallDriver becomes inaccessible to the higher-level driver, unless the higher-level driver has called IoSetCompletionRoutine to set up an IoCompletion routine for the IRP. If it has, the IRP input to the IoCompletion routine has its I/O status block set by the lower drivers, and all lower-level drivers' I/O stack locations are filled with zeros. Drivers must not use IoCallDriver to pass power IRPs (IRP_MJ_POWER). Use PoCallDriver instead. Callers of IoCallDriver must be running at IRQL <= DISPATCH_LEVEL. |
|
7楼#
发布于:2005-06-30 14:17
zhaock:
usb client不会自己直接控制硬件,比如处理中断,都要构造urb,call IoCallDriver往下传 -------------------------------------------------------------------------------- 我现在在写驱动部分,想自己处理中断,可一直没有办法实现,现在感觉就是StaratIo这个历程一直进不去,也可能是进去一两次就在也进不去了。请高手说说原因。是我的中断没有处理好是吧。释放部分是吗? |
|
|
8楼#
发布于:2005-06-30 15:31
对于usb client driver 你没有办法直接处理中断。
|
|
9楼#
发布于:2005-06-30 15:46
斑竹谢谢您了,辛苦了。
IoMarkIrpPending(Irp); IoStartPacket( fdo, Irp, 0, Ezusb_CancelIrp); Irp->IoStatus.Status = STATUS_PENDING; KeSynchronizeExecution(pdx->InterruptObject, (PKSYNCHRONIZE_ROUTINE)Ezusb_Read_Write, (PVOID)pdx)) 这几个函数不是处理中断的吗? 我的MSN:gaozhsoft@hotmail.com 或是告之您的以便象您请教。谢谢了。 |
|
|
10楼#
发布于:2005-06-30 15:56
KeSynchronizeExecution(pdx->InterruptObject, (PKSYNCHRONIZE_ROUTINE)Ezusb_Read_Write, (PVOID)pdx))
倒是和中断处理有关,你这个是哪里的代码,是你自己加的吗? |
|
11楼#
发布于:2005-07-02 09:44
我的usb设备插到计算机上,计算机识别不到新硬件,是不是插上后,usb bus driver会读设备描述表,而读设备描述表是在我固件程序中的中断里实现的,是不是usb bus driver 没有办法直接处理中断,没读到device descriptor,所以没有发现新硬件,我用的是usbn9604,还是我硬件上的原因,请斑竹和高手们多多指教。我也急啊
|
|
|
12楼#
发布于:2005-07-05 09:54
一、每个USB设备至少应有一个编号为0的控制端点以响应控制事务的输入输出。
二、每个设备都有一个唯一的设备描述符,它向主机软件标识该设备。主机使用GET_DESCRIPTOR控制事务直接从设备的0号端点读取该描述符。 建议楼主先好好看看有关的资料吧 |
|