| 
					阅读:1224回复:6
				 50分请教一个问题
					在编译驱动时有这样一个错误: 
 IoSetCompletionRoutine( R1394_SynchCompletionRoutine, (PVOID) &Event, TRUE, TRUE, TRUE ); 错误提示: cannot convert from \'long (__stdcall *)(struct _DEVICE_OBJECT *,struct _IRP *,struct _KEVENT *)\' to \'long (__stdcall *)(struct _DEVICE_OBJECT *,struct _IRP *,void *)\' 这是什么原因,我搞了好久没解决. | |
| 沙发#发布于:2002-06-06 12:08 
					少了一个参数。				 | |
| 
 | 
| 板凳#发布于:2002-06-06 12:42 
					看看函数原型:
 VOID IoSetCompletionRoutine( IN PIRP Irp, IN PIO_COMPLETION_ROUTINE CompletionRoutine, IN PVOID Context, IN BOOLEAN InvokeOnSuccess, IN BOOLEAN InvokeOnError, IN BOOLEAN InvokeOnCancel ); | |
| 
 | 
| 地板#发布于:2002-06-06 12:56 有两帖????? 迟了吗。。。。。。。。。。。。。 哦。。。。。。。。。。。。 :( | |
| 
 | 
| 地下室#发布于:2002-06-06 13:03 
					错误提示:
 cannot convert from \'long (__stdcall *)(struct _DEVICE_OBJECT *,struct _IRP *,struct _KEVENT *)\' to \'long (__stdcall *)(struct _DEVICE_OBJECT *,struct _IRP *,void *)\' 看错误提示,应该是你的 R1394_SynchCompletionRoutine 这个函数的原型不对。 你是 long R1394_SynchCompletionRoutine( PDEVICE_OBJECT, PIRP, PKEVENT ); 系统要求 long R1394_SynchCompletionRoutine( PDEVICE_OBJECT, PIRP, PVOID ); | |
| 
 | 
| 5楼#发布于:2002-06-06 15:15 
					to Tomgin :
 可是我已经把它强制转换了阿,怎么办? | |
| 6楼#发布于:2002-06-06 18:15 
					引用:
 -------------------------------------------------------------------------------- TO Tomgin 兄: 我看了DDK的例子,里面是这样定义 t1394Diag_SynchCompletionRoutine( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PKEVENT Event ) 它编译的时候为什么没错? 不胜感激 -------------------------------------------------------------------------------- 嘿嘿,这样看来问题在于你的R1394_SynchCompletionRoutine声明或引用,而不在IoSetCompletionRoutine。 NTSTATUS (*PIO_COMPLETION_ROUTINE) ( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context ); 你查一下R1394_SynchCompletionRoutine涉及的地方是否,还有没进行“类型转化”!struct _KEVENT * ---》 void * 应该可解决! 祝好运! 另: 有点糊涂了。。。。。。 是R1394_SynchCompletionRoutine还是t1394Diag_SynchCompletionRoutine??? :) | |
| 
 | 
 
							
 
				 
				