RE: IoBuildDeviceIoControlRequest() and IoCallDriver(-)

Re: [ntdev] RE: IoBuildDeviceIoControlRequest() and IoCallDriver( )Subsequent Read/Writes are going thru. It happens on both read and writes. Thanks for pointing out :- I was not zeroing srb and was not checking for SRB_STATUS_QUEUE_FROZEN. I will let u know the status after I test it.

Thanks a lot guys,
Sajeev.
----- Original Message -----
From: Todd Flanagan
To: NT Developers Interest List
Sent: Friday, June 16, 2000 5:33 AM
Subject: [ntdev] RE: IoBuildDeviceIoControlRequest() and IoCallDriver( )

Using IOCTL_SCSI_EXEC_IN and your own cdb/srb is the correct method if you’re issuing calls directly to the port driver from an intermediate driver. Some simple things to check: Can you issue subsequent read/writes from another instance of the user app or a second thread? Does the behavior just happen on reads or reads and writes (are you putting read data where you think you are, or are you putting it somewhere that is occasionally important)? Do you check for SRB_STATUS_QUEUE_FROZEN after every call to the port? Did you RtlZeroMemory the srb before you build it?

Todd

From: “Nemiroff, Daniel”
Reply-To: “NT Developers Interest List”
Date: Thu, 15 Jun 2000 14:35:55 -0700
To: “NT Developers Interest List”
Subject: [ntdev] RE: IoBuildDeviceIoControlRequest() and IoCallDriver( )

My first thought is that your request gets stuck in ScsiPort’s queue, or the queue gets stalled. To confirm where the IRP is use the !irp command in KD to see where it is.

Do the requests that don’t complete get sent down to the drive? (Use a Scsi bus analyzer if you have one). i.e. check if your command was sent, followed by a request sense command. During request sense commands ScsiPort may stall its queues.

Have you looked at any debug prints that may be coming form ScsiPort?

Are you building IRP_MJ_SCSI or IRP_MJ_DEVICE_IO_CONTROL requests? I believe you should be using IRP_MJ_DEVICE_IO_CONTROL with IOCTL_SCSI_PASS_THROUGH not IRP_MJ_SCSI.

Good luck,

Daniel

-----Original Message-----
From: Sajeev [mailto:xxxxx@amiindia.co.in]
Sent: Thursday, June 15, 2000 12:23 PM
To: NT Developers Interest List
Subject: [ntdev] RE: IoBuildDeviceIoControlRequest() and IoCallDriver()

I’m using IOCTL_SCSI_EXEC_IN as the control code for the IoBuildDeviceIoControlRequest() and using direct CDB command for reading. I doubt whether I can use IoBuildSynchronousFsdRequest() since, my filter sits between disk.sys and scsiport.

Thanks,
Sajeev

----- Original Message -----
From: Jamey Kirby mailto:xxxxx
To: NT Developers Interest List mailto:xxxxx
Sent: Thursday, June 15, 2000 11:53 AM
Subject: [ntdev] RE: IoBuildDeviceIoControlRequest() and IoCallDriver()

Are you using IoBuildDeviceIoControlRequest() to build IRP_MJ_READ and IRP_MJ_WRITE requests? If so, this is not correct, you shouold use IoBuildSynchronousFsdRequest() or IoBuildAsynchronousFsdRequest().

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Sajeev
Sent: Thursday, June 15, 2000 11:53 AM
To: NT Developers Interest List
Subject: [ntdev] IoBuildDeviceIoControlRequest() and IoCallDriver()

Hi All,
On getting a IOCTL from a win32 application, in my filter driver, I’m using IoBuildDeviceIoControlRequest() and IoCallDriver() to send block Read/Write commands(special purpose) to the underlying SCSI Port driver. I’m supplying a event to IoBuildDeviceIoControlRequest() and also waiting on it, if IoCallDriver() returns with STATUS_PENDING. But very rarely, the Read/Write I send to the underlying driver never returns(the event never gets signaled).

Can anybody tell me what might be the problem.

Thanks,
Sajeev.</mailto:xxxxx></mailto:xxxxx>