From: Alexandre Esteves <alexfmpe@proton.me> --- dlls/kernel32/tests/module.c | 6 ++++++ dlls/ntdll/loader.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 17881b88672..f548fdec316 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1309,6 +1309,7 @@ static void test_AddDllDirectory(void) static const WCHAR tmpW[] = {'t','m','p',0}; static const WCHAR dotW[] = {'.','\\','.',0}; static const WCHAR rootW[] = {'\\',0}; + static const WCHAR deviceW[] = {'\\','\\','.','\\', 'C', ':', '\\', 0}; WCHAR path[MAX_PATH], buf[MAX_PATH]; DLL_DIRECTORY_COOKIE cookie; BOOL ret; @@ -1343,6 +1344,11 @@ static void test_AddDllDirectory(void) SetLastError( 0xdeadbeef ); ret = pRemoveDllDirectory( cookie ); ok( ret, "RemoveDllDirectory failed err %lu\n", GetLastError() ); + cookie = pAddDllDirectory( deviceW ); + ok( cookie != NULL, "AddDllDirectory failed err %lu\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pRemoveDllDirectory( cookie ); + ok( ret, "RemoveDllDirectory failed err %lu\n", GetLastError() ); GetWindowsDirectoryW( buf, MAX_PATH ); lstrcpyW( buf + 2, tmpW ); cookie = pAddDllDirectory( buf ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 61cc9e1e112..ac42ba7c24c 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4727,7 +4727,7 @@ NTSTATUS WINAPI LdrAddDllDirectory( const UNICODE_STRING *dir, void **cookie ) struct dll_dir_entry *ptr; RTL_PATH_TYPE type = RtlDetermineDosPathNameType_U( dir->Buffer ); - if (type != RtlPathTypeRooted && type != RtlPathTypeDriveAbsolute && type != RtlPathTypeUncAbsolute) + if (type != RtlPathTypeRooted && type != RtlPathTypeDriveAbsolute && type != RtlPathTypeUncAbsolute && type != RtlPathTypeLocalDevice) return STATUS_INVALID_PARAMETER; status = RtlDosPathNameToNtPathName_U_WithStatus( dir->Buffer, &nt_name, NULL, NULL ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9917