persistentstorage/sql/SRC/Client/SqlDbSession.cpp
branchRCL_3
changeset 11 211563e4b919
parent 8 fa9941cf3867
child 23 26645d81f48d
equal deleted inserted replaced
10:31a8f755b7fe 11:211563e4b919
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   194 		return KErrNoMemory;	
   194 		return KErrNoMemory;	
   195 		}
   195 		}
   196 	TPtr8 bufPtr = buf->Des();
   196 	TPtr8 bufPtr = buf->Des();
   197 	RDesWriteStream out(bufPtr);
   197 	RDesWriteStream out(bufPtr);
   198 	TRAPD(err, SerializeToStreamL(out));
   198 	TRAPD(err, SerializeToStreamL(out));
   199 	if(err == KErrNone)
   199 	__SQLASSERT(err == KErrNone, ESqlPanicInternalError);//"Write to descriptor" streaming operatons can't fail
   200 		{
   200     TUint32 arg0 = (TUint32)bufPtr.Length() | (aReadOnly ? 0x80000000 : 0);
   201 		TUint32 arg0 = (TUint32)bufPtr.Length() | (aReadOnly ? 0x80000000 : 0);
   201     TIpcArgs ipcArgs(arg0, &bufPtr);
   202 		TIpcArgs ipcArgs(arg0, &bufPtr);
   202     err = aDbFile.TransferToServer(ipcArgs, 2, 3);
   203 		err = aDbFile.TransferToServer(ipcArgs, 2, 3);
   203     if(err == KErrNone)
   204 		if(err == KErrNone)
   204         {
   205 			{
   205         err = iDbSession.SendReceive(ESqlSrvDbAttachFromHandle, ipcArgs);
   206 			err = iDbSession.SendReceive(ESqlSrvDbAttachFromHandle, ipcArgs);
   206         }
   207 			}
       
   208 		}
       
   209 	delete buf;
   207 	delete buf;
   210 	return err;
   208 	return err;
   211 	}
   209 	}
   212 	
   210 	
   213 /**
   211 /**