kernel32: CreateDirectory shouldn't return ERROR_ACCESS_DENIED for the root of the...
commitc26b6afad37742cb6a9abc52ff1aee304d9ae689
authorDmitry Timoshkov <dmitry@baikal.ru>
Fri, 28 Dec 2018 07:42:20 +0000 (28 15:42 +0800)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 28 Dec 2018 16:42:23 +0000 (28 17:42 +0100)
tree32c4e97095f9e6064f4129b6fc7b026f2450623f
parent2058505cebc7bb069e1e2d0d738353336e943b7b
kernel32: CreateDirectory shouldn't return ERROR_ACCESS_DENIED for the root of the drive.

According to the testbot results CreateDirectory("C:\\", NULL) fails
with ERROR_ACCESS_DENIED for not administrators. However with UAC enabled
and not and administrator account I get ERROR_ALREADY_EXISTS in that case
with Windows 7 64-bit running on real hardware. Moreover, Wine doesn't
really perform any access checks in that case and blindly assumes that
returning STATUS_ACCESS_DENIED is correct behaviour for the drive's root:
dlls/ntdll/directory.c,lookup_unix_name().

This patch fixes an application that can't find its data files because
after it receives ERROR_ACCESS_DENIED it stops further directory traversing.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/kernel32/tests/directory.c
dlls/ntdll/directory.c