CurrentPhysicalMediaType throwing undocumented exceptions RRS feed

  • Question

  • Language: C#


    One of the things I test in my burn wizard is check if any media in the drive. Instead of doing this by trying to receive media change notifications, I do this by calling CurrentPhysicalMediaType on the IDiscFormat2Data interface every second. This works great in most cases. Now I am trying to see what happens while the recorder is in use by other applications so I insert a CD-RW and start some writing, erasing, writing, etc. Sometimes CurrentPhysicalMediaType now returns exceptions other than the documented exceptions:



    A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in ______.dll

    The media in the drive may have changed. (Exception from HRESULT: 0x80070456)


    A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in ______.dll
    The requested resource is in use. (Exception from HRESULT: 0x800700AA)

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in ______.dll
    The device is not ready. (Exception from HRESULT: 0x80070015)



    It's no problem for me to catch these exceptions and just return that there is no media inserted, but I want to know if there are also other exception I will have to take care of?




    Igor Markovic

    Monday, May 19, 2008 8:52 AM


  • While we try to document as best as possible the exceptions (or error return values) that we are aware may occur, it is difficult and actually impractical from an extensibility point of view to provide an hollistic list. Note that the MSDN documentation allows now to post community comment/feedback about the article of each method so you can share your finding with others.

    Friday, May 23, 2008 7:44 PM