CopyFile fails sometimes

Fabian Cenedese Cenedese at indel.ch
Thu Feb 12 06:10:43 CST 2004


Hi

I wrote my own little copy program which mostly works with CopyFile.
It does so quite well but it fails on some file(name)s. Here is the trace
of copying two files with admittedly unusual filenames:

trace:file:CopyFileW L"_ConfigurationType._TemplInfoLinkMaster_" -> L"C:\\imp2\\Config\\_ConfigurationType._TemplInfoLinkMaster_"
trace:file:CreateFileW L"_ConfigurationType._TemplInfoLinkMaster_" GENERIC_READ FILE_SHARE_READ FILE_SHARE_WRITE OPEN_EXISTING  attributes 0x0
FABI: FILE: FILE_CreateFile: /home/fabi/winec/IMD/Templates/InosConfiguration/_ConfigurationType._TemplInfoLinkMaster_
trace:file:CreateFileW returning 0x10
trace:file:GetFileInformationByHandle 0x10
trace:file:CreateFileW L"C:\\imp2\\Config\\_ConfigurationType._TemplInfoLinkMaster_" GENERIC_WRITE FILE_SHARE_READ FILE_SHARE_WRITE CREATE_ALWAYS  attributes 0x20
FABI: FILE: FILE_CreateFile: /home/fabi/winec/imp2/Config/_ConfigurationType._TemplInfoLinkMaster_
trace:file:CreateFileW returning 0x28
trace:file:ReadFile 0x10 0x408ceeb0 2048 0x408ceea8 (nil)
trace:file:WriteFile 0x28 0x408ceeb0 130 0x408ceeac (nil)
trace:file:ReadFile 0x10 0x408ceeb0 2048 0x408ceea8 (nil)

trace:file:CopyFileW L"_ConfigurationType._TemplInfoPpcISM_" -> L"C:\\imp2\\Config\\_ConfigurationType._TemplInfoPpcISM_"
trace:file:CreateFileW L"_ConfigurationType._TemplInfoPpcISM_" GENERIC_READ FILE_SHARE_READ FILE_SHARE_WRITE OPEN_EXISTING  attributes 0x0
FABI: FILE: FILE_CreateFile: /home/fabi/winec/IMD/Templates/InosConfiguration/_ConfigurationType._TemplInfoPpcISM_
trace:file:CreateFileW returning 0x10
trace:file:GetFileInformationByHandle 0x10
trace:file:CreateFileW L"C:\\imp2\\Config\\_ConfigurationType._TemplInfoPpcISM_" GENERIC_WRITE FILE_SHARE_READ FILE_SHARE_WRITE CREATE_ALWAYS  attributes 0x20
FABI: FILE: FILE_CreateFile: /home/fabi/winec/imp2/Config/_ConfigurationType._TemplInfoPpcISM_
trace:file:CreateFileW returning 0x28
trace:file:ReadFile 0x10 0x408ceeb0 2048 0x408ceea8 (nil)
trace:file:WriteFile 0x28 0x408ceeb0 124 0x408ceeac (nil)
trace:file:ReadFile 0x10 0x408ceeb0 2048 0x408ceea8 (nil)


There are several files like that but in the destination directory I get only one single
file with the name "_ConfigurationType" with which they all begin with. The content
is the one from the last file being copied. So it looks like the CreateFile somehow
messed up the name as everything else worked and copied all files over each
other. I traced it until the call to the server in FILE_CreateFile. I only had a look
at the server code but couldn't see anything where the filename is analyzed
(except for .exe and .com). Other files are copied without any problem, with
or without extension, even extensions longer than 3 chars.

But it gets even weird. My copy tool is a Win32 CLI app. I have a batch
file which calls this copy tool to copy several files (of course). If this batch
file again is called from a Win32 MFC+GUI app I get this described error. But
if I call it directly with wineconsole batch.bat the whole copying works.
So it may have to do with execution/redirection. But I'm out again.

Anything I could test?

Thanks

bye  Fabi





More information about the wine-devel mailing list