Problem with IoCompleteRequest() call.

Dear All,

I am relatively new to this group.
I am developing an asynchronous USB driver for Windows XP.
In my driver I need to write data into my device first.
After completion of writing only I can start reading back from device.
To get this scenario I used recursion APC calls to read and write.

When I receive in IRP from I/O manager, I am marking that IRP as
pending by using IoMarkIrpPending() call.

My problem is when I issue IoCompleteRequest () call after completion
of all data transfer, my driver is crashing.

If I remove “IoCompleteRequest ()” call, my driver is working fine.

What may be the reason for this behavior?

Thanks in Advance,
Regards,
Ramya

Hello Ramya,

A few more details would have made it easier.
Here is my guess: you are completing the IRP twice or
you are not returning STATUS_PENDING in your dispatch routine.

Good luck,
Andrei

Ramya Desai wrote:

Dear All,

I am relatively new to this group.
I am developing an asynchronous USB driver for Windows XP.
In my driver I need to write data into my device first.
After completion of writing only I can start reading back from device.
To get this scenario I used recursion APC calls to read and write.

When I receive in IRP from I/O manager, I am marking that IRP as
pending by using IoMarkIrpPending() call.

My problem is when I issue IoCompleteRequest () call after completion
of all data transfer, my driver is crashing.

If I remove “IoCompleteRequest ()” call, my driver is working fine.

What may be the reason for this behavior?

Thanks in Advance,
Regards,
Ramya


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@bitdefender.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/

I’m still puzzling over the statement:
“To get this scenario I used recursion APC calls to read and write.”

But those are indeed good guesses as to what is going wrong.

=====================
Mark Roddy

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrei Zlate-Podani
Sent: Tuesday, April 05, 2005 8:41 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Problem with IoCompleteRequest() call.

Hello Ramya,

A few more details would have made it easier.
Here is my guess: you are completing the IRP twice or you are not returning
STATUS_PENDING in your dispatch routine.

Good luck,
Andrei

Ramya Desai wrote:

Dear All,

I am relatively new to this group.
I am developing an asynchronous USB driver for Windows XP.
In my driver I need to write data into my device first.
After completion of writing only I can start reading back from device.
To get this scenario I used recursion APC calls to read and write.

When I receive in IRP from I/O manager, I am marking that IRP as
pending by using IoMarkIrpPending() call.

My problem is when I issue IoCompleteRequest () call after completion
of all data transfer, my driver is crashing.

If I remove “IoCompleteRequest ()” call, my driver is working fine.

What may be the reason for this behavior?

Thanks in Advance,
Regards,
Ramya


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@bitdefender.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Always return STATUS_PENDING from the dispatch routine if you called
IoMarkIrpPending.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Ramya Desai”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, April 05, 2005 4:28 PM
Subject: [ntdev] Problem with IoCompleteRequest() call.

> Dear All,
>
> I am relatively new to this group.
> I am developing an asynchronous USB driver for Windows XP.
> In my driver I need to write data into my device first.
> After completion of writing only I can start reading back from device.
> To get this scenario I used recursion APC calls to read and write.
>
> When I receive in IRP from I/O manager, I am marking that IRP as
> pending by using IoMarkIrpPending() call.
>
> My problem is when I issue IoCompleteRequest () call after completion
> of all data transfer, my driver is crashing.
>
> If I remove “IoCompleteRequest ()” call, my driver is working fine.
>
> What may be the reason for this behavior?
>
> Thanks in Advance,
> Regards,
> Ramya
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

If you are calling IoCompleteRequest in the IRP’s completion routine,
you need to return STATUS_MORE_PROCESSING_REQUIRED. What do you mean by
this:

To get this scenario I used recursion APC calls to read and write.

APCs are not documented and I have very rarely seen the need for a
driver to use them.

D

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrei
Zlate-Podani
Sent: Tuesday, April 05, 2005 5:41 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Problem with IoCompleteRequest() call.

Hello Ramya,

A few more details would have made it easier.
Here is my guess: you are completing the IRP twice or
you are not returning STATUS_PENDING in your dispatch routine.

Good luck,
Andrei

Ramya Desai wrote:

Dear All,

I am relatively new to this group.
I am developing an asynchronous USB driver for Windows XP.
In my driver I need to write data into my device first.
After completion of writing only I can start reading back from device.
To get this scenario I used recursion APC calls to read and write.

When I receive in IRP from I/O manager, I am marking that IRP as
pending by using IoMarkIrpPending() call.

My problem is when I issue IoCompleteRequest () call after completion
of all data transfer, my driver is crashing.

If I remove “IoCompleteRequest ()” call, my driver is working fine.

What may be the reason for this behavior?

Thanks in Advance,
Regards,
Ramya


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@bitdefender.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Ignorance more frequently begets confidence than does knowledge.
— Charles Darwin


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://linux.bitdefender.com/


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com