tags:

views:

45

answers:

1

I was wondering how one might extract the current state of the registry, of Windows XP, in C or C++? (While the OS is active).

I been trying to use BackupRead() on the registry-files, but it is impossible to CreateFile() them. I managed to create a Shadow Copy of the registry-files, but it wasn't the current state of the registry.

Would appreciate any hint... (I know ERUNT is able to do it)

Thanks, Doori Bar

A: 

RegSaveKey used to be the preferred method, but the documentation now states that you should use the Volume Shadow Copy Service. I think RegSaveKey should continue to work, though (assuming you have the required privileges). Of course you could always roll your own implementation as is demonstrated in the link in one of the other answers.

Luke
Do you happen to know if the recommended Shadow Copy method is actually -current state-? or actually it's the last state that been flushed to the file system (for example, upon shutdown), Thanks! Doori.
Doori Bar
I think I've found my answer: the registry must be flushed to disk upon using the Shadow Service. Thanks!
Doori Bar