Author: pschweitzer
Date: Sun Dec 12 22:17:45 2010
New Revision: 50019
URL:
http://svn.reactos.org/svn/reactos?rev=50019&view=rev
Log:
[NTOSKRNL]
Fixed FsRtlIsNameInExpression() according to r50018 tests
Modified:
trunk/reactos/ntoskrnl/fsrtl/name.c
Modified: trunk/reactos/ntoskrnl/fsrtl/name.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/name.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] Sun Dec 12 22:17:45 2010
@@ -29,55 +29,53 @@
while (i < Name->Length / sizeof(WCHAR) && k < Expression->Length
/ sizeof(WCHAR))
{
- if ((Expression->Buffer[k] == (IgnoreCase ? UpcaseTable[Name->Buffer[i]] :
Name->Buffer[i])) ||
- (Expression->Buffer[k] == L'?') || (Expression->Buffer[k] ==
DOS_QM) ||
- (Expression->Buffer[k] == DOS_DOT && (Name->Buffer[i] ==
L'.' || Name->Buffer[i] == L'0')))
- {
- i++;
+ if ((Expression->Buffer[k] == (IgnoreCase ? UpcaseTable[Name->Buffer[i]] :
Name->Buffer[i])) ||
+ (Expression->Buffer[k] == L'?') || (Expression->Buffer[k] ==
DOS_QM) ||
+ (Expression->Buffer[k] == DOS_DOT && Name->Buffer[i] ==
L'.'))
+ {
+ i++;
+ k++;
+ }
+ else if (Expression->Buffer[k] == L'*')
+ {
+ if (k < (Expression->Length / sizeof(WCHAR) - 1))
+ {
+ if (Expression->Buffer[k+1] != L'*' &&
Expression->Buffer[k+1] != L'?' &&
+ Expression->Buffer[k+1] != DOS_DOT &&
Expression->Buffer[k+1] != DOS_QM &&
+ Expression->Buffer[k+1] != DOS_STAR)
+ {
+ while ((IgnoreCase ? UpcaseTable[Name->Buffer[i]] :
Name->Buffer[i]) != Expression->Buffer[k+1] &&
+ i < Name->Length / sizeof(WCHAR)) i++;
+ }
+ }
+ else
+ {
+ i = Name->Length / sizeof(WCHAR);
+ }
+ k++;
+ }
+ else if (Expression->Buffer[k] == DOS_STAR)
+ {
+ j = i;
+ while (j < Name->Length / sizeof(WCHAR))
+ {
+ if (Name->Buffer[j] == L'.')
+ {
+ i = j;
+ }
+ j++;
+ }
+ k++;
+ }
+ else
+ {
+ i = Name->Length / sizeof(WCHAR);
+ }
+ }
+ if (k + 1 == Expression->Length / sizeof(WCHAR) && i == Name->Length /
sizeof(WCHAR) &&
+ Expression->Buffer[k] == DOS_DOT)
+ {
k++;
- }
- else if (Expression->Buffer[k] == L'*')
- {
- if (k < (Expression->Length / sizeof(WCHAR) - 1))
- {
- if (Expression->Buffer[k+1] != L'*' &&
Expression->Buffer[k+1] != L'?' &&
- Expression->Buffer[k+1] != DOS_DOT && Expression->Buffer[k+1]
!= DOS_QM &&
- Expression->Buffer[k+1] != DOS_STAR)
- {
- while ((IgnoreCase ? UpcaseTable[Name->Buffer[i]] : Name->Buffer[i]) !=
Expression->Buffer[k+1] &&
- i < Name->Length / sizeof(WCHAR)) i++;
- }
- else
- {
- if (!(Expression->Buffer[k+1] != DOS_DOT && (Name->Buffer[i] ==
L'.' || Name->Buffer[i] == L'0')))
- {
- i++;
- }
- }
- }
- else
- {
- i = Name->Length / sizeof(WCHAR);
- }
- k++;
- }
- else if (Expression->Buffer[k] == DOS_STAR)
- {
- j = i;
- while (j < Name->Length / sizeof(WCHAR))
- {
- if (Name->Buffer[j] == L'.')
- {
- i = j;
- }
- j++;
- }
- k++;
- }
- else
- {
- i = Name->Length / sizeof(WCHAR);
- }
}
return (k == Expression->Length / sizeof(WCHAR) && i == Name->Length /
sizeof(WCHAR));