[Bug 2127] WriteFile fails on threaded applications

Wine Bugs wine-bugs at winehq.org
Mon Oct 3 08:52:19 CDT 2005


http://bugs.winehq.org/show_bug.cgi?id=2127





------- Additional Comments From david.guembel at gmx.de  2005-03-10 08:52 -------
When removing the critical section, the problem still doesn't appear, not on
uniprocessor, not on SMP, and neither when running several instances of the test
program.

However, the application that causes the problem for me does not only do 1.
CreateFile, 2. WriteFile, 3. CloseHandle (like the test code above does), but 1.
CreateFile, 2. ReadFile, 3. CloseHandle, 4. CreateFile, 5. WriteFile, 6.
CloseHandle. I.e., it opens the file for reading, reads, closes the file, opens
it for writing, writes, closes the file. That still causes errors, and as you
suspected, the WriteFile gives me a 6 (= INVALID_HANDLE). 

I noticed that if I open the file for reading (step 1.) using GENERIC_READ |
GENERIC_WRITE, close it, then open it for writing (step 4.) using GENERIC_WRITE,
there is no problem. However if I open it for reading with GENERIC_READ only,
close it, and open it with GENERIC_WRITE for writing, the WriteFile gives me the
INVALID_HANDLE after some time. Looks like your assumption about the race in the
cache is correct, doesn't it? 

Anything else you'd like to see tested?

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list