Author: pschweitzer Date: Sun Apr 21 14:25:55 2013 New Revision: 58806
URL: http://svn.reactos.org/svn/reactos?rev=58806&view=rev Log: [NTOSKRNL] Allow ignoring all nullable matching wildcards at the end of the expression string when name is over in FsRtlIs*InExpression() This fixes a few tests
Modified: trunk/reactos/ntoskrnl/fsrtl/dbcsname.c trunk/reactos/ntoskrnl/fsrtl/name.c
Modified: trunk/reactos/ntoskrnl/fsrtl/dbcsname.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/dbcsname.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Sun Apr 21 14:25:55 2013 @@ -247,10 +247,19 @@ ExpressionPosition = BackTracking[StarFound--]; } } - if (ExpressionPosition + 1 == Expression->Length && NamePosition == Name->Length && - (Expression->Buffer[ExpressionPosition] == ANSI_DOS_DOT || Expression->Buffer[ExpressionPosition] == '*')) - { - ExpressionPosition++; + /* If we have nullable matching wc at the end of the string, eat them */ + if (ExpressionPosition != Expression->Length && NamePosition == Name->Length) + { + while (ExpressionPosition < Expression->Length) + { + if (Expression->Buffer[ExpressionPosition] != ANSI_DOS_DOT && + Expression->Buffer[ExpressionPosition] != '*' && + Expression->Buffer[ExpressionPosition] != ANSI_DOS_STAR) + { + break; + } + ExpressionPosition++; + } }
if (BackTracking)
Modified: trunk/reactos/ntoskrnl/fsrtl/name.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/name.c?rev=5... ============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] Sun Apr 21 14:25:55 2013 @@ -184,10 +184,19 @@ ExpressionPosition = BackTracking[StarFound--]; } } - if (ExpressionPosition + 1 == Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR) && - (Expression->Buffer[ExpressionPosition] == DOS_DOT || Expression->Buffer[ExpressionPosition] == L'*')) - { - ExpressionPosition++; + /* If we have nullable matching wc at the end of the string, eat them */ + if (ExpressionPosition != Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR)) + { + while (ExpressionPosition < Expression->Length / sizeof(WCHAR)) + { + if (Expression->Buffer[ExpressionPosition] != DOS_DOT && + Expression->Buffer[ExpressionPosition] != L'*' && + Expression->Buffer[ExpressionPosition] != DOS_STAR) + { + break; + } + ExpressionPosition++; + } }
if (BackTracking)