mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOSKRNL]
Reimplement (& fix) handling of DOS_DOT in FsRtlIs*InExpression(). This fixes lots of failing tests svn path=/trunk/; revision=58810
This commit is contained in:
parent
9870b21c66
commit
53db72e990
2 changed files with 73 additions and 2 deletions
|
@ -163,6 +163,7 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||||
SHORT StarFound = -1;
|
SHORT StarFound = -1;
|
||||||
PUSHORT BackTracking = NULL;
|
PUSHORT BackTracking = NULL;
|
||||||
USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars;
|
USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars;
|
||||||
|
BOOLEAN BeyondName;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
ASSERT(Name->Length);
|
ASSERT(Name->Length);
|
||||||
|
@ -228,6 +229,41 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||||
}
|
}
|
||||||
ExpressionPosition++;
|
ExpressionPosition++;
|
||||||
}
|
}
|
||||||
|
/* Check DOS_DOT */
|
||||||
|
else if (Expression->Buffer[ExpressionPosition] == DOS_DOT)
|
||||||
|
{
|
||||||
|
/* First try to find whether we are beyond last dot (beyond name) */
|
||||||
|
BeyondName = TRUE;
|
||||||
|
MatchingChars = NamePosition + 1;
|
||||||
|
while (MatchingChars < Name->Length)
|
||||||
|
{
|
||||||
|
if (Name->Buffer[MatchingChars] == '.')
|
||||||
|
{
|
||||||
|
BeyondName = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
MatchingChars++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we are beyond name, we null match */
|
||||||
|
if (BeyondName)
|
||||||
|
{
|
||||||
|
ExpressionPosition++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* If not, we only match a dot */
|
||||||
|
else if (Name->Buffer[NamePosition] == '.')
|
||||||
|
{
|
||||||
|
NamePosition++;
|
||||||
|
ExpressionPosition++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* Otherwise, fail */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* If nothing match, try to backtrack */
|
/* If nothing match, try to backtrack */
|
||||||
else if (StarFound >= 0)
|
else if (StarFound >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,7 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||||
UNICODE_STRING IntExpression;
|
UNICODE_STRING IntExpression;
|
||||||
USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars;
|
USHORT ExpressionPosition = 0, NamePosition = 0, MatchingChars;
|
||||||
WCHAR CompareChar;
|
WCHAR CompareChar;
|
||||||
|
BOOLEAN BeyondName;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check if we were given strings at all */
|
/* Check if we were given strings at all */
|
||||||
|
@ -112,8 +113,7 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||||
ExpressionPosition++;
|
ExpressionPosition++;
|
||||||
}
|
}
|
||||||
/* Check cases that eat one char */
|
/* Check cases that eat one char */
|
||||||
else if (Expression->Buffer[ExpressionPosition] == L'?' || (Expression->Buffer[ExpressionPosition] == DOS_QM) ||
|
else if (Expression->Buffer[ExpressionPosition] == L'?' || (Expression->Buffer[ExpressionPosition] == DOS_QM))
|
||||||
(Expression->Buffer[ExpressionPosition] == DOS_DOT && Name->Buffer[NamePosition] == L'.'))
|
|
||||||
{
|
{
|
||||||
NamePosition++;
|
NamePosition++;
|
||||||
ExpressionPosition++;
|
ExpressionPosition++;
|
||||||
|
@ -164,6 +164,41 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||||
}
|
}
|
||||||
ExpressionPosition++;
|
ExpressionPosition++;
|
||||||
}
|
}
|
||||||
|
/* Check DOS_DOT */
|
||||||
|
else if (Expression->Buffer[ExpressionPosition] == DOS_DOT)
|
||||||
|
{
|
||||||
|
/* First try to find whether we are beyond last dot (beyond name) */
|
||||||
|
BeyondName = TRUE;
|
||||||
|
MatchingChars = NamePosition + 1;
|
||||||
|
while (MatchingChars < Name->Length / sizeof(WCHAR))
|
||||||
|
{
|
||||||
|
if (Name->Buffer[MatchingChars] == L'.')
|
||||||
|
{
|
||||||
|
BeyondName = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
MatchingChars++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we are beyond name, we null match */
|
||||||
|
if (BeyondName)
|
||||||
|
{
|
||||||
|
ExpressionPosition++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* If not, we only match a dot */
|
||||||
|
else if (Name->Buffer[NamePosition] == L'.')
|
||||||
|
{
|
||||||
|
NamePosition++;
|
||||||
|
ExpressionPosition++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* Otherwise, fail */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* If nothing match, try to backtrack */
|
/* If nothing match, try to backtrack */
|
||||||
else if (StarFound >= 0)
|
else if (StarFound >= 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue