Return Values for Registry Services

The following list of error values is not comprehensive. It is included here to give you an idea of the kinds of errors to expect. Future versions of Windows may return new error codes, or return slightly different error codes under analogous circumstances.

Value

Meaning

ERROR_SUCCESS

The function was successful.

ERROR_NO_MORE_ITEMS

There are no more keys or values to enumerate.

ERROR_MORE_DATA

Passed in buffer is not large enough to hold the entire value.

ERROR_FILE_NOT_FOUND

The specified key was not found in the registry database.

ERROR_KEY_DELETED

HKEY passed to service has been deleted since it was opened.

ERROR_CANTOPEN ERROR_CANTREAD

Aliases of ERROR_FILE_NOT_FOUND for 16 bit code.

ERROR_ACCESS_DENIED

Attempt to write to a key for which code does not have write access.

ERROR_OUTOFMEMORY

Insufficient memory to open the registry key or insufficient memory to load the required data from the registry file.


The following may be returned when calling the registry services incorrectly:

ERROR_BADKEY

The subkey string contains an invalid character or the handle identifying the key is invalid.

ERROR_LOCK_FAILED

Registry reentered while blocked by same process.

ERROR_INVALID_PARAMETER

Parameter is required and not specified, an invalid pointer or otherwise not valid.


The following indicate a system problem. The system contains procedures for recovering from these errors, mostly involving rebooting:

ERROR_BADDB ERROR_REGISTRY_CORRUPT

Registry data structures corrupt.

ERROR_REGISTRY_IO_FAILED

The registry file cannot be found or it was already opened by another application. A full disk or problem reading or writing to the disk may also cause this error.


When an HKEY is specified as an input parameter, it must be an HKEY returned from one of the registry services or one of the following predefined keys:

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

HKEY_CURRENT_CONFIG

HKEY_DYN_DATA


Of the predefined key values, only HKEY_LOCAL_MACHINE and HKEY_DYN_DATA are available to VxDs during initialization time. The entire registry space can only be accessed after VxD initialization is complete.

The key names are in OEM character set with some variations. Prior to completion of VxD initialization, all key names referenced must not contain any characters in the extended character set (character whose value is greater than 127). After VxD initialization, the entire character set is available.