阅读:2382回复:6
DeviceIoControl的错误的问题!非常奇怪!
我在调试我的驱动程序的时候,出现如此奇怪的错误!
驱动程序已经加载、启动成功,现在通过DeviceIoControl向它发送命令,返回失败,错误码为1。我用VC的Error Lookup 工具查看此错误,为\"功能错误\",MSDN中查看error code,提示为\"1 Incorrect function. ERROR_INVALID_FUNCTION \"。 以前从严未碰过这样的错误,不知哪位兄弟能告诉我错误在哪里,谢谢!!! |
|
|
沙发#
发布于:2002-04-10 09:31
用户被禁言,该主题自动屏蔽! |
|
板凳#
发布于:2002-04-10 10:19
Although I\'v met with such problem many times ever, I think I can\'t give you any useful suggestion. So sorry! Because there are so many reason causing such error.
Maybe the parameter is error, or the device has some hardware problem, or the way calling the funtion is wrong. As I concerned, the error notification is almost no much helpful. check carefully.. |
|
|
地板#
发布于:2002-04-10 10:41
是不是你传进去的function code 驱动不支持?比如你
DeviceIoControl( hDevice, 5 /* function code */, ... 而驱动里面只有 switch( funcCode ) { { case 0: break; case 1: break; default: break; } |
|
地下室#
发布于:2002-04-10 11:15
用softic跟一下ioctl部分.
|
|
5楼#
发布于:2002-04-10 13:43
你是不是忘了在DriverEntry中加上
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchIOControl; ? |
|
6楼#
发布于:2002-04-10 13:44
I have solved the proglem,I am so careless that I put wrong parameters in it
|
|
|