http://bugs.winehq.org/show_bug.cgi?id=2127
------- Additional Comments From david.guembel@gmx.de 2005-03-10 05:14 ------- Aome additional info: A +file trace shows the following output in the relevant section ----------------------------------------------------------------------- trace:file:CreateFileW L"C:\TESTLOG.LOG" FILE_SHARE_WRITE creation 4 attributes 0x80 trace:file:RtlDosPathNameToNtPathName_U (L"C:\TESTLOG.LOG",0x7f10ca10,(nil),(nil)) trace:file:RtlGetFullPathName_U (L"C:\TESTLOG.LOG" 520 0x7f10c798 (nil)) trace:file:WriteFile 0x10 0x7ef045c8 41 0x7ef045b0 (nil) trace:file:wine_nt_to_unix_file_name L"\??\C:\TESTLOG.LOG" -> "/home/guembel/.wine/dosdevices/c:/TESTLOG.LOG" trace:file:WriteFile 0x42aa8 0x7ecfcabc 33 0x7ecfcaa8 (nil) trace:file:CreateFileW returning 0x42ab8 trace:file:SetFilePointerEx handle 0x42ab8 offset 0 newpos 0x7f10ca68 origin 2 WriteFile Failed with GetLastError of 5 ----------------------------------------------------------------------
The file the sample code is writing into exists, is owned by the user running Wine, and has 640 permission.
The output the program shows is as follows: -------------------------------------------------------- WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 Created 10 Threads WriteFile Failed with GetLastError of 5 WriteFile Failed with GetLastError of 5 [...] ---------------------------------------------------------
So WriteFile fails immediately after creating the first thread. The code that made me run into the problem is slightly different. It uses k Threads, each working on a different file doing open, read, close, open, write, close.