[Bug 9353] New: CreateFile with OPEN_ALWAYS on an existing directory sets wrong error code
http://bugs.winehq.org/show_bug.cgi?id=9353 Summary: CreateFile with OPEN_ALWAYS on an existing directory sets wrong error code Product: Wine Version: 0.9.43. Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-kernel AssignedTo: wine-bugs(a)winehq.org ReportedBy: lindevel(a)gmx.net When I call CreateFile like this: CreateFile("testdir", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS, NULL); with the directory "testdir" existing, it sets ERROR_ACCESS_DENIED, while Windows XP SP 2 sets ERROR_ALREADY_EXISTS (didn't confirm the Windows side myself). The correct flag I should be passing instead of OPEN_ALWAYS is OPEN_EXISTING (which works on Windows XP as well).
From a first try to find the cause for this, I believe that it is not in CreateFile and neither in NtCreateFile, but somewhere in wineserver.
-- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #1 from Austin English <austinenglish(a)gmail.com> 2007-08-17 16:32:22 --- Can you upload a sample program/testcase (source and binary) that demonstrates this problem? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #2 from Dennis Schridde <lindevel(a)gmx.net> 2007-08-17 17:59:44 --- Created an attachment (id=7645) --> (http://bugs.winehq.org/attachment.cgi?id=7645) Testcase -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #3 from Dennis Schridde <lindevel(a)gmx.net> 2007-08-17 18:00:29 --- Created an attachment (id=7646) --> (http://bugs.winehq.org/attachment.cgi?id=7646) Testcase - binary -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #4 from Dennis Schridde <lindevel(a)gmx.net> 2007-08-17 18:02:13 --- Compiled with GCC 4.2.0 for mingw32, with w32api-3.9, mingw-runtime-3.12. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #5 from Dennis Schridde <lindevel(a)gmx.net> 2007-08-17 19:00:35 --- I just confirmed (on WinXPSP2 in a VBox): On Windows XP OPEN_ALWAYS seems to work as well (opposing to the info I initially got from someone else on IRC). The testcase currently uses testdir in the "current directory", which, according to MSDN, is not supported. It should instead specify an absolute path, eg. "C:\\testdir". This doesn't change anything, neither on the Wine side (where it still does not work) nor on the Windows side (where it still works). (With OPEN_EXISTING and absolute paths, it also still works on both sides.) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #6 from Dennis Schridde <lindevel(a)gmx.net> 2007-08-17 19:03:00 --- PS: "works" in the 1st paragraph means: Windows is able to open the directory and lock it successfully, without errors. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Dennis Schridde <lindevel(a)gmx.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|CreateFile with OPEN_ALWAYS |CreateFile with OPEN_ALWAYS |on an existing directory |on an existing directory |sets wrong error code |fails with | |ERROR_ACCESS_DENIED --- Comment #7 from Dennis Schridde <lindevel(a)gmx.net> 2007-08-18 04:34:00 --- Just confirmed it again on the WinXPSP2 in my VBox. Wine seems wrong with failing to open the file, so I edited the bug-summary. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Keywords| |download, testcase Resolution| |FIXED --- Comment #8 from Austin English <austinenglish(a)gmail.com> 2008-04-09 04:42:42 --- Works fine for me in wine 0.9.59. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xerox_xerox2000(a)yahoo.co.uk Status|RESOLVED |UNCONFIRMED Resolution|FIXED | --- Comment #9 from Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> 2008-04-09 11:30:11 --- I don't think this is fixed: mkdir testdir wine testlock.exe Failure! Error was: 5 - Access denied Please be careful resolving bugs as fixed, whereas they are not -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 --- Comment #10 from Austin English <austinenglish(a)gmail.com> 2008-04-09 11:56:10 --- Thanks for catching that Louis. I misunderstood the code and since no instructions were included, assumed that when the program returned 'Success!' that it meant it. Confirming then. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #11 from Andrew Nguyen <arethusa26(a)gmail.com> 2008-11-29 22:14:54 --- The test application seems to work in today's Git (wine-1.1.9-183-gbbaa72d), so this is fixed. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 James Hawkins <truiken(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #12 from James Hawkins <truiken(a)gmail.com> 2008-11-29 22:21:25 --- Fixed. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #13 from Jeff Zaroyko <jeffz(a)jeffz.name> 2008-11-29 22:40:25 --- the issue still persists as per comment #9, reopening -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7645 is|0 |1 obsolete| | --- Comment #14 from Jeff Zaroyko <jeffz(a)jeffz.name> 2008-11-30 01:55:24 --- Created an attachment (id=17559) --> (http://bugs.winehq.org/attachment.cgi?id=17559) patch + testcase -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeffz(a)jeffz.name --- Comment #15 from Jeff Zaroyko <jeffz(a)jeffz.name> 2008-11-30 01:57:58 --- Dennis, Your testcase works after I apply my patch, is there a real application that this bug affects? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #16 from Dennis Schridde <lindevel(a)gmx.net> 2008-11-30 04:22:52 --- Jeff: If I would have finished the application I was writing, I could ensure you: Yes, there is. But since I did not, I can not confirm nor deny whether any real world application is affected by this issue. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #17 from Dmitry Timoshkov <dmitry(a)codeweavers.com> 2008-12-02 22:57:42 --- Probably (flags & (~O_TRUNC & ~O_CREAT)) should be replaced by (flags & (~(O_TRUNC | O_CREAT))) to make the intent more clear. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 --- Comment #18 from Jeff Zaroyko <jeffz(a)jeffz.name> 2008-12-03 00:01:12 --- (In reply to comment #17)
to make the intent more clear.
fair enough, I thought mine looked less noisy. Thanks for the feedback. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #19 from Jeff Zaroyko <jeffz(a)jeffz.name> 2008-12-03 19:01:10 --- Patches have been committed. http://source.winehq.org/git/wine.git/?a=commit;h=afce6158304ac4e0cb22bfde4d... http://source.winehq.org/git/wine.git/?a=commit;h=f8b5aa34dc4f4681a151cdc07a... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=9353 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #20 from Alexandre Julliard <julliard(a)winehq.org> 2008-12-05 11:12:39 --- Closing bugs fixed in 1.1.10. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org