RtlDeleteRegistryValue - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

/**
 * The RtlDeleteRegistryValue routine deletes a value from a registry key relative to one of the predefined RTL_REGISTRY_ locations.
 *
 * \param RelativeTo A flag that specifies the base location the Path is relative to.
 * \param Path A pointer to the null-terminated path of the key that contains the value.
 * \param ValueName A pointer to the null-terminated name of the value to delete.
 * \return NTSTATUS Successful or errant status.
 * \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtldeleteregistryvalue
 */
NTSYSAPI
NTSTATUS
NTAPI
RtlDeleteRegistryValue(
    _In_ ULONG RelativeTo,
    _In_ PCWSTR Path,
    _In_z_ PCWSTR ValueName
    );

#endif

View code on GitHub
// wdm.h

NTSYSAPI NTSTATUS RtlDeleteRegistryValue(
  [in] ULONG  RelativeTo,
  [in] PCWSTR Path,
  [in] PCWSTR ValueName
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-wdm-rtldeleteregistryvalue)

RtlDeleteRegistryValue function

Description

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

Parameters

RelativeTo [in]

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_HANDLE Specifies that the Path parameter is actually a registry handle to use. This value is optional.

Path [in]

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

ValueName [in]

Pointer to the value name to be removed from the registry.

Return value

RtlDeleteRegistryValue returns STATUS_SUCCESS if the value entry was deleted.

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

See also

RtlCheckRegistryKey

RtlQueryRegistryValues

RtlWriteRegistryValue

ZwEnumerateKey

ZwOpenKey