Is Windows 7 registry vollatile? RRS feed

  • Question

  • I have an application that saves some important data in the Windows Registry. This data is used when the system is restarted. The exact flow is as follows:

    1. The application is started for the first time.
    2. It writes some important configuration data of the current operation in the registry.
    3. The operation runs regularly until there is a failure (which can be the application process is ended, the computer is restarted or the power is down and the computer turns off).
    4. When the operation is restablished (after the computer restarts, in case it was turned off), it gets the configuration data from the registry and restarts the operation based on it.

    This operation flow worked for many years without any problem at all. However, a few months ago, we had to update our OS from XP to Windows 7, and it suddenly stopped working for the power down case. This means that if the computer was manually restarted or the process ended suddenly, it was able to recover the configuration from the registry. However if the computer was turned off due to a power failure, the registry was not holding the writen value, and the configuration data was empty.

    I am suspicious that Windows 7 registry is kind of vollatile. Which means that when we write in the registry from inside the application, this new key value is written in memory, and just stored in the hard disk when the Windows shut up process runs. If it were a database, we could say that a section was started and it was only committed when the shut down process was running. In case the computer is turned off without running this process, the section closed and the changes suffered a rollback.

    Is it a Windows 7 issue? Is there a way of "forcing" the commit inside the application code? Am I correct in my diagnose?

    Thank you.

    Monday, June 4, 2012 6:30 PM


All replies