blue44
驱动小牛
驱动小牛
  • 注册日期2006-05-17
  • 最后登录2012-03-31
  • 粉丝0
  • 关注0
  • 积分23分
  • 威望218点
  • 贡献值0点
  • 好评度84点
  • 原创分0分
  • 专家分0分
阅读:2049回复:5

请教驱动导致的蓝屏问题

楼主#
更多 发布于:2007-05-30 18:00
  安装了ezusb驱动,芯片是68001。在插拔的时候,有的电脑会出现蓝屏,有的不会,出现蓝屏的电脑也不是每次都蓝屏,概率5%-10%之间。蓝屏显示错误代码为0x0000007E,还显示了驱动的.sys文件。
估计是驱动的问题,但是不明白的是:为什么有的电脑会蓝屏有的不会,到底是驱动还是电脑的原因?原因可能在哪呢?如果驱动原因,为什么不会每次都蓝屏?是驱动冲突还是usb hub问题?而且因为出现蓝屏的电脑不是自己的电脑,没有办法调试,自己电脑都不蓝屏,郁闷啊
疯了
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-06-04 09:57
去学学开发driver的基本要求,否则你想破脑袋也想不出来原因
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
xjtusdbzh
禁止发言
禁止发言
  • 注册日期2005-04-22
  • 最后登录2018-07-10
  • 粉丝1
  • 关注0
  • 积分-812分
  • 威望44点
  • 贡献值1点
  • 好评度124点
  • 原创分1分
  • 专家分0分
板凳#
发布于:2007-06-07 17:01
用户被禁言,该主题自动屏蔽!
lejianz
驱动中牛
驱动中牛
  • 注册日期2003-03-05
  • 最后登录2023-11-15
  • 粉丝0
  • 关注0
  • 积分8分
  • 威望145点
  • 贡献值0点
  • 好评度116点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2007-06-07 17:11
只能让问题复现, 然后分析调试驱动了.
一起交流,共同提高!
blue44
驱动小牛
驱动小牛
  • 注册日期2006-05-17
  • 最后登录2012-03-31
  • 粉丝0
  • 关注0
  • 积分23分
  • 威望218点
  • 贡献值0点
  • 好评度84点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2007-06-12 09:21
跟进了,是在Ezusb_CallUSBD(fdo,Urb)中KeWaitForSingleObject无返回值所致,看网上贴子似乎这是个老问题,可是我加了5s延时后在自己机子上开始重起了,请问这是怎么回事?贴上我从网上弄的代码,请大家指教:
//-------------HUSBDCompletionRoutine---------
NTSTATUS  HUSBDCompletionRoutine(
                                IN PDEVICE_OBJECT DeviceObject,
                                IN PIRP Irp,
                                IN PVOID Context)
{
PKEVENT pEvent = (PKEVENT)Context;
KeSetEvent(pEvent, 0, TRUE);
return STATUS_MORE_PROCESSING_REQUIRED;
}

NTSTATUS Ezusb_CallUSBD(IN PDEVICE_OBJECT fdo, IN PURB urb)
{
NTSTATUS ntStatus,status=STATUS_SUCCESS;
PDEVICE_EXTENSION pdx;
PIRP irp;
IO_STATUS_BLOCK ioStatus;
PIO_STACK_LOCATION nextStack;

KEVENT event;

pdx=fdo->DeviceExtension;

//issue a synchronous request(同步请求)
KeInitializeEvent(&event,NotificationEvent,FALSE);

//build irp which will be send to bus driver
irp=IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB,
                                  pdx->StackDeviceObject,
                                  NULL,
                                  0,
                                  NULL,
                                  0,
                                  TRUE, //internal
                                  &event,
                                  &ioStatus);
//newly added for timeout
IoSetCompletionRoutine(irp,
                      (PIO_COMPLETION_ROUTINE)HUSBDCompletionRoutine,
                      (PVOID)&event,
                      TRUE,
                      TRUE,
                      TRUE);

//prepare for calling the usb bus driver
nextStack=IoGetNextIrpStackLocation(irp);
ASSERT(nextStack!=NULL);

nextStack->Parameters.Others.Argument1=urb;

//call the USB driver stack to perform the operation.if the return value is
//PENDING ,wait for request to complete

ntStatus=IoCallDriver(pdx->StackDeviceObject,irp);

//STATUS_PENDING means the lower driver have not finished processing the IRP,
//yet.we must wait.
if(ntStatus==STATUS_PENDING)
{
LARGE_INTEGER timeout5second;

timeout5second.QuadPart=-5*10000000; //5秒

status=KeWaitForSingleObject(
                            &event,
                            Suspended,
                            KernelMode,
                            FALSE,
                            &timeout5second);
if(status==STATUS_TIMEOUT)
{
IoCancelIrp(irp);
KeWaitForSingleObject(&event,Suspended,KernelMode,FALSE,NULL);
}


}
//else
//{
ioStatus.Status=ntStatus;

//added here
KeClearEvent(&event);
IoCompleteRequest(irp,IO_NO_INCREMENT);
KeWaitForSingleObject(&event,Suspended,KernelMode,FALSE,NULL);
//}

//USBD maps the error code for us,USBD uses error codes in its URB structure,
//that are more insightful into USB behavior.in order to match the
//NT status code,USBD maps its error codes into more general NT
// error categories so higher level drivers can decipher the error codes
// based on standard NT error code definitions.
//

ntStatus=ioStatus.Status;
//
// If the URB status was not USBD_STATUS_SUCCESS, we save a copy of the
// URB status in the device extension. After a failure, another IOCTL,
// IOCTL_EVK_GET_LAST_ERROR can be used to retrieve the URB status
// for the most recently failed URB. Of course, this status gets
// overwritten by subsequent failures, but it\'s better than nothing.
//
if(NT_SUCCESS(ntStatus))
{
if(!USBD_SUCCESS(urb->UrbHeader.Status))
ntStatus=STATUS_UNSUCCESSFUL;
}
return ntStatus;
}
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2007-06-14 12:38
看样子你也没有什么driver经验,这种不在自己掌控范围内的问题,最好还是找专业人士搞定吧~~~最近已经看到好几个人在说同样的问题咯
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
游客

返回顶部