Author: pschweitzer
Date: Sun Apr 21 19:01:09 2013
New Revision: 58814
URL:
http://svn.reactos.org/svn/reactos?rev=58814&view=rev
Log:
[KERNEL32]
Implement support for WC translation to DOS so that they are correctly passed to
FsRtlIs*InExpression()
Please retest issues CORE-5125 and CORE-7100
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/…
==============================================================================
--- 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] Sun Apr 21 19:01:09
2013
@@ -817,6 +817,46 @@
{
FilePattern.Length = 2;
}
+ else
+ {
+ /* Translate wildcard from "real" world to DOS world for lower
interpretation */
+ USHORT PatternIndex = 0;
+ while (PatternIndex < FilePattern.Length / sizeof(WCHAR))
+ {
+ if (PatternIndex > 0)
+ {
+ if (FilePattern.Buffer[PatternIndex] == L'.' &&
+ FilePattern.Buffer[PatternIndex - 1] == L'*')
+ {
+ FilePattern.Buffer[PatternIndex - 1] = L'<';
+ }
+ }
+
+ if (FilePattern.Buffer[PatternIndex] == L'?')
+ {
+ FilePattern.Buffer[PatternIndex] = L'>';
+ if (PatternIndex > 0)
+ {
+ if (FilePattern.Buffer[PatternIndex - 1] == L'.')
+ {
+ FilePattern.Buffer[PatternIndex - 1] = L'\"';
+ }
+ }
+ }
+ else if (FilePattern.Buffer[PatternIndex] == L'*')
+ {
+ if (PatternIndex > 0)
+ {
+ if (FilePattern.Buffer[PatternIndex - 1] == L'.')
+ {
+ FilePattern.Buffer[PatternIndex - 1] = L'\"';
+ }
+ }
+ }
+
+ PatternIndex++;
+ }
+ }
Status = NtQueryDirectoryFile(hDirectory,
NULL, NULL, NULL,