IRegistryKey::DeleteKey method

The DeleteKey method deletes the registry key.

Syntax

NTSTATUS DeleteKey(

);

Parameters

This function has no parameters.

Return Value

DeleteKey returns STATUS_SUCCESS if the call was successful. Otherwise, the method returns an appropriate error code.

Remarks

A caller deletes an IRegistryKey object's registry key by calling the DeleteKey method on that object. The key can be deleted only if the caller created the key with an ACCESS_MASK that permits deletion. The caller enables deletion by specifying a DesiredAccess parameter value of KEY_ALL_ACCESS (described in ZwCreateKey) to the PcNewRegistryKey, IPort::NewRegistryKey, or IRegistryKey::NewSubKey call that creates the key. When deleting a key, the IRegistryKey object discards its registry-key handle, and all other handles to the deleted key become invalid.

Requirements

   
Target Platform Universal
Header portcls.h (include Portcls.h)
IRQL PASSIVE_LEVEL

See Also

ACCESS_MASK

IPort::NewRegistryKey

IRegistryKey

IRegistryKey::NewSubKey

PcNewRegistryKey

ZwCreateKey

ZwDeleteKey