kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp
changeset 247 d8d70de2bd36
child 253 d37db4dcc88d
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
       
     1 /*
       
     2 * Copyright (c) 2010 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 "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 *
       
    16 */
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 
       
    24 #include "tranhandleserver.h"
       
    25 #include "tranhandlesession.h"
       
    26 #include "tranhandleserversecuritypolicy.h"
       
    27 #include "tranhandleserverconsts.h"
       
    28 #include "general.h"
       
    29 
       
    30 
       
    31 
       
    32 CTranHandleServer* CTranHandleServer::NewL(CActiveControl& aControl)
       
    33     {
       
    34     RDebug::Printf("CTranHandleServer::NewL");
       
    35     CTranHandleServer* self = new(ELeave) CTranHandleServer(aControl);
       
    36     CleanupStack::PushL(self);
       
    37     TInt err = self->Start(KTranHandleServerName);
       
    38 
       
    39     if ( err != KErrAlreadyExists )
       
    40         {
       
    41         User::LeaveIfError(err);
       
    42         }
       
    43     CleanupStack::Pop(self);
       
    44     return self;
       
    45     }
       
    46 
       
    47 CTranHandleServer::~CTranHandleServer()
       
    48     {
       
    49     RDebug::Printf("CTranHandleServer::~CTranHandleServer");
       
    50     }
       
    51 
       
    52 CTranHandleServer::CTranHandleServer(CActiveControl& aControl)
       
    53  :  CPolicyServer(CActive::EPriorityStandard, KTranHandleServerPolicy, ESharableSessions),
       
    54     iActiveControl(aControl)
       
    55     {
       
    56     }
       
    57 
       
    58 CSession2* CTranHandleServer::NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const
       
    59     {
       
    60     //Validate session as coming from UsbSvr
       
    61 	RDebug::Printf("CTranHandleServer::NewSessionL");
       
    62     CTranHandleSession* sess = CTranHandleSession::NewL(iActiveControl);
       
    63     return sess;
       
    64     }