Help with /?? stuff

Alberto Massari alby at exln.com
Thu Jan 9 03:37:44 CST 2003


Hi Shachar,

At 23.59 08/01/2003 +0200, Shachar Shemesh wrote:
>Hi,
>
>I'll clarify my specific predicament.
>
>It seems that when MoveFileEx is called with "MOVEFILE_DELAY_UNTIL_REBOOT" 
>flag, an entry is written into the registry with the file names to rename. 
>Windows being what it is, a MULTI_SZ entry is used in a way that is 
>totally and utterly incopatible with the MULTI_SZ definition, but we'll 
>leave that rant to another time.

You can read from the MSDN page 
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/movefileex.asp) 
what is the format used by MoveFileEx. That string is a NULL-separated list 
of pairs of files, where the first one is the source and the second is the 
target of the move operation (if the target is missing, the file should be 
deleted). I guess Wine is converting the NULL into \?? to be able to store 
it as a string.

BTW, do you need any help on this task?

Here is an excerpt of the doc:

"
If the dwFlags parameter specifies MOVEFILE_DELAY_UNTIL_REBOOT, MoveFileEx 
stores the locations of the files to be renamed at restart in the following 
registry value:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session 
Manager\PendingFileRenameOperations

The function fails if it cannot access the registry.

The PendingFileRenameOperations value is of type REG_MULTI_SZ. Each rename 
operation stores a pair of NULL-terminated strings. The system uses these 
registry entries to complete the operations at restart in the same order 
that they were issued. For example, the following code fragment creates 
registry entries that delete szDstFile and rename szSrcFile to be szDstFile 
at restart:


MoveFileEx(szDstFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
MoveFileEx(szSrcFile, szDstFile, MOVEFILE_DELAY_UNTIL_REBOOT);

The system stores the following entries in PendingFileRenameOperations:


szDstFile\0\0
szSrcFile\0szDstFile\0\0

Because the actual move and deletion operations specified with the 
MOVEFILE_DELAY_UNTIL_REBOOT flag take place after the calling application 
has ceased running, the return value cannot reflect success or failure in 
moving or deleting the file. Rather, it reflects success or failure in 
placing the appropriate entries into the registry.

The system deletes a directory tagged for deletion with the 
MOVEFILE_DELAY_UNTIL_REBOOT flag only if it is empty. To ensure deletion of 
directories, move or delete all files from the directory before attempting 
to delete it. Files may be in the directory at boot time, but they must be 
deleted or moved before the system can delete the directory.

The move and deletion operations are carried out at boot time in the same 
order they are specified in the calling application. To delete a directory 
that has files in it at boot time, first delete the files.
"

Alberto 





More information about the wine-devel mailing list