WdfDriverOpenPersistentStateRegistryKey function (wdfdriver.h)

Drivers should use WdfDriverOpenPersistentStateRegistryKey to write driver wide persistent information to the registry.

Syntax

NTSTATUS WdfDriverOpenPersistentStateRegistryKey(
  [in]           WDFDRIVER              Driver,
  [in]           ACCESS_MASK            DesiredAccess,
  [in, optional] PWDF_OBJECT_ATTRIBUTES KeyAttributes,
  [out]          WDFKEY                 *Key
);

Parameters

[in] Driver

A handle to the driver's framework driver object that the driver obtained from a previous call to WdfDriverCreate or WdfGetDriver.

[in] DesiredAccess

An ACCESS_MASK typed value that specifies an access mask for the registry key. A KMDF driver typically requests KEY_READ, KEY_WRITE, or KEY_READ | KEY_WRITE. If you are writing a UMDF driver, use KEY_READ or KEY_READ | KEY_SET_VALUE. As a best practice, ask for only the types of access that your driver needs.

[in, optional] KeyAttributes

A pointer to a caller-allocated WDF_OBJECT_ATTRIBUTES structure that specifies object attributes for the framework registry-key object. This parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.

[out] Key

A pointer to a location that receives a handle to a framework registry-key object.

Return value

Refer to WdfDriverOpenParametersRegistryKey.

Remarks

The Parameters key is for immutable settings provided in the INF file. To access those settings, use WdfDriverOpenParametersRegistryKey. The key returned from this API is for settings written at runtime.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1803
Minimum KMDF version 1.25
Minimum UMDF version 2.25
Header wdfdriver.h
IRQL PASSIVE_LEVEL

See also

WdfDriverOpenParametersRegistryKey

IoOpenDriverRegistryKey

DRIVER_REGKEY_TYPE