guoxian
驱动牛犊
驱动牛犊
  • 注册日期2001-11-22
  • 最后登录2005-11-28
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:821回复:0

debugprint 问题

楼主#
更多 发布于:2002-08-22 15:00
我安装了debugprint后,在执行到
    NTSTATUS status = IoCallDriver( dx->NextStackDevice, Irp);
语句时,计算机出错,询问是否重新启动,并且应用程序也自动退出了,有没有高手指点? 谢谢!

NTSTATUS CallUSBDI( IN PUSBKBD_DEVICE_EXTENSION dx, IN PVOID UrbEtc,
IN ULONG IoControlCode/*=IOCTL_INTERNAL_USB_SUBMIT_URB*/,
   IN ULONG Arg2/*=0*/)
{
IO_STATUS_BLOCK IoStatus;
KEVENT event;

// Initialise IRP completion event
KeInitializeEvent(&event, NotificationEvent, FALSE);

// Build Internal IOCTL IRP
PIRP Irp = IoBuildDeviceIoControlRequest(
IoControlCode, dx->NextStackDevice,
NULL, 0, // Input buffer
NULL, 0, // Output buffer
TRUE, &event, &IoStatus);
  // Get IRP stack location for next driver down (already set up)
PIO_STACK_LOCATION NextIrpStack = IoGetNextIrpStackLocation(Irp);
// Store pointer to the URB etc
NextIrpStack->Parameters.Others.Argument1 = UrbEtc;
NextIrpStack->Parameters.Others.Argument2 = (PVOID)Arg2;
  
// Call the driver and wait for completion if necessary
    NTSTATUS status = IoCallDriver( dx->NextStackDevice, Irp);
if (status == STATUS_PENDING)
{
// DebugPrintMsg(\"CallUSBDI: waiting for URB completion\");
status = KeWaitForSingleObject( &event, Suspended, KernelMode, FALSE, NULL);
status = IoStatus.Status;
}

// return IRP completion status
// DebugPrint(\"CallUSBDI returned %x\",status);
return status;
}
游客

返回顶部