[Bug 25207] New: SHFileOperation does not create new directory on FO_MOVE
http://bugs.winehq.org/show_bug.cgi?id=25207 Summary: SHFileOperation does not create new directory on FO_MOVE Product: Wine Version: 1.3.6 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: shell32 AssignedTo: wine-bugs(a)winehq.org ReportedBy: richard(a)rtrussell.co.uk Created an attachment (id=32007) --> (http://bugs.winehq.org/attachment.cgi?id=32007) C program to demonstrate the problem SHFileOperation should create the destination directory on an FO_MOVE operation, if it does not already exist, but fails to do so. See: http://msdn.microsoft.com/en-us/library/bb759795.aspx "Copy and Move operations can specify destination directories that do not exist. In those cases, the system attempts to create them and normally displays a dialog box to ask the user if they want to create the new directory. To suppress this dialog box and have the directories created silently, set the FOF_NOCONFIRMMKDIR flag in fFlags". -- 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=25207 --- Comment #1 from Richard Russell <richard(a)rtrussell.co.uk> 2010-11-17 17:37:24 CST --- Created an attachment (id=32008) --> (http://bugs.winehq.org/attachment.cgi?id=32008) Executable to demonstrate the problem Program should display 'Tests completed successfully' but under Wine 1.3.6 it displays 'SHFileOperation (FO_MOVE) failed with return value 1223'. -- 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=25207 Jeff Zaroyko <jeffz(a)jeffz.name> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Severity|major |normal --- Comment #2 from Jeff Zaroyko <jeffz(a)jeffz.name> 2010-11-17 17:40:31 CST --- not major: http://bugs.winehq.org/page.cgi?id=fields.html#bug_severity (unless you can list several applications which rely on this behavior) Confirming the testcase passes on Windows Vista SP2 32bit. -- 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=25207 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download -- 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=25207 --- Comment #3 from Richard Russell <richard(a)rtrussell.co.uk> 2011-11-19 07:03:37 CST --- "unless you can list several applications which rely on this behavior" The majority of applications compiled using 'BBC BASIC for Windows' will fail to run because of this bug. The total number is likely to be in the hundreds, although that would be difficult to confirm. Here are just a few of the applications affected: QBASIC to BBC BASIC translator: http://www.bbcbasic.co.uk/qb2bbc/QB2BBC.exe LB Booster: http://www.lbbooster.com/LBB.exe Test Card Generator: http://www.rtrussell.co.uk/tccgen/tcsetup.exe FIR Filter Design: http://www.rtr.myzen.co.uk/firbbc.exe BBC Free-D Camera Tracking: http://www.rtr.myzen.co.uk/fdsetup.exe Colour Recovery: http://www.rtr.myzen.co.uk/crexe128.zip Alien Eliminator: http://www.bb4wgames.com/progs/zip/alieneliminator.zip Vapiki: http://www.jeroengroenendaal.com/games/vapiki.exe Unnamed Shooter: http://81red.dk/UnnamedShooter.zip -- 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=25207 Jerome Leclanche <adys.wh(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh(a)gmail.com Severity|normal |major --- Comment #4 from Jerome Leclanche <adys.wh(a)gmail.com> 2011-11-19 12:09:50 CST --- Major. -- 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=25207 Erik Siers <eriksiers(a)bmi.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eriksiers(a)bmi.net -- 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=25207 Grahame Pratt <softappstudio(a)comcast.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |softappstudio(a)comcast.net --- Comment #5 from Grahame Pratt <softappstudio(a)comcast.net> 2011-11-20 23:01:36 CST --- I have four of my own BB4W applications which I would have to seriously rewrite to run under wine as long as this limitation applies. I suspect that there are hundreds of other BB4W users in the same boat. At the moment I am using Virtual-Win98SE machines to run them, terrible kluge! -- 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=25207 net201416 <net201416(a)yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |net201416(a)yahoo.com --- Comment #6 from net201416 <net201416(a)yahoo.com> --- Same problem x86 Wine 1.4.1 -- 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=25207 lizhenbo <litimetal(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |litimetal(a)gmail.com --- Comment #7 from lizhenbo <litimetal(a)gmail.com> --- Same problem on wine-1.7.11 -- 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=25207 lizhenbo <litimetal(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Paul.Vriens.Wine(a)gmail.com -- 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=25207 --- Comment #8 from lizhenbo <litimetal(a)gmail.com> --- This is first detected by Paul Vriens in dlls/shell32/tests/shlfileop.c --old code-- retval = SHFileOperationA(&shfo2); if (dir_exists("test6.txt")) { /* Vista and W2K8 (broken or new behavior ?) */ ok(retval == ERROR_NO_VOLUME_LABEL, "Expected ERROR_NO_VOLUME_LABEL, got %d\n", retval); ok(DeleteFileA("test6.txt\\test1.txt"), "The file is not moved\n"); RemoveDirectoryA("test6.txt"); ok(DeleteFileA("test7.txt\\test2.txt"), "The file is not moved\n"); RemoveDirectoryA("test7.txt"); } else { ok(retval == ERROR_CANCELLED, "Expected ERROR_CANCELLED, got %d\n", retval); ok(!file_exists("test6.txt"), "The file is not moved - many files are " "specified as a target\n"); } ------------ -- 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=25207 --- Comment #9 from lizhenbo <litimetal(a)gmail.com> --- Created attachment 47382 --> http://bugs.winehq.org/attachment.cgi?id=47382 0001-shell32-tests-SHFileOperation-should-create-new-direct.txt Patch for wine testcase -- 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=25207 --- Comment #10 from lizhenbo <litimetal(a)gmail.com> --- Created attachment 47383 --> http://bugs.winehq.org/attachment.cgi?id=47383 0002-shell32-SHFileOperation-should-create-new-directory-on.txt Patch for this problem I'm looking forward to your feedbacks, thank you. -- 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=25207 --- Comment #11 from Richard Russell <richard(a)rtrussell.co.uk> --- The destination directory requiring to be created may be of the form '..\..\dir1\dir2\dir3' (where neither dir1 nor dir2 exist), in other words it may require iteratively creating new subdirectories until the required 'level' is reached. The proposed patch appears only to call CreateDirectoryW which, unless I am mistaken, will not achieve that. -- 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=25207 --- Comment #12 from lizhenbo <litimetal(a)gmail.com> --- (In reply to comment #11)
The destination directory requiring to be created may be of the form '..\..\dir1\dir2\dir3' (where neither dir1 nor dir2 exist), in other words it may require iteratively creating new subdirectories until the required 'level' is reached.
The proposed patch appears only to call CreateDirectoryW which, unless I am mistaken, will not achieve that.
Thank you for checking that. You're right, I made a mistake. Could I use SHCreateDirectory ? -- 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=25207 --- Comment #13 from lizhenbo <litimetal(a)gmail.com> --- Created attachment 47384 --> http://bugs.winehq.org/attachment.cgi?id=47384 C program to demonstrate the problem(v2).c It shows a behavior: CreateDirectory function will only create the final directory in the path. -- 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=25207 --- Comment #14 from Richard Russell <richard(a)rtrussell.co.uk> --- (In reply to comment #12)
Could I use SHCreateDirectory ?
Probably yes, although in Windows Vista and later, SHCreateDirectory has been replaced by SHCreateDirectoryEx; I don't know what the situation is in Wine. My only concern would be what to supply as the 'hwnd' parameter. Maybe you should pass NULL when the FOF_SILENT flag is set and lpFileOp->hwnd if not? -- 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=25207 --- Comment #15 from lizhenbo <litimetal(a)gmail.com> --- (In reply to comment #14)
(In reply to comment #12)
Could I use SHCreateDirectory ?
Probably yes, although in Windows Vista and later, SHCreateDirectory has been replaced by SHCreateDirectoryEx; I don't know what the situation is in Wine.
My only concern would be what to supply as the 'hwnd' parameter. Maybe you should pass NULL when the FOF_SILENT flag is set and lpFileOp->hwnd if not?
Thank you. I checked wine's code, and I found SHCreateDirectoryEx has been implemented. As test_sh_create_dir() shows, SHCreateDirectoryEx should work in most situations (but may lack of tests for exceptions) Besides of it, I worry about dependencies. Luckily, SHCreateDirectoryExW and SHFileOperationW is in the same file, but I don't know if it is guaranteed. Thanks for mentioning 'hwnd'. I think we should do more tests, instead of only studying MSDN(although it's a good reference) IMHO. Sorry for my humble expressions. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Murray Colpman <muzerakascooby(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |muzerakascooby(a)gmail.com --- Comment #16 from Murray Colpman <muzerakascooby(a)gmail.com> --- I believe Block Post Software's simulators are affected by this bug (it could be another bug; I don't know exactly what it's calling, but it seems likely to be this issue given the error is about failure to create a file in a directory that actually doesn't exist). Demonstration versions are available. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Sebastian Lackner <sebastian(a)fds-team.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian(a)fds-team.de -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 --- Comment #17 from lizhenbo <litimetal(a)gmail.com> --- I've sent a patch: http://source.winehq.org/patches/data/113646 -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 lizhenbo <litimetal(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aric(a)codeweavers.com -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 lizhenbo <litimetal(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #47382|0 |1 is obsolete| | Attachment #47383|0 |1 is obsolete| | --- Comment #18 from lizhenbo <litimetal(a)gmail.com> --- Created attachment 52274 --> https://bugs.winehq.org/attachment.cgi?id=52274 patch v2.txt This is my second version of patch. However, I don't think this patch can be accepted to wine soon. If your application is blocked, maybe you can try wine-staging? See: https://bugs.wine-staging.com/show_bug.cgi?id=541 -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Michael Müller <michael(a)fds-team.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |michael(a)fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/shell32-SHFile | |Operation_Move -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 André H. <nerv(a)dawncrow.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv(a)dawncrow.de Staged patchset|https://github.com/wine-com |https://github.com/wine-sta |pholio/wine-staging/tree/ma |ging/wine-staging/tree/mast |ster/patches/shell32-SHFile |er/patches/shell32-SHFileOp |Operation_Move |eration_Move -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 joaopa <jeremielapuree(a)yahoo.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree(a)yahoo.fr --- Comment #19 from joaopa <jeremielapuree(a)yahoo.fr> --- Bug still occurs with wine-5.2:
SHFileOperation (FO_MOVE) failed with return value 1223
-- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Bruno Santos <brunomanuelsantos(a)tecnico.ulisboa.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brunomanuelsantos(a)tecnico.u | |lisboa.pt -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 nekoNexus(a)protonmail.ch changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nekoNexus(a)protonmail.ch -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Zeb Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12(a)gmail.com --- Comment #20 from Zeb Figura <z.figura12(a)gmail.com> --- (In reply to Murray Colpman from comment #16)
I believe Block Post Software's simulators are affected by this bug (it could be another bug; I don't know exactly what it's calling, but it seems likely to be this issue given the error is about failure to create a file in a directory that actually doesn't exist). Demonstration versions are available.
I can confirm that this application is fixed by the relevant patch. All of the other applications in comment 3 are either no longer accessible, or it's not clear to me how to trigger the failure, assuming it was ever actually related. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Zeb Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://web.archive.org/web | |/20240317200525/https://blo | |ckpostsoftware.co.uk/files/ | |Ford_Version_R1_setup.exe -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 --- Comment #21 from lizhenbo <litimetal(a)gmail.com> --- (In reply to Zeb Figura from comment #20)
I can confirm that this application is fixed by the relevant patch.
All of the other applications in comment 3 are either no longer accessible, or it's not clear to me how to trigger the failure, assuming it was ever actually related.
I tried my test code https://bugs.winehq.org/attachment.cgi?id=47384 With wine-9.4, it still shows Creating file C:\users\lizhenbo\Temp\shfotest.tmp Moving file to C:\users\lizhenbo\Temp\newsubdir\dir2\dir3\dir4\shfotest.tmp SHFileOperation (FO_MOVE) failed with return value 1223 I'm sorry for dropping my patch to wine-staging for years[1]. I'd like to pick up my staging patch and let it be accepted by wine-get [1]: https://github.com/wine-staging/wine-staging/tree/master/patches/shell32-SHF... -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 --- Comment #22 from Zeb Figura <z.figura12(a)gmail.com> --- (In reply to lizhenbo from comment #21)
With wine-9.4, it still shows Creating file C:\users\lizhenbo\Temp\shfotest.tmp Moving file to C:\users\lizhenbo\Temp\newsubdir\dir2\dir3\dir4\shfotest.tmp SHFileOperation (FO_MOVE) failed with return value 1223
It's not upstream yet. I submitted it as 5335. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Vijay Kamuju <infyquest(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Fixed by SHA1| |b4a5775ffb2e5c27ff85399f89f | |6b37f1d1298d3 Resolution|--- |FIXED CC| |infyquest(a)gmail.com --- Comment #23 from Vijay Kamuju <infyquest(a)gmail.com> --- Patch upstreamed - https://source.winehq.org/git/wine.git/commit/b4a5775ffb2e5c27ff85399f89f6b3... -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #24 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 9.5. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=25207 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |9.0.x -- 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=25207 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|9.0.x |--- --- Comment #25 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 9.0.x milestone from bug fixes included in 9.0.1. -- 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 (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla