/**
Check if we can copy the file to the new location
*/
TMTPResponseCode CMTPImageDpCopyObject::CanCopyObjectL(const TDesC& aOldName, const TDesC& aNewName) const
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPCOPYOBJECT_CANCOPYOBJECTL_ENTRY );
    TMTPResponseCode result = EMTPRespCodeOK;
    
    TEntry fileEntry;
    LEAVEIFERROR(iFramework.Fs().Entry(aOldName, fileEntry),
            OstTraceExt2( TRACE_ERROR, DUP1_CMTPIMAGEDPCOPYOBJECT_CANCOPYOBJECTL, 
                    "Gets the entry details for %S failed! error code %d", aOldName, munged_err ));
    TDriveNumber drive(static_cast<TDriveNumber>(iFramework.StorageMgr().DriveNumber(iStorageId)));
    LEAVEIFERROR(drive,
            OstTraceExt2( TRACE_ERROR, DUP2_CMTPIMAGEDPCOPYOBJECT_CANCOPYOBJECTL, 
                    "Gets drive for storage %d failed! error code %d", iStorageId, munged_err ));
    TVolumeInfo volumeInfo;
    LEAVEIFERROR(iFramework.Fs().Volume(volumeInfo, drive),
            OstTraceExt2( TRACE_ERROR, DUP3_CMTPIMAGEDPCOPYOBJECT_CANCOPYOBJECTL, 
                    "Gets volume information for driver %d failed! error code %d", drive, munged_err ));            
    
    if(volumeInfo.iFree < fileEntry.FileSize())
        {
        result = EMTPRespCodeStoreFull;
        }
    else if (BaflUtils::FileExists(iFramework.Fs(), aNewName))			
        {
        result = EMTPRespCodeInvalidParentObject;
        }
	OstTrace1( TRACE_NORMAL, CMTPIMAGEDPCOPYOBJECT_CANCOPYOBJECTL, 
	        "CanCopyObjectL - Exit with response code 0x%04X", result );
    OstTraceFunctionExit0( CMTPIMAGEDPCOPYOBJECT_CANCOPYOBJECTL_EXIT );
    return result;	
    }
// ---------------------------------------------------------
// CDpDataBuffer::SetLength
// This method sets length of buffer. This is called from
// CDpDataPort::SetReceiveBufferLength() method.
// ---------------------------------------------------------
//
TInt CDpDataBuffer::SetLength(
    const TInt aLen)
    {
    OstTrace0( TRACE_NORMAL, CDPDATABUFFER_SETLENGTH, "CDpDataBuffer::SetLength" );
    LOGM(" CDpDataBuffer::SetLength");

    //Initialization
    TInt max( 0 );
    TInt ret( KErrNone );

    if ( iHead + iWE.iSize > iEnd )
        {
        max = iHead + iWE.iSize;
        }
    else
        {
        max = iEnd;
        }

        OstTraceExt2( TRACE_NORMAL, DUP1_CDPDATABUFFER_SETLENGTH, "CDpDataBuffer:: iHead: %d, iWE.iSize: %d", iHead, iWE.iSize );
        OstTraceExt2( TRACE_NORMAL, DUP2_CDPDATABUFFER_SETLENGTH, "CDpDataBuffer:: iEnd : %d, aLen     : %d", iEnd, aLen );

        LOG2("  iHead: %d, \t iWE.iSize: %d", iHead, iWE.iSize );
        LOG2("  iEnd : %d, \t aLen     : %d", iEnd, aLen );

    if ( ( max >= ( aLen + iMaxReservationSize ) ) ||
            ( aLen < 2*iMaxReservationSize ) )
        {
        // buffer may be filled further than length

        OstTrace0( TRACE_NORMAL, DUP3_CDPDATABUFFER_SETLENGTH, "CDpDataBuffer:: ERROR, Client tried to reserve too big or too small Receive Buffer Size" );
        OstTraceExt2( TRACE_NORMAL, DUP4_CDPDATABUFFER_SETLENGTH, "CDpDataBuffer:: aLen: %d, iMaxReservationSize: %d", aLen, iMaxReservationSize );
        OstTrace1( TRACE_NORMAL, DUP5_CDPDATABUFFER_SETLENGTH, "CDpDataBuffer:: max: %d", max );

        LOG("  ERROR, Client tried to reserve too big or too small Receive Buffer Size");
        LOG2("  aLen: %d, \t iMaxReservationSize: %d", aLen, iMaxReservationSize );
        LOG1("  max: %d", max );

        ret = KErrArgument;
        }
    else
        {
        iBuf->Des().SetLength( max );
        HBufC8* tmp = NULL;

        // ReAllocL returns address of the expanded or contracted HBufC descriptor.
        // ReAllocL() leaves, if there is insufficient memory.
        TRAP(ret, ( tmp = iBuf->ReAllocL( aLen+iMaxReservationSize ) ));

        if ( KErrNone == ret )
            {
            iBuf=tmp;
            iBuf->Des().SetLength( aLen + iMaxReservationSize );
            iBufSize = aLen + iMaxReservationSize;
            iTreshold = aLen;
            }
        }

    return ret;
    }
