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. How to Create and format partitions

How to Create and format partitions

Scheduled Pinned Locked Moved C / C++ / MFC
toolstutorialquestioncareer
9 Posts 4 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.
  • M Offline
    M Offline
    Madan Chauhan
    wrote on last edited by
    #1

    Hi all, I am creating an application for windows Vista, XP and 2003Server. In my application I need to create and format partitions(Extended and primary both). I do not want to use DISKPART utility. Is there any other way to do this job like by using any win32API or any function provided by Microsoft in MSDN? Please give me some suggestions. Thanks

    C H 2 Replies Last reply
    0
    • M Madan Chauhan

      Hi all, I am creating an application for windows Vista, XP and 2003Server. In my application I need to create and format partitions(Extended and primary both). I do not want to use DISKPART utility. Is there any other way to do this job like by using any win32API or any function provided by Microsoft in MSDN? Please give me some suggestions. Thanks

      C Offline
      C Offline
      C myLife
      wrote on last edited by
      #2

      Ya ofCourse, you can use DeviceIoControl codes. for creating any partition (primary or logical) IOCTL_DISK_SET_DRIVE_LAYOUT can be used. :-D

      M 1 Reply Last reply
      0
      • C C myLife

        Ya ofCourse, you can use DeviceIoControl codes. for creating any partition (primary or logical) IOCTL_DISK_SET_DRIVE_LAYOUT can be used. :-D

        M Offline
        M Offline
        Madan Chauhan
        wrote on last edited by
        #3

        Thanks CMylife. I am going to implement it now. I will consult you after trying it. thanks

        C 1 Reply Last reply
        0
        • M Madan Chauhan

          Thanks CMylife. I am going to implement it now. I will consult you after trying it. thanks

          C Offline
          C Offline
          C myLife
          wrote on last edited by
          #4

          Its good that you are trying yourself. nothing you have to do. u first of all get the all partitions information by using IOCTL_DISK_GET_DRIVE_LAYOUT, then just edit the partition number, its offset, size and the last parameter , set that to true and finally run the IOCTL_DISK_SET_DRIVE_LAYOUT code from there itself. and then you are done with a new partition. All the best. :-D

          M 1 Reply Last reply
          0
          • M Madan Chauhan

            Hi all, I am creating an application for windows Vista, XP and 2003Server. In my application I need to create and format partitions(Extended and primary both). I do not want to use DISKPART utility. Is there any other way to do this job like by using any win32API or any function provided by Microsoft in MSDN? Please give me some suggestions. Thanks

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            Did you see FormatPartition and CreatePartition?

            Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

            S 1 Reply Last reply
            0
            • H Hamid Taebi

              Did you see FormatPartition and CreatePartition?

              Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

              S Offline
              S Offline
              Stephen Hewitt
              wrote on last edited by
              #6

              These look like they're for Windows CE.

              Steve

              C 1 Reply Last reply
              0
              • S Stephen Hewitt

                These look like they're for Windows CE.

                Steve

                C Offline
                C Offline
                C myLife
                wrote on last edited by
                #7

                google for FMIFS.h and FMIFS.dll to format any volume. :-D

                M 1 Reply Last reply
                0
                • C C myLife

                  Its good that you are trying yourself. nothing you have to do. u first of all get the all partitions information by using IOCTL_DISK_GET_DRIVE_LAYOUT, then just edit the partition number, its offset, size and the last parameter , set that to true and finally run the IOCTL_DISK_SET_DRIVE_LAYOUT code from there itself. and then you are done with a new partition. All the best. :-D

                  M Offline
                  M Offline
                  Madan Chauhan
                  wrote on last edited by
                  #8

                  Thanks CMyLife. I am not sure that you will get my query today coz this thread is of one day old. I have successfully created the partition using IOCTL_DISK_SET_DRIVE_LAYOUT. But now I am stuck in formatting this raw partition. There is one function FormatEx() but it is only for Vista. Is there any other way to format partition without using DISKPART and SHFormatDrive like some ioctl code. Thanks

                  1 Reply Last reply
                  0
                  • C C myLife

                    google for FMIFS.h and FMIFS.dll to format any volume. :-D

                    M Offline
                    M Offline
                    Madan Chauhan
                    wrote on last edited by
                    #9

                    OH... Pardon me I have quoted you without reading this reply from ur side. I am just checking for these FMIFS.h and FMIFS.dll Thanks

                    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