What does Windows error code 1018 (ERROR_KEY_DELETED) mean?

 
Previous Next
ERROR_NOT_REGISTRY_FILE ERROR_NO_LOG_SPACE

ERROR_KEY_DELETED

The registry key has entered deletion state

A registry key can be marked for deletion while handles to it still exist. Registry deletion is therefore a lifecycle event, not necessarily an instantaneous disappearance from every thread. ERROR_KEY_DELETED tells the caller that it attempted an operation through a key context that is already being removed.

Look for concurrent delete, uninstall, rollback, policy refresh, or configuration-reset code. A common race is one thread retaining an HKEY while another component deletes the same key tree and later code attempts to query or write through the stale handle. Reopening by name is useful only if the application contract permits the key to be recreated or if another owner is expected to restore it. Do not blindly create a deleted service or system key: deletion may be intentional and recreating an incomplete key can produce a different failure later.

What to inspect

  • Trace who can delete the key and when the failing handle was opened.
  • Close stale handles and re-resolve the key only when the ownership contract permits it.
  • Check uninstall, rollback, policy, and reset paths for concurrent deletion.

References


Looking for a different code? Search another status or error code.