Jump to content

Problem with RegRead and REG_MULTI_SZ data


Recommended Posts

When a file that's in use by the OS needs to be updated, the way most installations handle it is to put it into the PendingFileRenameOperations entry under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager. The entries are set up as follows:

The current file or directory which is to be moved or deleted is entered into the registry in the form:

\??\currentfullpath

followed by a NULL.

To destination is then entered into the registry in the form:

\??\newfullpath

followed by a NULL.

However, if the file is to be deleted, TWO NULLs are appended to the reistry entry which is where I'm running into a problem using RegRead. I'm trying to write a function which will put entries into this key. However, if the existing key (as it's last entry) has a delete file operation, there's no way for me to know since RegRead strips ALL the NULLs from the end of the entry!

I am probably going to write my own function to read the value as Binary Data and convert it to an ASCII string to preserve the true contents of the entry, but wanted to see if there were any other thoughts on this.

Incidentally, the way I'm finding out what the entry is supposed to be is with the SysInternal's Movefile from their PendMoves package - ( http://www.sysinternals.com/Utilities/PendMoves.html )

Jerry

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...