windows 创建文件系统“驱动程序”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7423718/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:04:44  来源:igfitidea点击:

Creating a File System "Driver"

c++windowsfilesystems

提问by Lander

I'm looking to create a "driver" I guess for a custom file system on physical disk for Windows. I don't exactly know the best way to explain it, but the device already has proper drivers and everything like that for Windows to communicate with it, but what I want to happen is for the user to be able to plug the device in to their PC, have it show up in My Computer, and give them full support for browsing the device.

我想为 Windows 的物理磁盘上的自定义文件系统创建一个“驱动程序”。我不完全知道解释它的最佳方法,但该设备已经有适当的驱动程序和类似的一切,以便 Windows 与它进行通信,但我想要发生的是让用户能够将设备插入到他们的 PC,让它显示在“我的电脑”中,并为他们提供浏览设备的完全支持。

I realize it's probably a little scary thinking about someone who doesn't know the basics of doing something like this even asking the question, but I already have classes and everything constructed for reading it within my own app... I just want everything to be more centralized and without more work from the end user. Does anyone have a good guide for creating a project like this?

我意识到对于一个不知道做这样的事情的基础知识甚至问这个问题的人来说,这可能有点可怕,但我已经有课程和所有内容可以在我自己的应用程序中阅读它......我只是想要一切更加集中,无需最终用户进行更多工作。有没有人有创建这样的项目的好指南?

回答by fvu

The closest thing I know of to what I understand from your description is an installable file system, like the Ext2 installable file systemthat allows Windows computers to work with Linux originating ext2 (and to a certain degree ext3) filesystems.

我所知道的与我从您的描述中所理解的内容最接近的事情是可安装的文件系统,例如Ext2 可安装的文件系统,它允许 Windows 计算机与源自 Linux 的 ext2(并且在某种程度上是 ext3)文件系统一起工作。

Maybe that can serve as a starting point for your investigations.

也许这可以作为您调查的起点。

As an alternative approach there's the Shell extensionwhich is a lot less complicated than the IFS. The now-defunct GMail shell extensionused that approach, and even though it's become nonfunctional due to changes in GMail, it can still serve as inspiration.

作为替代方法,Shell 扩展比 IFS 复杂得多。现已不复存在的GMail shell 扩展使用了这种方法,即使它由于 GMail 的变化而变得不起作用,它仍然可以作为灵感。

回答by Eugene Mayevski 'Callback

Your options are:

您的选择是:

  1. Create a kernel mode file system driver. 9-12 months of work for experienced developer.
  2. Use a framework and do everything in user mode. A couple of weeks of work to get the prototype working. The only drawback of this approach is that it's slower, than kernel-mode driver. You can play with Dokan mentioned above, or you can use our Callback File Systemfor commercial-grade development.
  1. 创建内核模式文件系统驱动程序。有经验的开发人员需要 9-12 个月的工作时间。
  2. 使用框架并在用户模式下执行所有操作。几周的工作才能使原型工作。这种方法的唯一缺点是它比内核模式驱动程序慢。您可以使用上面提到的 Dokan,也可以使用我们的回调文件系统进行商业级开发。

回答by Adam Maras

I think you need to look through the Windows Driver Kitdocumentation (and related subjects) to figure out exactly what you're looking to create.

我认为您需要查看Windows 驱动程序工具包文档(和相关主题)以准确确定您要创建的内容。

回答by Arvid

If you're intending to rely on the drivers that already exist, i.e. you don't need to actually execute your code in kernel land to communicate with it, I would recommend you take a look at FUSE for windows Dokan

如果您打算依赖已经存在的驱动程序,即您不需要在内核空间中实际执行您的代码来与之通信,我建议您查看 FUSE for windows Dokan

If you indeed need to run in kernel space, and communicate directly with the hardware, you probably want to download windows DDK (driver development kit). Keep in mind that drivers for communicating with a block device and filesystems are separated, and it sound like you're talking about the filesystem itself. I believe that anything you run in kernel space will not have access to the c++ runtime, which means you can only use a subset of c++ for kernel drivers.

如果您确实需要在内核空间中运行,并直接与硬件通信,您可能需要下载windows DDK(驱动程序开发工具包)。请记住,用于与块设备和文件系统通信的驱动程序是分开的,这听起来像是在谈论文件系统本身。我相信您在内核空间中运行的任何东西都无法访问 c++ 运行时,这意味着您只能将 c++ 的一个子集用于内核驱动程序。