Difference between Miniport driver, Protocol driver, Filter driver

Since I am new to windows driver development, I came across these terms ( Miniport driver, Protocol driver, Filter driver) frequently.

Can anyone explain what is the difference between these?

A lot of these terms are used very loosely. Also, we like to think of "Windows drivers" as a single specialty, but that's not true. Almost every subtype of driver (network, file system, disk, USB, audio, video, etc) has its own issue and its own vocabulary, and the terms often collide.

The term "miniport" is used when you have a port/miniport pair. For some driver classes, drivers for different devices have way more code in common then they have code specific to the device. In that case, Microsoft provide s "port" driver that handles all the boilerplate and common code, and what we write are "miniport" drivers that get loaded by the port driver as a DLL. The requests all go to the port driver, which calls callbacks in the miniport to do real work. This is a common, used in many different models.

Protocol drivers are used in network stack. I'm not a network guy, but I believe these drivers just implement the network protocols that aren't tied to specific hardware, like TCP.

The term "filter driver" is overloaded. The most common usage is as a PnP filter. The main driver for a piece of hardware is called the "function" driver. It is possible (and quite common) to insert additional drivers above and/or below the function driver, to intercept and act on the requests. This can be done to add additional functionality, or do performance analysis, or fix bugs, or emulate some other piece of hardware.

However, other stacks also use the term. In streaming drivers (audio and video), the components (miniports, as it turns out) in the driver stack are called "filters". Your audio driver might have a "speaker filter" and a "microphone filter". Those filters have "pins" that carry the actual streaming data.

File systems also have filters (and minifilters), which manage file I/O operations. They are similar to (but different from) PnP filters.

So, what you need to know depends VERY STRONGLY on what drivers you intend to write.

3 Likes

Thanks Tim for the eye opening information!