阅读:821回复:0
debugprint 问题
我安装了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; } |
|