- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
BOOL IsNameInExpression(PCWSTR Expression, PCWSTR Name, DWORD len)
{
WCHAR c, b;
while (c = *Expression++)
{
if (c == L'*')
{
__loop:
switch (*Expression)
{
case '*':
Expression++;
goto __loop;
case 0:
return TRUE;
}
if (len)
{
do
{
if (IsNameInExpression(Expression, Name++, len--)) return TRUE;
} while (len);
}
return FALSE;
}
if (!len--)
{
return FALSE;
}
b = *Name++;
if (c != L'?' && b != c)
{
return FALSE;
}
}
return !len;
}
BOOL IsNameInExpression(PCWSTR Expression, PUNICODE_STRING Name)
{
RtlUpcaseUnicodeString(Name, Name, FALSE);
return IsNameInExpression(Expression, Name->Buffer, Name->Length >> 1);
}
Dummy00001 28.11.2014 11:24 # +1
fobosD 28.11.2014 18:56 # 0
Анонимус 28.11.2014 16:34 # +1
bormand 28.11.2014 16:37 # 0