The usual method is to have a LIST_ENTRY queue in your DeviceExtension and put the pending IRP in that queue. If you can guarantee that no more that one IRP will be pending at any time, a pointer variable can replace the LIST_ENTRY. See the “Singly- and Doubly-Linked Lists” section in the WDK docs. You can use the Tail.Overlay.ListEntry field for queing IRPs. You also need to consider cancel processing whenever you queue IRPs in your driver.
Finally, you should consider using the driver framework for new development.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, July 30, 2007 7:19 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Problem with IRP and Processing data problem
Hi,
I’m developing a virtual port com driver, and i have some questions:
1 - when i need pending an IRP, i use a global variable (ex. pIrpData) to save IRP.
IoMarkIrpPending(pIrp);
pIrpData = pIrp;
return STATUS_PENDING;
And later i complete IRP (pIrpData).
This is working, but don?t seem the best way to do it, and i’m afraid in the future this can be a problem . Suggestions??
2 - there is a situation, that i make one connection through my virtual port, then the driver catch this connection and send data to user application, while the user application is processing the data if i send a new request to connect to virtual port before user application complete processing the pc restart. How can prevent this?
Sorry my English and thanks in advance.
Cheers.
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