How do I convert this physical string into logical string?

Discussion in 'Windows Vista Drivers' started by keandi, Oct 30, 2006.

  1. keandi

    keandi Guest

    Hi.

    I got my directory path by ObQueryNameString.
    But the path is not logical.. like this:
    Originally, the path is C:\MyDir.

    Could I convert the string into "C:\MyDir"?
     
    keandi, Oct 30, 2006
    #1
    1. Advertisements

  2. Read about the Mount Manager.

     
    David J. Craig, Oct 30, 2006
    #2
    1. Advertisements

  3. keandi

    soviet_bloke Guest

    @??\Device\HarddiskVolume1\MyDir
    Of course - this is what IoVolumeDeviceToDosName() and
    RtlVolumeDeviceToDosName() are for.

    Please check the NG thoroughly - as far as I remember, couple of
    months ago I explained how to do things like that on some thread.....


    Anton Bassov
     
    soviet_bloke, Oct 30, 2006
    #3
  4. Of course - this is what IoVolumeDeviceToDosName() and
    I would suggest the OP to rethink the design to never ever use drive letters in
    the kernel part, and use the volume GUIDs or even mountdev IDs instead.

    The user part will do the necessary conversions from the UI-level drive letters
    to the IDs, and then the user/kernel interface speaks in terms of IDs only.
     
    Maxim S. Shatskih, Oct 30, 2006
    #4
  5. Sorry for my ignorance but...

    why using drive letters in the kernel is a no-no?

    Have a nice day
    GV
     
    Gianluca Varenni, Oct 30, 2006
    #5
  6. why using drive letters in the kernel is a no-no?

    It is just more complex I think, and does not handle the directory mount
    points.
     
    Maxim S. Shatskih, Oct 31, 2006
    #6
  7. keandi

    soviet_bloke Guest

    Maxim,
    Well, probably the OP does not use it extensively, so that, for a quick
    and simple solution
    IoVolumeDeviceToDosName() should work just fine....

    Anton Bassov
     
    soviet_bloke, Oct 31, 2006
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.