From: Zhiyi Zhang Subject: Re: [PATCH] shell32: SHCreateDirectoryExW no CANCELLED for ALREADY_EXISTS Message-Id: <625aacf7-064f-78b6-6cda-f29e5bee09a3@codeweavers.com> Date: Tue, 16 Apr 2019 10:18:49 +0800 In-Reply-To: <20190416015731.5501-1-git@johnthomson.fastmail.com.au> References: <20190416015731.5501-1-git@johnthomson.fastmail.com.au> On 4/16/19 9:57 AM, John Thomson wrote: > If SHCreateDirectoryExW is passed a non-null hWnd, > but the directory already exists, > ERROR_CANCELLED is returned, rather than ERROR_ALREADY_EXISTS > > An application relying on an expected return code > may not proceed given the 0x4C7 1223 ERROR_CANCELLED, > rather than a 0xB7 183 ERROR_ALREADY_EXISTS > > Warframe in-game screenshots (F6) demonstrates this behaviour > > Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47023 > Signed-off-by: John Thomson > --- > My demo program of SHCreateDirectoryExW with a Hwnd > returned a 183 on Windows 7, and a 1223 in wine. > I would like someone else to confirm this. > > I am also unsure whether ERROR_FILE_EXISTS should also be returned > as another exception to the rule. > --- You can write some conformance tests and verify the behavior on TestBots(https://testbot.winehq.org/) Thanks. Zhiyi > dlls/shell32/shlfileop.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c > index c7bd54d200..1515ad3891 100644 > --- a/dlls/shell32/shlfileop.c > +++ b/dlls/shell32/shlfileop.c > @@ -763,7 +763,9 @@ int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES s > } > } > > - if (ret && hWnd && (ERROR_CANCELLED != ret)) > + if (ret && hWnd && > + ret != ERROR_CANCELLED && > + ret != ERROR_ALREADY_EXISTS) > { > /* We failed and should show a dialog box */ > FIXME("Show system error message, creating path %s, failed with error %d\n", debugstr_w(path), ret);