I would like a simple example on how to access sectors on a hard drive (read&write). Have written plenty of programs in MASM and am trying my hand at MASM32. I have written programs in MASM32 that can access a floppy but not a hard drive. It must be possible because I have seen C programs that do it but the source code always has some INCLUDE or EXTERNAL not found when I try to compile the source code. I would appreciate any help with a code example or at least a direction to look in.
For DOS programs it was fairly simple as you could just use the BIOS INT 13.
Newer versions of windows place security restrictions on what you're allowed to access - drive sectors being one of them.
That's not to say it isn't possible, but I'm assuming it'll require a system-level service (as in vxd.)
Check out the MSDN Library (http://www.msdn.com/library/default.asp). Maybe you'll find out there what you're looking for (try searching for hard drive sectors). :U
http://www.kibria.de/frhed.html
Hi!
Use the CreateFile function.
Take a look in the section Physical Disks and Volumes in
the page http://msdn.microsoft.com/library/en-us/fileio/base/createfile.asp
Regards,
Opcode
Direct access to hard drive is almost impossible in Windows due to its multitasking characteristics. Unlike DOS (as Tedd mentioned BIOS Int 13h) in Windows you can not find any API function to access HD directly and while Windows manages it well, there is no need to do that...
Code your own OS :bdg . My OS has reached an FDD driver and a minimal FAT12 driver.
Thomas