Only 2 devices behave like Not allow the IRP to hit the Device.

I have developed a driver like WinUSB. It is working with many device different devices.
But for two different devices the mass storage command failed.
If I analysis with Lecory analyzer the command is not hit the device with my Driver.
But if I use WinUSB driver given by Microsoft somewhat working.
My Understanding is that, The IRP is not delivered to device (Means CBW Command).
I tried with 10 seconds Timeout and after 10 second I am canceling the IRP and Coming out with Error to ReadFile() Call.

Application:-
CreateFile()
WriteFile()
ReadFile()

Order of Driver function Call in DispatchReadWrite:-
IoSetCompletionRoutine()
IoMarkIrpPending()
KeSetTimer()
IoCallDriver()
return STATUS_PENDING;
For_Error:
IoCompleteRequest()
return ntlStatus;

Order of Driver function Call in ReadWriteCompletion:-
KeCancelTimer();
USBIoDecrement

The first question you’ll have to answer is why you aren’t simply using WinUSB? What do you mean “somewhat working”?

Gary G. Little

----- Original Message -----
From: “glamar sk”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, December 14, 2010 6:58:54 AM
Subject: [ntdev] Only 2 devices behave like Not allow the IRP to hit the Device.

I have developed a driver like WinUSB. It is working with many device different devices.
But for two different devices the mass storage command failed.
If I analysis with Lecory analyzer the command is not hit the device with my Driver.
But if I use WinUSB driver given by Microsoft somewhat working.
My Understanding is that, The IRP is not delivered to device (Means CBW Command).
I tried with 10 seconds Timeout and after 10 second I am canceling the IRP and Coming out with Error to ReadFile() Call.

Application:-
CreateFile()
WriteFile()
ReadFile()

Order of Driver function Call in DispatchReadWrite:-
IoSetCompletionRoutine()
IoMarkIrpPending()
KeSetTimer()
IoCallDriver()
return STATUS_PENDING;
For_Error:
IoCompleteRequest()
return ntlStatus;

Order of Driver function Call in ReadWriteCompletion:-
KeCancelTimer();
USBIoDecrement


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Have you tried libusb ? It is not WDF/Winusb, and it is known to work.
It is also open source, so you can tweak it.

– pa

  1. There is some requirement in project which made us to think our own driver. Like more control over device which winusb dont give. Like tracking IRP/URB
  2. I am using WDM.
  3. I know abt WinUSB.SYS it doesnt suites us.

Example of My Problem:-
I Have following Commands.
A) Read10()
B) Write10()
C) Inquiry()
D) TestUnitReady()
All the Above 4 Command are working in 10 device out of 12 device.
But the balance 2 device is not receive the command from my drive.

I’m going to push the issue on WinUSB, because I have seen “it doesn’t suite us” used here too many times to find out WinUSB was being abused rather than used. I’m no expert on WinUSB, but there are folks here that encourage it’s use rather than write their own which usually doesn’t work, with them that wrote their own ending up back here to find out how they went wrong with WinUSB in the first place.

Gary G. Little

----- Original Message -----
From: “glamar sk”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, December 14, 2010 7:49:10 AM
Subject: RE:[ntdev] Only 2 devices behave like Not allow the IRP to hit the Device.

1. There is some requirement in project which made us to think our own driver. Like more control over device which winusb dont give. Like tracking IRP/URB
2. I am using WDM.
3. I know abt WinUSB.SYS it doesnt suites us.

Example of My Problem:-
I Have following Commands.
A) Read10()
B) Write10()
C) Inquiry()
D) TestUnitReady()
All the Above 4 Command are working in 10 device out of 12 device.
But the balance 2 device is not receive the command from my drive.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Gray,

I think you need to understand that there must be some need for developing
own driver. thats why we are developing that. As we mentioned we used WinUSB
and even we recommend it if no special requirement.

We give the reason too. “We need to print IRP/URB” information travelling to
down stack.
Thanks
Sunil
On Tue, Dec 14, 2010 at 7:27 PM, Gary G. Little wrote:

> I’m going to push the issue on WinUSB, because I have seen “it doesn’t
> suite us” used here too many times to find out WinUSB was being abused
> rather than used. I’m no expert on WinUSB, but there are folks here that
> encourage it’s use rather than write their own which usually doesn’t work,
> with them that wrote their own ending up back here to find out how they went
> wrong with WinUSB in the first place.
>
> Gary G. Little
>
> ----- Original Message -----
> From: “glamar sk”
> To: “Windows System Software Devs Interest List”
> Sent: Tuesday, December 14, 2010 7:49:10 AM
> Subject: RE:[ntdev] Only 2 devices behave like Not allow the IRP to hit the
> Device.
>
> 1. There is some requirement in project which made us to think our own
> driver. Like more control over device which winusb dont give. Like tracking
> IRP/URB
> 2. I am using WDM.
> 3. I know abt WinUSB.SYS it doesnt suites us.
>
> Example of My Problem:-
> I Have following Commands.
> A) Read10()
> B) Write10()
> C) Inquiry()
> D) TestUnitReady()
> All the Above 4 Command are working in 10 device out of 12 device.
> But the balance 2 device is not receive the command from my drive.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

sounds like your only requirement which precludes winusb is that you have debug statements in the io sending path. if that is it, you can use the KMDF IFR and !wdfkd.wdfiotarget to track all pending IRP/URB pairs in the debugger.

d