I have read hackchina and codeproject examples but it seems I can not figure out how to burn an existing .iso file. The examples above show ways of making an .iso from a folder and then burning it. I want to be able to directly burn an iso file.
Here is some code:
IDiscRecorder2 discRecorder = new MsftDiscRecorder2();
string Burner = comboBox1.SelectedItem.ToString();
foreach (DrvProperties prop in drv_props)
{
if (prop.letter.Contains(Burner)) // letter contains the drive's Letter (E:, G: etc.)
{
discRecorder.InitializeDiscRecorder(prop.ID); // ID contains drive's uniqueID
}
}
IDiscFormat2Data discFormatData = new MsftDiscFormat2Data();
discFormatData.Recorder = discRecorder;
IMAPI_MEDIA_PHYSICAL_TYPE mediaType = discFormatData.CurrentPhysicalMediaType;
......
......
Could someone please help me get further? Lets say I have example.iso. What should I do now? I don't understand. (I got using IMAPI2.interop in my code from CodeProject example).
Thanks a lot
Well i finally figured it out firstly you need to include the following name spaces:
In order to be able to use IStream.
Then you need to import SHCreateStreamOnFIle from shlwapi.dll to open a "read stream" to that iso:
and finally supply i to the discFormatData.Write() method.
I hope it helps someone. Take care