Previous Next

RtlDeleteRegistryValue

The RtlDeleteRegistryValue routine removes the specified entry name and the associated values from the registry along the given relative path.

NTSTATUS 
  RtlDeleteRegistryValue(
    IN ULONG  RelativeTo,
    IN PCWSTR  Path,
    IN PCWSTR  ValueName
    );

Parameters

RelativeTo
Specifies whether Path is an absolute registry path or is relative to a predefined key path as one of the following.
Value Meaning
RTL_REGISTRY_ABSOLUTE
  Path is an absolute registry path.
RTL_REGISTRY_SERVICES
  Path is relative to \Registry\Machine\System\CurrentControlSet\Services.
RTL_REGISTRY_CONTROL
  Path is relative to \Registry\Machine\System\CurrentControlSet\Control.
RTL_REGISTRY_WINDOWS_NT
  Path is relative to \Registry\Machine\Software\Microsoft\
Windows NT\CurrentVersion
.
RTL_REGISTRY_DEVICEMAP
  Path is relative to \Registry\Machine\Hardware\DeviceMap.
RTL_REGISTRY_USER
  Path is relative to \Registry\User\CurrentUser. (For a system process, this is \Users\.Default.)
RTL_REGISTRY_OPTIONAL
  Specifies that the key referenced by this parameter and the Path parameter are optional.
RTL_REGISTRY_HANDLE
  Specifies that the Path parameter is actually a registry handle to use. This value is optional.

Path
Specifies the registry path according to the RelativeTo value. If RTL_REGISTRY_HANDLE is set, Path is a handle to be used directly.
ValueName
Pointer to the value name to be removed from the registry.

Return Value

RtlDeleteRegistryValue returns STATUS_SUCCESS if the value entry was deleted.

Callers of RtlDeleteRegistryValue must be running at IRQL = PASSIVE_LEVEL.

Note that if RelativeTo is set to RTL_REGISTRY_HANDLE, the following occurs:

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

See Also

RtlCheckRegistryKey, RtlQueryRegistryValues, RtlWriteRegistryValue, ZwEnumerateKey, ZwOpenKey