WdfRegistryRemoveValue - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfregistry.h

NTSTATUS WdfRegistryRemoveValue(
  [in] WDFKEY           Key,
  [in] PCUNICODE_STRING ValueName
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfregistry-wdfregistryremovevalue)

WdfRegistryRemoveValue function

Description

[Applies to KMDF and UMDF]

The WdfRegistryRemoveValue method removes a specified value and its data from a specified registry key.

Parameters

Key [in]

A handle to a registry-key object that represents an opened registry key.

ValueName [in]

A pointer to a UNICODE_STRING structure that contains a value name.

Return value

WdfRegistryRemoveValue returns STATUS_SUCCESS if the operation succeeds. Otherwise, the method might return one of the following values:

Return code Description
STATUS_INVALID_DEVICE_REQUEST WdfRegistryRemoveValue was not called at IRQL = PASSIVE_LEVEL.
STATUS_INVALID_PARAMETER An invalid parameter was specified.
STATUS_ACCESS_DENIED The driver did not open the registry key with KEY_SET_VALUE access.

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

For more information about registry-key objects, see Using the Registry in Framework-Based Drivers.

Examples

The following code example removes the MyValue value and its data from a specified registry key.

DECLARE_CONST_UNICODE_STRING(valueName, L"MyValue");

status = WdfRegistryRemoveValue(
                                Key,
                                &valueName
                                );

See also

UNICODE_STRING