已答复 [How Do I] Find the Total DVD Disk Size using IMAPI

  • Monday, August 10, 2009 3:47 PM
     
     
    Hi everyone, I'm trying to use IMAPI to find details about a machines recording device and the media inside it.

    I've managed to find out how many blocks are available using IFileSystemImage.FreeMediaBlocks and IFileSystemImage.UsedBlocks
    However I can't find a method for getting the Total Size of a DVD disk, and I was wondering if there is method for retrieving this information.

    Also, can anyone explain to me what IDiscFormat2Data.MediaHeuristicallyBlank is all about. If it returns true, does that mean the disk is completely blank as in All zeros? Because I also notice that there is a IDiscFormat2Data.MediaPhysicallyBlank method as well and I'm am unsure of the difference.

    Many thanks to those who can point me in the right direction.
    From Tyraninjasaurus Rex
    Do Crabs Think We Walk Sideways??

All Replies

  • Thursday, August 13, 2009 8:10 PM
    Moderator
     
     Answered
    Hi Tyranin,

    >I've managed to find out how many blocks are available using IFileSystemImage.FreeMediaBlocks and IFileSystemImage.UsedBlocks. However I can't find a method for getting the Total Size of a DVD disk, and I was wondering if there is method for retrieving this information.
    It is because IFileSystemImage is an image, not an object representing the drive. i.e. : you can stretch and shrink image as much as you want. usually FreeMediaBlocks is determined from the specified drive.
    You might be interested in IDiscFormat2Data::get_TotalSectorsOnMedia
    http://msdn.microsoft.com/en-us/library/aa364881%28VS.85%29.aspx

    ---
    The difference between those two methods is documented on msdn:
    http://msdn.microsoft.com/en-us/library/aa365374%28VS.85%29.aspx
    http://msdn.microsoft.com/en-us/library/aa365375%28VS.85%29.aspx

    So, basically: get_MediaPhysicallyBlank asks drive if the inserted media is blank, get_MediaHeuristicallyBlank reads information from the media and judge if the media is blank, according to this information. We have get_MediaHeuristicallyBlank because some media can not be erased physically.
    There are few options for erasing discs: issue erase command to the drive (quick/full erase) and owerwriting by software. Most medias uses drive's erase command. BUT: there is no "erase" command for the DVD+RW and there is no "erased" state of DVD+RW for the drive.

    Thus:
    >can anyone explain to me what IDiscFormat2Data.MediaHeuristicallyBlank is all about. If it returns true, does that mean the disk is completely blank as in All zeros?
    no, some data can be untouched
    >If you ask for MediaPhysicallyBlank
    again: no. MediaPhysicallyBlank means that drive considers media to be blank (no mater what pattern, what data it uses to determine that the media is blank)

    With Regards,
    Mikhail
  • Wednesday, January 26, 2011 12:08 AM
     
     

    It's helpful to me, Thanks for your analysis!