RegReplaceKey Corruption

This is a discussion on RegReplaceKey Corruption within the Windows Programming forums, part of the Platform Specific Boards category; Hello. I am writing a simple backup app that uses RegSaveKey to save a portion of the registry. I then ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    4

    RegReplaceKey Corruption

    Hello. I am writing a simple backup app that uses RegSaveKey to save a portion of the registry. I then want to return it using RegReplaceKey. However, when I use RegReplaceKey on the exported file from RegSaveKey and restart my windows 2k pro machine, windows will not boot because it cannot load the file C:\WinNT\config\system. The only way I was able to solve the problem was by copying the system backup from repair.

    I tried to return the key using RegRestoreKey. This does work successfully (the changes are in place and there is no corruption of any sort after a restart). So it appears that the file exported by RegSaveKey works fine. I want to use RegReplaceKey because I intend on backing up crucial running areas of the registry (like specific parts of current control set), and I think those are most logically replaced when there is nothing actively running.

    Does anyone know why RegReplaceKey would be causing the corruption that keeps my computer from booting when RegRestoreKey works fine? Are there any alternatives to RegReplaceKey that replace the hive on shutdown when it is no longer being accessed? RegRestoreKey has the REG_REFRESH_HIVE flag which sounds as though it might do the same thing, but the wording seems too vague to know for certain. Also it says the TCB privilege is necessary, and I do not know of a way to acquire that privilege in my administrator-mode application.

    Thanks for any help you can provide.
    Sincerely,
    Paul

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    88
    Have you tried it on another machine? Perhaps your problem is local to your own machine. I'd test it myself, but I do not have access to an imaged version of windows 2k.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. glibc detected malloc(): memory corruption
    By totalnewbie in forum C Programming
    Replies: 6
    Last Post: 01-12-2009, 06:21 AM
  2. Heap corruption detected. What does it mean?
    By franziss in forum C++ Programming
    Replies: 17
    Last Post: 07-23-2008, 03:50 AM
  3. Replies: 7
    Last Post: 11-26-2007, 01:11 PM
  4. double free or corruption???
    By hwttdz in forum C++ Programming
    Replies: 2
    Last Post: 07-22-2006, 04:02 PM
  5. Heap corruption errors
    By VirtualAce in forum C++ Programming
    Replies: 0
    Last Post: 07-15-2006, 05:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21