Getting the full path.

Hi All,

I have a filter driver which filters all the requests to my FSD. When I am
getting an IRP_MJ_CREATE as a result of some action from EXPLORER I am
getting the full path for the file or Directory.

But, when I am getting the IRP_MJ_CREATE from the Dosprompt(cmd.exe) I am
getting only the relative path.

Now my question is is there any way I can get the full path using the
relative path???
If so kind let me know

regards,
Shivas

At 4/11/00 06:57 PM +0530, Shiva_Shankar wrote:

I have a
filter driver which filters all the requests to my FSD. When I am getting
an IRP_MJ_CREATE as a result of some action from EXPLORER I am getting
the full path for the file or Directory.

Now my question is is there any way I can get the full path using the
relative path???

Take a look at the sources of
FileMon
(http://www.sysinternals.com)
for an example of getting the absolute path for an intercepted file. Nore
however that the FileMon sources does not correctly process network paths
(i.e., \server\share\path).

With kind regards,

Bartjan Wattel
<mailto:xxxxx@ascit.com>

----------------------------------------- Yours, for X-Tra Security
!!! —

ThunderStore
HQ                  

Ant. v.d. Heydenstraat 2, 5527 BV HAPERT, The Netherlands

Tel: +31 (0)49 7383 505 / Fax: +31 (0)49 7388 440

Web:
http://www.thunderstore.com

ZwQueryInformationFile may help, if you have a handle for the file.

-----Original Message-----
From: Shiva_Shankar [mailto:xxxxx@Satyam.com]
Sent: Tuesday, April 11, 2000 9:27 AM
To: NT Developers Interest List
Subject: [ntdev] Getting the full path.

Hi All,

I have a filter driver which filters all the requests to my FSD. When I am
getting an IRP_MJ_CREATE as a result of some action from EXPLORER I am
getting the full path for the file or Directory.

But, when I am getting the IRP_MJ_CREATE from the Dosprompt(cmd.exe) I am
getting only the relative path.

Now my question is is there any way I can get the full path using the
relative path???
If so kind let me know

regards,
Shivas

Hi Shiva,

The I/O manager might give either the absolute path or the relative path.
When it supplies the absolute path, then the RelatedFileObject field in the
File Object is NULL, but when it sends the relative path, the
RelatedFileObject field contains the Relative FileName. in
RelatedFileObject->FileName

for e.g: for a file C:\driver\filter\dos
u might get the relative file name as ‘dos’ but ‘c:\driver\filter’ is
contained in RelatedFileObject->FileName. Append this name to the relative
file name to get the absolute path name.

Hope it helps
Ravi


From: Shiva_Shankar[SMTP:xxxxx@Satyam.com]
Sent: Tuesday, April 11, 2000 6:57 PM
To: NT Developers Interest List
Subject: [ntdev] Getting the full path.

Hi All,

I have a filter driver which filters all the requests to my FSD. When I am
getting an IRP_MJ_CREATE as a result of some action from EXPLORER I am
getting the full path for the file or Directory.

But, when I am getting the IRP_MJ_CREATE from the Dosprompt(cmd.exe) I am
getting only the relative path.

Now my question is is there any way I can get the full path using the
relative path???
If so kind let me know

regards,
Shivas