// ---------------------------------------------------------------------------------
// CUpnpTmAppServerService::LaunchAppActionL
// @param aAction pointer to upnp action object
// @return Returns upnp error code
// ---------------------------------------------------------------------------------
//
TUpnpErrorCode CUpnpTmAppServerService::LaunchAppActionL( CUpnpAction* aAction )
   {
   OstTraceFunctionEntry0( CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL_ENTRY );
   TUint appIdInt;  
   TUint profileIdInt;
   // Validates the input parameters
   if ( ( ConvertDescriptorToInt( aAction->ArgumentValue(KAppId), appIdInt ) != KErrNone )
       || ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone ))
        {
        OstTraceExt2( TRACE_ERROR, CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL, "CUpnpTmAppServerService::LaunchAppActionL;appIdInt=%u;profileIdInt=%u", appIdInt, profileIdInt );
        return EInvalidArgs;   // either invalid app ID or invalid profile ID  
        }

   RBuf8 launchUrl;
   TTerminalModeErrorCode ret = iTmServerImpl.LaunchApp( appIdInt,profileIdInt,launchUrl );
   
   if ( ret != ETerminalModeSuccess )
       {
       // Error is returned
       launchUrl.Close();
       OstTrace0( TRACE_ERROR, DUP1_CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL, "CUpnpTmAppServerService::LaunchAppActionL" );   
       return TUpnpErrorCode( ret );
       }
   CleanupClosePushL(launchUrl);
   aAction->SetArgumentL( KAppLaunchUri , launchUrl );
   
   CleanupStack::PopAndDestroy(&launchUrl);
   OstTraceFunctionExit0( CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL_EXIT );
   return EHttpOk;  
   }
// -----------------------------------------------------------------------------
// CSACommonIscServiceChannelListener::NewL
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CSACommonIscServiceChannelListener* CSACommonIscServiceChannelListener::NewL(
    MSAIscService& aAdaptation, 
    RIscApi& aIscApi)
    {
    OstTraceExt2( TRACE_NORMAL, SA_COMMON_ISC_SERVICE_CHANNEL_LISTENER_AUTOMATED_5,
        "ISCSERVICE - CSACommonIscServiceChannelListener::NewL(0x%x,0x%x)",
        (TUint)&aAdaptation, (TUint)&aIscApi );
    INTERNAL_TRACE( ( _L( "ISCSERVICE - CSACommonIscServiceChannelListener::NewL(0x%x,0x%x)" ),
        &aAdaptation, &aIscApi ) );

    CSACommonIscServiceChannelListener* self = new( ELeave ) CSACommonIscServiceChannelListener( 
        aAdaptation, 
        aIscApi );

    CleanupStack::PushL( self );
    self->ConstructL();
    CleanupStack::Pop( self );

    OstTrace1( TRACE_NORMAL, SA_COMMON_ISC_SERVICE_CHANNEL_LISTENER_AUTOMATED_6,
        "ISCSERVICE - CSACommonIscServiceChannelListener::NewL - return 0x%x", self );
    INTERNAL_TRACE( ( _L( "ISCSERVICE - CSACommonIscServiceChannelListener::NewL - return 0x%x" ),
        self ) );

    return self;
    }
    void CUT_PBASE_T_USBDI_1231::ExecuteHostTestCaseL()
        {
        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_ENTRY, this );

        OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP01, "====> ExecuteHostTestCaseL entry priority = %d",
                RThread().Priority());

        // Bump thread priority for this test only

        RThread().SetPriority(EPriorityAbsoluteHigh);
        OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP02, "Thread priority raised %d->%d", iPriority, RThread().Priority());

        iCaseStep = EInProcess;
        iActorFDF = CActorFDF::NewL(*this);
        iControlEp0 = new (ELeave) CEp0Transfer(iUsbInterface0);
        iInterface0Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface0,TCallBack(CUT_PBASE_T_USBDI_1231::Interface0ResumedL,this));
        iInterface1Watcher = new (ELeave) CInterfaceWatcher(iUsbInterface1,TCallBack(CUT_PBASE_T_USBDI_1231::Interface1ResumedL,this));

        // Monitor for device connections
        iActorFDF->Monitor();

        // Start the connection timeout    
        TimeoutIn(30);
        OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_EXECUTEHOSTTESTCASEL_EXIT, this );
        }
TBool CMTPSvcDeleteServicePropList::DoHandleResponsePhaseL()
	{
	OstTraceFunctionEntry0( CMTPSVCDELETESERVICEPROPLIST_DOHANDLERESPONSEPHASEL_ENTRY );
	TMTPResponseCode responseCode = EMTPRespCodeOK;
	TUint32 parameter = 0;
	const TUint count = iDeleteServicePropList->NumberOfElements();
	for (TUint i = 0; i < count && responseCode == EMTPRespCodeOK; i++)
		{
		TMTPTypeDataPair& element = iDeleteServicePropList->ElementL(i);
		
		if (iDataProvider.ServiceID() != element.Uint32(TMTPTypeDataPair::EOwnerHandle))
			{
			parameter = i;
			responseCode = EMTPRespCodeInvalidServiceID;
			break;
			}
	
		TUint16 propertyCode = element.Uint16(TMTPTypeDataPair::EDataCode);
		responseCode = iDataProvider.ServiceHandler()->DeleteServicePropertyL(propertyCode);
		if (EMTPRespCodeOK != responseCode)
			{
			parameter = i;
			break;
			}
		}
	SendResponseL(responseCode, 1, &parameter);
    OstTraceExt2( TRACE_NORMAL, CMTPSVCDELETESERVICEPROPLIST_DOHANDLERESPONSEPHASEL, 
            "Exit responseCode = 0x%04X, failed index = %u", responseCode, parameter );
	OstTraceFunctionExit0( CMTPSVCDELETESERVICEPROPLIST_DOHANDLERESPONSEPHASEL_EXIT );
	return EFalse;
	}
Exemplo n.º 7
0
TInt TFsFormatNext::DoRequestL(CFsRequest* aRequest)
//
// Format the next part of the media.
//
	{

	__PRINT1(_L("TFsFormatNext::DoRequestL() drv:%d"), aRequest->DriveNumber());
	CFormatCB* format=(CFormatCB*)aRequest->ScratchValue();
	TInt r=format->CheckMount();
	if (r!=KErrNone && r!=KErrInUse)
        {
    	__PRINT1(_L("TFsFormatNext::DoRequestL() err:%d"), r);
        return r;
        }

	TPtr8 pStep((TUint8*)&format->CurrentStep(),sizeof(TInt));
	aRequest->ReadL(KMsgPtr0,pStep);

	OstTrace1(TRACE_FILESYSTEM, FSYS_ECFORMATCBDOFORMATSTEPL, "this %x", format);

	TRAP(r,format->DoFormatStepL());

	OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFORMATCBDOFORMATSTEPLRET, "r %d  iCurrentStep %d", r, (TUint) format->CurrentStep());

	if (r==KErrNone)
		aRequest->WriteL(KMsgPtr0,pStep);
	if (r==KErrNone && format->CurrentStep()==0)
		{
		FsNotify::DiskChange(aRequest->DriveNumber());
		}
	return(r);
	}
// ---------------------------------------------------------------------------
// Checks whether the given connection was opened by the Wlan Sniffer
// application
// ---------------------------------------------------------------------------
//
TBool CWsfKeepalive::OpenedByWlanSniffer( TUint aConnectionId )
    {
    OstTraceFunctionEntry0( CWSFKEEPALIVE_OPENEDBYWLANSNIFFER_ENTRY );
    
    TBool retVal = EFalse;

    // Get all clients of this connection
    TConnMonClientEnumBuf clientInfo;
    iConnMon->GetClientInfo( clientInfo, aConnectionId );

    // Check whether Wlan sniffer is one of the clients
    for ( TInt i( 0 ); i < clientInfo().iCount; ++i )
        {
        if ( clientInfo().iUid[i] == KWlanSnifferUid )
            {
            // Match found, stop looking
            retVal = ETrue;
            break;
            }
        }
    
    OstTraceExt2(
        TRACE_NORMAL,
        CWSFKEEPALIVE_OPENEDBYWLANSNIFFER,
        "CWsfKeepalive::OpenedByWlanSniffer;aConnectionId=%u;retVal=%u",
        aConnectionId,
        retVal );
    
    OstTraceFunctionExit0( CWSFKEEPALIVE_OPENEDBYWLANSNIFFER_EXIT );
    return retVal;
    }
Exemplo n.º 9
0
/**
Decrements the reference counter of the specified entry.
If the counter reaches zero, the entry will be destroyed and removed from the container, 
the database connection - closed.

@param aFullName The full database name, including the path.
*/
void CSqlCompactor::ReleaseEntry(const TDesC& aFullName)
	{
	SQL_TRACE_COMPACT(OstTraceExt2(TRACE_INTERNALS, CSQLCOMPACTOR_RELEASEENTRY1, "0x%X;CSqlCompactor::ReleaseEntry;aFullName=%S", (TUint)this, __SQLPRNSTR(aFullName)));
	SQLCOMPACTOR_INVARIANT();
	TInt idx = iEntries.FindInOrder(aFullName, &CSqlCompactor::Search);
	__ASSERT_DEBUG(idx >= 0, __SQLPANIC(ESqlPanicInternalError));
	if(idx >= 0)
		{
		CSqlCompactEntry* entry = iEntries[idx];
		__ASSERT_DEBUG(entry != NULL, __SQLPANIC(ESqlPanicInternalError));
		if(entry)
			{
			if(entry->Release() == 0)
				{
				iEntries.Remove(idx);			
#ifdef _DEBUG
//This is used prevent the failure of the resource allocation checking for debug mode. 
				if(iEntries.Count() == 0)
				    {
                    iEntries.Reset();
				    }
#endif  
				}
			}
		}
	SQLCOMPACTOR_INVARIANT();
	}
// -----------------------------------------------------------------------------
// DDmcExtension::StateChangedDfc
// Dfc function, called by IsaKernelIF when a channel state has been changed
// -----------------------------------------------------------------------------
//
void DDmcExtension::StateChangedDfc(TAny *aPtr)
    {
    OstTrace1(TRACE_ENTRY_EXIT, DDMC_STATE_CHANGED_DFC_ENTRY,
              "DMC:KERN_EXTEN: StateChangedDfc() # IN - aPtr: 0x%x", (TUint)(aPtr));
    DMC_TRACE((("DMC:KERN_EXTEN: StateChangedDfc() # IN - aPtr: 0x%x"), aPtr));
    DMC_TRACE_ASSERT_RESET(aPtr, "DMC:EH_APE_CEN: StateChangedDfc() - Kernel NULL pointer",
                           KErrNoMemory);

    DDmcExtension* dmcExtPtr = static_cast<DDmcExtension*>(aPtr);

    OstTraceExt2(TRACE_FLOW, DDMC_STATE_CHANGED_DFC_1,
                 "DMC:KERN_EXTEN: StateChangedDfc() - iIsaKernelAPIOpenStatus: %d, EIscConnectionOk: %d",
                 dmcExtPtr->iIsaKernelModemStatus, EIscConnectionOk);
    DMC_TRACE((("DMC:KERN_EXTEN: StateChangedDfc() - iIsaKernelAPIOpenStatus: %d, EIscConnectionOk: %d"),
                 dmcExtPtr->iIsaKernelModemStatus, EIscConnectionOk));

    // A Modem connenction lost.
    if (dmcExtPtr->iIsaKernelModemStatus != EIscConnectionOk)
        {
        DmcEvHandApeCent::HandleEvent(KERNEL_EVENT_MODEM_CONNECTION_NOT_OK,
                                      NULL /* Kernel*/, NULL /* User */);
        }

    OstTrace0(TRACE_ENTRY_EXIT, DDMC_STATE_CHANGED_DFC_RETURN,
              "DMC:KERN_EXTEN: StateChangedDfc() # OUT");
    DMC_TRACE(("DMC:KERN_EXTEN: StateChangedDfc() # OUT"));
    }
