Some puzzles of shutdown

Hi, all.
In my upper disk filter driver, I use a file to record IO.When system is shutting down, I need to write data back to the file, so I will not miss any IO.I choose IoRegisterShutdownNotification function as the time I flush data to file.But after the DispatchShutdown routine which is registered, I can not write that file, so some IO will not be recorded.
I want to know if there is a way in which I can record these IO, or can I just reject these IO?
Thanks & Regards!

You can locate the file on disk before hand, then in SHUTDOWN, write to disk
directly. However, it is not so safe, because the file location may change
in defragment or other cases.

You can not reject these writes.

Regards
Haibo

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@huaweisymantec.com
Sent: Tuesday, April 21, 2009 10:26 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Some puzzles of shutdown

Hi, all.
In my upper disk filter driver, I use a file to record IO.When system is
shutting down, I need to write data back to the file, so I will not miss any
IO.I choose IoRegisterShutdownNotification function as the time I flush data
to file.But after the DispatchShutdown routine which is registered, I can
not write that file, so some IO will not be recorded.
I want to know if there is a way in which I can record these IO, or can I
just reject these IO?
Thanks & Regards!


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

Thanks Haibo,
If it’s IO to OS partition, I will not reject it.But if it’s IO to NonOS partition, can I reject it? I test it, and the system can shutdown successfully. Is there any influence to the system, since the FS cached IO is not write to disk?

System may be flushing data back to disk then. Drop any of these writes may
cause data corruption.

Regards
Haibo

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@huaweisymantec.com
Sent: Tuesday, April 21, 2009 12:41 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Some puzzles of shutdown

Thanks Haibo,
If it’s IO to OS partition, I will not reject it.But if it’s IO to NonOS
partition, can I reject it? I test it, and the system can shutdown
successfully. Is there any influence to the system, since the FS cached IO
is not write to disk?


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

So can I manually flush file system cache in the IoRegisterShutdownNotification callback, then reject all IO to NonOS partition and pass OS partition IO down to the lower driver?Does this causes data corruption?

Thanks

Is there anyone knows the problem?

System will flush fs cache during shutdown.
You should not reject any IO request from system.

Regards
Haibo

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@huaweisymantec.com
Sent: Tuesday, April 28, 2009 9:24 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Some puzzles of shutdown

So can I manually flush file system cache in the
IoRegisterShutdownNotification callback, then reject all IO to NonOS
partition and pass OS partition IO down to the lower driver?Does this causes
data corruption?

Thanks


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

How about the sequence? Is it OS patition the Last device shut down? If so, maybe I can record NonOS partition IO by writting file(just as c:\logfile.txt) and OS partition IO by writting OS partition sectors.

Thanks

You?ll be likely to want to read a disk file in a WDM driver while you?re initializing your device in response to an IRP_MN_START_DEVICE request. Depending on where your device falls in the initialization sequence, you might or might not have access to files using normal pathnames like ??\C:\dir\file.ext. To be safe, put your data files into some directory below the system root directory and use a filename like \SystemRoot\dir\file.ext. The SystemRoot branch of the namespace is always accessible since the operating system has to be able to read disk files to start up.

Is \SystemRoot\dir\file.ext always be accessible during shut down process?

Thanks