PDA

View Full Version : Reading PendingFileRenameOperations



dbriggs
10-08-2003, 09:20 AM
As a workaround during an upgrade install that must uninstall a previous version product, I am reading the multi-string PendingFileRenameOperations from the Registry before the uninstaller gets going. That way, I can put it back afterwards, effectively deleting any entries that the uninstaller might have made.

If it exists, PendingFileRenameOperations can contain multiple Unicode strings and may be quite long.

The Help, Data Types topic states that DS9 "does not support multiple NULL terminated strings in the same string variable".

I am just reading the value into a string variable and storing the length. If I need to, I put the value back using the same variables. Other than this, I don't intend to process the string in any way.

Does anyone know whether using an autosized string variable in this way is safe?

Thanks for any suggestions,

David

RichAquino
10-08-2003, 01:46 PM
Hi David,

You'll need to explicitly specify the string size (i.e. don't autosize). Please see the help topic "Using null-delimited strings".

Rich

dbriggs
10-09-2003, 06:56 AM
OK, thanks.

Am I correct in understanding that auto-size won't work except maybe to truncate the string to the first double-null. Even finding out how big the actual data is and fiddling with a string variable so it is big enough will still auto-size back down again, so that would not be any good either.

I don't know what the maximum size can be for a Unicode multi-string in the Registry. If I have to declare a size at compile time, can I use anything less than the maximum allowable for a string variable (65535 "characters") and hope?

I thought of calling REGEDIT /E to dump the Session Manager Key out to a .REG file and re-importing it afterwards, but I am getting all the sub-keys as well, so that is not really safe. It won't dump a single Value.

Any further suggestions?

David

dbriggs
10-10-2003, 01:21 PM
I have declared the string variable at 65534 "characters" (65535 gives a compiler error) and put a check in that will abort the install if the value that comes back is bigger than the buffer. That assumes that the numbers are equivalent data size and "characters", that is.

Thanks for the suggestions.

David

Mona23
03-01-2019, 04:24 AM
Even finding out how big the actual data is and fiddling with a string variable so it is big enough will still auto-size back down again diebestetest (https://www.diebestetest.de/), so that would not be any good either.