// ---------------------------------------------------------------------------------
// CUpnpTmAppServerService::TerminateAppActionL
// @param aAction pointer to upnp action object
// @return Returns upnp error code
// ---------------------------------------------------------------------------------
//
TUpnpErrorCode CUpnpTmAppServerService::TerminateAppActionL( CUpnpAction* aAction )
   { 
   OstTraceFunctionEntry0( CUPNPTMAPPSERVERSERVICE_TERMINATEAPPACTIONL_ENTRY );
   // Validates the input parameters
   TUint appIdInt;   
   TUint profileIdInt;
   if ( ( ConvertDescriptorToInt( aAction->ArgumentValue(KAppId), appIdInt ) != KErrNone )
       || ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone ))
        {
        OstTraceExt2( TRACE_ERROR, CUPNPTMAPPSERVERSERVICE_TERMINATEAPPACTIONL, "CUpnpTmAppServerService::TerminateAppActionL;appIdInt=%u;profileIdInt=%u", appIdInt, profileIdInt );
        return EInvalidArgs;   // either invalid app ID or invalid profile ID  
        }
   
   TTerminalModeErrorCode ret = iTmServerImpl.TerminateApp( appIdInt,profileIdInt );
   if ( ret != ETerminalModeSuccess )
       {
       // Error is returned
       aAction->SetArgumentL( KAppTerminateResult,KStatusFalse );
       OstTrace0( TRACE_ERROR, DUP1_CUPNPTMAPPSERVERSERVICE_TERMINATEAPPACTIONL, "CUpnpTmAppServerService::TerminateAppActionL" );    
       return TUpnpErrorCode( ret );
       }
   aAction->SetArgumentL( KAppTerminateResult,KStatusTrue); 
   OstTraceFunctionExit0( CUPNPTMAPPSERVERSERVICE_TERMINATEAPPACTIONL_EXIT );
   return EHttpOk;   
   }
Exemplo n.º 12
0
/** Commonly used step to load the USB Client Driver and set up
 *	a High-Speed electrical test VID/PID pair
 * @return ETrue if the ldd loaded sucessfully
 */
TBool COtgRoot::StepChangeVidPid(TUint16 aVID, TUint16 aPID)

	{
	test.Printf(_L("Load USBCC HS Test Client 0x%04x/0x%04x\n"),aVID,aPID);
	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID, "Load USBCC HS Test Client 0x%04x/0x%04x\n",(TUint32)aVID,(TUint32)aPID);

	TInt err;

	// Set the revised VID/PID pair
	
	TBuf8<KUsbDescSize_Device> theDeviceDescriptor;
	err = oUsbcClient.GetDeviceDescriptor(theDeviceDescriptor);
	if (err != KErrNone)
		{
		AssertionFailed2(KErrAbort, _L("Client GetDes Fail "), err);
		return (EFalse);
		}

	TUint16 oldVID = ( theDeviceDescriptor[8] )
		           + ( theDeviceDescriptor[9] << 8 );

	theDeviceDescriptor[8] = ( aVID & 0x00FF );
	theDeviceDescriptor[9] = ( aVID & 0xFF00 ) >> 8;

	test.Printf(_L("..Change VID 0x%04X->0x%04X\n"), oldVID, aVID);
	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID_DUP01, "..Change VID 0x%04X->0x%04X\n", (TUint32)oldVID, (TUint32)aVID);

	TUint16 oldPID = ( theDeviceDescriptor[10] )
		           + ( theDeviceDescriptor[11] << 8 );

	theDeviceDescriptor[10] = ( aPID & 0x00FF );
	theDeviceDescriptor[11] = ( aPID & 0xFF00 ) >> 8;

	test.Printf(_L("..Change PID 0x%04X->0x%04X\n"), oldPID, aPID);
	OstTraceExt2(TRACE_NORMAL, COTGROOT_STEPCHANGEVIDPID_DUP02, "..Change PID 0x%04X->0x%04X\n", (TUint32)oldPID, (TUint32)aPID);

	err = oUsbcClient.SetDeviceDescriptor(theDeviceDescriptor);
	if (err != KErrNone)
		{
		AssertionFailed2(KErrAbort, _L("Client SetDes Fail "), err);
		return (EFalse);
		}

	// Default no-problem return

	return(ETrue);
	}
Exemplo n.º 13
0
/**
Set the free space of the drive in the storage info data set
*/
void CMTPGetStorageInfo::SetFreeSpaceInBytesL()
	{
	TMTPTypeUint64 mtpFreeSpace;
	if(iIsCDrive)
	    {
	    mtpFreeSpace.Set(0);
	    }
	else
	    {
	    CRepository* repository(NULL);
	    TInt thresholdValue(0);
	    TRAPD(err,repository = CRepository::NewL(KCRUidUiklaf));
	    if (err == KErrNone)
	        {
	        err = repository->Get(KUikOODDiskFreeSpaceWarningNoteLevelMassMemory,thresholdValue);
	        if (err == KErrNone)
	            {
	            OstTrace1( TRACE_NORMAL, CMTPGETSTORAGEINFO_SETFREESPACEINBYTESL, 
	                    "Read from central repo:%d",  thresholdValue);
	            
	            thresholdValue += KFreeSpaceExtraReserved;
	            }	  
	        delete repository;
	        }
	    
	    if (err != KErrNone)
	        {
	        OstTrace0( TRACE_WARNING, DUP1_CMTPGETSTORAGEINFO_SETFREESPACEINBYTESL, "Fail in read ,use default" );
	        thresholdValue = KFreeSpaceThreshHoldDefaultValue + KFreeSpaceExtraReserved;
	        }
	    
	    OstTraceExt2( TRACE_NORMAL, DUP2_CMTPGETSTORAGEINFO_SETFREESPACEINBYTESL, 
	            "threshold:%d free space:%Ld",thresholdValue,iVolumeInfo.iFree );
	    
	    //Exclude the reserved disk space when reporting free space
	    TInt64 free = (iVolumeInfo.iFree > thresholdValue) ?
	        (iVolumeInfo.iFree - thresholdValue) : 0;
	    mtpFreeSpace.Set(free);
	    OstTrace1( TRACE_NORMAL, DUP3_CMTPGETSTORAGEINFO_SETFREESPACEINBYTESL, "set free:%ld", free);  
	    }
	
	OstTraceExt2( TRACE_NORMAL, DUP4_CMTPGETSTORAGEINFO_SETFREESPACEINBYTESL, 
	        "SetFreeSpaceInBytesL volume free:%Ld report:%Ld", iVolumeInfo.iFree,mtpFreeSpace.Value());
	
	iStorageInfo->SetL(CMTPTypeStorageInfo::EFreeSpaceInBytes, mtpFreeSpace);	
	}
/**
Save the object properties before doing the copy
*/
void CMTPImageDpCopyObject::GetPreviousPropertiesL(const TDesC& aOldFileName)
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPCOPYOBJECT_GETPREVIOUSPROPERTIESL_ENTRY );
    LEAVEIFERROR(iFramework.Fs().Modified(aOldFileName, iDateModified),
            OstTraceExt2( TRACE_ERROR, CMTPIMAGEDPCOPYOBJECT_GETPREVIOUSPROPERTIESL, 
                    "Gets the last modification date and time failed for %S! error code %d", aOldFileName, munged_err ));                        
    OstTraceFunctionExit0( CMTPIMAGEDPCOPYOBJECT_GETPREVIOUSPROPERTIESL_EXIT );
    }
/**
Process an SQL statement contained in the configuration file
and executes it if it is a supported statement.
Currently only 'CREATE INDEX' statements are supported.
The statement can contain comments that are understood by SQLite
- these can be in the form of an SQL comment or a 'C' comment, 
as defined at http://www.sqlite.org/lang_comment.html.

@param aStmt An SQL statement string, stripped of any whitespace 
			 at the beginning of it
@param aDbName Logical database name: "main" for the main database or attached database name

@leave KErrNoMemory, if an out of memory condition occurs
*/
void TSqlDbSysSettings::ProcessStatementL(const TDesC& aStmt, const TDesC& aDbName)
	{	
	SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_ENTRY, "Entry;0x%X;TSqlDbSysSettings::ProcessStatementL;Processing statement '%S'", (TUint)this, __SQLPRNSTR(aStmt)));	
	
	//If the statement only contained whitespace then just return
	if(aStmt.Length() == 0)
		{
		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT1, "Exit;0x%X;TSqlDbSysSettings::ProcessStatementL;The statement ignored because contains only whitespace", (TUint)this));	
		return;	
		}
		
	//Check that the statement does not contain an unsupported comment style
	if(KErrNotFound != aStmt.Find(_L("//")))
		{
		//The statement contains '//' which is an unsupported comment style, but rather
		//than leave here and cause the full file to fail, we just ignore this statement
		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT2, "Exit;0x%X;TSqlDbSysSettings::ProcessStatementL;The statement ignored because contains invalid comment style", (TUint)this));	
		return;
		}
		
	HBufC* stmtBuf = HBufC::NewLC(aStmt.Length() + 1 + aDbName.Length() + 1);
	TPtr stmtPtr = stmtBuf->Des();
	//If the 'aStmt' string is an SQL statement that is supported then execute it
	if(::IsStatementSupported(aStmt, aDbName, stmtPtr))
		{
		TInt err = ::DbExecStmt16(iDbHandle, stmtPtr);
		if(KErrNone == err)
			{
			SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL1, "0x%X;TSqlDbSysSettings::ProcessStatementL;Successfully executed statement", (TUint)this));		
			}
		else
			{
			SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL2, "0x%X;TSqlDbSysSettings::ProcessStatementL;Failed to execute the statement;err=%d", (TUint)this, err));		
			if(err == KErrNoMemory)
				{
				__SQLLEAVE(err);	
				}
			}
		}
	else
		{
		SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL3, "0x%X;TSqlDbSysSettings::ProcessStatementL;Non-supported statement, will be ignored", (TUint)this));		
		}
	CleanupStack::PopAndDestroy(); // stmtBuf
	SQL_TRACE_INTERNALS(OstTrace1(TRACE_INTERNALS, TSQLDBSYSSETTINGS_PROCESSSTATEMENTL_EXIT3, "Exit;0x%X;TSqlDbSysSettings::ProcessStatementL", (TUint)this));  
	}
Exemplo n.º 16
0
void CUT_PBASE_T_USBDI_0479::DeviceInsertedL(TUint aDeviceHandle)
	{
	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_ENTRY, this );
	Cancel();
	TInt err(KErrNone);
	
	// Validate that device is as expected
	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
		{
		// Incorrect device for this test case	

		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
			KErrNotFound,testDevice.SerialNumber(),TestCaseId());

		// Start the connection timeout again

		TimeoutIn(30);
		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT, this );
		return;
		}

	TUint32 validToken;
	TUint32 invalidToken(KMaxTUint-1); // The known invalid token
	
	err = testDevice.Device().GetTokenForInterface(0,validToken);
	if(err != KErrNone)
		{
		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface could not be retrieved",err);
		return TestFailed(err);
		}
	err = iUsbInterface0.Open(validToken); // Default interface setting 0
	if(err != KErrNone)
		{
		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0 using token %d",err,validToken);
		return TestFailed(err);
		}
	
	err = iDuplicateUsbInterface0.Open(invalidToken);
	if(err == KErrNone)
		{
		TBuf<64> msg;
		msg.Format(_L("<Error %d> Able to open an interface that is not present"),KErrCorrupt);
		OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP03, msg);
		iCaseStep = EFailed;
		TTestCaseFailed request(KErrCorrupt,msg);
		iClientAction->SendRequest(request,this);
		}
	else
		{
		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_DUP04, "Opening interface with invalid token failed with %d",err);
		User::After(1000000);
		iCaseStep = EPassed;
		TTestCasePassed request;
		iClientAction->SendRequest(request,this);	
		}
	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0479_DEVICEINSERTEDL_EXIT_DUP01, this );
	}
Exemplo n.º 17
0
/**
Connects the RFs.
If the operation fails, the program will be terminated.

@see TStaticFs
*/
TStaticFs::TStaticFs()
	{
	TInt err = Connect();
	if(err != KErrNone)
		{
		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICFS_TSTATICFS, "OS;0x%X;TStaticFs::TStaticFs;err=%d", (TUint)this, err));
		User::Exit(err);	
		}
	}
Exemplo n.º 18
0
/**
Creates the static mutexes.
If the creation fails, the program will be terminated.

@see TStaticMutex
*/
TStaticMutex::TStaticMutex()
	{
	TInt err = Create();
	if(err != KErrNone)
		{
		SQLITE_TRACE_OS(OstTraceExt2(TRACE_INTERNALS, TSTATICMUTEX_TSTATICMUTEX, "OS;0x%X;TStaticMutex::TStaticMutex;err=%d", (TUint)this, err));
		User::Exit(err);	
		}
	}
Exemplo n.º 19
0
// ---------------------------------------------------------------------------
// destructor, nothing to destruct
// ---------------------------------------------------------------------------
//
CFlexTimerItem::~CFlexTimerItem()
    {
        OstTraceExt2( TRACE_INTERNAL,
            DUP1_CFLEXTIMERITEM_CFLEXTIMERITEM,
            "CFlexTimerItem::~CFlexTimerItem;this=%x;iMFlexTimerServiceCB=%x",
            ( TUint )this,
            ( TUint )iMFlexTimerServiceCB );
    //Nothing to do here
    }
Exemplo n.º 20
0
/**
 * GetSet
 * 
 * @param aFunc Function choosed (@see ETraceCoreOstLddIfGetSet)
 * @return TDfc* if aFunc is EGetDfc, TDes8* EGetBuf and 0 with ESetWriter.
 */
EXPORT_C TUint32 DTraceCoreOstLddIf::GetSet(TTraceCoreOstLddIfGetSet aFunc, TUint32 aParam)
    {
    OstTraceExt2( TRACE_FLOW, DTRACECOREOSTLDDIF_GETSET_ENTRY, "> DTraceCoreOstLddIf::GetSet aFunc:%d, aParam:%d", aFunc, aParam );
    
    TUint32 ret(0);
    switch(aFunc)
        {
        case EGetDfc:
            {
            TraceCoreOstLddIf->iTraceCoreOstConnectionRegistered = ETrue;
            ret = reinterpret_cast<TUint32>(&(TraceCoreOstLddIf->iReceiveDfc));
            break;
            }
        case EGetBuf:
            {
            ret = reinterpret_cast<TUint32>(&(TraceCoreOstLddIf->iReceiveBuffer));
            break;
            }
        case ESetWriter:
            {
            // Set Writer to XTI if parameter is 0, otherwise USB
            DTraceCore* traceCore = DTraceCore::GetInstance();
            if ( traceCore != NULL )
                {
                // TraceSwitch uses 0 for XTI writer and 1 to OST writer
                // So it is not mapping one to one to enum found in TraceCoreWriter.h
                // for example to EWriterTypeXTI = 1
                // See TraceCoreWriter.h
                if(aParam==0)
                    {
                    traceCore->SwitchToWriter(EWriterTypeXTI);
                    }
                else if(aParam==1)
                    {
                    traceCore->SwitchToWriter(EWriterTypeUSBPhonet);
                    }
                // For other writers (>2) we use same as the enum
                else if(aParam > EWriterTypeUSBPhonet)
                    {
                    traceCore->SwitchToWriter((TWriterType) aParam);
                    }
                }
            break;
            }
        case ERegister:
            {
            TraceCoreOstLddIf->iTraceCoreOstConnection = (MTraceCoreOstConnectionIf*)aParam;
            break;
            }    
        default:
            __ASSERT_DEBUG( EFalse, Kern::Fault( "DTraceCoreOstLddIf::GetSet: Default case!", KErrArgument ) );
            break;
        }
    
    return ret;
    }
Exemplo n.º 21
0
void CHelloTraceFn::PreProcessedFn(TInt aDbgParam)
{
    OstTraceExt2( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_ENTRY_1, "CHelloTraceFn::PreProcessedFn: > CHelloTraceFn::PreProcessedFn;aDbgParam=%d;this=%x", (TInt) aDbgParam, (TUint) this);
#else
void CHelloTraceFn::PreProcessedFn()
{
    OstTrace1( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_ENTRY_2, "CHelloTraceFn::PreProcessedFn: > CHelloTraceFn::PreProcessedFn;this=%x", (TUint) this);
#endif
    Simple();
    OstTrace1( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_EXIT, "CHelloTraceFn::PreProcessedFn: < CHelloTraceFn::PreProcessedFn;this=%x", (TUint) this);
}
// -----------------------------------------------------------------------------
// CDpPn2Rx::RunError
// Leave in RunL() is handled here. Error code is returned,
// when internal error has occured.
// -----------------------------------------------------------------------------
//
TInt CDpPn2Rx::RunError(
    TInt aError )
    {
    OstTrace0( TRACE_NORMAL, CDPPN2RX_RUNERROR, "CDpPn2Rx::RunError" );
    OstTraceExt2( TRACE_NORMAL, DUP1_CDPPN2RX_RUNERROR, "CDpPn2Rx:: Port: %u, error code: %d", iDataPort.PortUnit(), aError );

    LOGM2("CDpPn2Rx::RunError - Port %d, error code: %d",
        iDataPort.PortUnit(), aError );

    return aError;
    }
Exemplo n.º 23
0
/**
A helper function of MoveObjectL.
@param aNewFileName the new file name after the object is moved.
*/
void CMTPMoveObject::MoveFileL(const TDesC& aNewFileName)
{
    OstTraceFunctionEntry0( CMTPMOVEOBJECT_MOVEFILEL_ENTRY );
    const TDesC& suid(iObjectInfo->DesC(CMTPObjectMetaData::ESuid));
    GetPreviousPropertiesL(suid);

    if(iFramework.StorageMgr().DriveNumber(iObjectInfo->Uint(CMTPObjectMetaData::EStorageId)) ==
            iFramework.StorageMgr().DriveNumber(iStorageId))
        //Move file to the same storage
    {
        LEAVEIFERROR(iFileMan->Move(suid, *iDest),
                     OstTraceExt2( TRACE_ERROR, CMTPMOVEOBJECT_MOVEFILEL, "move %S to %S failed!", suid, *iDest ));
        SetPreviousPropertiesL(aNewFileName);
        iObjectInfo->SetDesCL(CMTPObjectMetaData::ESuid, aNewFileName);
        iObjectInfo->SetUint(CMTPObjectMetaData::EStorageId, iStorageId);
        iObjectInfo->SetUint(CMTPObjectMetaData::EParentHandle, iNewParentHandle);
        iFramework.ObjectMgr().ModifyObjectL(*iObjectInfo);
        SendResponseL(EMTPRespCodeOK);
    }
    else
        //Move file between different storages
    {
        delete iNewFileName;
        iNewFileName = NULL;
        iNewFileName = aNewFileName.AllocL(); // Store the new file name

        LEAVEIFERROR(iFileMan->Move(suid, *iDest, CFileMan::EOverWrite, iStatus),
                     OstTraceExt2( TRACE_ERROR, DUP1_CMTPMOVEOBJECT_MOVEFILEL, "move %S to %S failed!", suid, *iDest));
        if ( !IsActive() )
        {
            SetActive();
        }

        delete iTimer;
        iTimer = NULL;
        iTimer = CPeriodic::NewL(EPriorityStandard);
        TTimeIntervalMicroSeconds32 KMoveObjectIntervalNone = 0;
        iTimer->Start(TTimeIntervalMicroSeconds32(KMoveObjectTimeOut), KMoveObjectIntervalNone, TCallBack(CMTPMoveObject::OnTimeoutL, this));
    }
    OstTraceFunctionExit0( CMTPMOVEOBJECT_MOVEFILEL_EXIT );
}
// ---------------------------------------------------------
// CDpMif::RunError
// Leave in RunL() is handled here. Error code is returned,
// when internal error has occured.
// ---------------------------------------------------------
//
TInt CDpMif::RunError(
    TInt aError )
    {
    OstTrace0( TRACE_NORMAL, CDPMIF_RUNERROR, "CDpMif::RunError" );
    LOGM2("CDpMif::RunError - Port %d, error code: %d",
        iDataPort.PortUnit(), aError );
    OstTraceExt2( TRACE_NORMAL, DUP1_CDPMIF_RUNERROR, "CDpMif:: Port: %u, error code: %d", iDataPort.PortUnit(), aError );

    // Message was not necessarily freed, if leave happened.
    iReceiveMessage.Zero();

    return aError;
    }
// -----------------------------------------------------------------------------
// CDpPn2Rx::RunL
// This active object is signalled by Isc Api.
// We will renew read to Isc Api.
// -----------------------------------------------------------------------------
//
void CDpPn2Rx::RunL()
    {
    OstTrace0( TRACE_NORMAL, CDPPN2RX_RUNL, "CDpPn2Rx::RunL" );
    OstTraceExt2( TRACE_NORMAL, DUP1_CDPPN2RX_RUNL, "CDpPn2Rx:: Port: %u, Status: %d", iDataPort.PortUnit(), iStatus.Int() );

    LOGM2("CDpPn2Rx::RunL - Port %d, Status: %d ",
        iDataPort.PortUnit(), iStatus.Int() );

    iRequestActive = EFalse;
    User::LeaveIfError( Read() );

    // don't set iStatus nor set_active here as it is better done in functions
    }
Exemplo n.º 26
0
    TInt CUT_PBASE_T_USBDI_1231::Interface0ResumedL(TAny* aPtr)
        {
        OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_ENTRY, 0 );

        OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP12, "====> Interface0ResumedL entry priority = %d", RThread().Priority());

        OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP13, "-Interface 0 resumed");
        CUT_PBASE_T_USBDI_1231* self =
                reinterpret_cast<CUT_PBASE_T_USBDI_1231*>(aPtr);
        
        TInt completionCode=self->iInterface0Watcher->CompletionCode();
        

#ifdef OST_TRACE_COMPILER_IN_USE
        TInt testStep = self->iCaseStep;
#endif
        OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP14, " -watcher 0 iStatus = %d <teststep %d>",completionCode, testStep);
           
        self->iInterface0Resumed = ETrue;
        
        switch (self->iCaseStep)
            {

            case EValidResumeWhenSuspending:
                {
                if (completionCode == KErrNone)
                 {
                 OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_DCUT_PBASE_T_USBDI_1231_DUP15, "Device resume while suspending succeed!");
                 self->TimeoutIn(10);
                 self->iCaseStep = EPassed;
                 self->SendEp0Request();
                 }
                else
                    {
                    RDebug::Printf(
                            "Device resume while suspending failed,<err %d>",
                            completionCode);
                    self->iCaseStep = EFailed;
                    self->SendEp0Request();
                    }
                }
                break;

            default:
                break;
            };

        OstTraceFunctionExitExt( CUT_PBASE_T_USBDI_1231_INTERFACE0RESUMEDL_EXIT, 0, KErrNone );
        return KErrNone;
        }
