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

Home NTFSD
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/


How to get the file ID

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hi All,

Does anyone know how to get the file ID from the full path file name or file
handle? I am knowing the file ID is one to one match up with the open file, am
I right? I can not find any information on how to get the file ID. Please give
me some help or hint, it is a very appreciated.

Thanks in advance.

JianJing Qin

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Do you want the file ID or do you want the file's object ID?

    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Wednesday, April 26, 2000 10:51 AM
    To: File Systems Developers
    Subject: [ntfsd] How to get the file ID


    Hi All,

    Does anyone know how to get the file ID from the full path file name or file
    handle? I am knowing the file ID is one to one match up with the open file,
    am
    I right? I can not find any information on how to get the file ID. Please
    give
    me some help or hint, it is a very appreciated.

    Thanks in advance.

    JianJing Qin




    ---
    You are currently subscribed to ntfsd as: [email protected]nt.com
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    1. To obtain file ID from handle you must call Nt(Zw)QueryInformationFile
    with FileInternalInformation information class (and as file information use
    FILE_INTERNAL_INFORMATION structure).

    2. To obtain file ID from file name you must first open the file using
    Nt(Zw)CreateFile, Nt(Zw)OpenFile or Win32 CreateFileW(A). Then you should
    do the same thing as in 1.


    Paul
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hi Arthur Kreitman,

    Can you tell me both? But the file ID first. I know the file object is not
    one to one match up with the file which mean one file can have many file object
    when it does multiple open.

    Thanks,

    JianJing Qin






    Arthur Kreitman on 04/26/2000 02:36:09 PM

    Please respond to "File Systems Developers"

    To: "File Systems Developers"
    cc: (bcc: Jian Qin/Tivoli Systems)
    Subject: [ntfsd] RE: How to get the file ID




    Do you want the file ID or do you want the file's object ID?

    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Wednesday, April 26, 2000 10:51 AM
    To: File Systems Developers
    Subject: [ntfsd] How to get the file ID


    Hi All,

    Does anyone know how to get the file ID from the full path file name or file
    handle? I am knowing the file ID is one to one match up with the open file,
    am
    I right? I can not find any information on how to get the file ID. Please
    give
    me some help or hint, it is a very appreciated.

    Thanks in advance.

    JianJing Qin




    ---
    You are currently subscribed to ntfsd as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')

    ---
    You are currently subscribed to ntfsd as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > Does anyone know how to get the file ID from the full path file name or
    file
    > handle? I am knowing the file ID is one to one match up with the open
    file,

    Do you mean on-disk file ID similar to s_ino (inode number) in UNIX?
    Try FileIndex field in FILE_xxx_INFORMATION structures.

    Max
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE