阅读:3430回复:2
两个例子的区别!
我比较了一下在UsbTherm和用driverworks生成的一个空的usb程序中,在creat例程中有点不同,在usbtherm中为:
NTSTATUS UsbThermometer::Create(KIrp I) { I.ForceReuseOfCurrentStackLocationInCalldown(); NTSTATUS status = m_Usb.PnpCall(this, I); CurrentIrp() = NULL; return status; } 而在driverworks 生成的usb中为: status = I.PnpComplete(this, STATUS_SUCCESS, IO_NO_INCREMENT); 而它把 I.ForceReuseOfCurrentStackLocationInCalldown(); NTSTATUS status = m_Usb.PnpCall(this, I); 这两项给注释掉了。为什么?难道他们会有一样的creat效果吗? |
|
沙发#
发布于:2001-04-24 08:51
关注!
|
|
|
板凳#
发布于:2001-04-27 08:28
老兄!差点被你搞晕掉!
你没有看Numega的注释吗? // Generally a create IRP is targeted at our FDO, so we don't need // to pass it down to the PDO. We have found for some devices, the // PDO is not expecting this Irp and returns an error code. // The default wizard code, therefore completes the Irp here using // PnpComplete(). The following commented code could be used instead // of PnpComplete() to pass the Irp to the PDO, which would complete it. // 我当时看到这句,就直接用的PnpComplete,没有试过把IRP传下去. |
|
|