About of IRP_WRITE operations

I am copying a 500 MB file using Explorer (XP) into my FSD drive. Explore
shows a progress dialog, with a Cancel button.

If I click the cancel button before all the data is written into the cache
manager, I can abort fine. But after that, when the cache manager is writing
the data into my FSD, I can not interrupt the IRP_WRITE stream, when I click
the Cancel button.

I tested with FileSpy and FileMon, but it appears that no IRP comes into my
FSD when I click the Cancel button. Or perhaps that’s is just a
FileSpy/FileMon update issue?

Anyway, when I click the Cancel button, is there any way to detect that in
my FSD while the paging I/O transfer is happening?

Regards,
Ole Thomasen

Wait, wait, wait. You are talking about two different things.

The cancel button has nothing to do with file system -
If the user clicks “Cancel”, the GUI thread notifies
the worker thread (the one who actually performs he copying)
that it must stop. The worker thread then stops copying.

On the FS level, you should just just stop receiving
write requests and you should receive the delete and
cleanup request.

I tested with FileSpy and FileMon, but it appears that no IRP comes into
my FSD when I click the Cancel button. Or perhaps that’s is just a
FileSpy/FileMon update issue?

I have tested the file copy operation with FileSpy and it works:

  1. Tons of FASTIO_WRITE (mixed with paging I/O writes,
    as the cache manager flushes the cache on the background)
    1a. (Cancel button has been pressed)
  2. IRP_MJ_SET_INFORMATION (FileDispositionInformation)
  3. IRP_MJ_CLEANUP

So it really does not look like a bug in FileSpy.
Try to simulate the operation on an NT-file system
and compare with yours, maybe it will tell you something.

L.

Well, one more thing - I forgot to write
that you will receive the WRITE requests
even after the IRP_MJ_SET_INFO(Disposition)
will come. These write requests come from the
System process (maybe you switched the “system”
in FileSpy’s process filter off ?)

After the cache is flushed, the file is being
IRP_MJ_CLOSEd and thus deleted (because
of the previous IRP_MJ_SET_INFO(Disposition)
request.

L.