Unsupported media state while drive becoming ready

I have consistently seenIDiscFormat2Data::get_CurrentMediaStatusreturn a state of IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MEDIA after I insert a blank recordable disc, after the drive becomes ready. There seems to be a transient state that exists immediately after the drive becomes ready. Prior to this state, while the drive is becoming ready, theget_CurrentMediaStatusmethod correctly returns an HRESULT of E_IMAPI_RECORDER_MEDIA_BECOMING_READY; then, immediately after becoming ready, it returns S_OK but reports a media state of unsupported. If you call it subsequently, it will return S_OK and correctly report the state as IMAPI_FORMAT2_DATA_MEDIA_STATE_BLANK.

It appears that this problem has something to do with the auto-insert notification (aka media change notification, MCN). The problem occurs at about the same time Vista autoplays the disc and displays a blank media popup. I also noticed that if I had calledIDiscRecorder2::DisableMcn prior to the error, the error becomes permanent. That is,everytime I callget_CurrentMediaStatusafter the drive becomes ready, it reports an unsupported media state one time (no matter how long I wait until after the drive becomes ready). I have to reboot the system to fix the problem. If I don't disable the MCN first, the error only occurs if I call get_CurrentMediaStatus immediately after the drive becomes ready. If I wait a second or two, I don't see the problem.

[1528 byte] By [Caliendo] at [2008-1-28]
# 1

Hi Caliendo,

Thanks for reporting this issue. Yep, seems to be a timing issue. We're looking at if we can still get this fix in for RTM (we have high hopes). Basically, the device has not reported a one-time error that is reported for media change in some cases, and with the right timing. Your repro steps (esp. w/disable of autoplay) helped us narrow this down quickly -- thanks! :)

If you want a temporary workaround: Prior to calling into IMAPI the first time with a given piece of media, use IDR2Ex's SendCommandNoData() to send a six-byte, all-zero command (and ignore the results).

Again, thanks for the clear report and repro steps. This is definitely an edge case we had not hit before.

Henry Gabryjelski

HenryGabryjelski-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Optical Platform Discussion...
# 2
Thanks! Your workaround seems to do the trick. By RTM, do you mean the fix would not appear until Vista is officially released? Or would the fix appear in the next beta build of Vista? (I'm currently using Build 5487).
Caliendo at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Optical Platform Discussion...
# 3
We are trying to make this fix for RC1, which come after the current beta build 5487. If this doesn't get fix in time, it will be only in the final official Vista release.
DavidBurg-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Optical Platform Discussion...
# 4
We have fixed this issue, however the fix will be available in RTM, it did not make the cut for RC1.
DavidBurg-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Optical Platform Discussion...
# 5
Fantastic!
Caliendo at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Optical Platform Discussion...

Software Development for Windows Vista

Site Classified