os/security/cryptomgmtlibs/securitycommonutils/source/scsclient/scsclientsubsessionbase.cpp
Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Defines the functionality which client-side subsession handles use
16 * to create and destroy subsessions, and to send messages to them.
26 #include <scs/scsclient.h>
27 #include <scs/scscommon.h>
29 using namespace ScsImpl;
32 EXPORT_C RScsClientSubsessionBase::RScsClientSubsessionBase()
34 This protected constructor prevents the class from being
35 instantiated directly.
42 EXPORT_C void RScsClientSubsessionBase::Close()
44 Closes the subsession, releasing resources on the server side.
47 CloseSubSession(ECloseSubsession);
50 EXPORT_C TInt RScsClientSubsessionBase::CreateSubsession(const RScsClientBase& aSession, TInt aFunction, const TIpcArgs& aArgs)
52 Create a subsession over the supplied session.
54 @param aSession Session which will host the subsession.
55 @param aFunction Command identifier. Bits 31:24 must be zero, because
56 they are reserved for SCS commands.
57 @param aArgs Standard IPC arguments. The fourth argument cannot be
58 used because that is reserved for the subsession handle.
59 @return Error code with which the server completed the request.
62 return RSubSessionBase::CreateSubSession(
64 ECreateSubsession | aFunction,
68 EXPORT_C TInt RScsClientSubsessionBase::CallSubsessionFunction(TInt aFunction) const
70 Send a command to the corresponding server-side subsession.
71 The subclass uses this function instead of directly calling
72 RSubSessionBase::SendReceive because it adds the SCS code which
73 marks this as a subsession call. Therefore, it can be routed
74 to the subsession object on the server side without any custom
77 @param aFunction Subsession command identifier. Bits 31:24 must be zero,
78 because they are reserved for SCS commands.
79 @return Error code with which the server completed the request.
82 __ASSERT_DEBUG(! ScsFieldUsed(aFunction), ClientSidePanic(EScsClNoArgsSubsessUsedScs));
84 TInt f = ECallSubsessionFunc | aFunction;
85 return RSubSessionBase::SendReceive(f);
88 EXPORT_C TInt RScsClientSubsessionBase::CallSubsessionFunction(TInt aFunction, const TIpcArgs& aArgs) const
90 Send a command to the corresponding server-side subsession.
91 The subclass uses this function instead of directly calling
92 RSubSessionBase::SendReceive because it adds the SCS code which
93 marks this as a subsession call. Therefore, it can be routed
94 to the subsession object on the server side without any custom
97 @param aFunction Subsession command identifier. Bits 31:24 must be zero,
98 because they are reserved for SCS commands.
99 @param aArgs Standard IPC arguments. The fourth argument cannot be
100 used because that is reserved for the subsession handle.
101 @return Error code with which the server completed the request.
104 __ASSERT_DEBUG(! ScsFieldUsed(aFunction), ClientSidePanic(EScsClArgsSubsessUsedScs));
106 TInt f = ECallSubsessionFunc | aFunction;
107 return RSubSessionBase::SendReceive(f, aArgs);
110 EXPORT_C void RScsClientSubsessionBase::CallSubsessionFunction(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus) const
112 Send a command to the corresponding server-side subsession.
114 @param aFunction Subsession command identifier. Bits 31:24 must be zero,
115 because they are reserved for SCS commands.
116 @param aArgs Standard IPC arguments. The fourth argument cannot be
117 used because that is reserved for the subsession handle.
118 @param aStatus The server completes this object when it has finished
119 handling the session.
122 __ASSERT_DEBUG(! ScsFieldUsed(aFunction), ClientSidePanic(EScsClArgsSubsessAsyncUsedScs));
124 TInt f = ECallSubsessionFunc | aFunction;
125 RSubSessionBase::SendReceive(f, aArgs, aStatus);
128 EXPORT_C void RScsClientSubsessionBase::CancelSubsessionFunction(TInt aFunction) const
130 Cancel an outstanding subsession request. This has no effect if the
131 request is not outstanding.
133 @param aFunction Implementation function. This must be the
134 same value that was supplied to CallSubsessionFunction.
137 __ASSERT_DEBUG(! ScsFieldUsed(aFunction), ClientSidePanic(EScsClCancelSubsessUsedScs));
139 TInt f = ECancelSubsessionFunc | aFunction;
140 RSubSessionBase::SendReceive(f);