IMAPI2: cannot finish the burn process
Hi, I'm trying to use IWriteEngine2 of IMAPI2 to write a single sector to a disc at LBA 0. Everything goes fine until the very end - when it's supposed to stop burning, the disc keeps spinning and the device is locked. I can't open the tray without doing a restart. In fact, WriteSection() returns S_OK, indicating that data must've been written, although the medium (CD-RW) remains blank afterwards (checked with hex editor).
Every call to the COM methods returns S_OK (this is what Assert() checks for), see excerpt below.
I've tried reading the stream, which works fine, so it shouldn't be a problem with IStream. The reason I'm using IWriteEngine2 is that data will be generated "on the fly" and should not be written in the conventional data CD format, but raw.
Assert(CoCreateInstance(__uuidof(MsftWriteEngine2), NULL, CLSCTX_ALL,
Assert(CoCreateInstance(__uuidof(MsftDiscRecorder2), NULL, CLSCTX_ALL,
Assert(CoCreateInstance(__uuidof(MsftDiscMaster2), NULL, CLSCTX_ALL,
long numDevices = 0;
for(int i = 0; i < 100; i++)
if(discMaster->get_Item(i, &uniqueID) == S_OK) break;
patternStream = SHCreateMemStream(pattern, 2048); //pattern is a valid pointer to 2048 bytes of memory
Assert(writeEngine->WriteSection(patternStream, 0, 1)); //after burning this returns S_OK
Let me know of any ideas to fix this. Thanks!