Re: Запись на логический диск WriteFile() == ERROR_ACCESS_DE
От: Ivan Россия www.rsdn.ru
Дата: 02.10.07 08:48
Оценка:
Здравствуйте, zaza1, Вы писали:

> под вистой ядро отлаживать очень паршиво

MSDN http://msdn2.microsoft.com/en-us/library/aa365748.aspx

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.


здесь есть информация по поводу возможных причин введения таких ограничений
http://theinvisiblethings.blogspot.com/2006/10/vista-rc2-vs-pagefile-attack-and-some.html

> пользую Syser — постоянные бсоды и подвисания отладчика (какие то косяки с выводом на экран помоему..).

лучше для отладки ядра использовать WinDbg

В режиме ядра эти ограничения уже мешать не будут — поэтому один из вариантов решения проблемы — разработка драйвера для низкоуровневой работы с диском. Этот драйвер необходимо будет подписать — иначе он не будет загружаться в Vista x64, как подписывать — см. в форуме "Низкоуровневое программирование"
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.