Flushregistry, Syntax, Remarks – Rockwell Automation 6182 SDK User Manual
Page 68

4–28
RAC6182-Specific Extensions to the CE API
Publication 6182-UM002B-EN-P
FlushRegistry
This function is the Flush Registry. It is prototyped in regflush.h.
Syntax
#include
#include
BOOL RegistryFlush(void)
Remarks
This function is defined as a macro in regflush.h. This function
commands the operating system to flush the entire registry to the
persistent registry storage. The procedure that occurs when this API is
invoked is as follows:
1. The entire registry information is collected from Windows CE.
2. This information is compressed to save space, and also results in a
time savings when going to flash memory such as the Disk-On-Chip.
3. Any existing temporary persistent registry file is deleted.
4. The temporary persistent registry file is created and the compressed
registry information written out.
5. Any existing backup persistent registry file is deleted.
6. Any existing primary persistent registry file is moved to the backup
persistent registry file.
7. The temporary persistent registry file is moved to the primary
persistent registry file and has its attributes set to read-only, hidden,
and system.
The function does not return unless there is an error or the flush is
successfully completed. Any fatal errors such as failing to allocate
enough working RAM, failing to create or write the temporary persistent
registry file or failure to move this file to be the primary persistent
registry file will result in failure of the function. File system errors will
result if the Disk-On-Chip is not properly formatted, has been corrupted,
or does not have enough space free.
The registry flush procedure requires 512K+2*(compressed registry size)
bytes of RAM be free as working space for storing and compressing the
registry. The Disk-On-Chip file-system needs to have (compressed
registry size rounded up to nearest cluster size) bytes free for registry
flush to succeed. Typical registry size for the base operating system are
on the order of 128K-160K uncompressed which compresses very well
to 32K-40K. Registry keys added by applications will certainly increase