.NETGURU
Is there an API to format the HD?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vc.libraries.

Post a new message to this list...

ZhangZQ
Is there an API to format the HD? I found to use the DeviceIoControl with
IOCTL_DISK_FORMAT_TRACKS code can format the floppy, but how to format the
HD, I don't want the SHFormatDrvie way.

Thank you very much!

Reply to this message...
 
    
David Mair
ZhangZQ wrote:
[Original message clipped]

There's a section on Physical Disks and Volumes in the Platform SDK
documentation for CreateFile() but you probably saw that as a method of
getting a handle for DeviceIoControl. I do believe you can just write to
the media direct with WriteFile() but I've never tried it other than for
floppy disks (Google appears to confirm it).

Most of the modern file systems I know of only lay down their
super-structure when formatting. This makes formats very quick but many
do a disk scan or even clear every sector with a pattern, adding a huge
amount of time. I once did something like this for floppy disks by
simply laying down the initialisation state programmatically (i.e. a
ExamGuru, BPB, FAT, Root Dir). If you know the file system media format you
can probably just lay down a default, empty one but I don't know how to
make a file system driver do a format on its own (would save you from
having to know the media format). You could write a pattern of your
devising to do a basic clearing of data but that won't do a forensic
safe cleanup - I believe the US DoD specifies a set of per-sector write
patterns they believe shreds the data to a forensic (or at least DoD
approved) state.
Reply to this message...
 
    
ZhangZQ
Thanks for your answer. Actually, I can create a specified filesystem by
direct-access the HD, but that newly partition can't be mounted and assigned
a driver letter until the Windows restart, I want to find a way to let the
OS to mount my newly created partition without reboot.

Regards,
ZhangZQ

"David Mair" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
David Mair
ZhangZQ wrote:
[Original message clipped]

Reboot? Er, this is Windows...right? Have you looked at the services
for volume management. They associate volumes with mount points. Perhaps
you can coerce the OS into accepting the changes to the media and
activate the volumes you create. I don't know if they help or if you've
looked at them but, if not, they may contain the answer.
Reply to this message...
 
    
CheckAbdoul
Take a look at the following link

http://www.sysinternals.com/ntw2k/source/fmifs.shtml

--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

"ZhangZQ" <Click here to reveal e-mail address> wrote in message
news:O$gyTu%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
ZhangZQ
Check Abdoul,

This information is very useful, but I still have some question.

1. I create a new raw partition by directly add a record in HD partition
table, after this partition was created, how to let the OS know there is a
new partition was created without reboot the OS.
2. I wonder about how to use the Windows MOUNT-POINT API to mount a raw
partition that without filesystem in it and assigns it a driver letter or
volume lable, those are the necessary parameters to pass to FormatEx
function.

Thank you very much!

Regards,
ZhangZQ

"CheckAbdoul" <checkabdoul at mvps dot org> дÈëÓʼþ
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Jon S.
I know in C you can use system() to access lcaolsystem commands
"ZhangZQ" <Click here to reveal e-mail address> wrote in message
news:O$gyTu%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Bill Thompson
"ZhangZQ" <Click here to reveal e-mail address> wrote in message
news:O$gyTu#Click here to reveal e-mail address...
[Original message clipped]

As a courtesy to the helpful members of this newsgroup, could you kindly
indicate how we can recognize the virus you're making?

Reply to this message...
 
    
ZhangZQ
Hi, I am not making virus, but making a storage application.

"Bill Thompson" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification