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/


Getting Drive Letter from Device name

OSR_Community_UserOSR_Community_User Member Posts: 110,217
I have written file system filter driver based on sfilter.
In the IRP_MN_MOUNT_VOLUME i get the device name in the form of
"\Device\CdRom0". now i want to get the drive letter for this device. how
do i go about. i tried ZwOpenSymbolicLinkObject and
ZwQuerySymbolicLinkObject. But ZwQuerySymbolicLinkObject fails with error
STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated.
Thanks....

Comments

  • Swati_ChawdharySwati_Chawdhary Member Posts: 12
    Check Out the Device Extention structure in FileSpy!
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Rtl/IoVolumeDeviceToDosName on the storage device object.

    - Nick Ryan

    > -----Original Message-----
    > From: [email protected]
    > [mailto:[email protected]] On Behalf Of
    > [email protected]
    > Sent: Monday, June 02, 2003 3:34 AM
    > To: File Systems Developers
    > Subject: [ntfsd] Getting Drive Letter from Device name
    >
    >
    > I have written file system filter driver based on sfilter.
    > In the IRP_MN_MOUNT_VOLUME i get the device name in the form
    > of "\Device\CdRom0". now i want to get the drive letter for
    > this device. how do i go about. i tried
    > ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject. But
    > ZwQuerySymbolicLinkObject fails with error
    > STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated. Thanks....
    >
    > ---
    > You are currently subscribed to ntfsd as: [email protected]
    > To unsubscribe send a blank email to [email protected]
    >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Thanks a lot.... it did work .. :)

    > Rtl/IoVolumeDeviceToDosName on the storage device object.
    >
    > - Nick Ryan
    >
    > > -----Original Message-----
    > > From: [email protected]
    > > [mailto:[email protected]] On Behalf Of
    > > [email protected]
    > > Sent: Monday, June 02, 2003 3:34 AM
    > > To: File Systems Developers
    > > Subject: [ntfsd] Getting Drive Letter from Device name
    > >
    > >
    > > I have written file system filter driver based on sfilter.
    > > In the IRP_MN_MOUNT_VOLUME i get the device name in the form
    > > of "\Device\CdRom0". now i want to get the drive letter for
    > > this device. how do i go about. i tried
    > > ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject. But
    > > ZwQuerySymbolicLinkObject fails with error
    > > STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated. Thanks....
    > >
    > > ---
    > > You are currently subscribed to ntfsd as: [email protected]
    > > To unsubscribe send a blank email to [email protected]
    > >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    hi, i used this function in create and it works most of the time. however,
    the function seems to hang when i plug in a usb harddisk. when is the safe
    time to use this function?

    Ampsi

    ----- Original Message -----
    From: "Nick Ryan" <[email protected]>
    To: "File Systems Developers" <[email protected]>
    Sent: Tuesday, June 03, 2003 01:40
    Subject: [ntfsd] RE: Getting Drive Letter from Device name


    Rtl/IoVolumeDeviceToDosName on the storage device object.

    - Nick Ryan

    > -----Original Message-----
    > From: [email protected]
    > [mailto:[email protected]] On Behalf Of
    > [email protected]
    > Sent: Monday, June 02, 2003 3:34 AM
    > To: File Systems Developers
    > Subject: [ntfsd] Getting Drive Letter from Device name
    >
    >
    > I have written file system filter driver based on sfilter.
    > In the IRP_MN_MOUNT_VOLUME i get the device name in the form
    > of "\Device\CdRom0". now i want to get the drive letter for
    > this device. how do i go about. i tried
    > ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject. But
    > ZwQuerySymbolicLinkObject fails with error
    > STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated. Thanks....
    >
    > ---
    > You are currently subscribed to ntfsd as: [email protected]
    > To unsubscribe send a blank email to [email protected]
    >



    ---
    You are currently subscribed to ntfsd as: [email protected]
    To unsubscribe send a blank email to [email protected]
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 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online