| Previous | Next |
| STATUS_FATAL_APP_EXIT | STATUS_WAS_UNLOCKED |
STATUS_PREDEFINED_HANDLE
The handle has special predefined-key semantics
Handles such as HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER are predefined entry points, not ordinary handles returned for one opened key. Windows can cache or remap them, and process-wide operations such as RegOverridePredefKey change where a predefined handle resolves.
This distinction matters in services and impersonating code. Microsoft documents separate APIs for disabling predefined-handle caching and for opening the current impersonated user key, because a cached HKEY_CURRENT_USER can otherwise refer to an unexpected security context.
What to inspect
- Identify whether the caller passed a predefined constant or an opened key handle.
- Check for RegOverridePredefKey in installers and test harnesses.
- Use RegOpenCurrentUser when the current impersonated user is required.
- Do not apply ordinary lifetime assumptions to a process-wide predefined handle.
References
- Microsoft Learn: Predefined Keys
- Microsoft Learn: RegOverridePredefKey
- Microsoft Learn: Registry Functions
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.