dosservices/dosserver/src/doscliextension.cpp
changeset 0 4e1aa6a622a0
child 15 b2f9f823b5fb
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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 *    Implementation for the RDosExtension class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "DosSvrServices.h"
       
    21 #include "dosclientserver.h"
       
    22 #include "dos_debug.h"
       
    23 
       
    24 //
       
    25 // ---------------------------------------------------------
       
    26 // RDosExtension::Open
       
    27 // ---------------------------------------------------------
       
    28 //  
       
    29 EXPORT_C TInt RDosExtension::Open(RDosServer& aServer)
       
    30 {
       
    31     API_TRACE_( "[DOSSERVER] RDosExtension::Open()" );
       
    32 
       
    33     return CreateSubSession(aServer,EDosCreateExtensionSubSession, TIpcArgs(TIpcArgs::ENothing, TIpcArgs::ENothing, KAutoComplete));
       
    34 }
       
    35 
       
    36 //
       
    37 // ---------------------------------------------------------
       
    38 // RDosExtension::CallFunction 
       
    39 // Synchronous, taking TAny*
       
    40 // ---------------------------------------------------------
       
    41 //  
       
    42 EXPORT_C TInt RDosExtension::CallFunction(TInt aFunc, TAny *aParameter, TInt aParLength, TBool aAutoComplete) 
       
    43 {
       
    44     API_TRACE_4( "[DOSSERVER] RDosExtension::CallFunction(0x%x, 0x%x, 0x%x, 0x%x)", aFunc, aParameter, aParLength, aAutoComplete );
       
    45 
       
    46     TExtensionParPckg parInfo;
       
    47 	TPtr8 parData(static_cast<TUint8*>(aParameter), aParLength, aParLength);
       
    48 
       
    49 	parInfo().iFunc = aFunc;
       
    50 	parInfo().iParLength = aParLength;
       
    51 	parInfo().iAutoComplete = aAutoComplete;
       
    52 
       
    53 	return CallFunction(parInfo, parData);
       
    54 }
       
    55 
       
    56 //
       
    57 // ---------------------------------------------------------
       
    58 // RDosExtension::CallFunction 
       
    59 // Synchronous, taking descriptor
       
    60 // ---------------------------------------------------------
       
    61 //  
       
    62 EXPORT_C TInt RDosExtension::CallFunction(const TExtensionParPckg& aParamInfo, TDes8& aParameter)
       
    63 {
       
    64     API_TRACE_4( "[DOSSERVER] RDosExtension::CallFunction(0x%x, 0x%x, 0x%x, 0x%x)"
       
    65         , aParamInfo().iFunc, aParamInfo().iParLength, aParamInfo().iAutoComplete, &aParameter );
       
    66 
       
    67     return SendReceive(ECallFunction, TIpcArgs(&aParamInfo, &aParameter, aParamInfo().iAutoComplete));
       
    68 }
       
    69 
       
    70 //
       
    71 // ---------------------------------------------------------
       
    72 // RDosExtension::CallFunction
       
    73 // Asynchronous, taking descriptor
       
    74 // ---------------------------------------------------------
       
    75 //  
       
    76 EXPORT_C void RDosExtension::CallFunction(TRequestStatus& aStatus, const TExtensionParPckg& aParamInfo, TDes8& aParameter)
       
    77 {
       
    78     API_TRACE_1( "[DOSSERVER] RDosExtension::CallFunction(0x%x)", aStatus.Int() );
       
    79     API_TRACE_4( "[DOSSERVER] RDosExtension::CallFunction(0x%x, 0x%x, 0x%x, 0x%x)"
       
    80         ,aParamInfo().iFunc, aParamInfo().iParLength, aParamInfo().iAutoComplete, &aParameter );
       
    81 
       
    82     SendReceive(ECallFunction, TIpcArgs(&aParamInfo, &aParameter, aParamInfo().iAutoComplete), aStatus);
       
    83 }
       
    84