-3

I am trying to code a tool like disk2vhd. I'm using the VHD windows api:

Virtual Disk Functions

The Virtual Disk API In Windows 7

Demo various VHD API usage (CppVhdAPI)

I created a vhd file and created a partition in it, but I don't know how to convert a Windows partition to vhd like disk2vhd creates a vhd using CreateVirtualDisk().

I've tried to copy all items from that partition to my vhd but it does not work.

Please show me how to do that.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • You've already found some good sources of information. Why don't you use them? When you get stuck, show us the code you have and then ask a specific question about that code. – David Heffernan Dec 01 '14 at 12:31
  • can you teach (show) me solution to do that @David – user1834949 Dec 01 '14 at 12:41
  • 2
    Why did you revert my question edit and make the question formatting worse? Was that an accident? – David Heffernan Dec 01 '14 at 12:42
  • Hi @Devid i was use it, but i can't find that (partition to vhd)on windows api create vhd windows api is : CreateVirtualDisk open vhd: OpenVirtualDisk – user1834949 Dec 01 '14 at 12:51
  • Never mind. I don't think I can help you if our communication is on this level. It won't work if the communication only goes in one direction. – David Heffernan Dec 01 '14 at 12:51

1 Answers1

1

I think you should do the following:

  1. Load hard disk's information,
  2. load disk partition,
  3. create a file vhd,
  4. copy partition to vhd.
bahrep
  • 29,961
  • 12
  • 103
  • 150
Lily Tran
  • 26
  • 3