does anyone know how to read the hard disk sector via C or MASM ??? I am running in Win Me and using visual studio C++ 6.0 and MASM 6.
Printable View
does anyone know how to read the hard disk sector via C or MASM ??? I am running in Win Me and using visual studio C++ 6.0 and MASM 6.
You might want to take a look on MSDN at DeviceIoControl - I can't quote anything here because there's a fair amount of it ;)
i do try to use the deviceIoControl but it only can works on the floppy not the hard disk
Here is a class that demonstrates sector read on a hard disk.
Nice code, but why this?The headers guard themselves internally so you don't need to.Code:#ifndef _STDEXCEPT_
#include <stdexcept>
#endif
#ifndef _IOSTREAM_
#include <iostream>
#endif
#ifndef _FSTREAM_
#include <fstream>
#endif
Not in all compilers. It is not really needed on windows systems as there are only a few compilers that are commonly used.
I often use it on *nix systems for compiler compatabilty.
FantastichenEin,
the example given by you only works in Windows NT environment. How can we read the sector in windows 9x or windows Me??
What? I'm slightly dubious at that...all the Unix compilers I've ever used don't need that.Quote:
Originally posted by FantastichenEin
Not in all compilers. It is not really needed on windows systems as there are only a few compilers that are commonly used.
I often use it on *nix systems for compiler compatabilty.
And what if they don't use that EXACT symbol? You're trying to use insider knowledge of the implementation, which is never a good thing to do.