Options for Registry Flushing (Windows Embedded CE 6.0)
1/6/2010
The RegFlushKey function has two different behaviors, depending on the type of registry on the device. You determine which of the following registry types to use:
- RAM-based registry
If an application calls RegFlushKey, the OS attempts to flush the entire registry to the Windows Embedded CE-based device supported storage. The implementation of this function is OEM-dependent, which results in the following scenarios:- If you do not support persistent registry storage, a call to this function fails.
- If you support persistent registry storage, a call to this function flushes the entire registry for storage.
- If your flush request fails, RegFlushKey fails.
For more information about supporting a persistent registry, see Persisting Data with the RAM-Based Registry.
- Hive-based registry
If an application calls RegFlushKey, the OS attempts to flush any changed data in the hive to the file beneath it. The particular hive to flush is determined from the specified key.
Applications can call RegFlushKey on the system hive or the user hive. The implementation of this function is not OEM-dependent.
For more information about how data is saved, see Data Persistence with the Hive-Based Registry.
By default, Windows Embedded CE does not support a lazy flush of the registry. The PRJ_ENABLE_REGFLUSH_THREAD environment variable can be set to force the OS to automatically lazy flush the registry. Windows Embedded CE-based devices that need to implement a lazy flush or power-down flush can also do so by calling RegFlushKey at any time from a shell, from a low-priority thread, or in the power-off switch handler in the keyboard driver.
Note
Calling this function excessively can negatively impact the performance of an application.
See Also
Concepts
Registry Flushing
Registry Operations
Flush-On-Close Registry Flushing
Hive-Based Registry Stored in RAM