| Re: How to do a function, like quick format? |
|
 |
|
 |
|
 |
|
 |
Group: microsoft.public.vc.mfc · Group Profile
Author: foobarfoobar Date: May 5, 2008 02:05
1. Use CreateProcess API to execute FORMAT command with correct
parameters.
2. When above approach is not sufficient, you use undocumented
FormatEx API. Long time ago there
was something called "fmifs.zip" or so available on the internet which
had source code of an example.
On May 5, 11:21 am, Joseph M. Newcomer flounder.com> wrote:
> Note that what you describe, to open PhysicalDriveN and write to it, is not the same as
> "formatting". It is certainly the same as "erasing".
>
> Why do you need to do this?
>
> You need to look into the DeviceIoControl operations for file systems.
> joe
>
>
>
> On Sun, 4 May 2008 22:51:57 -0700 (PDT), bluestar gmail.com> wrote:
>>Maybe it is a stupid question.
>
>>I want to do a function, like quick format
>
>>I have a idea that i use "CreateFile" to
>>open PhysicalDrive and write all zero
>>sectors by sectors until all size over.
>>But it will destroy all information,
>>including MBR and FAT32 Boot Record
>>, and spend much time to do.
>
>>How to do to let the function, like quick
>>format, avoid deleting MBR and and FAT32
>>Boot Record?
>
>>Not write all zero into sector 1 on each
>>drive(C:,D:) or on each PhysicalDrive,
>>right?
|