Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Getting the full path.

OSR_Community_UserOSR_Community_User Member Posts: 110,217
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

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217

    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,




    ----------------------------------------- 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


  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    ZwQueryInformationFile may help, if you have a handle for the file.

    -----Original Message-----
    From: Shiva_Shankar [mailto:[email protected]]
    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
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    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:[email protected]]
    > 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
    >
    >
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 January 2023 Live, Online
Developing Minifilters 20 March 2023 Live, Online
Internals & Software Drivers 17 April 2023 Live, Online
Writing WDF Drivers 22 May 2023 Live, Online