OUT PANSI_STRING FirstPart,
OUT PANSI_STRING RemainingPart)
{
- ULONG FirstPosition, i;
- ULONG SkipFirstSlash = 0;
+ USHORT FirstPosition, i;
+ USHORT SkipFirstSlash = 0;
PAGED_CODE();
/* Zero the strings before continuing */
NTAPI
FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
{
- ULONG i;
+ USHORT i;
PAGED_CODE();
/* Check every character */
switch (Expression->Buffer[ExpressionPosition])
{
case '*':
- StarFound = ExpressionPosition++;
+ StarFound = MAXUSHORT;
break;
case '?':
- ExpressionPosition++;
+ if (++ExpressionPosition == Expression->Length)
+ {
+ NamePosition = Name->Length;
+ break;
+ }
+
MatchingChars = NamePosition;
- while (Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition] &&
- NamePosition < Name->Length)
+ while (NamePosition < Name->Length &&
+ Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition])
{
NamePosition++;
}
break;
case ANSI_DOS_DOT:
- while (Name->Buffer[NamePosition] != '.' && NamePosition < Name->Length)
+ while (NamePosition < Name->Length && Name->Buffer[NamePosition] != '.')
{
NamePosition++;
}
if (ExpressionPosition == Expression->Length)
{
NamePosition = Name->Length;
+ break;
}
}
else if (Expression->Buffer[ExpressionPosition] == ANSI_DOS_STAR)
else if (StarFound != MAXUSHORT)
{
ExpressionPosition = StarFound + 1;
- while (Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition] &&
- NamePosition < Name->Length)
+ while (NamePosition < Name->Length &&
+ Name->Buffer[NamePosition] != Expression->Buffer[ExpressionPosition])
{
NamePosition++;
}
}
else
{
- NamePosition = Name->Length;
+ break;
}
}
if (ExpressionPosition + 1 == Expression->Length && NamePosition == Name->Length &&
{
ANSI_STRING FirstPart, RemainingPart, Name;
BOOLEAN LastDot;
- ULONG i;
+ USHORT i;
PAGED_CODE();
/* Just quit if the string is empty */
IN BOOLEAN LeadingBackslashPermissible)
{
ANSI_STRING FirstPart, RemainingPart, Name;
- ULONG i;
+ USHORT i;
PAGED_CODE();
/* Just quit if the string is empty */
i++;
}
/* Then check for bad characters */
- else if (!!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible))
+ else if (!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible))
{
return FALSE;
}