Hi list,
Can someone please give me a good place to RTFM what the !$&!% to do with paths that have /?? in them? Can I just give them over to win32 functions, or do I need to do something with them first?
Also, does anyone have any docs on "runonce.exe"? I have a very vauge knowledge of what it does, and I could find -q -b mentioned as command lines.
Shachar
"Shachar" == Shachar Shemesh arabeyes@sun.consumer.org.il writes:
Shachar> Hi list, Can someone please give me a good place to RTFM what Shachar> the !$&!% to do with paths that have /?? in them? Can I just Shachar> give them over to win32 functions, or do I need to do something Shachar> with them first?
Shachar> Also, does anyone have any docs on "runonce.exe"? I have a very Shachar> vauge knowledge of what it does, and I could find -q -b Shachar> mentioned as command lines.
Every function using the wine implementation of CreateFile should cope with a wide range of ways of writing the file path. So what did you do and what is your problem?
Bye
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.
The thing more interesting is that Windows, and as a result Wine, add "??" at the begining of the file name. This means that if I wanted to reanem C:\hello to C:\goodbye, the registry will get ??\C:\hello and ??\C:\goodbye. I tried passing this string directly into CreateFile, and no go (in other words, these are not valid file names, at least as far as Wine is concerned).
My question is whether anyone is familiar enough with the API to tell whether these are valid path names that are simply not understood by Windows, or whether I am supposed to strip them away, whether on Windows or on Wine?
Shachar
Uwe Bonnes wrote:
"Shachar" == Shachar Shemesh arabeyes@sun.consumer.org.il writes:
Shachar> Hi list, Can someone please give me a good place to RTFM what Shachar> the !$&!% to do with paths that have /?? in them? Can I just Shachar> give them over to win32 functions, or do I need to do something Shachar> with them first?
Shachar> Also, does anyone have any docs on "runonce.exe"? I have a very Shachar> vauge knowledge of what it does, and I could find -q -b Shachar> mentioned as command lines.
Every function using the wine implementation of CreateFile should cope with a wide range of ways of writing the file path. So what did you do and what is your problem?
Bye
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...) 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