[NTOSKRNL]
authorPierre Schweitzer <pierre@reactos.org>
Wed, 23 Feb 2011 12:09:07 +0000 (12:09 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Wed, 23 Feb 2011 12:09:07 +0000 (12:09 +0000)
Apply r50873 on FsRtlIsNameInExpression()

svn path=/trunk/; revision=50875

reactos/ntoskrnl/fsrtl/name.c

index 29f6e90..ecb2c3f 100644 (file)
@@ -41,7 +41,7 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
             switch (Expression->Buffer[ExpressionPosition])
             {
                 case L'*':
-                    StarFound = ExpressionPosition++;
+                    StarFound = MAXUSHORT;
                     break;
 
                 case L'?':
@@ -88,6 +88,7 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
             if (ExpressionPosition == Expression->Length / sizeof(WCHAR))
             {
                 NamePosition = Name->Length / sizeof(WCHAR);
+                break;
             }
         }
         else if (Expression->Buffer[ExpressionPosition] == DOS_STAR)
@@ -109,14 +110,14 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
             ExpressionPosition = StarFound + 1;
             while ((IgnoreCase ? UpcaseTable[Name->Buffer[NamePosition]] :
                     Name->Buffer[NamePosition]) != Expression->Buffer[ExpressionPosition] &&
-                   NamePosition < Name->Length / sizeof(WCHAR))
+                    NamePosition < Name->Length / sizeof(WCHAR))
             {
                 NamePosition++;
             }
         }
         else
         {
-            NamePosition = Name->Length / sizeof(WCHAR);
+            break;
         }
     }
     if (ExpressionPosition + 1 == Expression->Length / sizeof(WCHAR) && NamePosition == Name->Length / sizeof(WCHAR) &&