Bewerken

Delen via


Introduction to Registry Keys for Drivers

Drivers typically use a set of system-defined registry keys to store or access driver-specific or device-specific information. Your driver might access the following registry keys:

  • Parameters key

    The driver's Parameters key can contain configuration information for your driver and can be accessed by calling WdfDriverOpenParametersRegistryKey. For Kernel-Mode Driver Framework (KMDF) drivers, this key is located in the appropriate Services tree for the driver. For User-Mode Driver Framework (UMDF) drivers, this key is located in the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services tree, under the driver's service name. The subkey for the driver always uses the driver's service name, even if the driver binary's file name differs from the service name.

    Note

    UMDF does not support creating subkeys.

    When the system calls your driver's DriverEntry routine, it passes the driver a path to the driver's key in the appropriate Services tree. Your driver must pass this path to WdfDriverCreate. Subsequently, the driver can obtain the path by calling WdfDriverGetRegistryPath.

  • Software key

    A driver's software key is also called its driver key. The system stores information about each driver under its software key.

    Your driver can call WdfFdoInitOpenRegistryKey and WdfDeviceOpenRegistryKey to open a device's software key.

    Your driver's INF file can contain INF AddReg directives that set registry values under the software key using INF DDInstall sections.

  • Hardware keys

    When a driver stack informs the Plug and Play (PnP) manager that a device is connected to the system, the PnP manager creates a hardware key for the device. This key is also called a device key. Settings related to the hardware (such as interrupt settings) can be stored here by drivers.

    Your driver can call WdfFdoInitOpenRegistryKey and WdfDeviceOpenRegistryKey to open a device's hardware key.

    Your driver's INF file can contain INF AddReg directives that set registry values under the hardware key using INF DDInstall.HW sections.

To determine whether your driver type requires that you store information under specific registry keys, see the sections of this documentation that discuss your driver's device type by using the table of contents.

For more information about registry keys for drivers, see: