Microsoft KB Archive/323152

= PRB: The RegReplaceKey Function Is Unsuccessful and Results in ERROR_NOT_REGISTRY_FILE Error 1017 =

Article ID: 323152

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft Win32 Application Programming Interface

-



This article was previously published under Q323152



SYMPTOMS
The RegReplaceKey function does not succeed, and you receive the following system error message:

ERROR_NOT_REGISTRY_FILE

This is system error code 1017 and it means that the system has tried to load or restore a file into the registry, but the specified file is not in a registry file format.



CAUSE
Although this can occur with files that are not registry files (such as with .txt or .doc files), this can also occur with valid registry files that the currently installed operating system does not recognize.

For example, this error can occur during the following circumstances:
 * When you restore a Windows 2000 registry hive onto Windows NT 4.0.
 * When you restore a Windows XP SP1 registry hive onto Windows XP Gold.



RESOLUTION
IMPORTANT: When you replace a registry hive, make sure that the current operating system is the same (including service packs) as it was when the registry was backed up.



STATUS
This behavior is by design.



MORE INFORMATION
This error is most noticable when you perform a full system restore. You may have to install the same service pack that was in use during a backup before you restore the system. Otherwise, the registry hive from the more recent OS (as stored in the backup) might not be recognized by the current operating system that does not include the service packs.

NOTE: there are no known hotfixes that you must re-apply before doing a system restore operation.

Keywords: kbprb KB323152

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.