Exemplo n.º 27
0
void CUT_PBASE_T_USBDI_0474::DeviceInsertedL(TUint aDeviceHandle)
	{
	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_ENTRY, this );
	Cancel();
	TInt err(KErrNone); 
	
	// Validate that device is as expected
	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);
	if(testDevice.SerialNumber().Compare(TestCaseId()) != 0)
		{
		// Incorrect device for this test case	

		OstTraceExt3(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL, "<Warning %d> Incorrect device serial number (%S) connected for this test case (%S)",
			KErrNotFound,testDevice.SerialNumber(),TestCaseId());

		// Start the connection timeout again

		TimeoutIn(30);
		OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT, this );
		return;
		}
		
	// Check tree now
	TUsbGenericDescriptor deviceDesc = testDevice.DeviceDescriptor();
	TUsbGenericDescriptor configDesc = testDevice.ConfigurationDescriptor();

	// Check tree now	
	CHECK(CheckTreeAfterDeviceInsertion(testDevice, _L("RDeviceB")) == KErrNone);
		
	// Inform client device test case successful
	TUint32 token0;
	err = testDevice.Device().GetTokenForInterface(0,token0);
	if(err != KErrNone)
		{
		OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP01, "<Error %d> Token for interface 0 could not be retrieved",err);
		return TestFailed(err);
		}
	err = iUsbInterface0.Open(token0); // Default interface setting 0
	if(err != KErrNone)
		{
		OstTraceExt2(TRACE_NORMAL, CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 1 using token %d",err,token0);
		return TestFailed(err);
		} 
	 	
	iCaseStep = EPassed;
	TTestCasePassed request;
	iClientAction->SendRequest(request,this);
	OstTraceFunctionExit1( CUT_PBASE_T_USBDI_0474_DEVICEINSERTEDL_EXIT_DUP01, this );
	}
Exemplo n.º 28
0
	TInt CSBEParserProxy::ConvertToUnicodeL( TDes16& aUnicode, const TDesC8& aForeign )
        {
        OstTraceFunctionEntry0( CSBEPARSERPROXY_CONVERTTOUNICODEL_ENTRY );
        const TInt error = iConverter->ConvertToUnicode( aUnicode, aForeign, iConverterState );

        if  ( error != KErrNone )
            {
            HBufC* copy = HBufC::NewL( aForeign.Length() * 2 );
            copy->Des().Copy( aForeign );
            OstTraceExt2(TRACE_NORMAL, CSBEPARSERPROXY_CONVERTTOUNICODEL, "error: %d when converting: %S", error, *copy );
            delete copy;
            }

        OstTraceFunctionExit0( CSBEPARSERPROXY_CONVERTTOUNICODEL_EXIT );
        return error;
        }
/**
Set the object properties after doing the copy
*/
void CMTPImageDpCopyObject::SetPreviousPropertiesL(const TDesC& aNewFileName)
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPCOPYOBJECT_SETPREVIOUSPROPERTIESL_ENTRY );      
    LEAVEIFERROR(iFramework.Fs().SetModified(aNewFileName, iDateModified),
            OstTraceExt2( TRACE_ERROR, CMTPIMAGEDPCOPYOBJECT_SETPREVIOUSPROPERTIESL, 
                    "Sets the date and time for %S failed. Error code %d", aNewFileName, munged_err));
    iTargetObjectInfo = CMTPObjectMetaData::NewL();
    iTargetObjectInfo->SetUint(CMTPObjectMetaData::EDataProviderId, iSrcObjectInfo->Uint(CMTPObjectMetaData::EDataProviderId));
    iTargetObjectInfo->SetUint(CMTPObjectMetaData::EFormatCode, iSrcObjectInfo->Uint(CMTPObjectMetaData::EFormatCode));
    iTargetObjectInfo->SetUint(CMTPObjectMetaData::EFormatSubCode, iSrcObjectInfo->Uint(CMTPObjectMetaData::EFormatSubCode));
    iTargetObjectInfo->SetDesCL(CMTPObjectMetaData::EName, iSrcObjectInfo->DesC(CMTPObjectMetaData::EName));
    iTargetObjectInfo->SetUint(CMTPObjectMetaData::ENonConsumable, iSrcObjectInfo->Uint(CMTPObjectMetaData::ENonConsumable));
    iTargetObjectInfo->SetUint(CMTPObjectMetaData::EParentHandle, iNewParentHandle);
    iTargetObjectInfo->SetUint(CMTPObjectMetaData::EStorageId, iStorageId);
    iTargetObjectInfo->SetDesCL(CMTPObjectMetaData::ESuid, aNewFileName);
    OstTraceFunctionExit0( CMTPIMAGEDPCOPYOBJECT_SETPREVIOUSPROPERTIESL_EXIT );
    }
/**
Get a default parent object, ff the request does not specify a parent object, 
*/
void CMTPImageDpCopyObject::SetDefaultParentObjectL()
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL_ENTRY );
    TDriveNumber drive(static_cast<TDriveNumber>(iFramework.StorageMgr().DriveNumber(iStorageId)));
    LEAVEIFERROR(drive,
            OstTraceExt2( TRACE_ERROR, CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL, "No driver number for %d! error code %d",iStorageId, munged_err));
    TChar driveLetter;
    iFramework.Fs().DriveToChar(drive, driveLetter);
    TFileName driveBuf;
    driveBuf.Append(driveLetter);
    driveBuf = BaflUtils::RootFolderPath(driveBuf.Left(1));
    delete iDest;
    iDest = NULL;
    iDest = driveBuf.AllocL();
    iNewParentHandle = KMTPHandleNoParent;
    OstTraceFunctionExit0( CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL_EXIT );
    }