Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI ,

I know that Multisession using UDF filesystem is not supported in Windows Xp.so I choose Joliet to archive Multisession on bd -r disc.

I also know that Joliet filesystem requirs the file to be burned must be little than 4G. I am not sure if i can use Joliet on Bd- r because the capacity of the bd -r is 25G/50G.



code:

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);
}
Posted
Updated 31-Aug-10 21:43pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900