omadrm/drmplugins/drmrohandler/src/CRoHandler.cpp
branchRCL_3
changeset 10 89a1f2bd800d
parent 2 76350b5be3d8
child 12 8a03a285ab14
equal deleted inserted replaced
5:79d62d1d7957 10:89a1f2bd800d
     1 /*
     1 /*
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   713 #endif
   713 #endif
   714 
   714 
   715     HBufC16 *number( NULL );
   715     HBufC16 *number( NULL );
   716     HBufC16 *messageContent( NULL );
   716     HBufC16 *messageContent( NULL );
   717     HBufC16* buffer( NULL );
   717     HBufC16* buffer( NULL );
       
   718     _LIT( KMarker, "\x00" );
   718 
   719 
   719     TInt ret( 0 );
   720     TInt ret( 0 );
   720     if ( iMessageBodyPtr.Size() == 0 )
   721     if ( iMessageBodyPtr.Size() == 0 )
   721         {
   722         {
   722         User::Leave( KErrCorrupt );
   723         User::Leave( KErrCorrupt );
   769 
   770 
   770         number = HBufC16::NewLC( 11 ); //longer than max of tuint32
   771         number = HBufC16::NewLC( 11 ); //longer than max of tuint32
   771         TPtr ptr( number->Des() );
   772         TPtr ptr( number->Des() );
   772         ptr.AppendNum( localId, EDecimal );
   773         ptr.AppendNum( localId, EDecimal );
   773 
   774 
   774         messageContent = HBufC16::NewL( ptr.Length() + uri16.Length() + 4 );
   775         messageContent = HBufC16::NewL( ptr.Length() + uri16.Length() + 5 );
   775         TPtr ptrToMz( messageContent->Des() );
   776         TPtr ptrToMz( messageContent->Des() );
   776         ptrToMz.Append( _L( "1 " ) );
   777         ptrToMz.Append( _L( "1" ) );
       
   778         ptrToMz.Append( KMarker );
   777         ptrToMz.Append( ptr ); // add localID
   779         ptrToMz.Append( ptr ); // add localID
   778         ptrToMz.Append( _L( " " ) ); // add space
   780         ptrToMz.Append( KMarker );
   779         ptrToMz.Append( uri16 ); //add uri16
   781         ptrToMz.Append( uri16 ); //add uri16
   780 
   782         ptrToMz.Append( KMarker );
       
   783         
   781         CleanupStack::PopAndDestroy( number );
   784         CleanupStack::PopAndDestroy( number );
   782         CleanupStack::PopAndDestroy( buffer );
   785         CleanupStack::PopAndDestroy( buffer );
   783         CleanupStack::PushL( messageContent );
   786         CleanupStack::PushL( messageContent );
   784 
   787 
   785         // create empty sms
   788         // create empty sms