Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Is it possible to browse through Hidden Drives. Using VC++/C++?

Is it possible to browse through Hidden Drives. Using VC++/C++?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
12 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G G Haranadh

    Hi All, I need some help if is it possible to browse through the Hidden Drives. I mean Hidden Drives are nothing but drive with out having a drive letter. For example: [ Steps to create hidden drive: MyComputer>Manage>DiskManagement>SelectDrive>ChangeDriveLetter>Click Remove Button ] For now I am able to find the Hidden drives using some combination of following APIs: FindFirstVolumeW QueryDosDeviceW GetVolumePathNamesForVolumeNameW GetVolumeInformation FindNextVolumeW I need to Create Browser for the Hidden Drives. Please give some hints to proceed. Thanks a lot in advance. Regards Its Me Hara :)


    Nice talking to you. :-O
    If you judge people, you have no time to love them. -- Mother Teresa

    _ Offline
    _ Offline
    _Superman_
    wrote on last edited by
    #2

    You have all the answers. What problem are you facing here?

    «_Superman_» I love work. It gives me something to do between weekends.
    Microsoft MVP (Visual C++)

    G 1 Reply Last reply
    0
    • _ _Superman_

      You have all the answers. What problem are you facing here?

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      G Offline
      G Offline
      G Haranadh
      wrote on last edited by
      #3

      I was not able to get the volumes with respect to a disk. If PC has two Hard disks, each has multiple volumes. First disk has one hidden volume, second disk has two or some hidden volumes. I need to get the total Disks, and In that particular disk the total volumes along with hidden. Any clue in this way. I got the solution as total volumes. but not with respect to disk and its volumes.. Thanks for your reply.


      Nice talking to you. :-O
      If you judge people, you have no time to love them. -- Mother Teresa

      _ 1 Reply Last reply
      0
      • G G Haranadh

        I was not able to get the volumes with respect to a disk. If PC has two Hard disks, each has multiple volumes. First disk has one hidden volume, second disk has two or some hidden volumes. I need to get the total Disks, and In that particular disk the total volumes along with hidden. Any clue in this way. I got the solution as total volumes. but not with respect to disk and its volumes.. Thanks for your reply.


        Nice talking to you. :-O
        If you judge people, you have no time to love them. -- Mother Teresa

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #4

        Not sure if this will help you but here is something you can try. Try to open a volume using CreateFile by specifying the file name as \\.\C: for the C drive and dwCreationDisposition parameter as OPEN_EXISTING. If CreateFile fails, it could mean no such volume exists or you do not have permission to do this. Then you can use DeviceIoControl on the returned handle by specifying IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS as the control code. You will get the information as a VOLUME_DISK_EXTENTS structure in the lpOutBuffer output parameter. Remember that a disk can contain multiple volumes and a single volume can span multiple disks. You will all this information using the above function.

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        G 1 Reply Last reply
        0
        • _ _Superman_

          Not sure if this will help you but here is something you can try. Try to open a volume using CreateFile by specifying the file name as \\.\C: for the C drive and dwCreationDisposition parameter as OPEN_EXISTING. If CreateFile fails, it could mean no such volume exists or you do not have permission to do this. Then you can use DeviceIoControl on the returned handle by specifying IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS as the control code. You will get the information as a VOLUME_DISK_EXTENTS structure in the lpOutBuffer output parameter. Remember that a disk can contain multiple volumes and a single volume can span multiple disks. You will all this information using the above function.

          «_Superman_» I love work. It gives me something to do between weekends.
          Microsoft MVP (Visual C++)

          G Offline
          G Offline
          G Haranadh
          wrote on last edited by
          #5

          The actual straight problem here I am facing is for "C:" drive i can give path as C:\bla\bla..... But For hidden drives i was not able to give any specific base drive path. That is main problem, Is there any way to solve it. thanks a lot for your reply.:)


          Nice talking to you. :-O
          If you judge people, you have no time to love them. -- Mother Teresa

          _ 1 Reply Last reply
          0
          • G G Haranadh

            The actual straight problem here I am facing is for "C:" drive i can give path as C:\bla\bla..... But For hidden drives i was not able to give any specific base drive path. That is main problem, Is there any way to solve it. thanks a lot for your reply.:)


            Nice talking to you. :-O
            If you judge people, you have no time to love them. -- Mother Teresa

            _ Offline
            _ Offline
            _Superman_
            wrote on last edited by
            #6

            Let's assume D: is the hidden drive. In this case is it not possible to specify the volume name as \\.\D:?

            «_Superman_» I love work. It gives me something to do between weekends.
            Microsoft MVP (Visual C++)

            G 1 Reply Last reply
            0
            • _ _Superman_

              Let's assume D: is the hidden drive. In this case is it not possible to specify the volume name as \\.\D:?

              «_Superman_» I love work. It gives me something to do between weekends.
              Microsoft MVP (Visual C++)

              G Offline
              G Offline
              G Haranadh
              wrote on last edited by
              #7

              Hidden drive will not have the drive letter. If we go to the DiskManager application, and -> rightclick on one drive -> change or remove drive letter -> Click remove drive letter button. Drive letter will be removed. Also the drive will be disappered from my computer. But When we want the drive back as normal drive then we have to go to the same place same way. and you can see your drive again in my computer. add drive letter. all the data of the drive will be available as it is. Any way i will try in my ways, if i got solution i will share with you guys. Thanks.


              Nice talking to you. :-O
              If you judge people, you have no time to love them. -- Mother Teresa

              _ 1 Reply Last reply
              0
              • G G Haranadh

                Hidden drive will not have the drive letter. If we go to the DiskManager application, and -> rightclick on one drive -> change or remove drive letter -> Click remove drive letter button. Drive letter will be removed. Also the drive will be disappered from my computer. But When we want the drive back as normal drive then we have to go to the same place same way. and you can see your drive again in my computer. add drive letter. all the data of the drive will be available as it is. Any way i will try in my ways, if i got solution i will share with you guys. Thanks.


                Nice talking to you. :-O
                If you judge people, you have no time to love them. -- Mother Teresa

                _ Offline
                _ Offline
                _Superman_
                wrote on last edited by
                #8

                So you mean to say that when the drive is hidden CreateFile fails?

                «_Superman_» I love work. It gives me something to do between weekends.
                Microsoft MVP (Visual C++)

                G 1 Reply Last reply
                0
                • _ _Superman_

                  So you mean to say that when the drive is hidden CreateFile fails?

                  «_Superman_» I love work. It gives me something to do between weekends.
                  Microsoft MVP (Visual C++)

                  G Offline
                  G Offline
                  G Haranadh
                  wrote on last edited by
                  #9

                  "CreateFile & DeviceIoControl", combination is the only way i am thinking, but there must be some specific set of arguments I need to pass to call them to make it work. I dont know about that. I am first time using that creatfile function and such driver level calls etc and also there are less number of examples in net.


                  Nice talking to you. :-O
                  If you judge people, you have no time to love them. -- Mother Teresa

                  _ 1 Reply Last reply
                  0
                  • G G Haranadh

                    "CreateFile & DeviceIoControl", combination is the only way i am thinking, but there must be some specific set of arguments I need to pass to call them to make it work. I dont know about that. I am first time using that creatfile function and such driver level calls etc and also there are less number of examples in net.


                    Nice talking to you. :-O
                    If you judge people, you have no time to love them. -- Mother Teresa

                    _ Offline
                    _ Offline
                    _Superman_
                    wrote on last edited by
                    #10

                    Try this assuming D: is the hidden drive. HANDLE hVol = ::CreateFile(_T("\\.\D:"), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);

                    «_Superman_» I love work. It gives me something to do between weekends.
                    Microsoft MVP (Visual C++)

                    G 1 Reply Last reply
                    0
                    • _ _Superman_

                      Try this assuming D: is the hidden drive. HANDLE hVol = ::CreateFile(_T("\\.\D:"), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);

                      «_Superman_» I love work. It gives me something to do between weekends.
                      Microsoft MVP (Visual C++)

                      G Offline
                      G Offline
                      G Haranadh
                      wrote on last edited by
                      #11

                      Hidden drive will not have drive letter, that is the problem. :)


                      Nice talking to you. :-O
                      If you judge people, you have no time to love them. -- Mother Teresa

                      _ 1 Reply Last reply
                      0
                      • G G Haranadh

                        Hidden drive will not have drive letter, that is the problem. :)


                        Nice talking to you. :-O
                        If you judge people, you have no time to love them. -- Mother Teresa

                        _ Offline
                        _ Offline
                        _Superman_
                        wrote on last edited by
                        #12

                        You mean, you don't see it. But did you try it with CreateFile?

                        «_Superman_» I love work. It gives me something to do between weekends.
                        Microsoft MVP (Visual C++)

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups