c++ - Windows XP 上高级格式硬盘的物理扇区大小

标签 c++ windows-xp hard-drive sector

我需要检索硬盘的物理扇区大小以确定硬盘是否为 Windows XP 中的高级格式。

我尝试使用 STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR , 但它与 Windows XP 不兼容。我使用的任何方法都会返回 512 而不是 4096,其中包括 WMI,其中返回的唯一值是 512。

我一直在用 C++ 编写代码,如果有人能指出一种可以帮助我找到实际物理扇区大小的方法,我将不胜感激。

最佳答案

根据微软的 MSDN article :

Windows XP, Windows Server 2003, and Windows Server 2003 R2 do not support 512e or 4Kn media. While the system may boot up and be able to operate minimally, there may be unknown scenarios of functionality issues, data loss, or sub-optimal performance. Thus, Microsoft strongly cautions against using 512e media with Windows XP or other products based on the Windows XP codebase (such as Windows Home Server 1.0, Windows Server 2003, Windows Server 2003 R2, Windows XP 64-bit Edition, Windows XP Embedded, Windows Small Business Server 2003, and Windows Small Business Server 2003 R2).

在 Windows XP 下,您将无法获得真实的物理扇区大小,因为操作系统本身假定它为 512 字节。

关于c++ - Windows XP 上高级格式硬盘的物理扇区大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11300978/

相关文章:

java - 递归移动目录并在Java中合并它们的有效方法

c++ - 为什么不能在 C++ 中重载 '.' 运算符?

c++ - 如何将 Qt 组合框与按钮和某种显示图片的小部件连接起来?

c++ - ISO 货币字符串的查询窗口

jquery - 在 Windows XP 上使用 IE8 无法正确显示背景图像 .png

c - Linux : direct access to the hard-disk in C

windows - 如何在 Windows 中使用 DeviceIoControl() 读取单个扇区/集群?

c++ - 如何在 C++ 的头文件中使用一个类的对象作为另一个类的数据?

c++ - 重载引用转换

command-line - 通过命令行远程管理 Windows XP