什么是 Windows 操作系统中的驱动程序堆栈?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4254060/
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 15:39:19  来源:igfitidea点击:

What is a driver stack in the Windows OS?

windowsdrivers

提问by avi moraly

What is a driver stack in the Windows OS?

什么是 Windows 操作系统中的驱动程序堆栈?

I was reading material in NDISand wan't know what is it.

我正在NDIS中阅读材料,但不知道它是什么。

回答by Cody Gray

The Windows Driver Model(WDM) uses a layered approach in which a given device is served by at least two drivers: a busdriver and a functiondriver. A device might also have filter drivers that add value or modify the behavior of the device. The chain of drivers that serve a device is called a driver stack.

Windows驱动程序模型(WDM)使用其中一个给定的装置是由至少两个驱动器提供分层的方法:一公交车司机和 功能的驱动程序。设备可能还有过滤器驱动程序,可以增加设备的价值或修改设备的行为。为设备提供服务的驱动程序链称为驱动程序堆栈

       Layered driver architecture in Windows

       Layered driver architecture in Windows

(From: http://www.microsoft.com/whdc/archive/wdmoverview.mspx)

(来自:http: //www.microsoft.com/whdc/archive/wdmoverview.mspx


Also see: Device Driver Introduction, specifically section 5on the "Device Driver Stack."


另请参阅:设备驱动程序介绍,特别是关于“设备驱动程序堆栈”的第 5 节

回答by LordDoskias

One good metaphor if you are familiar with design patterns is the Decorator. As an example I'd take BufferedReader and any other types of reader. So you have your basic (and possibly not very efficient reader) and you want on-the-fly without caring how to make it buffered and speed up performance so you create a BufferedReader that wraps the underlying Reader object.

如果您熟悉设计模式,一个很好的比喻是装饰器。作为示例,我将使用 BufferedReader 和任何其他类型的阅读器。因此,您拥有基本的(可能不是非常高效的阅读器)并且您想要即时运行,而无需关心如何使其缓冲并提高性能,因此您创建了一个包装底层 Reader 对象的 BufferedReader。

The concept with driver stacks is similar - you might have your lower level driver which would write characters to device BUT you can attach on top of it another driver which would jumble every character it gets and essentially you have a whole crypto stack. That way the underlying driver doesn't know anything about whole this "magic" that is happening, it is doing exactly what it was made for - writing characters to a block device.

驱动程序堆栈的概念是相似的 - 您可能有一个较低级别的驱动程序,它将字符写入设备,但您可以在它上面附加另一个驱动程序,该驱动程序会混淆它获得的每个字符,并且本质上您有一个完整的加密堆栈。这样,底层驱动程序对正在发生的整个“魔法”一无所知,它正在做它的目的 - 将字符写入块设备。