|
|
От: |
Ivan
|
www.rsdn.ru |
| Дата: | 02.10.07 08:48 | ||
| Оценка: | |||
If you write directly to a volume that is mounted by a file system, you must first obtain exclusive access to the volume. Otherwise, you risk causing data corruption or system instability, because your application's writes may conflict with other changes coming from the file system and leave the contents of the volume in an inconsistent state. To prevent these problems, the following changes have been made in Windows Vista and later:
A write on a volume handle will succeed if the volume is not mounted by a file system, or if one of the following conditions is true:
— The sectors to be written to are boot sectors.
— The sectors to be written to reside outside of file system space.
— You have explicitly locked or dismounted the volume by using FSCTL_LOCK_VOLUME or FSCTL_DISMOUNT_VOLUME.
— The volume has no file system. (In other words, it has been mounted as a RAW volume.)
A write on a disk handle will succeed if one of the following conditions is true:
— The sectors to be written to do not fall within a volume's extents.
— The sectors to be written to fall within a mounted volume, but you have explicitly locked or dismounted the volume by using FSCTL_LOCK_VOLUME or FSCTL_DISMOUNT_VOLUME.
— The sectors to be written to fall within a volume that is not mounted or has no file system.