Форум: "Система";
Текущий архив: 2003.02.24;
Скачать: [xml.tar.bz2];
ВнизЧтение запись MBR Найти похожие ветки
← →
maxim2 (2002-12-23 06:15) [0]Привет всем!
Люди подскажите как?
← →
Сергей (2002-12-23 10:46) [1]Тоже как-то надо былдо это дело замутить на Win2k. Оно ругалось типа того чтоо нет привелегий для прямого доступа к диску. Выход - написал прогу под ДОС!
← →
MZU (2002-12-23 23:50) [2]Писать напрямую в ./Devices/Harddisk0
← →
Danlicha (2002-12-24 00:49) [3]Physical Disks and Volumes
You can use the CreateFile function to open a physical disk drive or a volume. The function returns a handle that can be used with the DeviceIoControl function. This enables you to access the disk"s partition table. It is potentially dangerous to do so, since an incorrect write to a disk could make its contents inaccessible. The following requirements must be met for such a call to succeed:
The caller must have administrative privileges. For more information, see Running with Special Privileges.
The dwCreationDisposition parameter must have the OPEN_EXISTING flag.
When opening a volume or floppy disk, the dwShareMode parameter must have the FILE_SHARE_WRITE flag.
When opening a physical drive, x, the lpFileName string should be of the form \\.\PHYSICALDRIVEx. Hard disk numbers start at zero. The following table shows some example physical drive strings.
String Meaning
\\.\PHYSICALDRIVE0 Opens the first physical drive.
\\.\PHYSICALDRIVE2 Opens the third physical drive.
For an example showing how to open a physical drive, see Calling DeviceIoControl.
When opening a volume or floppy drive, x, the lpFileName string should be of the form \\.\x:. Do not use a trailing backslash. This would indicate the root directory of the drive. The following table shows some example drive strings.
String Meaning
\\.\A: Opens drive A (floppy drive).
\\.\C: Opens drive C (volume).
Windows 2000 and later: You can also open a volume by referring to its volume name. For more information, see Naming a Volume.
Volume handles may be opened as noncached at the discretion of the file system, even when the noncached option is not specified with CreateFile. You should assume that all Microsoft file systems open volume handles as noncached. The restrictions on noncached I/O for files apply to volumes as well.
A file system may or may not require buffer alignment even though the data is noncached. However, if the noncached option is specified when opening a volume, buffer alignment is enforced regardless of the file system on the volume. It is recommended on all file systems that you open volume handles as noncached and follow the noncached I/O restrictions.
Страницы: 1 вся ветка
Форум: "Система";
Текущий архив: 2003.02.24;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.012 c