My application extensively reads and changes the windows registry. Because of the nature of the application there is possibility to destroy the system.
To avoid system destruction I want to create a temporary copy of my registry and use the copy (.reg file of everything? Or any other suitable export format) in my application. I'd prefer to keep all the windows functions the same, so, for testing I want to hook my own application's Registry functions with a DLL which would redirect all registry accesses to a file.
I did look for a few libraries but there is no such thing to do this, or maybe I don't know what so search for. What can I do in my situation?
In short:
I want to emulate the windows registry
I want to create a hook DLL, which will be injected into my own application
The hook dll will hook all windows registry functions and redirect them to a file in the DLL directory.
Is there an open source implementation of the windows Registry functions? I only have the headers but I need exact the same behaviour as windows offers to test the application thoroughly.