Djafken
asked on
reading disk sector in WinNT
I was wondering how I can read a sector of a hard disk. I was hoping I could do it with CreateFile('\\.\PhysicalDr ive0',...) and then read the drive with ReadFile. But that doesn't work. CreateFile creates a handle ok, but ReadFile keeps me giving error 87 (wrong parameter). Anyone any ideas?
Kind regards,
Djafken
Kind regards,
Djafken
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hard, floppy, CD-ROM - no difference.
When performing direct disk I/O, you must seek, read, and write in multiples of sector sizes of the device and on sector boundaries. It seems that you don't, that's why you get this error.
ASKER
Thanks, the problem was indeed the sector size, just like you mentioned.