[PATCH] ntdll: Fix handling of DOS style device paths in RtlIsDosDeviceName_U
Use existing general processing code instead of hardcoding a less general result. Signed-off-by: Lukas Platz <lukas.platz(a)bluescan.de> --- dlls/ntdll/path.c | 6 ++---- dlls/ntdll/tests/path.c | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 11483fabba..c41dc81a20 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -268,7 +268,6 @@ DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U( PCWSTR path ) */ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name ) { - static const WCHAR consoleW[] = {'\\','\\','.','\\','C','O','N',0}; static const WCHAR auxW[] = {'A','U','X'}; static const WCHAR comW[] = {'C','O','M'}; static const WCHAR conW[] = {'C','O','N'}; @@ -284,9 +283,8 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name ) case UNC_PATH: return 0; case DEVICE_PATH: - if (!strcmpiW( dos_name, consoleW )) - return MAKELONG( sizeof(conW), 4 * sizeof(WCHAR) ); /* 4 is length of \\.\ prefix */ - return 0; + start = dos_name + 4; /* skip device path prefix */ + break; case ABSOLUTE_DRIVE_PATH: case RELATIVE_DRIVE_PATH: start = dos_name + 2; /* skip drive letter */ diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 195dea37e8..e744c10649 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -114,6 +114,7 @@ static void test_RtlIsDosDeviceName_U(void) { "\\\\.\\CON", 8, 6, TRUE }, /* fails on win8 */ { "\\\\.\\con", 8, 6, TRUE }, /* fails on win8 */ { "\\\\.\\CON2", 0, 0 }, + { "\\\\.\\com3", 8, 8 }, { "", 0, 0 }, { "\\\\foo\\nul", 0, 0 }, { "c:\\nul:", 6, 6 }, -- 2.18.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50856 Your paranoid android. === wxppro (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w2003std (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === wvistau64 (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === wvistau64_zh_CN (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === wvistau64_fr (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === wvistau64_he (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w2008s64 (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w7u (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w7pro64 (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w8 (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w8adm (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w864 (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w1064 (32 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === wvistau64 (64 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w2008s64 (64 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w7pro64 (64 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w864 (64 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3 === w1064 (64 bit report) === ntdll: path.c:171: Test failed: Wrong result (0,0)/(8,8) for \\.\com3
participants (2)
-
Lukas Platz -
Marvin