我正在研究Windows设备驱动程序,我发现很难区分PDO和FDO。 让我告诉你,如果我错了,我脑中的stream动纠正了我!
当系统启动时,加载将创buildFDO的根总线驱动程序。 现在,它会枚举它的子设备,我想一个公交车司机的热插拔方法将被调用,当一个新的孩子将被发现,该方法将通知PNP经理。 PNPpipe理器会调用根总线驱动程序的AddDevice()例程,并且会为PCI等新的总线创buildPDO。请详细解释整个stream程,这只是我的想象。 然后logging下来,系统会加载PCI总线的function驱动程序,这将创buildFDO? 这个FDO是什么? 为什么我需要这个? 根据我的说法,PCI总线驱动程序也应该像根总线一样遵循相同的规则,枚举它的子节点并为它们创buildPDO,或者通过这个FDO它们的意思是PDO。 我很困惑:(!
你究竟在做什么,或者你只是想学习? 我只是想知道你是如何在堆叠中结束的。
PDO =物理设备对象
FDO =功能设备对象
一个PDO作为一个物理设备,但它不一定是物理的。 它本质上是总线上的设备和总线本身之间的接口。 这在MSDN上已经很好的涵盖了。
这是一个使用USB记忆棒的例子,这很好地说明了这个差别。
这是一个更深入的解释和重要的报价
如果您的参考点是PCI总线,那么Pci.sys是功能驱动程序。 但是如果您的参考点是Proseware Gizmo设备,那么Pci.sys就是公交车司机。 这种双重角色在PnP设备树中是典型的。 作为总线功能驱动程序的驱动程序也可作为总线子设备的总线驱动程序。
你也有过滤器驱动程序,让你坐在PDO和FDO之间,并开始做顽皮的东西,如隐藏文件,POC rootkits等。在这个阶段,你可以添加额外的功能,或完全阻止访问PDO。
这里是所有的MSDN链接。
http://msdn.microsoft.com/en-us/library/windows/hardware/hh439632(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ ff554721(v = vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/hh439643(v=vs.85).aspx http://msdn.microsoft.com/ en-us / library / windows / hardware / ff554731(v = vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ff564859(v=vs.85).aspx http://technet.microsoft.com/en-us/library/cc776371(v=ws.10).aspx
如果这不能为您清理,请随时发回。
According to me PCI bus driver should also follow the same as done by the root bus, enumerate its child and create PDOs for them
– WRONG!
。
如果您正在谈论WDM,则PnP管理器会创建PDO。 在此之前, YOU
必须在DriverEntry()
创建它(在检测到设备之后DriverEntry()
。
这里是摘录形式“Programming the Microsoft Windows Driver Model”,第二版,Walter One:
- PDO stands for physical device object. The bus driver uses this object to represent the connection between the device and the bus. - FDO stands for function device object. The function driver uses this object to manage the functionality of the device. - FiDO stands for filter device object. A filter driver uses this object as a place to store the information it needs to keep about the hardware and its filtering activities. (The early beta releases of the Windows 2000 DDK used the term FiDO, and I adopted it then. The DDK no longer uses this term because, I guess, it was considered too frivolous.)
希望这可以帮助你。