MSDN Documentation

Microsoft Developer Network

Configuring Devices

This section delves into the process of configuring devices within the Windows Plug and Play (PnP) framework. Proper configuration ensures that devices are recognized, resources are allocated, and the operating system can effectively manage hardware.

Device Configuration Process

The PnP manager orchestrates the configuration of devices. When a new device is detected or an existing device's state changes, PnP initiates a sequence of actions to assign resources and load the appropriate driver.

Resource Requirements

Devices require specific system resources to operate. These include:

PnP's primary role is to manage the allocation of these resources to avoid conflicts between devices.

Configuration Manager

The Configuration Manager is a core component of the PnP subsystem. It maintains the hardware tree and manages device enumeration, resource allocation, and driver loading.

Device Interface Classes

Devices are categorized into interface classes, which allows the system to manage similar devices uniformly. This includes classes for storage, networking, display, sound, and more.

Configuration Flags

Various flags can be used to control device configuration behavior. These are often set in the registry or through device properties.

Flag Name Description
CM_CONFIGFLAG_DISABLE_REMOVE_UI Prevents the user from removing the device through the Device Manager UI.
CM_CONFIGFLAG_DONOTUSE_DMA Instructs PnP not to assign DMA resources to this device.
CM_CONFIGFLAG_POWER_MANAGEMENT Indicates that the device supports power management features.

Configuring Devices Programmatically

Developers can interact with the PnP Configuration Manager using Windows API functions. Key functions include:

Note: Direct manipulation of device configuration is typically handled by the PnP manager. Drivers generally receive configuration information rather than actively configuring hardware themselves.
Tip: Understanding the PnP architecture is crucial for developing robust and reliable Windows drivers. Resource conflicts are a common source of driver issues.