如何访问磁盘的原始部门XP用C程序? [英] How do I access a raw sector of disk in XP with a c program?

查看:126
本文介绍了如何访问磁盘的原始部门XP用C程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何访问硬盘的扇区在Windows XP中有一个C程序?

I want to know that how to access a sector of the hard disk in Windows XP with a C program?

推荐答案

您需要打开原始磁盘设备,最好使用Windows API而不是标准的C文件I / O库的任何部分。然后,您可以使用Windows API来读取和写入(但只有当你细心)原部门。要获取写访问,磁盘通常必须不能安装。要做到这一点在所有的,你需要授予管理员权限。

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.

开始在MSDN文档 的CreateFile() ,并密切注意题为物理磁盘和卷一节。命名一个文件在的页面和 DOS设备名称也很有趣

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.

这篇关于如何访问磁盘的原始部门XP用C程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