hi,USB read and write operation

hi,
i have written an asynchronous IOCTL in my driver to handle writing
and reading data from the my USB device.wirte and read are performed
alternatively due to device buffer limitation.actually this device
does encryption and decryption.
now my problem is

when i send some data from the application the data should be
encrypted /decrypted.but i am facing a strange problem when i first
time do encryption its working fine.

when i run my application for more number of times for encryption
(using encrypt command continuosly )that application is getting hanged
or some times i am getting some error messege (application error).

if i restart the system or remove my USB device and plugin again.its
working fine.

so i would like to know wat i am doing wrong .whether i am not
handling irps correctly when i do it asynchronously or something i am
missing in my driver.
but the same driver when i have done it synchrously it is working fine.

can any one help in this?
thanks in advance,
with regards,
bkr.

Hi BKR,

As a first step, you should enable driver verifier on your driver, and
if possible you should be doing testing on Windows Server 2003 (as it
has the latest driver verifier features). You should enable everything
except the “Disk CRC” checking, as that is not relevant to your problem.
I think you will be surprised with how many things can be caught
immediately and easily understood when running under the driver
verifier.

Generally speaking, hangs of an application indicate that an IO
operation is not competing. You can usually find all the IRPs that an
application has sent with built in debugger commands:

REM – of course, replace 0xBAADF00D with your process.
REM – can also do ‘!process 0 1’ to see list of processes.
!process 0xBAADF00D 7 – shows stacks and wait states for the threads in
the process
REM – once you know the thread of interest, you can also do ‘!thread
7’

You can also use ‘!irpfind’ to see all outstanding irps. You could also
keep some tracking information on which irps you are currently
processing, to see if it matches what the system thinks. Add other
logging that seems to help as soon as you get additional information on
where the irp is hung. If you need additional help with this issue,
post more details here on this list – the current amount of information
you provided is, unfortunately, not sufficient to determine the cause of
the problem.

If you are not familiar with the debugger, I highly recommend taking a
course on debugging windows drivers. The debugger that Microsoft ships
has become significantly improved over the last few years, and is a free
download.

Hth,
.

-----Original Message-----
From: Bharat Kumar V [mailto:xxxxx@gmail.com]
Sent: Sunday, April 03, 2005 10:08 PM
Subject: hi,USB read and write operation

hi,
i have written an asynchronous IOCTL in my driver to handle writing
and reading data from the my USB device.wirte and read are performed
alternatively due to device buffer limitation.actually this device
does encryption and decryption.
now my problem is

when i send some data from the application the data should be
encrypted /decrypted.but i am facing a strange problem when i first
time do encryption its working fine.

when i run my application for more number of times for encryption
(using encrypt command continuosly )that application is getting hanged
or some times i am getting some error messege (application error).

if i restart the system or remove my USB device and plugin again.its
working fine.

so i would like to know wat i am doing wrong .whether i am not
handling irps correctly when i do it asynchronously or something i am
missing in my driver.
but the same driver when i have done it synchrously it is working fine.

can any one help in this?
thanks in advance,
with regards,
bkr.

thanks for ur reply.
bharat.

On Apr 5, 2005 9:31 PM, Henry Gabryjelski
wrote:
> Hi BKR,
>
> As a first step, you should enable driver verifier on your driver, and
> if possible you should be doing testing on Windows Server 2003 (as it
> has the latest driver verifier features). You should enable everything
> except the “Disk CRC” checking, as that is not relevant to your problem.
> I think you will be surprised with how many things can be caught
> immediately and easily understood when running under the driver
> verifier.
>
> Generally speaking, hangs of an application indicate that an IO
> operation is not competing. You can usually find all the IRPs that an
> application has sent with built in debugger commands:
>
> REM – of course, replace 0xBAADF00D with your process.
> REM – can also do ‘!process 0 1’ to see list of processes.
> !process 0xBAADF00D 7 – shows stacks and wait states for the threads in
> the process
> REM – once you know the thread of interest, you can also do ‘!thread
> 7’
>
> You can also use ‘!irpfind’ to see all outstanding irps. You could also
> keep some tracking information on which irps you are currently
> processing, to see if it matches what the system thinks. Add other
> logging that seems to help as soon as you get additional information on
> where the irp is hung. If you need additional help with this issue,
> post more details here on this list – the current amount of information
> you provided is, unfortunately, not sufficient to determine the cause of
> the problem.
>
> If you are not familiar with the debugger, I highly recommend taking a
> course on debugging windows drivers. The debugger that Microsoft ships
> has become significantly improved over the last few years, and is a free
> download.
>
> Hth,
> .
>
> -----Original Message-----
> From: Bharat Kumar V [mailto:xxxxx@gmail.com]
> Sent: Sunday, April 03, 2005 10:08 PM
> Subject: hi,USB read and write operation
>
> hi,
> i have written an asynchronous IOCTL in my driver to handle writing
> and reading data from the my USB device.wirte and read are performed
> alternatively due to device buffer limitation.actually this device
> does encryption and decryption.
> now my problem is
>
> when i send some data from the application the data should be
> encrypted /decrypted.but i am facing a strange problem when i first
> time do encryption its working fine.
>
> when i run my application for more number of times for encryption
> (using encrypt command continuosly )that application is getting hanged
> or some times i am getting some error messege (application error).
>
> if i restart the system or remove my USB device and plugin again.its
> working fine.
>
> so i would like to know wat i am doing wrong .whether i am not
> handling irps correctly when i do it asynchronously or something i am
> missing in my driver.
> but the same driver when i have done it synchrously it is working fine.
>
> can any one help in this?
> thanks in advance,
> with regards,
> bkr.
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>