IMAPI_MEDIA_PHYSICAL_TYPE mediaType = IMAPI_MEDIA_TYPE_UNKNOWN; discFormatData.GetInterface()->get_CurrentPhysicalMediaType(&mediaType); // mediatype is BDR image->ChooseImageDefaultsForMediaType(mediaType); //Instead of the default UDF filesystem,using Joliet to archieve the multisession on xp hr = image->put_FileSystemsToCreate((FsiFileSystems)(FsiFileSystemJoliet|FsiFileSystemISO9660)); VARIANT_BOOL vbBlank ; discFormatData.GetInterface()->get_MediaHeuristicallyBlank(&vbBlank); if(vbBlank == VARIANT_TRUE) { BSTR bstrFileName = strFileName.AllocSysString(); image->put_VolumeName(bstrFileName); SysFreeString(bstrFileName); } else { SAFEARRAY *pSafeArrayMulSection = NULL; HRESULT hrTemp = discFormatData.GetInterface()->get_MultisessionInterfaces(&pSafeArrayMulSection); if(!SUCCEEDED(hrTemp)) { return FALSE; } if(SUCCEEDED(hrTemp)) { VARIANT *va = NULL ; SafeArrayAccessData(pSafeArrayMulSection,(VOID**)&va); if(va) { IMultisession *pMultisession = NULL ; pMultisession = (IMultisession*)va[0].pdispVal; hr = pMultisession->put_InUse(VARIANT_TRUE); if(!SUCCEEDED(hr)) { ::OspPrintf(TRUE,TRUE,"ERROR:Multiple session Inuse failed\n"); } } hrTemp = image->put_MultisessionInterfaces(pSafeArrayMulSection); if (!SUCCEEDED(hrTemp)) { ::OspPrintf(TRUE,TRUE,"put_MultisessionInterfaces Failed ! Code: OX%08x",hrTemp); ::OspPost(MAKEIID(CDBURN_APP_ID,1),BURN_MULTISESSION_ERROR,&tParam,sizeof(TParam),0); return FALSE; } FsiFileSystems fs; hr = image->GetDefaultFileSystemForImport((FsiFileSystems)(FsiFileSystemJoliet|FsiFileSystemISO9660),&fs); FsiFileSystems filesystem ; hrTemp = image->ImportFileSystem(&filesystem); if(!SUCCEEDED(hrTemp)) { return FALSE; } }// getmultisession SafeArrayDestroy(pSafeArrayMulSection); } LONG lFreeSectorOnMedia = 0; hr = discFormatData.GetInterface()->get_FreeSectorsOnMedia(&lFreeSectorOnMedia); if(SUCCEEDED(hr)) { // lFreeSectorOnMedia is about 50G in byts ,could I set the FreeMediaBlocks property of Image which uses Joliet filesystem, so large? hr = image->put_FreeMediaBlocks(lFreeSectorOnMedia); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)