Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Comparing filenames

Reply
Thread Tools Display Modes

Comparing filenames

 
 
Bennie
Guest
Posts: n/a

 
      11-20-2011
Hello,

I have been stuck on this a while now. I have found many suggestions
on the internet that almost work, but I have not been able to find
something that does what I need.

I am writing a driver that needs to take certain actions (such as deny
access, log the event) when certain files are accessed. To achieve
this it "hooks" functions such as ZwOpenFile. It can execute code just
before ZwOpenFile is called, as well as just after. It also has access
to the parameters in each case. A list of file names is kept
internally by the driver. On each attempt to access a file, it
searches for the file name in the internal list of files, and looks up
the appropriate action to take.

Now for the part I am stuck on. I am having trouble determining if two
strings point to the same file. For example, internally the string \??
\C:\WINDOWS\System32\event.log is kept, while \SystemRoot\event.log is
being passed as parameter to ZwOpenFile. A simple string compare will
not suffice.

I need a way to compare the string kept internally and the string
passed as parameter no matter what the format is, and to see if they
point to the same file. The method also needs to work across different
drives.

I would greatly appreciate any help in this regard.

Bennie
 
Reply With Quote
 
 
 
 
Bennie
Guest
Posts: n/a

 
      11-20-2011
Just a correction. Internally the string \??\C:\WINDOWS\event.log is
kept. Also, the proposed solution should work on XP as well.
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Long filenames not supported.. yuppicide Windows Small Business Server 6 03-15-2012 05:48 AM
Comparing Multiple machine VS single machine requirement Manish Windows Server 0 06-30-2010 01:50 PM
Arranging numbers as filenames Soul Man Windows Vista File Management 5 08-22-2007 01:36 AM
None of the "<size> Icons" views in Explorer display filenames Raivo Windows Vista File Management 3 02-24-2007 10:47 PM



1 2 3 4 5 6 7 8 9 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 51 52 53 54 55 56 57 58 59