[NTOSKRNL]

Nearly properly reimplement DOT_STAR in FsRtlIs*InExpression.
Should fix tests broken by hackfix

svn path=/trunk/; revision=58818
This commit is contained in:
Pierre Schweitzer 2013-04-21 20:34:17 +00:00
parent e25146372d
commit 4e5c5772f1
2 changed files with 76 additions and 10 deletions

View file

@ -218,14 +218,47 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
/* Check DOS_STAR */ /* Check DOS_STAR */
else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_STAR) else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_STAR)
{ {
MatchingChars = NamePosition; /* We can only consume dot if that's not the last one
while (MatchingChars < Name->Length) * Otherwise, we null match
*/
if (Name->Buffer[NamePosition] == '.')
{ {
if (Name->Buffer[MatchingChars] == '.') MatchingChars = NamePosition + 1;
while (MatchingChars < Name->Length)
{ {
NamePosition = MatchingChars; if (Name->Buffer[MatchingChars] == '.')
{
NamePosition++;
break;
}
MatchingChars++;
}
}
else
{
/* XXX: Eat everything till the end */
if (ExpressionPosition + 1 == Expression->Length)
{
NamePosition = Name->Length;
}
/* Try to eat till the next matching char or . */
MatchingChars = NamePosition;
while (MatchingChars < Name->Length)
{
if (ExpressionPosition + 1 < Expression->Length &&
Name->Buffer[MatchingChars] == Expression->Buffer[ExpressionPosition + 1])
{
NamePosition = MatchingChars;
break;
}
else if (Name->Buffer[MatchingChars] == '.')
{
NamePosition = MatchingChars + 1;
break;
}
MatchingChars++;
} }
MatchingChars++;
} }
ExpressionPosition++; ExpressionPosition++;
} }

View file

@ -153,14 +153,47 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
/* Check DOS_STAR */ /* Check DOS_STAR */
else if (Expression->Buffer[ExpressionPosition] == DOS_STAR) else if (Expression->Buffer[ExpressionPosition] == DOS_STAR)
{ {
MatchingChars = NamePosition; /* We can only consume dot if that's not the last one
while (MatchingChars < Name->Length / sizeof(WCHAR)) * Otherwise, we null match
*/
if (Name->Buffer[NamePosition] == L'.')
{ {
if (Name->Buffer[MatchingChars] == L'.') MatchingChars = NamePosition + 1;
while (MatchingChars < Name->Length / sizeof(WCHAR))
{ {
NamePosition = MatchingChars; if (Name->Buffer[MatchingChars] == L'.')
{
NamePosition++;
break;
}
MatchingChars++;
}
}
else
{
/* XXX: Eat everything till the end */
if (ExpressionPosition + 1 == Expression->Length / sizeof(WCHAR))
{
NamePosition = Name->Length;
}
/* Try to eat till the next matching char or . */
MatchingChars = NamePosition;
while (MatchingChars < Name->Length / sizeof(WCHAR))
{
if (ExpressionPosition + 1 < Expression->Length / sizeof(WCHAR) &&
Name->Buffer[MatchingChars] == Expression->Buffer[ExpressionPosition + 1])
{
NamePosition = MatchingChars;
break;
}
else if (Name->Buffer[MatchingChars] == L'.')
{
NamePosition = MatchingChars + 1;
break;
}
MatchingChars++;
} }
MatchingChars++;
} }
ExpressionPosition++; ExpressionPosition++;
} }