33. WDM driver framework

Source: Internet
Author: User

In WDMProgramAnd other features are transferred to the adddevice routine. Adddevice is an important difference between WDM drivers and legacy nt drivers.

When a device is inserted into a computer, the system bus driver (root Bus) will enumerate that a new device is inserted. Then, the PnP Manager will be notified to find the device driver to be loaded. Based on the bus of the device, the PnP Manager loads the corresponding bus driver device and obtains the physical device object (PDO, vendorid and other information are loaded to the driver of the device, and the created PDO is passed as a parameter to the adddevice routine. The adddevice routine mounts its own device object to the PDO. The device Stack has been created.

1. Functional Device objects

It is the device_object data structure, which is generally created by the adddevice routine and then loaded on the physical device object. The driver of the function device object will also set the entry of each dispatch function in DriverEntry.

2. Physical Device objects

You can use the device object viewer to observe.

When the system starts, the root bus driver is loaded, and then the driver device mounted on the Root bus is found. If a PCI device is found, the PDO of the PCI device is loaded and the appropriate fdo is searched for loading. For example, a USB adapter is used as a PCI device and loaded with PDO and fdo.

Physical Device objects are generally created by bus drivers. WDM enables people to focus more on fdo. One or more filter drivers can be added between PDO and fdo. The filter driver can intercept and modify the plug-and-play IRPs.

WDM is developed based on the concept of layered driving. WDM drivers are generally divided into bus drivers and functional drivers. The function driver is mounted on the bus, and the function driver processes some IRPs. Most plug-and-play IRPs are forwarded to the bus driver for processing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.