Author: pschweitzer Date: Mon Apr 22 19:36:33 2013 New Revision: 58833
URL: http://svn.reactos.org/svn/reactos?rev=58833&view=rev Log: [NTOSKRNL] Properly handle (as Windows does) WC in case last dot was eaten in path name translation Fixes last FindFile failing tests
Modified: trunk/reactos/dll/win32/kernel32/client/file/find.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/find.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/find.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/find.c [iso-8859-1] Mon Apr 22 19:36:33 2013 @@ -669,7 +669,7 @@ PFIND_DATA_HANDLE FindDataHandle; PFIND_FILE_DATA FindFileData;
- UNICODE_STRING NtPath, FilePattern; + UNICODE_STRING NtPath, FilePattern, FileName; PWSTR NtPathBuffer; RTL_RELATIVE_NAME_U RelativePath; ULONG DeviceNameInfo = 0; @@ -678,6 +678,8 @@ OBJECT_ATTRIBUTES ObjectAttributes; IO_STATUS_BLOCK IoStatusBlock; HANDLE hDirectory = NULL; + + BOOLEAN HadADot = FALSE;
/* * May represent many FILE_BOTH_DIR_INFORMATION @@ -691,6 +693,12 @@ { SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; + } + + RtlInitUnicodeString(&FileName, lpFileName); + if (FileName.Length != 0 && FileName.Buffer[FileName.Length / sizeof(WCHAR) - 1] == L'.') + { + HadADot = TRUE; }
if (!RtlDosPathNameToNtPathName_U(lpFileName, @@ -856,6 +864,15 @@
PatternIndex++; } + + /* Handle partial wc if our last dot was eaten */ + if (HadADot) + { + if (FilePattern.Buffer[FilePattern.Length / sizeof(WCHAR) - 1] == L'*') + { + FilePattern.Buffer[FilePattern.Length / sizeof(WCHAR) - 1] = L'<'; + } + } }
Status = NtQueryDirectoryFile(hDirectory,