Partager via


Device Manager Architecture (Windows Embedded CE 6.0)

1/6/2010

Device Manager runs under the Windows Embedded CE operating system tracking loaded drivers and their interfaces. It runs continuously and launches from the kernel. Device Manager can notify the user when device interfaces become available and unavailable. A user or the system itself can make device interfaces available or unavailable. Additionally, Device Manager notifies the kernel that a device interface supports file operations, such as CreateFile, to access devices that expose the stream interface. Device Manager sends power notification callbacks to device drivers and provides power management services. For more information, see Power Management.

Device Manager controls the Active key in the registry. Only Device Manager should access the Active key for read or write access. You can indirectly access the Active key through a parameter to a device driver's initialization function.

Device Manager searches the HKEY_LOCAL_MACHINE\Drivers\RootKey registry key to determine the key to begin the driver loading process. The default value of RootKey is Drivers, but it is usually equal to Drivers\BuiltIn. Device Manager calls ActivateDeviceEx to load the driver specified by the Dll subkey's value found in the key specified by the RootKey value. The Dll subkey's value is by default BusEnum.dll, also referred to as the bus enumerator. Loading BusEnum.dll causes all device drivers to load. A device loaded by ActivateDeviceEx can read its activation handle from its Active registry key.

Device Manager associates a bus name with drivers. Unnamed devices can also have a bus name because even though applications might not be able to access the driver, the driver can be accessed by other drivers or system entities, such as the Power Manager. The bus name can have a different ACL from the regular device name.

Drivers can programmatically advertise interfaces by calling DMAdvertiseInterface. DMAdvertiseInterface enables drivers to add more searchable GUIDs to their associated lists. DMAdvertiseInterface is exposed by Devmgr.dll, which also implements most Device Manager functionality. Because only the Device Manager can load Devmgr.dll, only device drivers can call DMAdvertiseInterface. If a device driver does not advertise the unavailability of its interfaces when the driver is unloaded, Device Manager automatically cleans up the interface advertisement notification.

Device Manager Components

Device Manager consists of three components: nk.exe, device.dll, and devmgr.dll. Nk.exe loads device.dll, which is a thin shell that loads devmgr.dll. Devmgr.dll implements the core device manager functionality.

Because Device Manager consists of two separate modules, device drivers can link directly with Device Manager and invoke specific functions, such as DMAdvertiseInterface, without incurring the overhead of a system call.

The following table shows the components of Device Manager.

Component Description

devcore

Provides the core Device Manager functionality.

iorm

Provides the I/O Resource Manager functionality. Iorm is a required component and cannot be removed.

pmif

nopmif

Pmif provides the interface to Power Manager DLL entry points.

Nopmif provides the stubbed version of the Power Manager entry points.

See Also

Concepts

Resolving Race Conditions in Device Drivers

Other Resources

Device Manager
Stream Interface Drivers