Handling floppy

whenever any of my dispatch routines need a corresponding completion routine, i would increment a counter (from Nagar’s example in his book) in the dispatch routine before IoCallDriver and decrement it before returning from the completion routine.

when i receive a FastIoDetachDevice call, i would check if this counter is positive and wait till it becomes 0 before performing the detach.

this works when i save something to floppy from an application, change the disk, and save something else in the 2nd disk.

however, if i use “Send to A:” to copy a file to disk, change the disk and do the same thing to the 2nd file, the operation would not complete. after checking, it was found that a create request targeted to the device object handling the first disk was received just before the FastIoDetachDevice call, and this request never got completed. as a result, the counter is positive and thus caused the thread to wait.

is the create request issued to determine if the removable media is valid?

has the request been cancelled without my driver’s knowledge although i have set the completion routine to invoke on cancel?

can the system request for a detach even though the request was not completed?

is there a way to detect it?

as a side issue, i noticed that file object pointers usually start with 0x8 or 0xF. any difference between the two types?

Ho Mun Chuen
xxxxx@pmail.ntu.edu.sg
@@ “Not everything that counts can be counted;
<” )~ and not everything that can be counted counts"
//\ … Albert Einstein


Use email, earn rewards at http://www.helloasia.com