Partager via


Flush-On-Close Registry Flushing (Windows CE 5.0)

Send Feedback

If you have the hive-based registry, you can use aggressive flushing in the registry. With aggressive flushing, RegFlushKey is called every time RegCloseKey is called. If your device has persistent storage, aggressive flushing can cause performance issues.

The following registry key shows how to enable aggressive flushing:

[HKEY_LOCAL_MACHINE\init\BootVars]
    "RegistryFlags"=dword:1

Setting the RegistryFlags value equal to one enables aggressive flushing. If your device has persistent storage, do not set this value. If this registry value is not present or is set to zero, the registry flushes nondeterministically. For more information about nondeterministic registry flushing, see Nondeterministic Registry Flushing.

The RegistryFlags value is read only once during boot time, and is not read again until a reboot. Therefore, you cannot toggle the aggressive flushing functionality. When aggressive flushing is on, the semantics do not start until all processes in the initialization sequence have started. These delayed effects attempt to avoid adversely affecting the boot speed. This assumes that registry settings written during boot time are likely to apply only to the current device state, and therefore would not require the same level of permanence that most registry settings need.

If the flush fails, for example, due to an out-of-disk error, the key is still closed. In that case, RegCloseKey returns the error resulting from the failed flush.

See Also

Advanced Registry Concepts | Nondeterministic Registry Flushing | Registry

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.