FS 开发 - KMDF Windows 驱动程序

FS Development - KMDF Windows Driver

我是新来的,正在尝试为 tar 'filesystem'(安装 tar)开发概念 fs 驱动程序。我的问题是,OS 如何检测到分区具有 TAR 文件系统并自动加载我的驱动程序?

首先加载FS调用IoRegisterFileSystem - this routine inserts the device object into the list of file systems in the system. then you must have a WRK. when say file opened on device with VPB IopCheckVpbMounted is called and he call IopMountVolume - this is key point for mount understand. this routine first walk through list with registered FS and send IRP_MN_MOUNT_VOLUME到所有直到一些FS没有return成功代码。也是列表中的最后一个条目 - 特殊文件系统识别器 - 他尝试确定卷的格式。如果是 - 他 return STATUS_FS_DRIVER_REQUIRED - 表示需要为此卷加载新的 FS。系统在这种情况下调用 IopLoadFileSystemDriver。当微型文件系统识别器驱动程序将卷识别为特定文件系统时调用此例程,但尚未加载该文件系统的驱动程序。目前FS_Rec.sys支持下一个FS:

cdfs
ReFS
ReFSv1 // begin from win 10
ExFat
FastFat
Udfs
Ntfs

为了支持其他 - 你需要或自动加载自己的 FS 驱动程序或自我识别器(迷你驱动程序)来识别你的 FS 和 return STATUS_FS_DRIVER_REQUIRED IRP_MJ_FILE_SYSTEM_CONTROL.IRP_MN_MOUNT_VOLUME 并加载你的 FS(通过 ZwLoadDriver 调用 ) 在 IRP_MJ_FILE_SYSTEM_CONTROL.IRP_MN_LOAD_FILE_SYSTEM