106 // |
106 // |
107 EXPORT_C RDRMRightsClient::RDRMRightsClient() : |
107 EXPORT_C RDRMRightsClient::RDRMRightsClient() : |
108 iPtr( NULL ) |
108 iPtr( NULL ) |
109 { |
109 { |
110 } |
110 } |
111 |
111 |
112 // ----------------------------------------------------------------------------- |
112 // ----------------------------------------------------------------------------- |
113 // RDRMRightsClient::~RDRMRightsClient |
113 // RDRMRightsClient::~RDRMRightsClient |
114 // Destructor. |
114 // Destructor. |
115 // ----------------------------------------------------------------------------- |
115 // ----------------------------------------------------------------------------- |
116 // |
116 // |
117 EXPORT_C RDRMRightsClient::~RDRMRightsClient() |
117 EXPORT_C RDRMRightsClient::~RDRMRightsClient() |
118 { |
118 { |
119 } |
119 } |
120 |
120 |
121 // ----------------------------------------------------------------------------- |
121 // ----------------------------------------------------------------------------- |
122 // RDRMRightsClient::Connect |
122 // RDRMRightsClient::Connect |
123 // Opens connection to the server. |
123 // Opens connection to the server. |
124 // ----------------------------------------------------------------------------- |
124 // ----------------------------------------------------------------------------- |
125 // |
125 // |
126 EXPORT_C TInt RDRMRightsClient::Connect() |
126 EXPORT_C TInt RDRMRightsClient::Connect() |
127 { |
127 { |
128 TInt ret = KErrNone; |
128 TInt ret = KErrNone; |
129 TUint8 count = 0; |
129 TUint8 count = 0; |
130 |
130 |
131 const TVersion requiredVersion( |
131 const TVersion requiredVersion( |
132 DRMEngine::KServerMajorVersion, |
132 DRMEngine::KServerMajorVersion, |
133 DRMEngine::KServerMinorVersion, |
133 DRMEngine::KServerMinorVersion, |
134 DRMEngine::KServerBuildVersion ); |
134 DRMEngine::KServerBuildVersion ); |
135 |
135 |
136 FOREVER |
136 FOREVER |
137 { |
137 { |
138 DRMLOG( _L( "RDRMRightsClient::Connect(): Create a new session" ) ); |
138 DRMLOG( _L( "RDRMRightsClient::Connect(): Create a new session" ) ); |
139 ret = CreateSession( DRMEngine::KServerName, |
139 ret = CreateSession( DRMEngine::KServerName, |
140 requiredVersion, |
140 requiredVersion, |
141 KMaxMessageSlots ); |
141 KMaxMessageSlots ); |
142 |
142 |
143 if ( ret == KErrNotFound && count < KStartupCount ) |
143 if ( ret == KErrNotFound && count < KStartupCount ) |
144 { |
144 { |
145 ret = StartServer(); |
145 ret = StartServer(); |
146 if ( ret ) |
146 if ( ret ) |
147 { |
147 { |
148 break; |
148 break; |
149 } |
149 } |
150 |
150 |
151 ++count; |
151 ++count; |
152 } |
152 } |
153 else |
153 else |
154 { |
154 { |
155 break; |
155 break; |
156 } |
156 } |
157 } |
157 } |
158 |
158 |
159 #ifdef __DRM_FULL |
159 #ifdef __DRM_FULL |
160 // startup code, if it starts it starts if not it will be tried again. |
160 // startup code, if it starts it starts if not it will be tried again. |
161 RDRMHelper helper; |
161 RDRMHelper helper; |
162 TInt ignore = helper.Connect(); // Start HelperServer |
162 TInt ignore = helper.Connect(); // Start HelperServer |
163 helper.Close(); |
163 helper.Close(); |
164 #endif |
164 #endif |
165 |
165 |
166 DRMLOG2( _L( "RDRMRightsClient::Connect(): Result: %d" ), ret ); |
166 DRMLOG2( _L( "RDRMRightsClient::Connect(): Result: %d" ), ret ); |
167 |
167 |
168 return ret; |
168 return ret; |
169 } |
169 } |
170 |
170 |
171 // ----------------------------------------------------------------------------- |
171 // ----------------------------------------------------------------------------- |
172 // RDRMRightsClient::Close |
172 // RDRMRightsClient::Close |
173 // Closes the connection to the server. |
173 // Closes the connection to the server. |
174 // ----------------------------------------------------------------------------- |
174 // ----------------------------------------------------------------------------- |
175 // |
175 // |
176 EXPORT_C void RDRMRightsClient::Close() |
176 EXPORT_C void RDRMRightsClient::Close() |
177 { |
177 { |
178 DRMLOG( _L( "RDRMRightsClient::Close()" ) ); |
178 DRMLOG( _L( "RDRMRightsClient::Close()" ) ); |
179 RHandleBase::Close(); |
179 RHandleBase::Close(); |
180 } |
180 } |
181 |
181 |
182 EXPORT_C TInt RDRMRightsClient::StartServer() |
182 EXPORT_C TInt RDRMRightsClient::StartServer() |
183 { |
183 { |
184 DRMLOG( _L( "RDRMRightsClient::StartServer()" ) ); |
184 DRMLOG( _L( "RDRMRightsClient::StartServer()" ) ); |
185 |
185 |
186 RSemaphore semaphore; |
186 RSemaphore semaphore; |
187 RSemaphore semaphore2; |
187 RSemaphore semaphore2; |
188 TFindServer server( DRMEngine::KServerName ); |
188 TFindServer server( DRMEngine::KServerName ); |
189 TFullName name; |
189 TFullName name; |
190 RProcess process; |
190 RProcess process; |
191 TInt error = KErrNone; |
191 TInt error = KErrNone; |
192 |
192 |
193 // "local" semaphore |
193 // "local" semaphore |
194 error = semaphore2.CreateGlobal( KRightsServerStarterSemaphore, // name |
194 error = semaphore2.CreateGlobal( KRightsServerStarterSemaphore, // name |
195 1 , // count |
195 1 , // count |
196 EOwnerThread ); // owner |
196 EOwnerThread ); // owner |
197 |
197 |
198 if ( error == KErrAlreadyExists ) |
198 if ( error == KErrAlreadyExists ) |
199 { |
199 { |
200 error = semaphore2.OpenGlobal( KRightsServerStarterSemaphore ); |
200 error = semaphore2.OpenGlobal( KRightsServerStarterSemaphore ); |
201 } |
201 } |
202 |
202 |
203 |
203 |
204 // Semaphore not created or opened, don't need to close |
204 // Semaphore not created or opened, don't need to close |
205 if( error ) |
205 if( error ) |
206 { |
206 { |
207 return error; |
207 return error; |
208 } |
208 } |
209 |
209 |
210 // Server updated semaphore |
210 // Server updated semaphore |
211 error = semaphore.CreateGlobal( DRMEngine::KDRMSemaphore, // name |
211 error = semaphore.CreateGlobal( DRMEngine::KDRMSemaphore, // name |
212 0 , // count |
212 0 , // count |
213 EOwnerThread ); // owner |
213 EOwnerThread ); // owner |
214 |
214 |
215 if ( error == KErrAlreadyExists ) |
215 if ( error == KErrAlreadyExists ) |
216 { |
216 { |
217 error = semaphore.OpenGlobal( DRMEngine::KDRMSemaphore ); |
217 error = semaphore.OpenGlobal( DRMEngine::KDRMSemaphore ); |
218 } |
218 } |
219 |
219 |
220 // Semaphore not created or opened, don't need to close |
220 // Semaphore not created or opened, don't need to close |
221 if( error ) |
221 if( error ) |
222 { |
222 { |
223 semaphore2.Close(); |
223 semaphore2.Close(); |
224 return error; |
224 return error; |
225 } |
225 } |
226 |
226 |
227 // Wait until server has done all its things. |
227 // Wait until server has done all its things. |
228 semaphore2.Wait(); |
228 semaphore2.Wait(); |
229 |
229 |
230 // Check if the server is already running. |
230 // Check if the server is already running. |
231 error = server.Next( name ); |
231 error = server.Next( name ); |
232 |
232 |
233 if ( !error ) |
233 if ( !error ) |
234 { |
234 { |
235 // Yep, it's already running. |
235 // Yep, it's already running. |
236 error = KErrNone; |
236 error = KErrNone; |
237 } |
237 } |
238 else |
238 else |
239 { |
239 { |
240 error = process.Create( KServerFileName, |
240 error = process.Create( KServerFileName, |
241 KNullDesC ); |
241 KNullDesC ); |
242 |
242 |
243 if ( !error ) |
243 if ( !error ) |
244 { |
244 { |
245 User::After( 1000 ); |
245 User::After( 1000 ); |
246 |
246 |
247 process.Resume(); |
247 process.Resume(); |
248 process.Close(); |
248 process.Close(); |
249 |
249 |
250 // Wait here for the server process startup to complete |
250 // Wait here for the server process startup to complete |
251 // server will signal the global semaphore |
251 // server will signal the global semaphore |
252 semaphore.Wait(); |
252 semaphore.Wait(); |
253 } |
253 } |
254 } |
254 } |
255 |
255 |
256 // Close both semaphores and signal the "local" one. |
256 // Close both semaphores and signal the "local" one. |
257 semaphore.Close(); |
257 semaphore.Close(); |
258 semaphore2.Signal(); |
258 semaphore2.Signal(); |
259 semaphore2.Close(); |
259 semaphore2.Close(); |
260 |
260 |
261 DRMLOG2( _L( "RDRMRightsClient::StartServer(): %d" ), error ); |
261 DRMLOG2( _L( "RDRMRightsClient::StartServer(): %d" ), error ); |
262 return error; |
262 return error; |
263 |
263 |
264 } |
264 } |
265 |
265 |
266 // ----------------------------------------------------------------------------- |
266 // ----------------------------------------------------------------------------- |
267 // RDRMRightsClient::AddRecord |
267 // RDRMRightsClient::AddRecord |
268 // Add a new entry to the rights database. |
268 // Add a new entry to the rights database. |
269 // ----------------------------------------------------------------------------- |
269 // ----------------------------------------------------------------------------- |
270 // |
270 // |
271 EXPORT_C TInt RDRMRightsClient::AddRecord( const TDesC8& aCEK, // Content encryption key |
271 EXPORT_C TInt RDRMRightsClient::AddRecord( const TDesC8& aCEK, // Content encryption key |
272 // The rights object which is to be added |
272 // The rights object which is to be added |
273 const CDRMPermission& aRightsObject, |
273 const CDRMPermission& aRightsObject, |
274 const TDesC8& aCID, // Content-ID |
274 const TDesC8& aCID, // Content-ID |
275 TDRMUniqueID& aID ) // Unique ID, out-parameter |
275 TDRMUniqueID& aID ) // Unique ID, out-parameter |
276 { |
276 { |
277 DRMLOG( _L( "RDRMRightsClient::AddRecord" ) ); |
277 DRMLOG( _L( "RDRMRightsClient::AddRecord" ) ); |
278 TInt error = KErrArgument; |
278 TInt error = KErrArgument; |
279 |
279 |
280 // Check the parameters. |
280 // Check the parameters. |
281 if ( aCEK.Length() ) |
281 if ( aCEK.Length() ) |
282 { |
282 { |
283 |
283 |
284 HBufC8* rightsData = NULL; |
284 HBufC8* rightsData = NULL; |
285 TRAP( error, rightsData = aRightsObject.ExportL() ); |
285 TRAP( error, rightsData = aRightsObject.ExportL() ); |
286 TInt size = aRightsObject.Size(); |
286 TInt size = aRightsObject.Size(); |
287 |
287 |
288 if ( rightsData && size > 0 ) |
288 if ( rightsData && size > 0 ) |
289 { |
289 { |
290 // For C/S communications. |
290 // For C/S communications. |
291 TPtr8 rightsObject( NULL, 0 ); |
291 TPtr8 rightsObject( NULL, 0 ); |
292 TPtr8 uid( reinterpret_cast< TUint8* >( &aID ), |
292 TPtr8 uid( reinterpret_cast< TUint8* >( &aID ), |
293 0, |
293 0, |
294 sizeof( TDRMUniqueID ) ); |
294 sizeof( TDRMUniqueID ) ); |
295 |
295 |
296 rightsObject.Set( const_cast< TUint8* >( rightsData->Ptr() ), |
296 rightsObject.Set( const_cast< TUint8* >( rightsData->Ptr() ), |
297 size, |
297 size, |
298 size ); |
298 size ); |
299 |
299 |
300 |
300 |
301 // Send the message. |
301 // Send the message. |
302 error = SendReceive( DRMEngine::EAddRecord, |
302 error = SendReceive( DRMEngine::EAddRecord, |
303 TIpcArgs( &aCID, &rightsObject, &aCEK, &uid ) ); |
303 TIpcArgs( &aCID, &rightsObject, &aCEK, &uid ) ); |
304 |
304 |
305 delete rightsData; |
305 delete rightsData; |
306 rightsData = NULL; |
306 rightsData = NULL; |
307 } |
307 } |
308 } |
308 } |
309 |
309 |
310 DRMLOG2( _L( "RDRMRightsClient::AddRecord: %d" ), error ); |
310 DRMLOG2( _L( "RDRMRightsClient::AddRecord: %d" ), error ); |
311 return error; |
311 return error; |
312 } |
312 } |
313 |
313 |
314 |
314 |
323 const CDRMPermission& aRightsObject, |
323 const CDRMPermission& aRightsObject, |
324 const TDesC8& aCID, |
324 const TDesC8& aCID, |
325 TDRMUniqueID& aID ) // Unique ID, out-parameter |
325 TDRMUniqueID& aID ) // Unique ID, out-parameter |
326 { |
326 { |
327 DRMLOG( _L( "RDRMRightsClient::AddProtectedRecord" ) ); |
327 DRMLOG( _L( "RDRMRightsClient::AddProtectedRecord" ) ); |
328 |
328 |
329 TInt error = KErrNone; |
329 TInt error = KErrNone; |
330 TInt message = DRMEngine::EAddProtectedRecord; |
330 TInt message = DRMEngine::EAddProtectedRecord; |
331 HBufC8* rightsData = NULL; |
331 HBufC8* rightsData = NULL; |
332 TInt size = aRightsObject.Size(); |
332 TInt size = aRightsObject.Size(); |
333 TPtr8 rightsObject( NULL, 0 ); |
333 TPtr8 rightsObject( NULL, 0 ); |
334 TPtr8 uid( reinterpret_cast< TUint8* >( &aID ), 0, |
334 TPtr8 uid( reinterpret_cast< TUint8* >( &aID ), 0, |
335 sizeof( TDRMUniqueID ) ); |
335 sizeof( TDRMUniqueID ) ); |
336 TPtr8 key( NULL, 0 ); |
336 TPtr8 key( NULL, 0 ); |
337 |
337 |
338 TRAP( error, rightsData = aRightsObject.ExportL() ); |
338 TRAP( error, rightsData = aRightsObject.ExportL() ); |
339 if ( !error ) |
339 if ( !error ) |
340 { |
340 { |
341 rightsObject.Set( const_cast< TUint8* >( rightsData->Ptr() ), size, |
341 rightsObject.Set( const_cast< TUint8* >( rightsData->Ptr() ), size, |
342 size ); |
342 size ); |
343 |
343 |
344 if ( aDomainRecord ) |
344 if ( aDomainRecord ) |
345 { |
345 { |
346 message = DRMEngine::EAddDomainRecord; |
346 message = DRMEngine::EAddDomainRecord; |
347 } |
347 } |
348 error = SendReceive( message, TIpcArgs( &aCID, &rightsObject, &aProtectedCek, &uid ) ); |
348 error = SendReceive( message, TIpcArgs( &aCID, &rightsObject, &aProtectedCek, &uid ) ); |
349 |
349 |
350 delete rightsData; |
350 delete rightsData; |
351 rightsData = NULL; |
351 rightsData = NULL; |
352 } |
352 } |
353 DRMLOG2( _L( "RDRMRightsClient::AddProtectedRecord: %d" ), error ); |
353 DRMLOG2( _L( "RDRMRightsClient::AddProtectedRecord: %d" ), error ); |
354 return error; |
354 return error; |
355 } |
355 } |
356 |
356 |
357 // ----------------------------------------------------------------------------- |
357 // ----------------------------------------------------------------------------- |
358 // RDRMRightsClient::GetDBEntriesL |
358 // RDRMRightsClient::GetDBEntriesL |
359 // Get a file name from the server. The file contains the rights objects, |
359 // Get a file name from the server. The file contains the rights objects, |
452 // |
452 // |
453 EXPORT_C TInt RDRMRightsClient::DeleteDbEntry( const TDesC8& aContentID, |
453 EXPORT_C TInt RDRMRightsClient::DeleteDbEntry( const TDesC8& aContentID, |
454 const TDRMUniqueID& aUniqueID ) |
454 const TDRMUniqueID& aUniqueID ) |
455 { |
455 { |
456 DRMLOG( _L( "RDRMRightsClient::DeleteDbEntry with CID & UID" ) ); |
456 DRMLOG( _L( "RDRMRightsClient::DeleteDbEntry with CID & UID" ) ); |
457 |
457 |
458 if ( aContentID.Length() ) |
458 if ( aContentID.Length() ) |
459 { |
459 { |
460 // Something to do. |
460 // Something to do. |
461 // Put aUniqueID inside a descriptor. |
461 // Put aUniqueID inside a descriptor. |
462 // Works even if its typedef is changed. |
462 // Works even if its typedef is changed. |
463 TPtrC8 uid( reinterpret_cast< TUint8* >( |
463 TPtrC8 uid( reinterpret_cast< TUint8* >( |
464 const_cast< TDRMUniqueID* >( &aUniqueID ) ), |
464 const_cast< TDRMUniqueID* >( &aUniqueID ) ), |
465 sizeof( TDRMUniqueID ) ); |
465 sizeof( TDRMUniqueID ) ); |
466 |
466 |
467 return SendReceive( DRMEngine::EDeleteRO, |
467 return SendReceive( DRMEngine::EDeleteRO, |
468 TIpcArgs( &uid, NULL, NULL, &aContentID ) ); |
468 TIpcArgs( &uid, NULL, NULL, &aContentID ) ); |
469 } |
469 } |
470 |
470 |
471 return KErrArgument; |
471 return KErrArgument; |
472 } |
472 } |
473 |
473 |
474 // ----------------------------------------------------------------------------- |
474 // ----------------------------------------------------------------------------- |
475 // RDRMRightsClient::ExportContentIDList |
475 // RDRMRightsClient::ExportContentIDList |
476 // Overloaded method: requests all content IDs to be put to a file. |
476 // Overloaded method: requests all content IDs to be put to a file. |
477 // Assumes that the given descriptor represents a buffer large enough to |
477 // Assumes that the given descriptor represents a buffer large enough to |
478 // contain the file name. |
478 // contain the file name. |
479 // ----------------------------------------------------------------------------- |
479 // ----------------------------------------------------------------------------- |
480 // |
480 // |
481 EXPORT_C TInt RDRMRightsClient::ExportContentIDList( TDes& aFileName ) |
481 EXPORT_C TInt RDRMRightsClient::ExportContentIDList( TDes& aFileName ) |
482 { |
482 { |
483 DRMLOG( _L( "RDRMRightsClient::ExportContentIDLis" ) ); |
483 DRMLOG( _L( "RDRMRightsClient::ExportContentIDLis" ) ); |
484 |
484 |
485 return SendReceive( DRMEngine::EExportCIDs, |
485 return SendReceive( DRMEngine::EExportCIDs, |
486 TIpcArgs( &aFileName ) ); |
486 TIpcArgs( &aFileName ) ); |
487 |
487 |
488 } |
488 } |
489 |
489 |
490 // ----------------------------------------------------------------------------- |
490 // ----------------------------------------------------------------------------- |
491 // RDRMRightsClient::ExportContentIDList |
491 // RDRMRightsClient::ExportContentIDList |
492 // Overloaded method: requests all content IDs to be put to a file, |
492 // Overloaded method: requests all content IDs to be put to a file, |
493 // and then converts the file into RPointerArray. |
493 // and then converts the file into RPointerArray. |
494 // ----------------------------------------------------------------------------- |
494 // ----------------------------------------------------------------------------- |
495 // |
495 // |
496 EXPORT_C TInt RDRMRightsClient::ExportContentIDList( RPointerArray< HBufC8 >& aCIDList ) |
496 EXPORT_C TInt RDRMRightsClient::ExportContentIDList( RPointerArray< HBufC8 >& aCIDList ) |
497 { |
497 { |
498 DRMLOG( _L( "RDRMRightsClient::ExportContentIDList to array" ) ); |
498 DRMLOG( _L( "RDRMRightsClient::ExportContentIDList to array" ) ); |
499 TFileName name; |
499 TFileName name; |
500 aCIDList.ResetAndDestroy(); |
500 aCIDList.ResetAndDestroy(); |
501 |
501 |
502 TInt error = ExportContentIDList( name ); |
502 TInt error = ExportContentIDList( name ); |
503 if ( !error ) |
503 if ( !error ) |
504 { |
504 { |
505 RFs fs; |
505 RFs fs; |
506 error = fs.Connect(); |
506 error = fs.Connect(); |
715 TIpcArgs ( &aLastTwoDataBlocks) ); |
715 TIpcArgs ( &aLastTwoDataBlocks) ); |
716 } |
716 } |
717 |
717 |
718 // ----------------------------------------------------------------------------- |
718 // ----------------------------------------------------------------------------- |
719 // RDRMRightsClient:: |
719 // RDRMRightsClient:: |
720 // |
720 // |
721 // ----------------------------------------------------------------------------- |
721 // ----------------------------------------------------------------------------- |
722 // |
722 // |
723 EXPORT_C TInt RDRMRightsClient::ForwardLockURI( HBufC8*& aURI ) |
723 EXPORT_C TInt RDRMRightsClient::ForwardLockURI( HBufC8*& aURI ) |
724 { |
724 { |
725 DRMLOG( _L( "RDRMRightsClient::ForwardLockURI" ) ); |
725 DRMLOG( _L( "RDRMRightsClient::ForwardLockURI" ) ); |
726 TBuf8< DRMEngine::KMaxOmaV1CIDLength > buf; |
726 TBuf8< DRMEngine::KMaxOmaV1CIDLength > buf; |
727 TInt error = SendReceive( DRMEngine::EGetFLUri, |
727 TInt error = SendReceive( DRMEngine::EGetFLUri, |
728 TIpcArgs( &buf ) ); |
728 TIpcArgs( &buf ) ); |
729 |
729 |
730 if ( error ) |
730 if ( error ) |
731 { |
731 { |
732 aURI = NULL; |
732 aURI = NULL; |
733 return error; |
733 return error; |
734 } |
734 } |
735 |
735 |
736 aURI = buf.Alloc(); |
736 aURI = buf.Alloc(); |
737 |
737 |
738 if ( aURI ) |
738 if ( aURI ) |
739 { |
739 { |
740 return KErrNone; |
740 return KErrNone; |
741 } |
741 } |
742 |
742 |
743 return KErrNoMemory; |
743 return KErrNoMemory; |
744 } |
744 } |
745 |
745 |
746 |
746 |
747 // ----------------------------------------------------------------------------- |
747 // ----------------------------------------------------------------------------- |
748 // RDRMRightsClient::AddDomainRO |
748 // RDRMRightsClient::AddDomainRO |
749 // Add domain rights object xml representation to the rdb |
749 // Add domain rights object xml representation to the rdb |
750 // ----------------------------------------------------------------------------- |
750 // ----------------------------------------------------------------------------- |
751 // |
751 // |
752 EXPORT_C TInt RDRMRightsClient::AddDomainRO( const TDesC8& aRoId, |
752 EXPORT_C TInt RDRMRightsClient::AddDomainRO( const TDesC8& aRoId, |
753 const TDesC8& aXmlData ) |
753 const TDesC8& aXmlData ) |
754 { |
754 { |
755 DRMLOG( _L( "RDRMRightsClient::AddDomainRO" ) ); |
755 DRMLOG( _L( "RDRMRightsClient::AddDomainRO" ) ); |
756 TInt error = KErrArgument; |
756 TInt error = KErrArgument; |
757 |
757 |
758 // Check the parameters. |
758 // Check the parameters. |
759 if ( aRoId.Length() && aXmlData.Length() ) |
759 if ( aRoId.Length() && aXmlData.Length() ) |
760 { |
760 { |
761 // Send the message. |
761 // Send the message. |
762 error = SendReceive( DRMEngine::EAddDomainRO, |
762 error = SendReceive( DRMEngine::EAddDomainRO, |
763 TIpcArgs( &aRoId, &aXmlData) ); |
763 TIpcArgs( &aRoId, &aXmlData) ); |
764 } |
764 } |
765 |
765 |
766 DRMLOG2( _L( "RDRMRightsClient::AddDomainRO: %d" ), error ); |
766 DRMLOG2( _L( "RDRMRightsClient::AddDomainRO: %d" ), error ); |
767 return error; |
767 return error; |
768 }; |
768 }; |
769 |
769 |
770 // ----------------------------------------------------------------------------- |
770 // ----------------------------------------------------------------------------- |
771 // RDRMRightsClient::GetDomainROL |
771 // RDRMRightsClient::GetDomainROL |
772 // Get domain rights object xml representation from the rdb |
772 // Get domain rights object xml representation from the rdb |
773 // ----------------------------------------------------------------------------- |
773 // ----------------------------------------------------------------------------- |
774 // |
774 // |
775 EXPORT_C HBufC8* RDRMRightsClient::GetDomainROL( const TDesC8& aRoId ) |
775 EXPORT_C HBufC8* RDRMRightsClient::GetDomainROL( const TDesC8& aRoId ) |
776 { |
776 { |
777 DRMLOG( _L( "RDRMRightsClient::GetDomainROL" ) ); |
777 DRMLOG( _L( "RDRMRightsClient::GetDomainROL" ) ); |
778 |
778 |
779 // Check the parameter. |
779 // Check the parameter. |
780 if ( aRoId.Length() ) |
780 if ( aRoId.Length() ) |
781 { |
781 { |
782 TInt size = 0; |
782 TInt size = 0; |
783 TPckg<TInt> package( size ); |
783 TPckg<TInt> package( size ); |
784 |
784 |
785 // Call the server. Throw an exception in case of an error. |
785 // Call the server. Throw an exception in case of an error. |
786 User::LeaveIfError( |
786 User::LeaveIfError( |
787 SendReceive( DRMEngine::EGetDomainRO, |
787 SendReceive( DRMEngine::EGetDomainRO, |
788 TIpcArgs( &package, &aRoId ) ) ); |
788 TIpcArgs( &package, &aRoId ) ) ); |
789 |
789 |
790 HBufC8* roData = HBufC8::NewMaxLC( size ); |
790 HBufC8* roData = HBufC8::NewMaxLC( size ); |
791 |
791 |
792 // Package 'object' into TPtr8. |
792 // Package 'object' into TPtr8. |
793 TPtr8 objectPkg( const_cast< TUint8* >( roData->Ptr() ), |
793 TPtr8 objectPkg( const_cast< TUint8* >( roData->Ptr() ), |
794 size, |
794 size, |
795 size ); |
795 size ); |
796 |
796 |
797 User::LeaveIfError( |
797 User::LeaveIfError( |
798 SendReceive( DRMEngine::EGetPreparedData, |
798 SendReceive( DRMEngine::EGetPreparedData, |
799 TIpcArgs( &objectPkg) ) ); |
799 TIpcArgs( &objectPkg) ) ); |
800 CleanupStack::Pop( roData ); // roData |
800 CleanupStack::Pop( roData ); // roData |
801 return roData; |
801 return roData; |
802 } |
802 } |
803 |
803 |
804 User::Leave( KErrArgument ); |
804 User::Leave( KErrArgument ); |
805 |
805 |
806 // Never reached. |
806 // Never reached. |
807 return NULL; |
807 return NULL; |
808 }; |
808 }; |
809 |
809 |
810 // ----------------------------------------------------------------------------- |
810 // ----------------------------------------------------------------------------- |
811 // RDRMRightsClient::GetDomainROL |
811 // RDRMRightsClient::GetDomainROL |
812 // Get domain rights object xml representation from the rdb |
812 // Get domain rights object xml representation from the rdb |
813 // ----------------------------------------------------------------------------- |
813 // ----------------------------------------------------------------------------- |
837 TIpcArgs(&ptr))); |
837 TIpcArgs(&ptr))); |
838 offset = 0; |
838 offset = 0; |
839 while (offset < size) |
839 while (offset < size) |
840 { |
840 { |
841 Mem::Copy( &roSize, ptr.Ptr()+offset, sizeof(TInt) ); |
841 Mem::Copy( &roSize, ptr.Ptr()+offset, sizeof(TInt) ); |
842 offset += sizeof (TInt); |
842 offset += sizeof (TInt); |
843 ro = ptr.Mid(offset, roSize).AllocL(); |
843 ro = ptr.Mid(offset, roSize).AllocL(); |
844 aRoList.Append(ro); |
844 aRoList.Append(ro); |
845 offset += roSize; |
845 offset += roSize; |
846 } |
846 } |
847 CleanupStack::PopAndDestroy(); |
847 CleanupStack::PopAndDestroy(); |
848 } |
848 } |
849 }; |
849 }; |
850 |
850 |
851 // ----------------------------------------------------------------------------- |
851 // ----------------------------------------------------------------------------- |
852 // RDRMRightsClient:: |
852 // RDRMRightsClient:: |
853 // |
853 // |
854 // ----------------------------------------------------------------------------- |
854 // ----------------------------------------------------------------------------- |
855 // |
855 // |
856 EXPORT_C TInt RDRMRightsClient::Encrypt( const TDesC8& aIv, |
856 EXPORT_C TInt RDRMRightsClient::Encrypt( const TDesC8& aIv, |
857 TPtr8& aData, |
857 TPtr8& aData, |
858 TBool aAddPadding ) |
858 TBool aAddPadding ) |
859 { |
859 { |
860 return SendReceive( DRMEngine::EEncrypt, |
860 return SendReceive( DRMEngine::EEncrypt, |
861 TIpcArgs( &aIv, &aData, aAddPadding ) ); |
861 TIpcArgs( &aIv, &aData, aAddPadding ) ); |
862 } |
862 } |
863 |
863 |
864 // ----------------------------------------------------------------------------- |
864 // ----------------------------------------------------------------------------- |
865 // RDRMRightsClient:: |
865 // RDRMRightsClient:: |
866 // |
866 // |
867 // ----------------------------------------------------------------------------- |
867 // ----------------------------------------------------------------------------- |
868 // |
868 // |
869 EXPORT_C TInt RDRMRightsClient::Decrypt( const TDesC8& aIv, |
869 EXPORT_C TInt RDRMRightsClient::Decrypt( const TDesC8& aIv, |
870 TPtr8& aData, |
870 TPtr8& aData, |
871 TBool aRemovePadding ) |
871 TBool aRemovePadding ) |
872 { |
872 { |
873 return SendReceive( DRMEngine::EDecrypt, |
873 return SendReceive( DRMEngine::EDecrypt, |
874 TIpcArgs( &aIv, &aData, aRemovePadding ) ); |
874 TIpcArgs( &aIv, &aData, aRemovePadding ) ); |
875 } |
875 } |
876 |
876 |
877 // ----------------------------------------------------------------------------- |
877 // ----------------------------------------------------------------------------- |
878 // RDRMRightsClient:: |
878 // RDRMRightsClient:: |
879 // |
879 // |
880 // ----------------------------------------------------------------------------- |
880 // ----------------------------------------------------------------------------- |
881 // |
881 // |
882 EXPORT_C TInt RDRMRightsClient::InitializeKey( const TDesC8& aContentId ) |
882 EXPORT_C TInt RDRMRightsClient::InitializeKey( const TDesC8& aContentId ) |
883 { |
883 { |
884 return SendReceive( DRMEngine::EInitializeKey, |
884 return SendReceive( DRMEngine::EInitializeKey, |
885 TIpcArgs( &aContentId ) ); |
885 TIpcArgs( &aContentId ) ); |
886 } |
886 } |
887 |
887 |
888 // ----------------------------------------------------------------------------- |
888 // ----------------------------------------------------------------------------- |
889 // RDRMRightsClient:: |
889 // RDRMRightsClient:: |
890 // |
890 // |
891 // ----------------------------------------------------------------------------- |
891 // ----------------------------------------------------------------------------- |
892 // |
892 // |
893 EXPORT_C TInt RDRMRightsClient::InitializeGroupKey( const TDesC8& aGroupId, |
893 EXPORT_C TInt RDRMRightsClient::InitializeGroupKey( const TDesC8& aGroupId, |
894 const TDesC8& aGroupKey, |
894 const TDesC8& aGroupKey, |
895 TEncryptionMethod aMethod ) |
895 TEncryptionMethod aMethod ) |
896 { |
896 { |
897 return SendReceive( DRMEngine::EInitializeGroupKey, |
897 return SendReceive( DRMEngine::EInitializeGroupKey, |
898 TIpcArgs( &aGroupId, &aGroupKey, aMethod ) ); |
898 TIpcArgs( &aGroupId, &aGroupKey, aMethod ) ); |
899 } |
899 } |
900 |
900 |
901 // ----------------------------------------------------------------------------- |
901 // ----------------------------------------------------------------------------- |
902 // RDRMRightsClient::DeleteDomainRO |
902 // RDRMRightsClient::DeleteDomainRO |
903 // Delete domain rights object xml representation from the rdb |
903 // Delete domain rights object xml representation from the rdb |
904 // ----------------------------------------------------------------------------- |
904 // ----------------------------------------------------------------------------- |
905 // |
905 // |
906 EXPORT_C TInt RDRMRightsClient::DeleteDomainRO( const TDesC8& aRoId ) |
906 EXPORT_C TInt RDRMRightsClient::DeleteDomainRO( const TDesC8& aRoId ) |
907 { |
907 { |
908 DRMLOG( _L( "RDRMRightsClient::DeleteDomainRO" ) ); |
908 DRMLOG( _L( "RDRMRightsClient::DeleteDomainRO" ) ); |
909 |
909 |
910 // Check the parameter. |
910 // Check the parameter. |
911 if ( aRoId.Length() ) |
911 if ( aRoId.Length() ) |
912 { |
912 { |
913 return SendReceive( DRMEngine::EDeleteDomainRO, |
913 return SendReceive( DRMEngine::EDeleteDomainRO, |
914 TIpcArgs( &aRoId ) ); |
914 TIpcArgs( &aRoId ) ); |
915 } |
915 } |
916 |
916 |
917 return KErrArgument; |
917 return KErrArgument; |
918 }; |
918 }; |
919 |
919 |
920 |
920 |
921 // ----------------------------------------------------------------------------- |
921 // ----------------------------------------------------------------------------- |
922 // RDRMRightsClient:: |
922 // RDRMRightsClient:: |
923 // |
923 // |
924 // ----------------------------------------------------------------------------- |
924 // ----------------------------------------------------------------------------- |
925 // |
925 // |
926 EXPORT_C TInt RDRMRightsClient::IsInCache( const TDesC8& aID, |
926 EXPORT_C TInt RDRMRightsClient::IsInCache( const TDesC8& aID, |
927 const TTime& aTime, |
927 const TTime& aTime, |
928 TBool& aInCache ) |
928 TBool& aInCache ) |
929 { |
929 { |
930 DRMLOG( _L( "RDRMRightsClient::IsInCache" ) ); |
930 DRMLOG( _L( "RDRMRightsClient::IsInCache" ) ); |
931 TPckgC< TTime > timePckg( aTime ); |
931 TPckgC< TTime > timePckg( aTime ); |
932 TPckg< TBool > inCache( aInCache ); |
932 TPckg< TBool > inCache( aInCache ); |
933 |
933 |
934 return SendReceive( DRMEngine::EIsInCache, |
934 return SendReceive( DRMEngine::EIsInCache, |
935 TIpcArgs( &aID, &timePckg, &inCache ) ); |
935 TIpcArgs( &aID, &timePckg, &inCache ) ); |
936 } |
936 } |
937 |
937 |
938 // ----------------------------------------------------------------------------- |
938 // ----------------------------------------------------------------------------- |
939 // RDRMRightsClient:: |
939 // RDRMRightsClient:: |
940 // |
940 // |
941 // ----------------------------------------------------------------------------- |
941 // ----------------------------------------------------------------------------- |
942 // |
942 // |
943 EXPORT_C TInt RDRMRightsClient::IsInCache( const TDesC8& aID, |
943 EXPORT_C TInt RDRMRightsClient::IsInCache( const TDesC8& aID, |
944 TBool& aInCache ) |
944 TBool& aInCache ) |
945 { |
945 { |
946 DRMLOG( _L( "RDRMRightsClient::IsInCache" ) ); |
946 DRMLOG( _L( "RDRMRightsClient::IsInCache" ) ); |
947 |
947 |
948 TPckg< TBool > inCache( aInCache ); |
948 TPckg< TBool > inCache( aInCache ); |
949 |
949 |
950 return SendReceive( DRMEngine::EIsInCache, |
950 return SendReceive( DRMEngine::EIsInCache, |
951 TIpcArgs( &aID, NULL, &inCache ) ); |
951 TIpcArgs( &aID, NULL, &inCache ) ); |
952 } |
952 } |
953 |
953 |
954 // ----------------------------------------------------------------------------- |
954 // ----------------------------------------------------------------------------- |
955 // RDRMRightsClient:: |
955 // RDRMRightsClient:: |
956 // |
956 // |
957 // ----------------------------------------------------------------------------- |
957 // ----------------------------------------------------------------------------- |
958 // |
958 // |
959 EXPORT_C TInt RDRMRightsClient::AddToCache( const TDesC8& aID, |
959 EXPORT_C TInt RDRMRightsClient::AddToCache( const TDesC8& aID, |
960 const TTime& aTime ) |
960 const TTime& aTime ) |
961 { |
961 { |
962 DRMLOG( _L( "RDRMRightsClient::AddToCache" ) ); |
962 DRMLOG( _L( "RDRMRightsClient::AddToCache" ) ); |
963 |
963 |
964 TPckgC< TTime > timePckg( aTime ); |
964 TPckgC< TTime > timePckg( aTime ); |
965 |
965 |
966 return SendReceive( DRMEngine::EAddToCache, |
966 return SendReceive( DRMEngine::EAddToCache, |
967 TIpcArgs( &aID, &timePckg ) ); |
967 TIpcArgs( &aID, &timePckg ) ); |
968 } |
968 } |
969 |
969 |
970 // ----------------------------------------------------------------------------- |
970 // ----------------------------------------------------------------------------- |
971 // RDRMRightsClient:: |
971 // RDRMRightsClient:: |
972 // |
972 // |
973 // ----------------------------------------------------------------------------- |
973 // ----------------------------------------------------------------------------- |
974 // |
974 // |
975 EXPORT_C TInt RDRMRightsClient::AddToCache( const TDesC8& aID ) |
975 EXPORT_C TInt RDRMRightsClient::AddToCache( const TDesC8& aID ) |
976 { |
976 { |
977 DRMLOG( _L( "RDRMRightsClient::AddToCache" ) ); |
977 DRMLOG( _L( "RDRMRightsClient::AddToCache" ) ); |
978 |
978 |
979 return SendReceive( DRMEngine::EAddToCache, |
979 return SendReceive( DRMEngine::EAddToCache, |
980 TIpcArgs( &aID, NULL ) ); |
980 TIpcArgs( &aID, NULL ) ); |
981 } |
981 } |
982 |
982 |
983 // ----------------------------------------------------------------------------- |
983 // ----------------------------------------------------------------------------- |
984 // RDRMRightsClient::DeleteExpiredPermissions |
984 // RDRMRightsClient::DeleteExpiredPermissions |
985 // |
985 // |
986 // ----------------------------------------------------------------------------- |
986 // ----------------------------------------------------------------------------- |
987 // |
987 // |
988 EXPORT_C void RDRMRightsClient::DeleteExpiredPermissions( TRequestStatus& aStatus ) |
988 EXPORT_C void RDRMRightsClient::DeleteExpiredPermissions( TRequestStatus& aStatus ) |
989 { |
989 { |
990 DRMLOG( _L( "RDRMRightsClient::DeleteExpiredPermissions" ) ); |
990 DRMLOG( _L( "RDRMRightsClient::DeleteExpiredPermissions" ) ); |
991 |
991 |
992 SendReceive( DRMEngine::EDeleteExpired, aStatus ); |
992 SendReceive( DRMEngine::EDeleteExpired, aStatus ); |
993 } |
993 } |
994 |
994 |
995 // ----------------------------------------------------------------------------- |
995 // ----------------------------------------------------------------------------- |
996 // RDRMRightsClient::SetEstimatedArrival |
996 // RDRMRightsClient::SetEstimatedArrival |
997 // sets the estimated RO arrival time to the given delta |
997 // sets the estimated RO arrival time to the given delta |
998 // ----------------------------------------------------------------------------- |
998 // ----------------------------------------------------------------------------- |
999 // |
999 // |
1086 { |
1086 { |
1087 error = KErrNoMemory; |
1087 error = KErrNoMemory; |
1088 } |
1088 } |
1089 } |
1089 } |
1090 } |
1090 } |
1091 |
1091 |
1092 return error; |
1092 return error; |
1093 } |
1093 } |
1094 |
1094 |
1095 // ----------------------------------------------------------------------------- |
1095 // ----------------------------------------------------------------------------- |
1096 // RDRMRightsClient::Cancel |
1096 // RDRMRightsClient::Cancel |
1097 // ----------------------------------------------------------------------------- |
1097 // ----------------------------------------------------------------------------- |
1098 // |
1098 // |
1099 EXPORT_C void RDRMRightsClient::Cancel() |
1099 EXPORT_C void RDRMRightsClient::Cancel() |
1100 { |
1100 { |
1101 DRMLOG( _L(" RDRMRightsClient::Cancel" ) ); |
1101 DRMLOG( _L(" RDRMRightsClient::Cancel" ) ); |
1102 SendReceive( DRMEngine::ECancel ); |
1102 SendReceive( DRMEngine::ECancel ); |
1103 } |
1103 } |
1104 |
1104 |
1105 |
1105 |
1106 // ----------------------------------------------------------------------------- |
1106 // ----------------------------------------------------------------------------- |
1107 // RDRMRightsClient::GetUdtData |
1107 // RDRMRightsClient::GetUdtData |
1108 // ----------------------------------------------------------------------------- |
1108 // ----------------------------------------------------------------------------- |
1109 // |
1109 // |
1110 EXPORT_C TInt RDRMRightsClient::GetUdtData( TDes8& aUdtData ) |
1110 EXPORT_C TInt RDRMRightsClient::GetUdtData( TDes8& aUdtData ) |
1111 { |
1111 { |
1112 DRMLOG( _L( "RDRMRightsClient::GetUdtData" ) ); |
1112 DRMLOG( _L( "RDRMRightsClient::GetUdtData" ) ); |
1113 |
1113 |
1114 TInt error = SendReceive( DRMEngine::EGetUdtData, |
1114 TInt error = SendReceive( DRMEngine::EGetUdtData, |
1115 TIpcArgs( &aUdtData ) ); |
1115 TIpcArgs( &aUdtData ) ); |
1116 |
1116 |
1117 return error; |
1117 return error; |
1118 }; |
1118 }; |
1119 |
1119 |
1120 // ----------------------------------------------------------------------------- |
1120 // ----------------------------------------------------------------------------- |
1121 // RDRMRightsClient::InitializeUdt |
1121 // RDRMRightsClient::InitializeUdt |
1122 // ----------------------------------------------------------------------------- |
1122 // ----------------------------------------------------------------------------- |
1123 // |
1123 // |
1124 EXPORT_C TInt RDRMRightsClient::InitiateUdt( const TDesC8& aKey ) |
1124 EXPORT_C TInt RDRMRightsClient::InitiateUdt( const TDesC8& aKey ) |
1125 { |
1125 { |
1126 DRMLOG( _L( "RDRMRightsClient::InitiateUdt" ) ); |
1126 DRMLOG( _L( "RDRMRightsClient::InitiateUdt" ) ); |
1127 |
1127 |
1128 TInt error = SendReceive( DRMEngine::EInitiateUdt, |
1128 TInt error = SendReceive( DRMEngine::EInitiateUdt, |
1129 TIpcArgs( &aKey ) ); |
1129 TIpcArgs( &aKey ) ); |
1130 return error; |
1130 return error; |
1131 }; |
1131 }; |
1132 |
1132 |
1133 // ----------------------------------------------------------------------------- |
1133 // ----------------------------------------------------------------------------- |
1134 // RDRMRightsClient::InitOrphanedContentIdList |
1134 // RDRMRightsClient::InitOrphanedContentIdList |
1135 // ----------------------------------------------------------------------------- |
1135 // ----------------------------------------------------------------------------- |
1136 // |
1136 // |
1137 EXPORT_C void RDRMRightsClient::InitOrphanedContentIdList( TBool aPerformScan, |
1137 EXPORT_C void RDRMRightsClient::InitOrphanedContentIdList( TBool aPerformScan, |
1138 TRequestStatus& aStatus ) |
1138 TRequestStatus& aStatus ) |
1139 { |
1139 { |
1140 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList" ) ); |
1140 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList" ) ); |
1141 |
1141 |
1142 SendReceive( DRMEngine::EInitOrphanedList, |
1142 SendReceive( DRMEngine::EInitOrphanedList, |
1143 TIpcArgs( aPerformScan ), aStatus ); |
1143 TIpcArgs( aPerformScan ), aStatus ); |
1144 |
1144 |
1145 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList done" ) ); |
1145 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList done" ) ); |
1146 }; |
1146 }; |
1147 |
1147 |
1148 |
1148 |
1149 // ----------------------------------------------------------------------------- |
1149 // ----------------------------------------------------------------------------- |
1150 // RDRMRightsClient::ExportOrphanedContentIdList |
1150 // RDRMRightsClient::ExportOrphanedContentIdList |
1151 // ----------------------------------------------------------------------------- |
1151 // ----------------------------------------------------------------------------- |
1152 // |
1152 // |
1153 EXPORT_C TInt RDRMRightsClient::ExportOrphanedContentIdList( TDes& aFileName ) |
1153 EXPORT_C TInt RDRMRightsClient::ExportOrphanedContentIdList( TDes& aFileName ) |
1154 { |
1154 { |
1155 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList" ) ); |
1155 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList" ) ); |
1156 |
1156 |
1157 return SendReceive( DRMEngine::EGetOrphanedList, |
1157 return SendReceive( DRMEngine::EGetOrphanedList, |
1158 TIpcArgs( &aFileName ) ); |
1158 TIpcArgs( &aFileName ) ); |
1159 |
1159 |
1160 }; |
1160 }; |
1161 |
1161 |
1162 // ----------------------------------------------------------------------------- |
1162 // ----------------------------------------------------------------------------- |
1163 // RDRMRightsClient::ExportOrphanedContentIdList |
1163 // RDRMRightsClient::ExportOrphanedContentIdList |
1164 // ----------------------------------------------------------------------------- |
1164 // ----------------------------------------------------------------------------- |
1165 // |
1165 // |
1166 EXPORT_C TInt RDRMRightsClient::ExportOrphanedContentIdList( |
1166 EXPORT_C TInt RDRMRightsClient::ExportOrphanedContentIdList( |
1167 RPointerArray<HBufC8>& aContentIdList ) |
1167 RPointerArray<HBufC8>& aContentIdList ) |
1168 { |
1168 { |
1169 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList to array" ) ); |
1169 DRMLOG( _L( "RDRMRightsClient::ExportOrphanedContentIdList to array" ) ); |
1170 TFileName name; |
1170 TFileName name; |
1171 aContentIdList.ResetAndDestroy(); |
1171 aContentIdList.ResetAndDestroy(); |
1172 |
1172 |
1173 TInt error = ExportOrphanedContentIdList( name ); |
1173 TInt error = ExportOrphanedContentIdList( name ); |
1174 if ( !error ) |
1174 if ( !error ) |
1175 { |
1175 { |
1176 RFs fs; |
1176 RFs fs; |
1177 error = fs.Connect(); |
1177 error = fs.Connect(); |
1180 TRAP( error, URIFileToArrayL( fs, name, aContentIdList ) ); |
1180 TRAP( error, URIFileToArrayL( fs, name, aContentIdList ) ); |
1181 if ( error ) |
1181 if ( error ) |
1182 { |
1182 { |
1183 aContentIdList.ResetAndDestroy(); |
1183 aContentIdList.ResetAndDestroy(); |
1184 } |
1184 } |
1185 |
1185 |
1186 fs.Delete( name ); |
1186 fs.Delete( name ); |
1187 fs.Close(); |
1187 fs.Close(); |
1188 } |
1188 } |
1189 } |
1189 } |
1190 |
1190 |
1191 DRMLOG2( _L( "RDRMRightsClient::ExportOrphanedContentIdList to array: %d" ), error ); |
1191 DRMLOG2( _L( "RDRMRightsClient::ExportOrphanedContentIdList to array: %d" ), error ); |
1192 |
1192 |
1193 return error; |
1193 return error; |
1194 }; |
1194 }; |
1195 |
1195 |
1196 // ----------------------------------------------------------------------------- |
1196 // ----------------------------------------------------------------------------- |
1197 // RDRMRightsClient::EncodeRightsIssuerField |
1197 // RDRMRightsClient::EncodeRightsIssuerField |
1198 // The encoded field is consturcted from |
1198 // The encoded field is consturcted from |
1199 // - F/L prefix |
1199 // - F/L prefix |
1200 // - phone serial number |
1200 // - phone serial number |
1201 // - base64encode(AES IV + AES encoded original field incl. padding) |
1201 // - base64encode(AES IV + AES encoded original field incl. padding) |
1202 // ----------------------------------------------------------------------------- |
1202 // ----------------------------------------------------------------------------- |
1203 // |
1203 // |
1204 EXPORT_C TInt RDRMRightsClient::EncodeRightsIssuerField( |
1204 EXPORT_C TInt RDRMRightsClient::EncodeRightsIssuerField( |
1205 const TDesC8& aOldValue, |
1205 const TDesC8& aOldValue, |
1206 HBufC8*& aNewValue ) |
1206 HBufC8*& aNewValue ) |
1207 { |
1207 { |
1208 DRMLOG( _L( "RDRMRightsClient::EncodeRightsIssuerField" ) ); |
1208 DRMLOG( _L( "RDRMRightsClient::EncodeRightsIssuerField" ) ); |
1209 |
1209 |
1210 TInt error( KErrNone ); |
1210 TInt error( KErrNone ); |
1211 |
1211 |
1212 TInt size( aOldValue.Length() ); // original length |
1212 TInt size( aOldValue.Length() ); // original length |
1213 size += KDCFKeySize - ( size % KDCFKeySize ); // padding |
1213 size += KDCFKeySize - ( size % KDCFKeySize ); // padding |
1214 size += KDCFKeySize; // IV |
1214 size += KDCFKeySize; // IV |
1215 size += ( size + 2 ) / 3 * 4; // base64 |
1215 size += ( size + 2 ) / 3 * 4; // base64 |
1216 size += RMobilePhone::KPhoneSerialNumberSize; |
1216 size += RMobilePhone::KPhoneSerialNumberSize; |
1217 size += 3; // "flk" |
1217 size += 3; // "flk" |
1218 |
1218 |
1219 aNewValue = HBufC8::New( size ); |
1219 aNewValue = HBufC8::New( size ); |
1220 if ( aNewValue ) |
1220 if ( aNewValue ) |
1221 { |
1221 { |
1222 TPtr8 des( aNewValue->Des() ); |
1222 TPtr8 des( aNewValue->Des() ); |
1223 |
1223 |
1224 des = aOldValue; |
1224 des = aOldValue; |
1225 |
1225 |
1226 error = SendReceive( DRMEngine::EEncodeRightsIssuerField, |
1226 error = SendReceive( DRMEngine::EEncodeRightsIssuerField, |
1227 TIpcArgs( &des ) ); |
1227 TIpcArgs( &des ) ); |
1228 if ( error ) |
1228 if ( error ) |
1229 { |
1229 { |
1230 delete aNewValue; |
1230 delete aNewValue; |
1270 } |
1270 } |
1271 else |
1271 else |
1272 { |
1272 { |
1273 error = KErrNoMemory; |
1273 error = KErrNoMemory; |
1274 } |
1274 } |
1275 |
1275 |
1276 DRMLOG2( _L( "DRMRightsClient::DecodeRightsIssuerField: error %d" ), error ); |
1276 DRMLOG2( _L( "DRMRightsClient::DecodeRightsIssuerField: error %d" ), error ); |
1277 |
1277 |
1278 return error; |
1278 return error; |
1279 } |
1279 } |
1280 |
1280 |
1281 // ----------------------------------------------------------------------------- |
1281 // ----------------------------------------------------------------------------- |
1282 // RDRMRightsClient::SetAuthenticationSeed |
1282 // RDRMRightsClient::SetAuthenticationSeed |
1283 // |
1283 // |
1284 // ----------------------------------------------------------------------------- |
1284 // ----------------------------------------------------------------------------- |
1285 // |
1285 // |
1286 EXPORT_C TInt RDRMRightsClient::SetAuthenticationSeed( const TDesC8& aContentID, |
1286 EXPORT_C TInt RDRMRightsClient::SetAuthenticationSeed( const TDesC8& aContentID, |
1287 const TDesC8& aSeed ) |
1287 const TDesC8& aSeed ) |
1288 { |
1288 { |
1289 DRMLOG( _L( "RDRMRightsClient::SetAuthenticationSeed" ) ); |
1289 DRMLOG( _L( "RDRMRightsClient::SetAuthenticationSeed" ) ); |
1290 return SendReceive( DRMEngine::ESetAuthenticationSeed, |
1290 return SendReceive( DRMEngine::ESetAuthenticationSeed, |
1291 TIpcArgs( &aContentID, &aSeed ) ); |
1291 TIpcArgs( &aContentID, &aSeed ) ); |
1292 } |
1292 } |
1293 |
1293 |
1294 // ----------------------------------------------------------------------------- |
1294 // ----------------------------------------------------------------------------- |
1295 // RDRMRightsClient::GetAuthenticationSeed |
1295 // RDRMRightsClient::GetAuthenticationSeed |
1296 // |
1296 // |
1297 // ----------------------------------------------------------------------------- |
1297 // ----------------------------------------------------------------------------- |
1298 // |
1298 // |
1299 EXPORT_C TInt RDRMRightsClient::GetAuthenticationSeed( const TDesC8& aContentID, |
1299 EXPORT_C TInt RDRMRightsClient::GetAuthenticationSeed( const TDesC8& aContentID, |
1300 TDes8& aSeed ) |
1300 TDes8& aSeed ) |
1301 { |
1301 { |
1302 DRMLOG( _L( "RDRMRightsClient::GetAuthenticationSeed" ) ); |
1302 DRMLOG( _L( "RDRMRightsClient::GetAuthenticationSeed" ) ); |
1303 return SendReceive( DRMEngine::EGetAuthenticationSeed, |
1303 return SendReceive( DRMEngine::EGetAuthenticationSeed, |
1304 TIpcArgs( &aContentID, &aSeed ) ); |
1304 TIpcArgs( &aContentID, &aSeed ) ); |
1305 } |
1305 } |
1306 |
1306 |
1307 // ----------------------------------------------------------------------------- |
1307 // ----------------------------------------------------------------------------- |
1308 // RDRMRightsClient::FileToListL |
1308 // RDRMRightsClient::FileToListL |
1309 // Converts the given file into an array. |
1309 // Converts the given file into an array. |
1310 // ----------------------------------------------------------------------------- |
1310 // ----------------------------------------------------------------------------- |
1313 const TDesC& aFileName, |
1313 const TDesC& aFileName, |
1314 RPointerArray< CDRMPermission >& aList ) |
1314 RPointerArray< CDRMPermission >& aList ) |
1315 { |
1315 { |
1316 DRMLOG( _L( "RDRMRightsClient::FileToListL" ) ); |
1316 DRMLOG( _L( "RDRMRightsClient::FileToListL" ) ); |
1317 TInt error = KErrNone; |
1317 TInt error = KErrNone; |
1318 |
1318 |
1319 // Temporary storage. |
1319 // Temporary storage. |
1320 CDRMPermission* tmpObject; |
1320 CDRMPermission* tmpObject; |
1321 |
1321 |
1322 // To access the file data. |
1322 // To access the file data. |
1323 RFileReadStream fileStream; |
1323 RFileReadStream fileStream; |
1324 |
1324 |
1325 // How many objects there is in the file. |
1325 // How many objects there is in the file. |
1326 TInt size = 0; |
1326 TInt size = 0; |
1327 |
1327 |
1328 // Temporary counter. |
1328 // Temporary counter. |
1329 TInt count = 0; |
1329 TInt count = 0; |
1330 |
1330 |
1331 |
1331 |
1332 // Open the file. |
1332 // Open the file. |
1333 User::LeaveIfError( fileStream.Open( aFs, aFileName, EFileRead | EFileStream ) ); |
1333 User::LeaveIfError( fileStream.Open( aFs, aFileName, EFileRead | EFileStream ) ); |
1334 CleanupClosePushL( fileStream ); |
1334 CleanupClosePushL( fileStream ); |
1335 |
1335 |
1336 size = fileStream.ReadInt32L(); |
1336 size = fileStream.ReadInt32L(); |
1337 |
1337 |
1338 while( count < size ) |
1338 while( count < size ) |
1339 { |
1339 { |
1340 // Allocate a new RO. |
1340 // Allocate a new RO. |
1341 tmpObject = CDRMPermission::NewL(); |
1341 tmpObject = CDRMPermission::NewL(); |
1342 |
1342 |
1343 // Read the object. |
1343 // Read the object. |
1344 TRAP( error, tmpObject->InternalizeL( fileStream ) ); |
1344 TRAP( error, tmpObject->InternalizeL( fileStream ) ); |
1345 |
1345 |
1346 if ( !error ) |
1346 if ( !error ) |
1347 { |
1347 { |
1348 // Add the object into the list. |
1348 // Add the object into the list. |
1349 error = aList.Append( tmpObject ); |
1349 error = aList.Append( tmpObject ); |
1350 } |
1350 } |
1351 |
1351 |
1352 if ( error ) |
1352 if ( error ) |
1353 { |
1353 { |
1354 delete tmpObject; |
1354 delete tmpObject; |
1355 User::Leave( error ); |
1355 User::Leave( error ); |
1356 } |
1356 } |
1357 |
1357 |
1358 // Now tmpObject is under responsibility of aList. |
1358 // Now tmpObject is under responsibility of aList. |
1359 ++count; |
1359 ++count; |
1360 } |
1360 } |
1361 |
1361 |
1362 // All done. |
1362 // All done. |
1363 CleanupStack::PopAndDestroy(); // fileStream |
1363 CleanupStack::PopAndDestroy(); // fileStream |
1364 } |
1364 } |
1365 |
1365 |
1366 // ----------------------------------------------------------------------------- |
1366 // ----------------------------------------------------------------------------- |
1367 // RDRMRightsClient::URIFileToArrayL |
1367 // RDRMRightsClient::URIFileToArrayL |
1368 // Converts the given file into an array. |
1368 // Converts the given file into an array. |
1374 { |
1374 { |
1375 DRMLOG( _L( "RDRMRightsClient::URIFileToArrayL" ) ); |
1375 DRMLOG( _L( "RDRMRightsClient::URIFileToArrayL" ) ); |
1376 RFileReadStream stream; |
1376 RFileReadStream stream; |
1377 TUint16 size = 0; |
1377 TUint16 size = 0; |
1378 TPtr8 data( NULL, 0, 0 ); |
1378 TPtr8 data( NULL, 0, 0 ); |
1379 |
1379 |
1380 User::LeaveIfError( stream.Open( aFs, aFile, EFileRead | EFileStream ) ); |
1380 User::LeaveIfError( stream.Open( aFs, aFile, EFileRead | EFileStream ) ); |
1381 CleanupClosePushL( stream ); |
1381 CleanupClosePushL( stream ); |
1382 |
1382 |
1383 size = stream.ReadUint16L(); |
1383 size = stream.ReadUint16L(); |
1384 while( size > 0 ) |
1384 while( size > 0 ) |
1385 { |
1385 { |
1386 HBufC8* tmp = HBufC8::NewLC( size ); |
1386 HBufC8* tmp = HBufC8::NewLC( size ); |
1387 data.Set( tmp->Des() ); |
1387 data.Set( tmp->Des() ); |
1388 stream.ReadL( data, size ); |
1388 stream.ReadL( data, size ); |
1389 User::LeaveIfError( aList.Append( tmp ) ); |
1389 User::LeaveIfError( aList.Append( tmp ) ); |
1390 CleanupStack::Pop(); // tmp |
1390 CleanupStack::Pop(); // tmp |
1391 size = stream.ReadUint16L(); |
1391 size = stream.ReadUint16L(); |
1392 } |
1392 } |
1393 |
1393 |
1394 // All read, return. |
1394 // All read, return. |
1395 |
1395 |
1396 CleanupStack::PopAndDestroy(); // stream |
1396 CleanupStack::PopAndDestroy(); // stream |
1397 } |
1397 } |
1398 |
1398 |
1399 // ----------------------------------------------------------------------------- |
1399 // ----------------------------------------------------------------------------- |
1400 // RDRMRightsClient::VerifyMacL |
1400 // RDRMRightsClient::VerifyMacL |
1401 // Verifies the MAC. |
1401 // Verifies the MAC. |
1402 // ----------------------------------------------------------------------------- |
1402 // ----------------------------------------------------------------------------- |
1403 // |
1403 // |
1404 EXPORT_C TInt RDRMRightsClient::VerifyMacL(const TDesC8& aSignedInfoElement, |
1404 EXPORT_C TInt RDRMRightsClient::VerifyMacL(const TDesC8& aSignedInfoElement, |
1405 const TDesC8& aMacValue ) const |
1405 const TDesC8& aMacValue ) const |
1406 { |
1406 { |
1407 DRMLOG( _L( "RDRMRightsClient::VerifyMacL" ) ); |
1407 DRMLOG( _L( "RDRMRightsClient::VerifyMacL" ) ); |
1408 |
1408 |
1409 TInt error = SendReceive( DRMEngine::EVerifyMac, |
1409 TInt error = SendReceive( DRMEngine::EVerifyMac, |
1410 TIpcArgs( &aSignedInfoElement, &aMacValue) ); |
1410 TIpcArgs( &aSignedInfoElement, &aMacValue) ); |
1411 return error; |
1411 return error; |
1412 } |
1412 } |
1413 |
1413 |
1414 |
1414 |
1415 // ----------------------------------------------------------------------------- |
1415 // ----------------------------------------------------------------------------- |
1416 // RDRMRightsClient::GetSupportedIndividualsL |
1416 // RDRMRightsClient::GetSupportedIndividualsL |
1417 // retrieves the supported individuals list |
1417 // retrieves the supported individuals list |
1418 // ----------------------------------------------------------------------------- |
1418 // ----------------------------------------------------------------------------- |
1419 // |
1419 // |
1420 EXPORT_C TInt RDRMRightsClient::GetSupportedIndividualsL( |
1420 EXPORT_C TInt RDRMRightsClient::GetSupportedIndividualsL( |
1421 RPointerArray<HBufC8>& aIndividuals) const |
1421 RPointerArray<HBufC8>& aIndividuals) const |
1422 { |
1422 { |
1423 DRMLOG( _L( "RDRMRightsClient::GetSupportedIndividualsL" ) ); |
1423 DRMLOG( _L( "RDRMRightsClient::GetSupportedIndividualsL" ) ); |
1424 TPckgBuf< TInt > size( 0 ); |
1424 TPckgBuf< TInt > size( 0 ); |
1425 TInt error = SendReceive( DRMEngine::EGetSupportedIndividuals, |
1425 TInt error = SendReceive( DRMEngine::EGetSupportedIndividuals, |
1426 TIpcArgs( &size) ); |
1426 TIpcArgs( &size) ); |
1427 HBufC8* dataBuf = NULL; |
1427 HBufC8* dataBuf = NULL; |
1428 HBufC8* individual = NULL; |
1428 HBufC8* individual = NULL; |
1429 TInt indivSize; |
1429 TInt indivSize; |
1430 TInt offset; |
1430 TInt offset; |
1431 |
1431 |
1432 if ( !error ) |
1432 if ( !error ) |
1433 { |
1433 { |
1434 if ( !size() ) |
1434 if ( !size() ) |
1435 { |
1435 { |
1436 return KErrNone; |
1436 return KErrNone; |
1439 { |
1439 { |
1440 dataBuf = HBufC8::NewLC( size() ); |
1440 dataBuf = HBufC8::NewLC( size() ); |
1441 if ( dataBuf ) |
1441 if ( dataBuf ) |
1442 { |
1442 { |
1443 TPtr8 data( dataBuf->Des() ); |
1443 TPtr8 data( dataBuf->Des() ); |
1444 |
1444 |
1445 error = SendReceive( DRMEngine::EGetPreparedData, |
1445 error = SendReceive( DRMEngine::EGetPreparedData, |
1446 TIpcArgs( &data ) ); |
1446 TIpcArgs( &data ) ); |
1447 |
1447 |
1448 if ( !error ) |
1448 if ( !error ) |
1449 { |
1449 { |
1450 offset = 0; |
1450 offset = 0; |
1451 while (offset < size()) |
1451 while (offset < size()) |
1452 { |
1452 { |
1453 Mem::Copy( &indivSize, data.Ptr()+offset, sizeof(TInt) ); |
1453 Mem::Copy( &indivSize, data.Ptr()+offset, sizeof(TInt) ); |
1454 offset += sizeof (TInt); |
1454 offset += sizeof (TInt); |
1455 individual = data.Mid(offset, indivSize).AllocLC(); |
1455 individual = data.Mid(offset, indivSize).AllocLC(); |
1456 aIndividuals.AppendL(individual); |
1456 aIndividuals.AppendL(individual); |
1457 CleanupStack::Pop(); // individual |
1457 CleanupStack::Pop(); // individual |
1458 offset += indivSize; |
1458 offset += indivSize; |
1459 } |
1459 } |
1460 } |
1460 } |
1461 } |
1461 } |
1462 CleanupStack::PopAndDestroy(); |
1462 CleanupStack::PopAndDestroy(); |
1463 } |
1463 } |
1464 } |
1464 } |
1465 return KErrNone; |
1465 return KErrNone; |
1466 } |
1466 } |
1467 |
1467 |
1468 // ----------------------------------------------------------------------------- |
1468 // ----------------------------------------------------------------------------- |
1469 // RDRMRightsClient::StopWatching |
1469 // RDRMRightsClient::StopWatching |
1470 // ----------------------------------------------------------------------------- |
1470 // ----------------------------------------------------------------------------- |
1471 // |
1471 // |
1472 EXPORT_C void RDRMRightsClient::StopWatching() const |
1472 EXPORT_C void RDRMRightsClient::StopWatching() const |
1473 { |
1473 { |
1474 SendReceive( DRMEngine::EStopWatching ); |
1474 SendReceive( DRMEngine::EStopWatching ); |
1475 } |
1475 } |
1476 |
1476 |
1477 // ----------------------------------------------------------------------------- |
1477 // ----------------------------------------------------------------------------- |
1478 // RDRMRightsClient::UnwrapMacAndRek |
1478 // RDRMRightsClient::UnwrapMacAndRek |
1479 // ----------------------------------------------------------------------------- |
1479 // ----------------------------------------------------------------------------- |
1480 // |
1480 // |
1481 EXPORT_C TInt RDRMRightsClient::UnwrapMacAndRek( const TDesC8& aMacAndRek, |
1481 EXPORT_C TInt RDRMRightsClient::UnwrapMacAndRek( const TDesC8& aMacAndRek, |
1482 TKeyTransportScheme aTransportScheme, |
1482 TKeyTransportScheme aTransportScheme, |
1483 const TDesC8& aRightsIssuerId, |
1483 const TDesC8& aRightsIssuerId, |
1484 const TDesC8& aDomainId ) const |
1484 const TDesC8& aDomainId ) const |
1485 { |
1485 { |
1486 HBufC8* data = NULL; |
1486 HBufC8* data = NULL; |
1487 TPtr8 dataPtr( NULL, 0 ); |
1487 TPtr8 dataPtr( NULL, 0 ); |
1488 TInt err = KErrNone; |
1488 TInt err = KErrNone; |
1489 |
1489 |
1490 data = HBufC8::New( 1 + aMacAndRek.Size() ); |
1490 data = HBufC8::New( 1 + aMacAndRek.Size() ); |
1491 |
1491 |
1492 if ( data ) |
1492 if ( data ) |
1493 { |
1493 { |
1494 dataPtr.Set( data->Des() ); |
1494 dataPtr.Set( data->Des() ); |
1495 dataPtr.SetLength( 1 ); |
1495 dataPtr.SetLength( 1 ); |
1496 dataPtr[0] = aTransportScheme; |
1496 dataPtr[0] = aTransportScheme; |
1497 dataPtr.Append( aMacAndRek ); |
1497 dataPtr.Append( aMacAndRek ); |
1498 |
1498 |
1499 if( aDomainId.Length() ) |
1499 if( aDomainId.Length() ) |
1500 { |
1500 { |
1501 err = SendReceive( DRMEngine::EUnwrapDomainMacAndRek, TIpcArgs( &dataPtr, |
1501 err = SendReceive( DRMEngine::EUnwrapDomainMacAndRek, TIpcArgs( &dataPtr, |
1502 &aRightsIssuerId, |
1502 &aRightsIssuerId, |
1503 &aDomainId ) ); |
1503 &aDomainId ) ); |
1533 } |
1533 } |
1534 |
1534 |
1535 // ----------------------------------------------------------------------------- |
1535 // ----------------------------------------------------------------------------- |
1536 // RDRMRightsClient::GetMeteringData() |
1536 // RDRMRightsClient::GetMeteringData() |
1537 // ----------------------------------------------------------------------------- |
1537 // ----------------------------------------------------------------------------- |
1538 // |
1538 // |
1539 #ifndef RD_DRM_METERING |
1539 #ifndef RD_DRM_METERING |
1540 EXPORT_C HBufC8* RDRMRightsClient::GetMeteringDataL( const TDesC8& /*aRiId*/ ) |
1540 EXPORT_C HBufC8* RDRMRightsClient::GetMeteringDataL( const TDesC8& /*aRiId*/ ) |
1541 { |
1541 { |
1542 return NULL; |
1542 return NULL; |
1543 } |
1543 } |
1544 #else |
1544 #else |
1545 EXPORT_C HBufC8* RDRMRightsClient::GetMeteringDataL( const TDesC8& aRiId ) |
1545 EXPORT_C HBufC8* RDRMRightsClient::GetMeteringDataL( const TDesC8& aRiId ) |
1546 { |
1546 { |
1547 TInt error = KErrNone; |
1547 TInt error = KErrNone; |
1548 HBufC8* meteringData = NULL; |
1548 HBufC8* meteringData = NULL; |
1549 |
1549 |
1550 if ( aRiId.Length() ) |
1550 if ( aRiId.Length() ) |
1551 { |
1551 { |
1552 TInt size = 0; |
1552 TInt size = 0; |
1553 TPckg<TInt> package( size ); |
1553 TPckg<TInt> package( size ); |
1554 |
1554 |
1555 error = SendReceive( DRMEngine::EGetMeteringData, |
1555 error = SendReceive( DRMEngine::EGetMeteringData, |
1556 TIpcArgs( &package, &aRiId ) ); |
1556 TIpcArgs( &package, &aRiId ) ); |
1557 |
1557 |
1558 if ( error == KErrNotFound ) |
1558 if ( error == KErrNotFound ) |
1559 { |
1559 { |
1560 return NULL; |
1560 return NULL; |
1561 } |
1561 } |
1562 |
1562 |
1563 User::LeaveIfError( error ); |
1563 User::LeaveIfError( error ); |
1564 |
1564 |
1565 meteringData = HBufC8::NewMaxLC( size ); |
1565 meteringData = HBufC8::NewMaxLC( size ); |
1566 |
1566 |
1567 // Package 'object' into TPtr8. |
1567 // Package 'object' into TPtr8. |
1568 TPtr8 objectPkg( const_cast< TUint8* >( meteringData->Ptr() ), |
1568 TPtr8 objectPkg( const_cast< TUint8* >( meteringData->Ptr() ), |
1569 size, |
1569 size, |
1570 size ); |
1570 size ); |
1571 |
1571 |
1572 User::LeaveIfError( SendReceive( DRMEngine::EGetPreparedData, |
1572 User::LeaveIfError( SendReceive( DRMEngine::EGetPreparedData, |
1573 TIpcArgs( &objectPkg) ) ); |
1573 TIpcArgs( &objectPkg) ) ); |
1574 |
1574 |
1575 CleanupStack::Pop(); // meteringData |
1575 CleanupStack::Pop(); // meteringData |
1576 return meteringData; |
1576 return meteringData; |
1577 } |
1577 } |
1578 |
1578 |
1579 User::Leave( KErrArgument ); |
1579 User::Leave( KErrArgument ); |
1580 return NULL; |
1580 return NULL; |
1581 } |
1581 } |
1582 #endif //RD_DRM_METERING |
1582 #endif //RD_DRM_METERING |
1583 |
1583 |
1584 // ----------------------------------------------------------------------------- |
1584 // ----------------------------------------------------------------------------- |
1585 // RDRMRightsClient::DeleteMeteringDataL |
1585 // RDRMRightsClient::DeleteMeteringDataL |
1586 // ----------------------------------------------------------------------------- |
1586 // ----------------------------------------------------------------------------- |
1587 // |
1587 // |
1588 #ifndef RD_DRM_METERING |
1588 #ifndef RD_DRM_METERING |
1589 EXPORT_C TInt RDRMRightsClient::DeleteMeteringDataL( const TDesC8& /*aRiId*/ ) |
1589 EXPORT_C TInt RDRMRightsClient::DeleteMeteringDataL( const TDesC8& /*aRiId*/ ) |
1590 { |
1590 { |
1591 return KErrNotSupported; |
1591 return KErrNotSupported; |
1592 } |
1592 } |
1593 #else |
1593 #else |
1594 EXPORT_C TInt RDRMRightsClient::DeleteMeteringDataL( const TDesC8& aRiId ) |
1594 EXPORT_C TInt RDRMRightsClient::DeleteMeteringDataL( const TDesC8& aRiId ) |
1595 { |
1595 { |
1596 if ( aRiId.Length() ) |
1596 if ( aRiId.Length() ) |
1597 { |
1597 { |
1598 User::LeaveIfError( SendReceive( DRMEngine::EDeleteMeteringData, |
1598 User::LeaveIfError( SendReceive( DRMEngine::EDeleteMeteringData, |