开发者

How do I access a raw sector of disk in XP with a c program?

开发者 https://www.devze.com 2023-01-12 05:39 出处:网络
I want to know that how to access a sector of the hard disk in Win开发者_JAVA技巧dows XP with a C program? You will need to open the raw disk device, ideally with the Windows API rather than any part

I want to know that how to access a sector of the hard disk in Win开发者_JAVA技巧dows XP with a C program?


You will need to open the raw disk device, ideally with the Windows API rather than any part of the standard C file I/O library. You would then use the Windows API to read and write (but only if you are careful) the raw sectors. To get write access, the disk must usually not be mounted. To do this at all, you need privileges granted to Administrators.

Start at the MSDN documentation for CreateFile(), and pay careful attention to the section titled "Physical Disks and Volumes". The pages on Naming a File and DOS device names may also be interesting.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号