UM analogue for FsRtlIsNameInExpression?

Hi guys,

I’ve been using PathMatchSpec routine from SHELL API to do “query dir” template matching in the User Mode. Most of the time it works (don’t you love that expression?), however, there are edge cases (well, just one so far) when it doesn’t work. For instance, “;” character drives this routine crazy. If I match “t;t.txt” name with “t;t.txt” template PathMatchSpec doesn’t recognize the match. So, does anybody know a better UM routine for such task?

TIA,

Vladimir

Maybe , this would help:

// ----------------------------------------------------------------------------
// case-insensitively matches strings with * and ?.
// if there’s a match, returns true.
bool StrMatch(LPCTSTR pattern, LPCTSTR candidate) { // after Bruce Florman
for(;; ++pattern, ++candidate) {
switch(*pattern) {
case 0:
return *candidate == 0;
case _T(‘*’):
for(;; ++candidate) {
if(StrMatch(pattern+1, candidate))
return true;
if(*candidate == 0)
return false;
}
case _T(‘?’):
if(*candidate == 0)
return false;
continue;
default:
if(_totupper(*candidate) != _totupper(*pattern))
return false;
continue;
}
}
}
// ----------------------------------------------------------------------------

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, March 13, 2007 5:55 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] UM analogue for FsRtlIsNameInExpression?

Hi guys,

I’ve been using PathMatchSpec routine from SHELL API to do “query dir” template matching in the User Mode. Most of the time it works (don’t you love that expression?), however, there are edge cases (well, just one so far) when it doesn’t work. For instance, “;” character drives this routine crazy. If I match “t;t.txt” name with “t;t.txt” template PathMatchSpec doesn’t recognize the match. So, does anybody know a better UM routine for such task?

TIA,

Vladimir


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com