Share via


Options for Registry Flushing

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/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:

Note

Windows Mobile does not support RAM-based registry.

  • RAM-based registry
    If an application calls RegFlushKey, the OS attempts to flush the entire registry to the 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.
  • 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. **

By default, Windows Mobile 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 phones 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

Other Resources