Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

Registry Keys Related to Loaded Device Drivers

Registry Keys Related to Loaded Device Drivers

Apart from configurable registry entries in driver-specific subkeys, Device Manager also maintains dynamic registry information in subkeys for loaded drivers under the HKEY_LOCAL_MACHINEDriversActive key. The subkeys correspond to numerical values that the operating system assigns dynamically and increments for each driver until the system is restarted. The number does not signify a particular driver. For example, if you unload and reload a device driver, the operating system assigns the next number to the driver and does not reuse the previous subkey. Because you cannot ensure a reliable association between the subkey number and a particular device driver, you should not edit the driver entries in the HKEY_LOCAL_MACHINEDriversActive key manually. However, you can create, read, and write driver-specific registry keys at load time in a driver's XXX_Init function because Device Manager passes the path to the current DriversActive subkey to the stream driver as the first parameter. The driver can open this registry key using OpenDeviceKey.

Table 6-4 lists typical entries that the subkeys under DriversActive can contain.

Table 6-4 Registry entries for device drivers under the HKEY_LOCAL_MACHINEDriversActive key

Registry Entry Type Description
Hnd REG_DWORD The handle value for the loaded device driver. You can obtain this DWORD value from the registry and pass it in a call to DeactivateDevice in order to unload the driver.
BusDriver REG_SZ The name of the driver's bus.
BusName REG_SZ The name of the device's bus.
DevID A unique device identifier from Device Manager.
FullName REG_SZ The name of the device if used with the $device namespace.
Name REG_SZ The driver's legacy device file name including index, if a prefix is specified (not present for drivers that do not specify a prefix).
Order REG_DWORD The same order value as in the driver's registry key.
Key REG_SZ The registry path to the driver's registry key.
PnpId REG_SZ The Plug and Play identifier string for PCMCIA drivers.
Sckt REG_DWORD For PCMCIA drivers, describes the current socket and function of the PC card.

NOTE

Checking the Active key

By calling the RequestDeviceNotifications function with a device interface GUID of DEVCLASS_STREAM_GUID, an application can receive messages from Device Manager to identify loaded stream drivers programmatically. RequestDeviceNotifications supersedes the EnumDevices function.

Оглавление книги


Генерация: 1.233. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз