Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // HDbsBuf class - "DBMS security" related code only
22 Standard phase-one factory method for HDbsBuf instances.
23 @param aDbSession RDbs session instance.
24 @param aFunction DBMS server function code. EDbsDatabaseList DBMS function code is only used.
25 @param aArgs EDbsDatabaseList related set of arguments.
26 @return A pointer to the created HDbsBuf instance.
27 @leave One of the system-wide error codes, including KErrNoMemory.
29 HDbsBuf* HDbsBuf::NewLC(const RDbs& aDbSession, TDbsFunction aFunction, TIpcArgs& aArgs)
31 HDbsBuf* self = new (ELeave) HDbsBuf;
33 self->ConstructL(aDbSession, aFunction, aArgs);
38 Standard phase-two construction method for HDbsBuf instances.
39 @param aDbSession RDbs session instance.
40 @param aFunction DBMS server function code. EDbsDatabaseList DBMS function code is only used.
41 @param aArgs EDbsDatabaseList related set of arguments.
42 @leave One of the system-wide error codes, including KErrNoMemory.
44 void HDbsBuf::ConstructL(const RDbs& aDbSession, TDbsFunction aFunction, TIpcArgs& aArgs)
46 TPckg<TDbsStreamBuf> pckg(iBuf);
48 iIpc.OpenL(aDbSession, aFunction, aArgs);
49 TUint8* base = iBuf.iData;
50 // if reading we already have one buffer-full of data
51 TInt avail = Max(0, Min(iBuf.iExt, KDbsStreamBufSize));
52 SetBuf(ERead, base, base + avail);
54 SetBuf(EWrite, base, base);