PRB: RegReplaceKey Fails on Windows 98 If User Profiles Are Enabled

ID: Q214775


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), on platform(s):
    • Microsoft Windows 98
    • Microsoft Windows 95


SYMPTOMS

If the RegReplaceKey API is used to replace the registry key of the currently-logged-on user (HKEY_USERS\Username), and user profiles are enabled, the API call fails with a return value of 0x57 (ERROR_INVALID_PARAMETER). The specified registry key is not replaced.


CAUSE

RegReplaceKey does not work on Windows 98 if user profiles are enabled.


RESOLUTION

Microsoft does not recommend using the RegReplaceKey API on Windows 98.

To restore the Windows 98 registry from a backup, Microsoft recommends replacing the registry files (System.dat and User.dat) during the real-mode portion of Windows startup. This method prevents possible registry corruption if another application reads from or writes to the registry while the restore (replace) operation is in progress. This method is used by the Windows 98 Registry Checker utility to restore backed-up copies of the Windows 98 registry.

Note that the Command Prompt Only startup option is not sufficient for this. The registry is still accessed and registry corruption can occur. It is recommended that you use the Autoexec.bat to replace this file as the Autoexec.bat is processed during the real-mode portion of the startup process and before the registry is loaded.


MORE INFORMATION

Please see the References section for additional information about the RegReplaceKey API.


REFERENCES

For additional information about problems with RegReplaceKey under Windows 98, please see the following article in the Microsoft Knowledge Base:

Q193467 BUG: RegReplaceKey() Fails in Windows 98


For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
Q141721 HOWTO: Boot to a Command Prompt by Default

Additional query words:

Keywords : kbKernBase kbSDKWin32 kbWinOS98 kbWinOS98bug kbfaq
Version : winnt:
Platform : winnt
Issue type : kbprb


Last Reviewed: December 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.