/** Handle a client request. Leaving is handled by CEglContentSession::ServiceError() which reports the error code to the client */ void CEglContentSession::ServiceL(const RMessage2& aMessage) { switch(aMessage.Function()) { case ETerminateServer: { aMessage.Complete(KErrNone); CActiveScheduler::Stop(); break; } case EGetSyncImage: { // Get the current image synchronously, the frame // number is not returned as the client will already know the frame number // as it controls when a frame is drawn TSgDrawableId id; Server().GetSyncImage(id); TPckg<TSgDrawableId> idPckg(id); aMessage.Write(0, idPckg); aMessage.Complete(KErrNone); break; } case EGetAsyncImage: { // Get the current image and it's frame number, the drawing is // asynchronous so the client needs to know which one this as it cannot tell otherwise TSgDrawableId id; TInt fnum = Server().GetAsyncImage(id); TPckg<TSgDrawableId> idPckg(id); aMessage.Write(0, idPckg); TPckg<TInt> fnumPckg(fnum); aMessage.Write(1, fnumPckg); aMessage.Complete(KErrNone); break; } case EGetAsyncImageDebug: { // Get the current image and it's frame number, the drawing is // asynchronous so the client needs to know which one this as it cannot tell otherwise TSgDrawableId id; TInt fnum = Server().GetAsyncImageDebug(id); TPckg<TSgDrawableId> idPckg(id); aMessage.Write(0, idPckg); TPckg<TInt> fnumPckg(fnum); aMessage.Write(1, fnumPckg); aMessage.Complete(KErrNone); break; } default: { PanicClient(aMessage, EPanicIllegalFunction); } } }
void CStsServerSession::DoRegisterMsgQueueL(const RMessage2& aMessage) { TInt result = iMsgQueue.Open(aMessage, 0); if (result == KErrNone) { TThreadId id = RThread().Id(); TPckg<TThreadId> idPckg(id); TRAP(result,aMessage.Write(1, idPckg)); } aMessage.Complete(result); }
void CCntItemMsgHandler::SeekContactL(const RMessage2& aMessage) { CheckForManagerL(); MLplCollection& collection = iManager->GetPersistenceLayer().FactoryL().GetCollectorL(); TContactItemId actualId; TUid contactType; TBool deleted(EFalse); // SeekContactL returns the Deleted Flag, the Contact ID and the // contact type. TBool seekRet = collection.SeekContactL(aMessage.Int0(),actualId,contactType,deleted); if(seekRet) { TPckg<TInt> idPckg(actualId); aMessage.WriteL(1,idPckg); TPckg<TUid> typePckg(contactType); aMessage.WriteL(2,typePckg); TPckg<TInt> deletePckg(deleted); aMessage.WriteL(3,deletePckg); } aMessage.Complete(seekRet); }