From: Frank Natoli on
What Win32 IOCTLs are involved in fully initializing a hard drive? I
am referring to a hard drive that has been subject to a full
declassify / erase operation.

IOCTL_DISK_DELETE_DRIVE_LAYOUT says "the disk will be formatted from
sector zero to the end of the disk" but of course without any
partitions format has no information to work with.

IOCTL_DISK_CREATE_DISK appears to be the correct follow-up IOCTL to
IOCTL_DISK_DELETE_DRIVE_LAYOUT but says nothing about formatting.

IOCTL_DISK_SET_DRIVE_LAYOUT_EX may or may not be superfluous if you
use IOCTL_DISK_CREATE_DISK.

IOCTL_DISK_FORMAT_TRACKS and IOCTL_DISK_FORMAT_TRACKS_EX says floppy
only.

IOCTL_DISK_FORMAT_MEDIA and IOCTL_DISK_FORMAT_VOLUME says Windows CE
only.

Would be nice to see the source to DISKPART.EXE or something
equivalent. Thanks.
From: David Craig on
Do you have the document 'fatgen103.docx'? If not, get it and understand
the layout of the hard drive. True, it is just for FAT12/16/32, but it
covers the MBR (Master Boot Record including the partition table) and PBR
(Partition Boot Record). I just write to sector zero with a valid MBR and
that is easy as soon as you compute the correct values for the partition
table.

"Frank Natoli" <FrankJNatoli(a)EmbarqMail.com> wrote in message
news:1328e6cc-a65e-43fb-8784-7c693bb8d023(a)31g2000vbf.googlegroups.com...
> What Win32 IOCTLs are involved in fully initializing a hard drive? I
> am referring to a hard drive that has been subject to a full
> declassify / erase operation.
>
> IOCTL_DISK_DELETE_DRIVE_LAYOUT says "the disk will be formatted from
> sector zero to the end of the disk" but of course without any
> partitions format has no information to work with.
>
> IOCTL_DISK_CREATE_DISK appears to be the correct follow-up IOCTL to
> IOCTL_DISK_DELETE_DRIVE_LAYOUT but says nothing about formatting.
>
> IOCTL_DISK_SET_DRIVE_LAYOUT_EX may or may not be superfluous if you
> use IOCTL_DISK_CREATE_DISK.
>
> IOCTL_DISK_FORMAT_TRACKS and IOCTL_DISK_FORMAT_TRACKS_EX says floppy
> only.
>
> IOCTL_DISK_FORMAT_MEDIA and IOCTL_DISK_FORMAT_VOLUME says Windows CE
> only.
>
> Would be nice to see the source to DISKPART.EXE or something
> equivalent. Thanks.


From: Frank Natoli on
No. But was able to find fatget103.doc on the web. I'm afraid it's
much lower level than I want to work with. Would like to keep within
CreateFile/DeviceIoControl/CloseHandle. Thanks.