installationservices/swinstallationfw/source/sifcommon.cpp
changeset 75 2d2d25361590
parent 55 ac7f90a6ff4c
equal deleted inserted replaced
69:b18a4bf55ddb 75:2d2d25361590
   585 	}
   585 	}
   586 
   586 
   587 void COpaqueNamedParams::VerifyExternalizedSizeForNewParamArrayL(TInt aNameSize, TInt aValueSize) const
   587 void COpaqueNamedParams::VerifyExternalizedSizeForNewParamArrayL(TInt aNameSize, TInt aValueSize) const
   588 	{
   588 	{
   589 	const TInt load = 2*sizeof(TInt) + aNameSize + aValueSize;
   589 	const TInt load = 2*sizeof(TInt) + aNameSize + aValueSize;
   590 	if (aNameSize > KMaxOpaqueParamsDescriptorSize || iExternalizedSize + load > KMaxOpaqueParamsExternalizedSize)
   590 	if (aNameSize > KMaxOpaqueParamNameDescriptorSize || iExternalizedSize + load > KMaxOpaqueParamsExternalizedSize)
   591 		{
   591 		{
   592 		User::Leave(KErrOverflow);
   592 		User::Leave(KErrOverflow);
   593 		}
   593 		}
   594 	iExternalizedSize += load;
   594 	iExternalizedSize += load;
   595 	}
   595 	}
   942     return iSize;
   942     return iSize;
   943     }
   943     }
   944 
   944 
   945 void CItemBase::VerifyExternalizedSizeForParamL(TUint aValueSize) const
   945 void CItemBase::VerifyExternalizedSizeForParamL(TUint aValueSize) const
   946     {
   946     {
   947     if(aValueSize > KMaxOpaqueParamsDescriptorSize)
   947     if(aValueSize > KMaxOpaqueParamValueDescriptorSize)
   948         {
   948         {
   949         User::Leave(KErrOverflow);
   949         User::Leave(KErrOverflow);
   950         }
   950         }
   951     }
   951     }
   952 
   952 
   957     }
   957     }
   958 
   958 
   959 void CItemBase::InternalizeL (RReadStream& aStream)
   959 void CItemBase::InternalizeL (RReadStream& aStream)
   960     {
   960     {
   961     delete iName;
   961     delete iName;
   962     iName = HBufC::NewL(aStream, KMaxOpaqueParamsDescriptorSize);
   962     iName = HBufC::NewL(aStream, KMaxOpaqueParamNameDescriptorSize);
   963     iSize = aStream.ReadInt32L();
   963     iSize = aStream.ReadInt32L();
   964     }
   964     }
   965     
   965     
   966 /*
   966 /*
   967  * CStringItem
   967  * CStringItem
  1011 
  1011 
  1012 void CStringItem::InternalizeL(RReadStream& aStream)
  1012 void CStringItem::InternalizeL(RReadStream& aStream)
  1013     {
  1013     {
  1014     CItemBase::InternalizeL(aStream);
  1014     CItemBase::InternalizeL(aStream);
  1015     DeleteObjectZ(iString);
  1015     DeleteObjectZ(iString);
  1016     iString = HBufC::NewL(aStream, KMaxOpaqueParamsDescriptorSize);
  1016     iString = HBufC::NewL(aStream, KMaxOpaqueParamValueDescriptorSize);
  1017     }
  1017     }
  1018 
  1018 
  1019 const TDesC& CStringItem::StringValue() const
  1019 const TDesC& CStringItem::StringValue() const
  1020     {
  1020     {
  1021     return *iString;
  1021     return *iString;