|
1 /* |
|
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * sisregistry - client registry entry interface implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 #include<s32mem.h> |
|
27 #include <hash.h> |
|
28 #include <swi/sistruststatus.h> |
|
29 #include <x509cert.h> |
|
30 #include "sisregistrydependency.h" |
|
31 #include "sisregistryentry.h" |
|
32 #include "sisregistrysession.h" |
|
33 #include "sisregistryclientserver.h" |
|
34 #include "sisregistrypackage.h" |
|
35 #include "sisregistryobject.h" |
|
36 #include "hashcontainer.h" |
|
37 #include "arrayutils.h" |
|
38 #include "cleanuputils.h" |
|
39 |
|
40 using namespace Swi; |
|
41 |
|
42 const TInt KMinBufferSize = 20; |
|
43 |
|
44 EXPORT_C TInt RSisRegistryEntry::Open(RSisRegistrySession& aSession, TUid aUid) |
|
45 { |
|
46 TPckgC<TUid> uid(aUid); |
|
47 |
|
48 return CreateSubSession(aSession, EOpenRegistryUid, TIpcArgs(&uid)); |
|
49 } |
|
50 |
|
51 EXPORT_C TInt RSisRegistryEntry::OpenL(RSisRegistrySession& aSession, |
|
52 const CSisRegistryPackage& aPackage) |
|
53 { |
|
54 // dynamic buffer since we don't know in advance the size required |
|
55 CBufFlat* tempBuffer = CBufFlat::NewL(KDefaultBufferSize); |
|
56 CleanupStack::PushL(tempBuffer); |
|
57 |
|
58 RBufWriteStream stream(*tempBuffer); |
|
59 CleanupClosePushL(stream); |
|
60 |
|
61 aPackage.ExternalizeL(stream); |
|
62 stream.CommitL(); |
|
63 |
|
64 // Now, create an HBufC8 from the stream buf's length, and copy |
|
65 // the stream buffer into this descriptor |
|
66 HBufC8* buffer = HBufC8::NewLC(tempBuffer->Size()); |
|
67 TPtr8 ptr(buffer->Des()); |
|
68 tempBuffer->Read(0, ptr, tempBuffer->Size()); |
|
69 |
|
70 TInt err = CreateSubSession(aSession, EOpenRegistryPackage, TIpcArgs(&ptr)); |
|
71 User::LeaveIfError(err); |
|
72 |
|
73 CleanupStack::PopAndDestroy(3, tempBuffer); // tempBuffer, stream, buffer |
|
74 |
|
75 return err; |
|
76 } |
|
77 |
|
78 EXPORT_C TInt RSisRegistryEntry::Open(RSisRegistrySession &aSession, const TDesC& aPackageName, const TDesC& aVendorName) |
|
79 { |
|
80 return CreateSubSession(aSession, EOpenRegistryNames, TIpcArgs(&aPackageName, &aVendorName)); |
|
81 } |
|
82 |
|
83 EXPORT_C void RSisRegistryEntry::Close() |
|
84 { |
|
85 CloseSubSession(ECloseRegistryEntry); |
|
86 } |
|
87 |
|
88 EXPORT_C TBool RSisRegistryEntry::IsPresentL() |
|
89 { |
|
90 TBool isPresent = EFalse ; |
|
91 TPckg<TBool> isPresentPkg(isPresent); |
|
92 |
|
93 User::LeaveIfError(SendReceive(EUidPresent, TIpcArgs(&isPresentPkg))); |
|
94 |
|
95 return isPresent; |
|
96 } |
|
97 |
|
98 EXPORT_C TBool RSisRegistryEntry::IsSignedL() |
|
99 { |
|
100 TBool isSigned = EFalse; |
|
101 TPckg<TBool> isSignedPkg(isSigned); |
|
102 |
|
103 User::LeaveIfError(SendReceive(ESigned, TIpcArgs(&isSignedPkg))); |
|
104 return isSigned; |
|
105 } |
|
106 |
|
107 EXPORT_C TSisPackageTrust RSisRegistryEntry::TrustL() const |
|
108 { |
|
109 TSisPackageTrust trust; |
|
110 TPckg<TSisPackageTrust> trustPkg(trust); |
|
111 |
|
112 User::LeaveIfError(SendReceive(EGetTrust, TIpcArgs(&trustPkg))); |
|
113 return trust; |
|
114 } |
|
115 |
|
116 EXPORT_C TTime RSisRegistryEntry::TrustTimeStampL() const |
|
117 { |
|
118 TTime trustTimeStamp; |
|
119 TPckg<TTime> timePkg(trustTimeStamp); |
|
120 |
|
121 User::LeaveIfError(SendReceive(ETrustTimeStamp, TIpcArgs(&timePkg))); |
|
122 return trustTimeStamp; |
|
123 } |
|
124 |
|
125 EXPORT_C TSisTrustStatus RSisRegistryEntry::TrustStatusL() |
|
126 { |
|
127 HBufC8* buffer = SendReceiveBufferLC((TInt)ETrustStatus); |
|
128 |
|
129 // create a stream based on the buffer |
|
130 RDesReadStream stream(*buffer); |
|
131 CleanupClosePushL(stream); |
|
132 |
|
133 // reassemble from the stream |
|
134 TSisTrustStatus trustStatus; |
|
135 |
|
136 trustStatus.InternalizeL(stream); |
|
137 |
|
138 CleanupStack::PopAndDestroy(2, buffer); // buffer, stream |
|
139 |
|
140 return trustStatus; |
|
141 |
|
142 } |
|
143 |
|
144 EXPORT_C TBool RSisRegistryEntry::IsInRomL() |
|
145 { |
|
146 TBool isInRom = EFalse; |
|
147 TPckg<TBool> isInRomPkg(isInRom); |
|
148 |
|
149 User::LeaveIfError(SendReceive(EInRom, TIpcArgs(&isInRomPkg))); |
|
150 return isInRom; |
|
151 } |
|
152 |
|
153 |
|
154 |
|
155 EXPORT_C TBool RSisRegistryEntry::IsAugmentationL() |
|
156 { |
|
157 TBool isAugmentation = EFalse; |
|
158 TPckg<TBool> isAugmentationPkg(isAugmentation); |
|
159 |
|
160 User::LeaveIfError(SendReceive(EAugmentation, TIpcArgs(&isAugmentationPkg))); |
|
161 return isAugmentation; |
|
162 } |
|
163 |
|
164 EXPORT_C TVersion RSisRegistryEntry::VersionL() |
|
165 { |
|
166 TVersion version; |
|
167 TPckg<TVersion> packageVersion(version); |
|
168 |
|
169 User::LeaveIfError(SendReceive(EVersion, TIpcArgs(&packageVersion))); |
|
170 return version; |
|
171 } |
|
172 |
|
173 EXPORT_C TLanguage RSisRegistryEntry::LanguageL() |
|
174 { |
|
175 TLanguage language; |
|
176 TPckg<TLanguage> packageLanguage(language); |
|
177 |
|
178 User::LeaveIfError(SendReceive(ELanguage, TIpcArgs(&packageLanguage))); |
|
179 return language; |
|
180 } |
|
181 |
|
182 EXPORT_C TUid RSisRegistryEntry::UidL() |
|
183 { |
|
184 TUid uid; |
|
185 TPckg<TUid> packageUid(uid); |
|
186 |
|
187 User::LeaveIfError(SendReceive(EUid, TIpcArgs(&packageUid))); |
|
188 return uid; |
|
189 } |
|
190 |
|
191 EXPORT_C HBufC* RSisRegistryEntry::PackageNameL() |
|
192 { |
|
193 HBufC* buffer = HBufC::NewLC(KDefaultBufferSize); |
|
194 TPtr ptr = buffer->Des(); |
|
195 User::LeaveIfError(SendReceive(EPackageName, TIpcArgs(&ptr))); |
|
196 CleanupStack::Pop(buffer); |
|
197 return buffer; |
|
198 } |
|
199 |
|
200 EXPORT_C HBufC* RSisRegistryEntry::UniqueVendorNameL() |
|
201 { |
|
202 HBufC* buffer = HBufC::NewLC(KDefaultBufferSize); |
|
203 TPtr ptr = buffer->Des(); |
|
204 User::LeaveIfError(SendReceive(EUniqueVendorName, TIpcArgs(&ptr))); |
|
205 CleanupStack::Pop(buffer); |
|
206 return buffer; |
|
207 } |
|
208 |
|
209 EXPORT_C HBufC* RSisRegistryEntry::LocalizedVendorNameL() |
|
210 { |
|
211 HBufC* buffer = HBufC::NewLC(KDefaultBufferSize); |
|
212 TPtr ptr=buffer->Des(); |
|
213 User::LeaveIfError(SendReceive(ELocalizedVendorName, TIpcArgs(&ptr))); |
|
214 CleanupStack::Pop(buffer); |
|
215 return buffer; |
|
216 } |
|
217 |
|
218 EXPORT_C void RSisRegistryEntry::SidsL(RArray<TUid>& aSids) |
|
219 { |
|
220 HBufC8* buffer = SendReceiveBufferLC(ESids); |
|
221 |
|
222 // create a stream based on the buffer |
|
223 RDesReadStream stream(*buffer); |
|
224 CleanupClosePushL(stream); |
|
225 |
|
226 // reassemble the array from the stream |
|
227 InternalizeArrayL(aSids, stream); |
|
228 |
|
229 CleanupStack::PopAndDestroy(2, buffer);// buffer, stream |
|
230 } |
|
231 |
|
232 |
|
233 EXPORT_C void RSisRegistryEntry::FilesL(RPointerArray<HBufC>& aFiles) |
|
234 { |
|
235 TInt startingFile = 0; |
|
236 TPckgBuf<TInt> filesCount; |
|
237 TStubExtractionMode operationMode = EGetCount; |
|
238 |
|
239 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
240 TPckgC<TInt> pckgStartingFile(startingFile); |
|
241 #endif |
|
242 |
|
243 // Get the total file count. |
|
244 TPckgC<TStubExtractionMode> packageMode(operationMode); |
|
245 |
|
246 TInt result = SendReceive(EFiles, TIpcArgs(&packageMode, &filesCount)); |
|
247 User::LeaveIfError(result); |
|
248 |
|
249 TInt totalFilesCount = filesCount(); |
|
250 operationMode = EGetFiles; |
|
251 |
|
252 HBufC8* buffer = HBufC8::NewLC(KDefaultBufferSize); |
|
253 |
|
254 TPtr8 pOutput(buffer->Des()); |
|
255 while (startingFile < totalFilesCount) |
|
256 { |
|
257 // Fetch the files. |
|
258 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
259 User::LeaveIfError(SendReceive(EFiles, TIpcArgs(&packageMode, &pOutput))); |
|
260 #else |
|
261 User::LeaveIfError(SendReceive(EFiles, TIpcArgs(&packageMode, &pckgStartingFile, &pOutput))); |
|
262 #endif |
|
263 // create a stream based on the buffer |
|
264 RDesReadStream stream(*buffer); |
|
265 CleanupClosePushL(stream); |
|
266 |
|
267 // reassemble the array from the stream |
|
268 InternalizePointerArrayL(aFiles, stream); |
|
269 |
|
270 CleanupStack::PopAndDestroy(&stream); //stream |
|
271 |
|
272 startingFile = aFiles.Count(); |
|
273 } |
|
274 |
|
275 CleanupStack::PopAndDestroy(buffer); |
|
276 } |
|
277 |
|
278 EXPORT_C void RSisRegistryEntry::CertificateChainsL(RPointerArray<HBufC8>& aCertificateChains) |
|
279 { |
|
280 HBufC8* buffer = SendReceiveBufferLC(ECertificateChains); |
|
281 |
|
282 // create a stream based on the buffer |
|
283 RDesReadStream stream(*buffer); |
|
284 CleanupClosePushL(stream); |
|
285 |
|
286 // reassemble the array from the stream |
|
287 InternalizePointerArrayL(aCertificateChains, stream); |
|
288 |
|
289 CleanupStack::PopAndDestroy(2, buffer);// buffer, stream |
|
290 } |
|
291 |
|
292 EXPORT_C CHashContainer* RSisRegistryEntry::HashL(const TDesC& aFileName) |
|
293 { |
|
294 HBufC8* buffer = SendReceiveBufferLC(EHashEntry, aFileName); |
|
295 |
|
296 RDesReadStream stream(*buffer); |
|
297 CleanupClosePushL(stream); |
|
298 |
|
299 // reassemble the hash from the stream |
|
300 CHashContainer* hash = CHashContainer::NewLC(stream); |
|
301 CleanupStack::Pop(hash); |
|
302 |
|
303 CleanupStack::PopAndDestroy(2, buffer);// buffer, stream |
|
304 |
|
305 return hash; |
|
306 } |
|
307 |
|
308 EXPORT_C TInt RSisRegistryEntry::PropertyL(TInt aKey) |
|
309 { |
|
310 TInt value; |
|
311 TPckg<TInt> propertyValuePckg(value); |
|
312 User::LeaveIfError(SendReceive(EProperty, TIpcArgs(aKey, &propertyValuePckg))); |
|
313 return value; |
|
314 } |
|
315 |
|
316 EXPORT_C void RSisRegistryEntry::AugmentationsL(RPointerArray<HBufC>& aPackageNames, RPointerArray<HBufC>& aVendorNames) |
|
317 { |
|
318 HBufC8* buffer = RSisRegistryEntry::SendReceiveBufferLC(EPackageAugmentations); |
|
319 |
|
320 // create a stream based on the buffer |
|
321 RDesReadStream stream(*buffer); |
|
322 CleanupClosePushL(stream); |
|
323 |
|
324 // reassemble the array from the stream |
|
325 RPointerArray<CSisRegistryPackage> packages; |
|
326 CleanupResetAndDestroy<RPointerArray<CSisRegistryPackage> >::PushL(packages); |
|
327 InternalizePointerArrayL(packages, stream); |
|
328 |
|
329 aPackageNames.ResetAndDestroy(); |
|
330 aVendorNames.ResetAndDestroy(); |
|
331 |
|
332 for (TInt i = 0; i < packages.Count(); i++) |
|
333 { |
|
334 HBufC* package = packages[i]->Name().AllocLC(); |
|
335 HBufC* vendor = packages[i]->Vendor().AllocLC(); |
|
336 |
|
337 aPackageNames.AppendL(package); |
|
338 aVendorNames.AppendL(vendor); |
|
339 |
|
340 CleanupStack::Pop(2, vendor); //vendor package, |
|
341 } |
|
342 CleanupStack::PopAndDestroy(3, buffer);// buffer, stream, packages |
|
343 } |
|
344 |
|
345 EXPORT_C void RSisRegistryEntry::AugmentationsL(RPointerArray<CSisRegistryPackage>& aPackages) |
|
346 { |
|
347 HBufC8* buffer = RSisRegistryEntry::SendReceiveBufferLC(EPackageAugmentations); |
|
348 |
|
349 // create a stream based on the buffer |
|
350 RDesReadStream stream(*buffer); |
|
351 CleanupClosePushL(stream); |
|
352 |
|
353 // reassemble the array from the stream |
|
354 InternalizePointerArrayL(aPackages, stream); |
|
355 |
|
356 CleanupStack::PopAndDestroy(2, buffer); // buffer, stream |
|
357 } |
|
358 |
|
359 EXPORT_C TInt RSisRegistryEntry::AugmentationsNumberL() |
|
360 { |
|
361 TInt numAugmentation = 0; |
|
362 TPckg<TInt> numAugmentationPkg(numAugmentation); |
|
363 |
|
364 User::LeaveIfError(SendReceive(EPackageAugmentationsNumber, TIpcArgs(&numAugmentationPkg))); |
|
365 |
|
366 return numAugmentation; |
|
367 } |
|
368 |
|
369 EXPORT_C CSisRegistryPackage* RSisRegistryEntry::PackageL() |
|
370 { |
|
371 HBufC8* buffer = SendReceiveBufferLC(EPackage); |
|
372 |
|
373 // create a stream based on the buffer |
|
374 RDesReadStream stream(*buffer); |
|
375 CleanupClosePushL(stream); |
|
376 |
|
377 // Create the package from the stream |
|
378 CSisRegistryPackage* package = CSisRegistryPackage::NewLC(stream); |
|
379 CleanupStack::Pop(package); |
|
380 |
|
381 CleanupStack::PopAndDestroy(2, buffer);// buffer, stream |
|
382 return package; |
|
383 } |
|
384 |
|
385 EXPORT_C TInt64 RSisRegistryEntry::SizeL() |
|
386 { |
|
387 TInt64 size = 0; |
|
388 TPckg<TInt64> packageSize(size); |
|
389 User::LeaveIfError(SendReceive(ESize, TIpcArgs(&packageSize))); |
|
390 return size; |
|
391 } |
|
392 |
|
393 EXPORT_C void RSisRegistryEntry::ControllersL(RPointerArray<HBufC8>& aControllers) |
|
394 { |
|
395 HBufC8* buffer = SendReceiveBufferLC(EControllers); |
|
396 |
|
397 // this call returns pure data, so we don't incur the overheads of the streamstore |
|
398 TInt len(0); |
|
399 TPckg<TInt> lenPckg(len); |
|
400 |
|
401 TInt pos(0); |
|
402 TInt lenLen = lenPckg.Length(); |
|
403 TInt bufLen = buffer->Length(); |
|
404 while (pos != bufLen) |
|
405 { |
|
406 lenPckg.Copy(buffer->Mid(pos, lenLen)); |
|
407 pos += lenLen; |
|
408 |
|
409 HBufC8* controller = buffer->Mid(pos, len).AllocLC(); |
|
410 aControllers.AppendL(controller); |
|
411 CleanupStack::Pop(controller); |
|
412 pos += len; |
|
413 } |
|
414 |
|
415 CleanupStack::PopAndDestroy(buffer); |
|
416 } |
|
417 |
|
418 EXPORT_C TChar RSisRegistryEntry::SelectedDriveL() |
|
419 { |
|
420 TInt drive; |
|
421 TPckg<TInt> selectedDrive(drive); |
|
422 |
|
423 User::LeaveIfError(SendReceive(ESelectedDrive, TIpcArgs(&selectedDrive))); |
|
424 return drive; |
|
425 } |
|
426 |
|
427 EXPORT_C TUint RSisRegistryEntry::InstalledDrivesL() |
|
428 { |
|
429 TUint drive; |
|
430 TPckg<TUint> installeddrives(drive); |
|
431 |
|
432 User::LeaveIfError(SendReceive(EInstalledDrives, TIpcArgs(&installeddrives))); |
|
433 return drive; |
|
434 } |
|
435 |
|
436 EXPORT_C TBool RSisRegistryEntry::ShutdownAllAppsL() |
|
437 { |
|
438 TBool shutdownAllApps = EFalse; |
|
439 TPckg<TBool> packageShutdownAllApps(shutdownAllApps); |
|
440 User::LeaveIfError(SendReceive(EShutdownAllApps, TIpcArgs(&packageShutdownAllApps))); |
|
441 return shutdownAllApps; |
|
442 } |
|
443 |
|
444 EXPORT_C TBool RSisRegistryEntry::VerifyControllerSignatureL(RPointerArray<CX509Certificate>& aX509CertArray) |
|
445 { |
|
446 return VerifyControllerSignatureL(aX509CertArray, ETrue); |
|
447 } |
|
448 |
|
449 EXPORT_C TBool RSisRegistryEntry::VerifyControllerSignatureL(RPointerArray<CX509Certificate>& aX509CertArray, TBool aCheckDateAndTime) |
|
450 { |
|
451 TInt count = aX509CertArray.Count(); |
|
452 TInt bufferSize = Max(count * KDefaultBufferSize / 2, KMinBufferSize); |
|
453 CBufFlat* tempBuffer = CBufFlat::NewL(bufferSize); |
|
454 CleanupStack::PushL(tempBuffer); |
|
455 |
|
456 RBufWriteStream stream(*tempBuffer); |
|
457 CleanupClosePushL(stream); |
|
458 |
|
459 // Externalise the pointer array |
|
460 ExternalizePointerArrayL(aX509CertArray, stream); |
|
461 stream.CommitL(); |
|
462 |
|
463 // Create an HBufC8 from the stream buf's length, and copy |
|
464 // the stream buffer into this descriptor |
|
465 bufferSize = tempBuffer->Size(); |
|
466 HBufC8* buffer = HBufC8::NewLC(bufferSize); |
|
467 TPtr8 pbuffer(buffer->Des()); |
|
468 tempBuffer->Read(0, pbuffer, bufferSize); |
|
469 |
|
470 TBool isVerified = EFalse; |
|
471 TPckg<TBool> packagedResult(isVerified); |
|
472 |
|
473 TPckgC<TBool> packagedDateCheck(aCheckDateAndTime); |
|
474 |
|
475 User::LeaveIfError(SendReceive(EVerifyController, TIpcArgs(&packagedResult, &pbuffer, &packagedDateCheck))); |
|
476 |
|
477 CleanupStack::PopAndDestroy(3, tempBuffer); // tempBuffer, stream, buffer |
|
478 |
|
479 return isVerified; |
|
480 } |
|
481 |
|
482 EXPORT_C TInt RSisRegistryEntry::RemoveWithLastDependentL() |
|
483 { |
|
484 TInt isRemoveWithLastDependent = 0; |
|
485 TPckg<TInt> isRemoveWithLastDependentPkg(isRemoveWithLastDependent); |
|
486 |
|
487 User::LeaveIfError(SendReceive(ERemoveWithLastDependent, TIpcArgs(&isRemoveWithLastDependentPkg))); |
|
488 return isRemoveWithLastDependent; |
|
489 } |
|
490 |
|
491 EXPORT_C void RSisRegistryEntry::SetRemoveWithLastDependentL(TUid uid) |
|
492 { |
|
493 TPckg<TUid> uidPkg(uid); |
|
494 User::LeaveIfError(SendReceive(ESetRemoveWithLastDependent, TIpcArgs(&uidPkg))); |
|
495 } |
|
496 |
|
497 EXPORT_C TBool RSisRegistryEntry::RemovableL() |
|
498 { |
|
499 TBool isRemovable = ETrue; |
|
500 TPckg<TBool> packageIsRemovable(isRemovable); |
|
501 User::LeaveIfError(SendReceive(ENonRemovable, TIpcArgs(&packageIsRemovable))); |
|
502 return isRemovable; |
|
503 } |
|
504 |
|
505 HBufC8* RSisRegistryEntry::SendReceiveBufferLC(TInt aMessage) |
|
506 { |
|
507 HBufC8* output = HBufC8::NewLC(KDefaultBufferSize); |
|
508 |
|
509 TPtr8 pOutput(output->Des()); |
|
510 |
|
511 TInt result=SendReceive(aMessage, TIpcArgs(&pOutput)); |
|
512 |
|
513 if (result == KErrOverflow) |
|
514 { |
|
515 TInt sizeNeeded; |
|
516 |
|
517 TPckg<TInt> sizeNeededPackage(sizeNeeded); |
|
518 sizeNeededPackage.Copy(*output); |
|
519 |
|
520 // Re-allocate buffer |
|
521 CleanupStack::PopAndDestroy(output); |
|
522 output = HBufC8::NewLC(sizeNeeded); |
|
523 |
|
524 TPtr8 pResizedOutput(output->Des()); |
|
525 |
|
526 result=SendReceive(aMessage, TIpcArgs(&pResizedOutput)); |
|
527 } |
|
528 User::LeaveIfError(result); |
|
529 return output; |
|
530 } |
|
531 |
|
532 HBufC8* RSisRegistryEntry::SendReceiveBufferLC(TInt aMessage, const TDesC& aInputDescriptor) |
|
533 { |
|
534 HBufC8* output = HBufC8::NewLC(KDefaultBufferSize); |
|
535 |
|
536 TPtr8 pOutput(output->Des()); |
|
537 |
|
538 TInt result=SendReceive(aMessage, TIpcArgs(&aInputDescriptor, &pOutput)); |
|
539 |
|
540 if (result == KErrOverflow) |
|
541 { |
|
542 TInt sizeNeeded; |
|
543 TPckg<TInt> sizeNeededPackage(sizeNeeded); |
|
544 sizeNeededPackage.Copy(*output); |
|
545 |
|
546 // Re-allocate buffer |
|
547 CleanupStack::PopAndDestroy(output); |
|
548 output = HBufC8::NewLC(sizeNeeded); |
|
549 |
|
550 TPtr8 pResizedOutput(output->Des()); |
|
551 |
|
552 result=SendReceive(aMessage, TIpcArgs(&aInputDescriptor, &pResizedOutput)); |
|
553 } |
|
554 User::LeaveIfError(result); |
|
555 return output; |
|
556 } |
|
557 |
|
558 EXPORT_C TBool RSisRegistryEntry::PreInstalledL() |
|
559 { |
|
560 TBool preInstalled = EFalse; |
|
561 TPckg<TBool> isPreInstalled(preInstalled); |
|
562 |
|
563 User::LeaveIfError(SendReceive(EPreInstalled, TIpcArgs(&isPreInstalled))); |
|
564 return preInstalled; |
|
565 } |
|
566 |
|
567 EXPORT_C TBool RSisRegistryEntry::IsDeletablePreInstalledL() |
|
568 { |
|
569 TBool deletablePreInstalled = EFalse; |
|
570 TPckg<TBool> deletablePreInstalledPckg(deletablePreInstalled); |
|
571 |
|
572 User::LeaveIfError(SendReceive(EDeletablePreInstalled, TIpcArgs(&deletablePreInstalledPckg))); |
|
573 return deletablePreInstalled; |
|
574 } |
|
575 |
|
576 |
|
577 EXPORT_C void RSisRegistryEntry::DependentPackagesL(RPointerArray<CSisRegistryPackage>& aPackages) |
|
578 { |
|
579 HBufC8* buffer = SendReceiveBufferLC(EDependentPackages); |
|
580 |
|
581 // create a stream based on the buffer |
|
582 RDesReadStream stream(*buffer); |
|
583 CleanupClosePushL(stream); |
|
584 |
|
585 // reassemble the array from the stream |
|
586 InternalizePointerArrayL(aPackages, stream); |
|
587 |
|
588 CleanupStack::PopAndDestroy(2, buffer); // buffer, stream |
|
589 } |
|
590 |
|
591 EXPORT_C void RSisRegistryEntry::DependenciesL(RPointerArray<CSisRegistryDependency>& aDependencies) |
|
592 { |
|
593 HBufC8* buffer = SendReceiveBufferLC(EDependencies); |
|
594 |
|
595 // create a stream based on the buffer |
|
596 RDesReadStream stream(*buffer); |
|
597 CleanupClosePushL(stream); |
|
598 |
|
599 // reassemble the array from the stream |
|
600 InternalizePointerArrayL(aDependencies, stream); |
|
601 |
|
602 CleanupStack::PopAndDestroy(2, buffer); // buffer, stream |
|
603 } |
|
604 |
|
605 EXPORT_C void RSisRegistryEntry::EmbeddedPackagesL(RPointerArray<CSisRegistryPackage>& aPackages) |
|
606 { |
|
607 HBufC8* buffer = SendReceiveBufferLC(EEmbeddedPackages); |
|
608 |
|
609 // create a stream based on the buffer |
|
610 RDesReadStream stream(*buffer); |
|
611 CleanupClosePushL(stream); |
|
612 |
|
613 // reassemble the array from the stream |
|
614 InternalizePointerArrayL(aPackages, stream); |
|
615 |
|
616 CleanupStack::PopAndDestroy(2, buffer); // buffer, stream |
|
617 } |
|
618 |
|
619 EXPORT_C void RSisRegistryEntry::EmbeddingPackagesL(RPointerArray<CSisRegistryPackage>& aEmbeddingPackages) |
|
620 { |
|
621 HBufC8* buffer = SendReceiveBufferLC(EEmbeddingPackages); |
|
622 |
|
623 // create a stream based on the buffer |
|
624 RDesReadStream stream(*buffer); |
|
625 CleanupClosePushL(stream); |
|
626 |
|
627 // reassemble the array from the stream |
|
628 InternalizePointerArrayL(aEmbeddingPackages, stream); |
|
629 |
|
630 CleanupStack::PopAndDestroy(2, buffer); // buffer, stream |
|
631 } |
|
632 |
|
633 EXPORT_C TBool RSisRegistryEntry::IsSignedBySuCertL() |
|
634 { |
|
635 TBool signedSuCert = EFalse; |
|
636 TPckg<TBool> signedSuCertPckg(signedSuCert); |
|
637 |
|
638 User::LeaveIfError(SendReceive(ESignedBySuCert, TIpcArgs(&signedSuCertPckg))); |
|
639 return signedSuCert; |
|
640 } |
|
641 |