logical and physical device access

This is a discussion on logical and physical device access within the Windows Programming forums, part of the Platform Specific Boards category; hi, I was wondering how i could map a logical device letter to its physical device call ie. C: to ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    99

    logical and physical device access

    hi, I was wondering how i could map a logical device letter to its physical device call ie. C: to physicaldevice1. I am using createfile to access the drives but i want to be able to tell what drive letter corresponds to each physicaldevice#

    could anyone help me out?

    thanks

  2. #2
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    Again, this has nothing to do with C++ and much to do with Windows programming, so next time, post in the Windows board. It's not hard.
    I hate real numbers.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    99
    sorry, is there a chance a moderator could move my post to there?

    sorry

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    Moved.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    99
    cheers - wont happen again.

    hopefully some guys from this forum will be able to advise me

    thank you

  6. #6
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    You don't say what language you're looking for, but regardless I think you're looking to use WMI to do this. Here's a link on C# I googled up.

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    99
    sorry i should have stated that, im looking to write it in c++. Ive seen the example on msdn but i can make it wok and it seems like a lot of code to do such a task

  8. #8
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    You mean you have seen this example and are looking for a more direct way to do the mapping ?

    i can make it work
    Your problem is solved then. Isn't it ?
    I hate real numbers.

  9. #9
    Registered User
    Join Date
    Apr 2008
    Posts
    99
    sorry (oh my god could this post go anymore worng haha). No i have seen the example but I cant make it work, my typo there, sorry again. When I put that code into my command line compiler i get an error with the line

    Code:
    __in PWCHAR VolumeName
    my compiler says undefined symbol '__in'

  10. #10
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    You're not using Visual Studio I gather.

    Well, these annotations are Microsoft extensions, so you should not use them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. The inner-workings of a uP
    By Cell in forum Tech Board
    Replies: 26
    Last Post: 02-23-2009, 01:54 PM
  2. physical address or logical ??
    By agarwaga in forum C++ Programming
    Replies: 1
    Last Post: 02-25-2006, 02:36 PM
  3. Size of 1 pixel
    By ooosawaddee3 in forum C++ Programming
    Replies: 4
    Last Post: 07-26-2002, 09:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21