FsRtlIsNameInExpression does not work !

Dear all,

I found that the runtime routine: FsRtlIsNameInExpression could not work well. Such like the following two cases:

PUNICODE_STRING PatternName, FileName

PatternName= “e2*” || PatternName = “*.gz”
FileName= “e2fsprogs” || FileName= “ext3-2.4-0.9.6-248.gz”

if (FsRtlDoesNameContainWildCards(PatternName)
{
if (FsRtlIsNameInExpression(
PatternName,
FileName,
TRUE,
NULL)
{
// For the above cases, it should macth.
}
}

Any one can give a clue or other simple solutions ? I just don’t want to write my own match routines for it.

Another question: It is very strange. I typed “dir *.gz” at dos command window, but when I caught my QueryDirectory routine vis softice, the PatternName was “>.gz”, not the expected pattern: “*.gz” ?

Best wishes,

Matt

Hi,

Read carefully the description in IFS help for this routine
(If IgnoreCase is TRUE, Expression must be uppercase)
and check #define for DOS_DOT, DOS_QM etc. wildcards.

Kind regards,
Leonid.

“Matt Wu” wrote in message news:xxxxx@ntfsd…
>
> Dear all,
>
> I found that the runtime routine: FsRtlIsNameInExpression could not work
well. Such like the following two cases:
>
> PUNICODE_STRING PatternName, FileName
>
> PatternName= “e2*” || PatternName = “*.gz”
> FileName= “e2fsprogs” || FileName= “ext3-2.4-0.9.6-248.gz”
> …
> if (FsRtlDoesNameContainWildCards(PatternName)
> {
> if (FsRtlIsNameInExpression(
> PatternName,
> FileName,
> TRUE,
> NULL)
> {
> // For the above cases, it should macth.
> }
> }
> …
>
> Any one can give a clue or other simple solutions ? I just don’t want to
write my own match routines for it.
>
> Another question: It is very strange. I typed “dir .gz" at dos command
window, but when I caught my QueryDirectory routine vis softice, the
PatternName was “>.gz”, not the expected pattern: "
.gz” ?
>
> Best wishes,
>
> Matt
>
>
>
>

Strange, since FsRtlIsNameInExpression is used to do the wildcard filtering in the filesystem.
DIR *.TXT causes FindFirstFile with a wildcard, which in turn forces the FSD to use FsRtlIsNameInExpression.

Look at FASTFAT source.

Max

----- Original Message -----
From: “Matt Wu”
To: “File Systems Developers”
Sent: Tuesday, May 14, 2002 12:18 PM
Subject: [ntfsd] FsRtlIsNameInExpression does not work !

> Dear all,
>
> I found that the runtime routine: FsRtlIsNameInExpression could not work well. Such like the following two cases:
>
> PUNICODE_STRING PatternName, FileName
>
> PatternName= “e2*” || PatternName = “*.gz”
> FileName= “e2fsprogs” || FileName= “ext3-2.4-0.9.6-248.gz”
> …
> if (FsRtlDoesNameContainWildCards(PatternName)
> {
> if (FsRtlIsNameInExpression(
> PatternName,
> FileName,
> TRUE,
> NULL)
> {
> // For the above cases, it should macth.
> }
> }
> …
>
> Any one can give a clue or other simple solutions ? I just don’t want to write my own match routines for it.
>
> Another question: It is very strange. I typed “dir .gz" at dos command window, but when I caught my QueryDirectory routine vis
softice, the PatternName was “>.gz”, not the expected pattern: "
.gz” ?
>
> Best wishes,
>
> Matt
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>

Leonid Zhigunov,

Thanks!

It works well when I tried “dir *.GZ” … So this case, I need to upcase the pattern string.

Matt

Hi,

Read carefully the description in IFS help for this routine
(If IgnoreCase is TRUE, Expression must be uppercase)
and check #define for DOS_DOT, DOS_QM etc. wildcards.

Kind regards,
Leonid.

“Matt Wu” wrote in message news:xxxxx@ntfsd…
>>
>> Dear all,
>>
>> I found that the runtime routine: FsRtlIsNameInExpression could not work
>well. Such like the following two cases:
>>
>> PUNICODE_STRING PatternName, FileName
>>
>> PatternName= “e2*” || PatternName = “*.gz”
>> FileName= “e2fsprogs” || FileName= “ext3-2.4-0.9.6-248.gz”
>> …
>> if (FsRtlDoesNameContainWildCards(PatternName)
>> {
>> if (FsRtlIsNameInExpression(
>> PatternName,
>> FileName,
>> TRUE,
>> NULL)
>> {
>> // For the above cases, it should macth.
>> }
>> }
>> …
>>
>> Any one can give a clue or other simple solutions ? I just don’t want to
>write my own match routines for it.
>>
>> Another question: It is very strange. I typed “dir .gz" at dos command
>window, but when I caught my QueryDirectory routine vis softice, the
>PatternName was “>.gz”, not the expected pattern: "
.gz” ?
>>
>> Best wishes,
>>
>> Matt
>>
>>
>>
>>
>
>
>
>—
>You are currently subscribed to ntfsd as: mattwu@163.com
>To unsubscribe send a blank email to %%email.unsub%%