IMAPI刻录机:多区段(multisession)续刻

(1)什么是多区段刻录?

即MultiSession,这是多区段刻录方式。每个刻录过程只刻录并且关闭一个区段,剩余空间下次可以继续刻录下一区段。因此,往往光盘上存在多个区段,称为多区段光盘。如果光盘中只有一个区段,但光盘没有关闭,也可成为多区段光盘。这种方式多用于数据光盘的刻录,方便之处在于不必一次刻满整盘。

 

(2)多区段刻录的应用

在Nero中就很好的实现了多区段刻录的功能,具体可以查看这里

http://hi.baidu.com/wyshyr/blog/item/3c2599ee2ae7322a2cf53409.html

 

(3)IMAPI如何实现多区段刻录

首先,在MSDN(http://msdn.microsoft.com/zh-cn/library/aa364806%28v=VS.85%29.aspx)上查看的IMAPI的功能支持多区段刻录

IMAPI provides the following capabilities:

Creates and burns single-session and multisession discs

 

那么我们如何来实现呢,可以参考SDK的例子imapi2sample。

(1)IDiscFormat2Data对象提供get_MultisessionInterfaces方法用来获取当前多区段接口

(2)调用IFileSystemImage对象提供的put_MultisessionInterfaces方法用来设置当前的多区段接口

  1. // Check if media is blank   
  2. if (SUCCEEDED(hr))  
  3. {  
  4.     hr = dataWriter->get_MediaHeuristicallyBlank(&isBlank);  
  5.     if (FAILED(hr))  
  6.     {  
  7.         printf("Failed to get_MediaHeuristicallyBlank/n");  
  8.         PrintHR(hr);  
  9.     }  
  10. }  
  11. if (SUCCEEDED(hr) && !options.Multi && !isBlank)  
  12. {  
  13.     printf("*** WRITING TO NON-BLANK MEDIA WITHOUT IMPORT! ***/n");  
  14. }  
  15. // ImportFileSystem - Import file data from disc   
  16. if (SUCCEEDED(hr) && options.Multi)  
  17. {         
  18.     FsiFileSystems fileSystems;  
  19.     SAFEARRAY* multiSession = NULL;  
  20.     // Get mutlisession interface to set in image   
  21.     if (SUCCEEDED(hr))  
  22.     {          
  23.         hr = dataWriter->get_MultisessionInterfaces(&multiSession);  
  24.         if (FAILED(hr))  
  25.         {  
  26.             printf("Failed dataWriter->MultisessionInterfaces/n");  
  27.             PrintHR(hr);  
  28.         }  
  29.     }  
  30.     // Set the multisession interface in the image   
  31.     if (SUCCEEDED(hr))  
  32.     {  
  33.         hr = image->put_MultisessionInterfaces(multiSession);  
  34.         if (FAILED(hr))  
  35.         {  
  36.             printf("Failed image->put_MultisessionInterfaces/n");  
  37.             PrintHR(hr);  
  38.             if (multiSession != NULL)  
  39.             {  
  40.                 SafeArrayDestroy(multiSession);  
  41.             }  
  42.         }  
  43.         multiSession = NULL;  
  44.     }  
  45.     if (SUCCEEDED(hr))  
  46.     {  
  47.         hr = image->ImportFileSystem(&fileSystems);  
  48.         if (FAILED(hr))  
  49.         {  
  50.             if (hr == IMAPI_E_EMPTY_DISC)  
  51.             {  
  52.                 printf("Empty Disc/n");  
  53.                 hr = S_OK;  
  54.             }  
  55.             else  
  56.             {  
  57.                 printf("Failed to ImportFileSystem/n");  
  58.                 PrintHR(hr);  
  59.             }  
  60.         }  
  61.     }  
  62. }  

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值