Freigeben über


RegRestoreFile (Windows CE 5.0)

Send Feedback

This function places the operating system in a state in which the registry can be replaced by the supplied file on a warm boot.

BOOL RegRestoreFile( LPCWSTR lpszFile );

Parameters

  • lpszFile
    [in] Specifies the name of the file to be saved. The file can exist on any mounted file system that is accessible by the OS.

Return Values

TRUE indicates success; FALSE indicates failure. To get extended error information, call GetLastError. GetLastError may fail, returning ERROR_NOT_SUPPORTED.

Remarks

The RegRestoreFile API is only supported by the object store-based registry. To save and restore data in the hive-based registry, see RegSaveKey and RegReplaceKey.

The file to be restored can exist on any mounted file system that is accessible by the operating system.

Calling RegRestoreFile copies the file to the RAM file system. RegRestoreFile either renames lpszFile to Restore.fdf, or else it copies the contents to Restore.fdf before it deletes lpszFile. If lpszFile is set to Restore.fdf, the API succeeds but no data is copied.

To complete a registry replacement operation, the operating system must undergo a warm boot. Then, during initialization, the operating system will read the Restore.fdf file and create/store its contents in the registry.

The data file saved by WriteRegistryToOEM cannot be imported directly by RegRestoreFile. Use RegCopyFile to save the data to be restored by RegRestoreFile, or use WriteRegistryToOEM to save the data to be imported by ReadRegistryFromOEM.

Requirements

OS Versions: Windows CE 2.10 and later.
Header: Pwinreg.h.
Link Library: Coredll.lib.

See Also

RegCopyFile | RegSaveKey | RegReplaceKey | WriteRegistryToOEM | ReadRegistryFromOEM | Persisting Data with the RAM-Based Registry

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.