mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/crequestchecker.cpp
branchRCL_3
changeset 23 e42293e811d8
parent 11 780c925249c1
equal deleted inserted replaced
22:b034b1c214c2 23:e42293e811d8
   241     PRINT1( _L("MM MTP => CRequestChecker::VerifyObjectHandleL aHandle = 0x%x"), aHandle );
   241     PRINT1( _L("MM MTP => CRequestChecker::VerifyObjectHandleL aHandle = 0x%x"), aHandle );
   242     TMTPResponseCode ret = EMTPRespCodeOK;
   242     TMTPResponseCode ret = EMTPRespCodeOK;
   243 
   243 
   244     CMTPObjectMetaData* object( CMTPObjectMetaData::NewLC() );
   244     CMTPObjectMetaData* object( CMTPObjectMetaData::NewLC() );
   245     TBool result( iFramework.ObjectMgr().ObjectL( aHandle, *object ) );
   245     TBool result( iFramework.ObjectMgr().ObjectL( aHandle, *object ) );
   246     iObjectArray.AppendL( object );
       
   247     CleanupStack::Pop( object );
       
   248     iHandles.AppendL( aHandle );
       
   249 
       
   250     // Obj handle exists
   246     // Obj handle exists
   251     if ( result )
   247     if ( result )
   252         {
   248         {
   253         const TDesC& suid( object->DesC( CMTPObjectMetaData::ESuid ) );
   249         const TDesC& suid( object->DesC( CMTPObjectMetaData::ESuid ) );
   254         TEntry entry;
   250         TEntry entry;
   275 
   271 
   276             if ( ( EMTPRespCodeOK == ret ) && ( aElementInfo.iElementAttr & EMTPElementAttrDir ) && !entry.IsDir() )
   272             if ( ( EMTPRespCodeOK == ret ) && ( aElementInfo.iElementAttr & EMTPElementAttrDir ) && !entry.IsDir() )
   277                 ret = EMTPRespCodeInvalidParentObject;
   273                 ret = EMTPRespCodeInvalidParentObject;
   278             }
   274             }
   279         }
   275         }
       
   276 
       
   277     if ( result )
       
   278         {
       
   279         iObjectArray.AppendL( object );
       
   280         CleanupStack::Pop( object );
       
   281         iHandles.AppendL( aHandle );
       
   282         }
   280     else
   283     else
       
   284         {
       
   285         CleanupStack::PopAndDestroy( object );
   281         ret = EMTPRespCodeInvalidObjectHandle;
   286         ret = EMTPRespCodeInvalidObjectHandle;
       
   287         }
   282 
   288 
   283     PRINT1( _L( "MM MTP <= CRequestChecker::VerifyObjectHandleL ret = 0x%x" ), ret );
   289     PRINT1( _L( "MM MTP <= CRequestChecker::VerifyObjectHandleL ret = 0x%x" ), ret );
   284 
   290 
   285     return ret;
   291     return ret;
   286     }
   292     }