Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - calling imapi2 function put_MultisessionInterfaces return error

Reply
 
Old 04-25-2007   #1 (permalink)
caijx


 
 

calling imapi2 function put_MultisessionInterfaces return error

Hi all,

I am trying to write a program to burn data to blank disc(CD-R or
CD-RW) in recording multi-session on Vista Ultimate, but I had a problem in
calling put_MultisessionInterfaces, which always return 0xC0AAB156 error at
the first time, I refer to IMAPI2 header file "imapi2fserror.h" , this error
is as follows:

[ imapi2fserror.h]

// MessageId: IMAPI_E_IMPORT_SEEK_FAILURE

// Cannot seek to block %1!I64d! on source disc.
#define IMAPI_E_IMPORT_SEEK_FAILURE ((HRESULT)0xC0AAB156L)



But refer to IFileSystemImage:ut_MultisessionInterfaces interface, the
return is as follows:

HRESULT put_MultisessionInterfaces(
SAFEARRAY newVal
);

Return Value

S_OK on success; otherwise, failure. The following error codes can be
returned:
IMAPI_E_INCOMPATIBLE_MULTISESSION_TYPE
IMAPI_E_IMPORT_MEDIA_NOT_ALLOWED
IMAPI_E_NO_COMPATIBLE_MULTISESSION_TYPE


my some code is as follows:

FsiFileSystems fileSystems;
SAFEARRAY* multiSession = NULL;

// Get mutlisession interface to set in image
if (SUCCEEDED(hr))
{
hr = dataWriter->get_MultisessionInterfaces(&multiSession);

if (FAILED(hr))
{
printf("Failed dataWriter->MultisessionInterfaces\n");
PrintHR(hr);
}
}

VARIANT* pvarArray;
CComQIPtr<IMultisession> pMultiSession;

if(SUCCEEDED(hr) && (multiSession->cbElements>=1))
{
hr = SafeArrayAccessData(multiSession,(void**) &pvarArray);
}
if (SUCCEEDED(hr))
{
pMultiSession = pvarArray[0].pdispVal;
}
if (SUCCEEDED(hr))
{
hr = pMultiSession->put_InUse(VARIANT_TRUE);

}
IDiscRecorder2* pcurrentrecorder;
if (SUCCEEDED(hr))
{
hr = pMultiSession->get_ImportRecorder( &pcurrentrecorder);
}
if (SUCCEEDED(hr))
{

hr = SafeArrayUnaccessData(multiSession);
}
IMultisessionSequential* pMultiSessionSequential = NULL;
VARIANT_BOOL isFirstDataSession;
VARIANT_BOOL isSupportSession;
if (SUCCEEDED(hr))
{
hr
=pMultiSession->QueryInterface(IID_IMultisessionSequential,(void**)&pMultiSessionSequential);
}
if (SUCCEEDED(hr))
{
hr =
pMultiSessionSequential->get_IsSupportedOnCurrentMediaState(&isSupportSession);
}
if (SUCCEEDED(hr))
{
hr =
pMultiSessionSequential->get_IsFirstDataSession(&isFirstDataSession);
}
LONG lFreeSectorOnMedia;
if (SUCCEEDED(hr))
{
hr = pMultiSessionSequential->get_FreeSectorsOnMedia(&lFreeSectorOnMedia);
}
LONG lStartAddressOfPreviousSession;
if (SUCCEEDED(hr))
{
hr =
pMultiSessionSequential->get_StartAddressOfPreviousSession(&lStartAddressOfPreviousSession);
}

if (SUCCEEDED(hr))
{
pMultiSessionSequential->Release();
}


if (SUCCEEDED(hr))
{
hr = image->put_MultisessionInterfaces(multiSession);
if (FAILED(hr))
{
printf("Failed image->put_MultisessionInterfaces\n");
PrintHR(hr);
if (multiSession != NULL)
{
SafeArrayDestroy(multiSession);
}
}
multiSession = NULL;
}


The return value is incorrect and very strange, and I test the
imapi2sample project of Vista SDK imapi2 sample , multisession burn fail
and error is the same .(C:\Program Files\Microsoft
SDKs\Windows\v6.0\Samples\WinBase\imapi\imapi2sample)

by the way, I am sure that my program can run correctly in multisession
for CD-R or CD-RW which has be burned in multisession.

So what has happen in calling put_MultisessionInterfaces for blank
disc at first time? and how to resolve this?

Any suggestions would be greatly appritiated. Thanks.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Re: Calling function from script PowerShell
Error on return from function call in ASP.NET "Operation is not supported on this platform." .NET General
Problems calling a function PowerShell
calling imapi2 put_MultisessionInterfaces return error Vista General
return 800C013E while calling GetMessageProps in WinMail Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46