>>How Partition Magic formats a drive for example? How OS let him do its job?
Partition Magic does not use either C or C++ standard functions for that because there are no such standard functions. It will have to go directly to the os api system calls, such as win32 api functions. I don't know which specific functions because I've never attempted to format a drive in a win32 program. Those os-specific functions can be called just like any of the standard c or c++ functions, just include the correct header file(s) and libraries. For win32 api functions, see www.msdn.microsoft.com or your compiler's online help files for win32 api functions.