如何在 Windows 中打开 Linux 风格的 /dev/sdXY 分区?

发布于 2024-10-07 05:01:56 字数 714 浏览 0 评论 0原文

如何在 Windows 中打开分区 Linux 风格 /dev/sdXY? 目前我正在打开 \\\\.\\PhysicalDrive%d 然后调用 DeviceIoControl(IOCTL_DISK_GET_DRIVE_LAYOUT, ...)< /code>获取分区 布局,并存储包含该区域的偏移量和大小 文件系统。在我的代码中,我通过分区的偏移量来偏移设备上的 IO 操作。

此外,如何删除明显的同步行为? Windows 上的物理驱动器原始设备上的操作非常慢,我希望操作系统尽可能进行缓存。

How do open a partition in Windows a la Linux style /dev/sdXY? Currently I'm opening \\\\.\\PhysicalDrive%d then calling DeviceIoControl(IOCTL_DISK_GET_DRIVE_LAYOUT, ...) to get the partition
layouts, and storing the offset and size of the region containing the
filesystem. In my code I offset IO operations on the device by the offset to the partition.

Furthermore, how do I remove the apparently synchronous behaviour? Operations are very slow on the physical drive raw device on Windows, and I'd prefer the OS did caching where possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹雨成花 2024-10-14 05:01:57

您可以使用 \\?\GLOBALROOT\Device\Harddisk0\Partition0 等路径来访问分区。有关命名空间的一般信息,请参阅此处。也可能想尝试 WinObj ;它允许您浏览对象管理器名称空间。

You can use paths like \\?\GLOBALROOT\Device\Harddisk0\Partition0 to access partitions. See here for general information about namespaces. Also might want to give WinObj a try; it lets you browse the object manager namespace.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文