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

Registry Settings to Load Device Drivers

Registry Settings to Load Device Drivers

If you use ActivateDeviceEx to load your driver dynamically, you are not required to place the driver's registry settings in a subkey under HKEY_LOCAL_MACHINEDriversBuiltIn. You can use an arbitrary path, such as HKEY_LOCAL_MACHINESampleDriver. However, the registry values for the driver are the same in both cases. Table 6-3 lists general registry entries that you can specify for a device driver in the driver's registry subkey (see Figure 6-4 for sample values).

Table 6-3 General registry entries for device drivers

Registry Entry Type Description
Prefix REG_SZ A string value that contains the driver's three-letter name. This is the value that replaces XXX in the stream interface functions. Applications also use this prefix to open a context of the driver through CreateFile.
Dll REG_SZ This is the name of the DLL that Device Manager loads to load the driver. Note that this is the only mandatory registry entry for a driver.
Index REG_DWORD This is the number appended to the driver prefix to create the driver's file name. For example, if this value is 1, applications can access this driver through a call to CreateFile(L"XXX1:"…) or CreateFile(L"$deviceXXX1"…). Note that this value is optional. If you do not define it, Device Manager assigns the next available index value to the driver.
Order REG_DWORD This is the order in which Device Manger loads the driver. If this value is not specified, the driver will be loaded last, at the same time as other drivers with no order specified. Drivers with the same Order value start concurrently. You should only configure this value to enforce a sequential load order. For example, a Global Positioning System (GPS) driver might require a Universal Asynchronous Receiver/Transmitter (UART) driver to get access to the GPS data through a serial port. In this case, it is important to assign the UART driver a lower Order value than the GPS driver so that the UART driver starts first. This will enable the GPS driver to access the UART driver during its initialization.
IClass REG_MULTI_SZ This value can specify predefined device interface globally unique identifiers (GUIDs). To advertise an interface to Device Manager, such as to support the Plug and Play notification system and power management capabilities, add the corresponding interface GUIDs to the IClass value or call AdvertiseInterface in the driver.
Flags REG_DWORD This value can contain the following flags:
? DEVFLAGS_UNLOAD (0x0000 0001) The driver unloads after a call to XXX_Init.
? DEVFLAGS_NOLOAD (0x0000 0004) The driver cannot be loaded.
? DEVFLAGS_NAKEDENTRIES (0x0000 0008) The entry points of the driver are Init, Open, IOControl, and so forth, without any prefixes.
? DEVFLAGS_BOOTPHASE_1 (0x0000 1000) The driver is loaded during system phase 1 for systems with multiple boot phases. This prevents the driver from being loaded more than one time during the boot process.
? DEVFLAGS_IRQ_EXCLUSIVE (0x0000 0100) The bus driver loads this driver only when it has exclusive access to the interrupt request (IRQ) specified by the IRQ value.
? DEVFLAGS_LOAD_AS_USERPROC (0x0000 0010) Loads the driver in user mode.
UserProcGroup REG_DWORD Associates a driver marked with the DEVFLAGS_LOAD_AS_USERPROC (0x0000 0010) flag to load in user mode with a user-mode driver host process group. User-mode drivers that belong to the same group are loaded by Device Manager in the same host process instance. If this registry entry does not exist, Device Manager loads the user-mode driver into a new host process instance.

NOTE

Flags

For details about the Flags registry value, see the section "ActivateDeviceEx" in the Windows Embedded CE 6.0 Documentation, available on the Microsoft MSDN Web site at http://msdn2.microsoft.com/en-us/library/aa929596.aspx.

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


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