My questions both deal with process cleanup. Presume a well-written
application, except as noted.
If a user-mode process uses AWE to allocate physical pages of memory,
but fails to free them prior to the process dying, will the system
automatically cleanup (release and unlock as neccessary) those pages of
memory for the process?
If a user-mode process has an open handle to a device, and has a pending
IRP to that device, will the CLOSE IRP that occurs as part of process
cleanup occur while that pending IRP is outstanding, or will the CLOSE
IRP wait until outstanding IO has completed?
Thanks!
.
Is this a quiz, or are you really asking the development community
rather than, say, the guys who own the I/O manager.
-
yes
-
I believe the answer is yes since the I/O holds an object reference
to the file object. (the cleanup IRL won’t wait though)
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Henry Gabryjelski
Sent: Thursday, July 15, 2004 9:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Process cleanup questions (AWE & CLOSE irps)
My questions both deal with process cleanup. Presume a well-written
application, except as noted.
If a user-mode process uses AWE to allocate physical pages of memory,
but fails to free them prior to the process dying, will the system
automatically cleanup (release and unlock as neccessary) those pages of
memory for the process?
If a user-mode process has an open handle to a device, and has a pending
IRP to that device, will the CLOSE IRP that occurs as part of process
cleanup occur while that pending IRP is outstanding, or will the CLOSE
IRP wait until outstanding IO has completed?
Thanks!
.
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
> If a user-mode process has an open handle to a device, and has a pending
IRP to that device, will the CLOSE IRP that occurs as part of process
cleanup occur while that pending IRP is outstanding, or will the CLOSE
IRP wait until outstanding IO has completed?
Drivers are required to cancel the pending IRPs in the CLEANUP path which is
invoked from the process exit path.
From this, I can conclude that the process exit path (which is invoked from the
exit path of the thread in the process) first closes the handles, and only then
waits for the IRPs to complete.
It is also a known fact that the thread exit path waits for all overlapped IO
to complete. It tries to cancel all pending IRPs linked to this thread, and
then waits till this list will become empty.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com