disk-formatting

Formatting a hard disk in c++ on Windows 7

I am wondering how to format a hard disk in Windows 7 through c++? I currently have an application that is successful at this using a function in a dll. Unfortunately I don't have the code for the dll so there is no way for me to see what its doing. It doesn't actually format the drive itself but it launches the format utility built into...