|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052" xml:lang="en"><title>Migrating |
|
13 to V2 client-server APIs</title><shortdesc>Describes how to modify client-server implementations to use the |
|
14 new Version 2 client-server APIs instead of the deprecated Version 1 APIs.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>The new APIs have been introduced as part of the effort to provide a more |
|
16 secure interface for client-server communications, and form an essential component |
|
17 of Platform Security in Symbian platform. </p> |
|
18 <ul> |
|
19 <li id="GUID-C53A38E9-A821-577A-930A-F478954FF806"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-35D3BD7A-8C16-50C3-80AD-2422E3B92AAB">General points</xref> </p> </li> |
|
20 <li id="GUID-FD82A424-BDB5-5DE7-8904-C579C7683CA1"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-0FA5EC5C-8F7B-5E95-BE28-CD0DB6BDCBEE">The Version 1 client-server APIs</xref> </p> </li> |
|
21 <li id="GUID-63746CDF-E64B-5BA0-A133-8DFD0FA9FCF5"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-8BDFF94E-80E6-5CAF-8CC0-04D7F74FAF43">The Version 2 client-server APIs</xref> </p> </li> |
|
22 <li id="GUID-87719C35-00EB-51BE-8D01-6955535C6B4A"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-C5A1C9BA-7637-53EB-9898-A58336F87389">Changes to the client interface</xref> </p> </li> |
|
23 <li id="GUID-CFDDD4B4-DD54-5F9C-B60D-D361EA621670"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-450BE510-C3C9-5988-853B-1A03A84F0875">Changes to the server interface</xref> </p> </li> |
|
24 <li id="GUID-30E36FBF-25EA-5347-810E-D2C85F853CCD"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-07F7FFA6-D421-54E2-90F7-69F002702C46">Using RMessagePtr2</xref> </p> </li> |
|
25 <li id="GUID-A2E1CEF3-BD6F-594D-B4DC-098FBABBC6F4"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-1ABF5DC6-A957-5623-93AB-CD7631A36A33">Migration quick reference</xref> </p> </li> |
|
26 </ul> |
|
27 <section id="GUID-35D3BD7A-8C16-50C3-80AD-2422E3B92AAB"><title>General points</title> <p>The |
|
28 user library, EUSER.DLL, makes both the Version 1 and Version 2 client-server |
|
29 APIs available. However, it is possible to 'hide' the Version 1 APIs during |
|
30 compilation by defining the C pre-processor macro <codeph>__HIDE_IPC_V1__</codeph>. </p> <p>For |
|
31 example, by adding the following line to a component's MMP file: </p> <codeblock id="GUID-048E20E3-1E8C-5F08-9E40-CE0A43849AD5" xml:space="preserve">macro __HIDE_IPC_V1__</codeblock> <p>This |
|
32 can also be done globally for all components in Symbian platform by defining |
|
33 the macro in the platform's HRH file: </p> <codeblock id="GUID-30C6F786-CB13-5962-80E5-5ACBB5879B8C" xml:space="preserve">#define __HIDE_IPC_V1__</codeblock> <p>In |
|
34 addition, the EUSER header files define the macro <codeph>__IPC_V2_PRESENT__</codeph>, |
|
35 which allows source code that still needs to compile with older Symbian platform |
|
36 releases, to detect the presence of the new APIs, and use conditional compilation |
|
37 as appropriate. </p> </section> |
|
38 <section id="GUID-0FA5EC5C-8F7B-5E95-BE28-CD0DB6BDCBEE"><title>The Version |
|
39 1 client-server APIs</title> <p>The following classes and functions are defined |
|
40 as constituting the Version 1 client-server APIs: </p> <codeblock id="GUID-339D79DC-B401-5F09-B5A2-3D3EE10B3D63" xml:space="preserve">class CSharableSession |
|
41 class CSession |
|
42 class CServer |
|
43 class RMessagePtr |
|
44 class RMessage |
|
45 class RServer |
|
46 |
|
47 RSessionBase::Share(TAttachMode aAttachMode=EExplicitAttach) |
|
48 RSessionBase::Attach() |
|
49 RSessionBase::Send(TInt aFunction,TAny* aPtr) |
|
50 RSessionBase::SendReceive(TInt aFunction,TAny* aPtr,TRequestStatus& aStatus) |
|
51 RSessionBase::SendReceive(TInt aFunction,TAny* aPtr) |
|
52 |
|
53 RSubSessionBase::CreateSubSession(RSessionBase&,TInt aFunction,const TAny* aPtr) |
|
54 RSubSessionBase::Send(TInt aFunction,const TAny* aPtr) |
|
55 RSubSessionBase::SendReceive(TInt aFunction,const TAny* aPtr,TRequestStatus&) |
|
56 RSubSessionBase::SendReceive(TInt aFunction,const TAny* aPtr) |
|
57 |
|
58 RThread::GetDesLength(const TAny* aPtr) |
|
59 RThread::GetDesMaxLength(const TAny* aPtr) |
|
60 RThread::ReadL(const TAny* aPtr,TDes8& aDes,TInt anOffset) |
|
61 RThread::ReadL(const TAny* aPtr,TDes16 &aDes,TInt anOffset) |
|
62 RThread::WriteL(const TAny* aPtr,const TDesC8& aDes,TInt anOffset) |
|
63 RThread::WriteL(const TAny* aPtr,const TDesC16& aDes,TInt anOffset)</codeblock> <p>The |
|
64 following functions are considered part of the client-server Version 1 APIs, |
|
65 when the target thread is in another process. Note that these APIs are <i>not</i> hidden |
|
66 by the <codeph>__HIDE_IPC_V1__</codeph> macro. </p> <codeblock id="GUID-BDAF69BC-F736-5E2F-9E7C-37B9AAC75A0E" xml:space="preserve">RThread::RequestComplete(TRequestStatus*& aStatus,TInt aReason) |
|
67 RThread::Kill(TInt aReason) |
|
68 RThread::Terminate(TInt aReason) |
|
69 RThread::Panic(const TDesC& aCategory,TInt aReason) |
|
70 </codeblock> </section> |
|
71 <section id="GUID-8BDFF94E-80E6-5CAF-8CC0-04D7F74FAF43"><title>The Version |
|
72 2 client-server APIs</title> <p>The following classes and functions are defined |
|
73 as constituting the Version 2 client-server APIs. </p> <codeblock id="GUID-E2EDBA7A-5668-52F4-BCF1-18F53A2DD1E9" xml:space="preserve">class CSession2 |
|
74 class CServer2 |
|
75 class RMessagePtr2 |
|
76 class RMessage2 |
|
77 class RServer2 |
|
78 class TIpcArgs |
|
79 |
|
80 RSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) |
|
81 RSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs, TRequestStatus&) |
|
82 RSessionBase::SendReceive(TInt aFunction, const TIpcArgs& aArgs) |
|
83 RSessionBase::ShareAuto() |
|
84 |
|
85 RSubSessionBase::CreateSubSession(RSessionBase&,TInt aFunction,const TIpcArgs&) |
|
86 RSubSessionBase::Send(TInt aFunction,const TIpcArgs& aArgs) |
|
87 RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs, TRequestStatus&) |
|
88 RSubSessionBase::SendReceive(TInt aFunction,const TIpcArgs& aArgs)</codeblock> </section> |
|
89 <section id="GUID-C5A1C9BA-7637-53EB-9898-A58336F87389"><title>Changes to |
|
90 the client interface</title> <p>The client interface to a server consists |
|
91 of a class derived either from <codeph>RSessionBase</codeph> or <codeph>RSubSessionBase</codeph>. |
|
92 This section lists the changes required to the use of these classes. </p> <ul> |
|
93 <li id="GUID-65CF4ED6-3133-5452-800C-F1EDA040B7C2"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-F5FB0FB3-6868-5B26-99A5-62082BFA87FD">RSessionBase::Share()</xref> </p> </li> |
|
94 <li id="GUID-93211175-EBE0-5C2E-9F67-3BFF6E50E5DD"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-68B92D5D-7786-51CD-9A3D-7C835FD64496">RSessionBase::Attach()</xref> </p> </li> |
|
95 <li id="GUID-596E1B2A-E1FF-553B-A257-A4091DD15F1A"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-8AF1B8B3-F598-5318-B9F9-5C74EEE8FCC9">RSessionBase::Send() & RSessionBase::SendReceive()</xref> </p> </li> |
|
96 <li id="GUID-E88F13D3-C4C9-5624-A90B-2CC3EA841D5D"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-449D6257-772B-5E08-8E4B-40C11EAF8FBA">RSubSessionBase::CreateSubSession()</xref> </p> </li> |
|
97 <li id="GUID-B28619D3-BDE6-5434-AB33-3016BA200633"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-858A58D1-A539-55FB-855E-50B997BA9A41">RSubSessionBase::Send() & RSubSessionBase::SendReceive()</xref> </p> </li> |
|
98 </ul> <p id="GUID-F5FB0FB3-6868-5B26-99A5-62082BFA87FD"><b>RSessionBase::Share()</b> </p> <table id="GUID-175135E8-8583-53E4-8829-88738EEFA357"> |
|
99 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
100 <tbody> |
|
101 <row> |
|
102 <entry><p>Version 1 functions: </p> </entry> |
|
103 <entry><codeblock id="GUID-3A5C2CAB-646B-5C1F-BA30-9808202B61E5" xml:space="preserve">Share() |
|
104 Share(EExplicitAttach) |
|
105 Share(EAutoAttach)</codeblock> </entry> |
|
106 </row> |
|
107 <row> |
|
108 <entry><p>Version 2 function: </p> </entry> |
|
109 <entry><codeblock id="GUID-D946029A-A553-5BB3-B868-5348D06CF11E" xml:space="preserve">ShareAuto()</codeblock> </entry> |
|
110 </row> |
|
111 </tbody> |
|
112 </tgroup> |
|
113 </table> <p>In Version 1, the two different share modes existed for historical |
|
114 reasons. All sessions created with new Version 2 servers behave like the Version |
|
115 1 <i>auto attach</i> sessions; there is no <i>explicit attach</i> sharing |
|
116 mode. The new <codeph>ShareAuto()</codeph> function should be used to replace |
|
117 all occurrences of <codeph>Share()</codeph>. </p> <p id="GUID-68B92D5D-7786-51CD-9A3D-7C835FD64496"><b>RSessionBase::Attach()</b> </p> <table id="GUID-43575561-41F7-5F61-ADF2-06892D06941B"> |
|
118 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
119 <tbody> |
|
120 <row> |
|
121 <entry><p>Version 1 function: </p> </entry> |
|
122 <entry><codeblock id="GUID-4E94517B-AAD4-5A7C-8B67-19E2DABF99BF" xml:space="preserve">Attach()</codeblock> </entry> |
|
123 </row> |
|
124 <row> |
|
125 <entry><p>Version 2 function: </p> </entry> |
|
126 <entry><p>NONE </p> </entry> |
|
127 </row> |
|
128 </tbody> |
|
129 </tgroup> |
|
130 </table> <p>There is no explicit attach mode in the Version 2 API, (see <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-F5FB0FB3-6868-5B26-99A5-62082BFA87FD">RSessionBase::Share()</xref>). |
|
131 This means that all occurrences of <codeph>Attach()</codeph> must be removed |
|
132 from your code when migrating. </p> <p id="GUID-8AF1B8B3-F598-5318-B9F9-5C74EEE8FCC9"><b>RSessionBase::Send() & |
|
133 RSessionBase::SendReceive()</b> </p> <table id="GUID-BA09FDB1-4DF3-5D73-B314-1333E479FF35"> |
|
134 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
135 <tbody> |
|
136 <row> |
|
137 <entry><p>Version 1 functions: </p> </entry> |
|
138 <entry><codeblock id="GUID-7117993F-8620-598F-818B-769B91A94E02" xml:space="preserve">Send(TInt aFunction,TAny* aPtr) |
|
139 SendReceive(TInt aFunction,TAny* aPtr,TRequestStatus& aStatus) |
|
140 SendReceive(TInt aFunction,TAny* aPtr)</codeblock> </entry> |
|
141 </row> |
|
142 <row> |
|
143 <entry><p>Version 2 functions: </p> </entry> |
|
144 <entry><codeblock id="GUID-0A9B8E34-708E-531F-B6C3-2AD2EF9A831B" xml:space="preserve">Send(TInt aFunction,const TIpcArgs& aArgs) |
|
145 SendReceive(TInt aFunction,const TIpcArgs& aArgs, TRequestStatus& aStatus) |
|
146 SendReceive(TInt aFunction, const TIpcArgs& aArgs)</codeblock> </entry> |
|
147 </row> |
|
148 </tbody> |
|
149 </tgroup> |
|
150 </table> <p>These are functions for sending request messages to a server. |
|
151 Each of these messages can take up to <codeph>KMaxMessageArguments</codeph> arbitrary |
|
152 arguments (i.e. 4 arguments), and it is the packaging of these arguments which |
|
153 has been changed in the Version 2 APIs. </p> <p>The Version 1 APIs take a <codeph>TAny*</codeph>, |
|
154 which points to a C array containing a <codeph>KMaxMessageArguments</codeph> number |
|
155 of 32-bit quantities, usually <codeph>TAny</codeph> * or <codeph>TInt</codeph> types. |
|
156 This is an example Version 1 client function: </p> <codeblock id="GUID-5FF9D271-11EC-5144-A3ED-8D0B65DD43E1" xml:space="preserve">TInt RMySession::Write(TDes8C& aDes, TInt aLength, TInt aMode) |
|
157 { |
|
158 TAny* args[KMaxMessageArguments]; |
|
159 args[0]=&aDes; |
|
160 args[1]=(TAny*)aLength; |
|
161 args[2]=(TAny*)aMode; |
|
162 return SendReceive(ERequestWrite, &args[0]); |
|
163 }</codeblock> <p>The Version 2 APIs package all of the arguments into |
|
164 a <codeph>TIpcArgs</codeph> object. This has templated constructors that take |
|
165 between 0 and 4 objects. The above example would be implemented like this |
|
166 using the Version 2 APIs: </p> <codeblock id="GUID-3AD69C4D-B00D-5384-9455-4529235ADC0B" xml:space="preserve">TInt RMySession::Write(TDes8& aDes, TInt aLength, TInt aMode) |
|
167 { |
|
168 TIpcArgs args(&aDes, aLength, aMode); |
|
169 return SendReceive(ERequestWrite, args); |
|
170 }</codeblock> <p>This could also be written in a shorter way: </p> <codeblock id="GUID-9F904E6F-C2BE-57C9-B287-F25D4C743B54" xml:space="preserve">TInt RMySession::Write(TDes8C& aDes, TInt aLength, TInt aMode) |
|
171 { |
|
172 return SendReceive(ERequestWrite, TIpcArgs(&aDes, aLength, aMode) ); |
|
173 }</codeblock> <p>The <codeph>TIpcArgs</codeph> object stores additional |
|
174 type information for each argument, and this is used to validate a server's |
|
175 usage of the arguments with the various <codeph>RMessagePtr2::Read()</codeph> and <codeph>RMessagePtr2::Write()</codeph> functions. </p> <p>If |
|
176 you need to explicitly send an empty or unused argument to a server, then |
|
177 use the <codeph>ENothing</codeph> enumeration. For example: </p> <codeblock id="GUID-1AFAE8D7-6EF1-531C-9605-249952DD3414" xml:space="preserve">TIpcArgs args(arg1, TIpcArgs::ENothing, arg3);</codeblock> <p>The |
|
178 second argument will have an undefined value when the server receives the |
|
179 message. </p> <p id="GUID-449D6257-772B-5E08-8E4B-40C11EAF8FBA"><b>RSubSessionBase::CreateSubSession()</b> </p> <table id="GUID-D11D839A-A6DC-56F6-A375-715C3C20DB58"> |
|
180 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
181 <tbody> |
|
182 <row> |
|
183 <entry><p>Version 1 function: </p> </entry> |
|
184 <entry><codeblock id="GUID-C10014FE-A269-55B4-8D7C-AFA726A7468D" xml:space="preserve">CreateSubSession(RSessionBase& aSession,TInt aFunction,const TAny* aPtr)</codeblock> </entry> |
|
185 </row> |
|
186 <row> |
|
187 <entry><p>Version 2 function: </p> </entry> |
|
188 <entry><codeblock id="GUID-4EDF33FA-B99D-5089-AB2E-F6DD29814FA7" xml:space="preserve">CreateSubSession(RSessionBase, TInt aFunction, const TIpcArgs& aArgs)</codeblock> </entry> |
|
189 </row> |
|
190 </tbody> |
|
191 </tgroup> |
|
192 </table> <p>The message arguments supplied to this function use a <codeph>TIpcArgs</codeph> object |
|
193 in Version 2. This is for the same reason as described in <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-8AF1B8B3-F598-5318-B9F9-5C74EEE8FCC9">RSessionBase::Send() & RSessionBase::SendReceive()</xref>. </p> <p id="GUID-858A58D1-A539-55FB-855E-50B997BA9A41"><b>RSubSessionBase::Send() |
|
194 & RSubSessionBase::SendReceive()</b> </p> <table id="GUID-3357BA2C-42CF-5590-94EE-0AC5C46C463B"> |
|
195 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
196 <tbody> |
|
197 <row> |
|
198 <entry><p>Version 1 functions: </p> </entry> |
|
199 <entry><codeblock id="GUID-4CCEAB86-160A-50DD-B2AD-63BAD6E865C7" xml:space="preserve">Send(TInt aFunction,const TAny* aPtr) |
|
200 SendReceive(TInt aFunction,const TAny* aPtr,TRequestStatus&) |
|
201 SendReceive(TInt aFunction,const TAny* aPtr)</codeblock> </entry> |
|
202 </row> |
|
203 <row> |
|
204 <entry><p>Version 2 functions: </p> </entry> |
|
205 <entry><codeblock id="GUID-0E7FE44C-19E2-5F5C-98A7-04F9F7129C70" xml:space="preserve">Send(TInt aFunction,const TIpcArgs& aArgs) |
|
206 SendReceive(TInt aFunction,const TIpcArgs& aArgs, TRequestStatus&) |
|
207 SendReceive(TInt aFunction,const TIpcArgs& aArgs)</codeblock> </entry> |
|
208 </row> |
|
209 </tbody> |
|
210 </tgroup> |
|
211 </table> <p>The message arguments supplied to this function use a <codeph>TIpcArgs</codeph> object |
|
212 in Version 2. This is for the same reason as described in <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-8AF1B8B3-F598-5318-B9F9-5C74EEE8FCC9">RSessionBase::Send() & RSessionBase::SendReceive()</xref>. </p> </section> |
|
213 <section id="GUID-450BE510-C3C9-5988-853B-1A03A84F0875"><title>Changes to |
|
214 the server interface</title> <p>This section details the changes required |
|
215 to migrate a server implementation to the Version 2 APIs. These APIs have, |
|
216 in nearly all cases, been implemented using the same class names as in Version |
|
217 1, but with the addition of the suffix '2'. For example, <codeph>CServer2</codeph> implements |
|
218 the Version 2 APIs corresponding to the Version 1 functionality provided by <codeph>CServer</codeph>. </p> <ul> |
|
219 <li id="GUID-F2E4AB18-F24A-5EEF-B5CC-F8FBF947DE4E"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-43CF1E50-8E60-5633-97B7-B030D1DEC182">CServer</xref> </p> </li> |
|
220 <li id="GUID-7A262AF7-DBBD-5765-8179-F72E288304B2"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-B05AFD51-FF98-5972-9F40-107D8F8FEA5A">CServer::NewSessionL()</xref> </p> </li> |
|
221 <li id="GUID-1E1E1D8C-5BA5-5116-99B0-41453000DEE5"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-77592C37-AF3E-59DE-981E-AF23B442163B">CSharableSession</xref> </p> </li> |
|
222 <li id="GUID-C02F715E-6DF6-5AB0-A607-D740F32ADCEF"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-1616B87E-A4C3-509B-AF79-D4A964032BF1">CSharableSession::CreateL()</xref> </p> </li> |
|
223 <li id="GUID-3D09C142-DCF5-5FC6-99CC-A54D2FBECFBF"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-868E4703-DD82-5145-809D-91908237266C">CSharableSession::ResourceCountMarkEnd()</xref> </p> </li> |
|
224 <li id="GUID-38A6E9AB-4804-5852-907D-264F0CDA6D0B"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-54BF8797-7AE5-57E0-B5FD-C36C45D8CFFB">CSharableSession::RMessage()</xref> </p> </li> |
|
225 <li id="GUID-69440B22-6333-5783-A129-AFFFF7639068"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-F62D83DD-2A1C-5745-9813-E6646FF167BB">CSession</xref> </p> </li> |
|
226 <li id="GUID-12DC701E-E313-5CFA-9113-077423AE1CFE"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-F0C1B0F6-BF72-5A52-84D1-E7E748D3E1A5">CSession::CSession()</xref> </p> </li> |
|
227 <li id="GUID-D1DE193D-A5E7-5A80-B317-2E657008B174"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-F2BB351E-73DA-522A-96ED-361F2EB1A379">RMessage</xref> </p> </li> |
|
228 <li id="GUID-606187D7-226C-5919-86D9-7881540D30D6"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-B0431DFE-C0E5-5767-A299-564EC502B01E">RMessage::Client()</xref> </p> </li> |
|
229 <li id="GUID-06E2F69F-ABEE-5AB8-9751-45E285C3B494"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-4EEFEF47-D875-5C16-8836-98DD03C0A91D">RMessage::MessagePtr()</xref> </p> </li> |
|
230 <li id="GUID-73BB6C0D-FEE3-5C9A-B2E6-7BFCD2C59C1B"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-8754F52F-371C-546B-9290-B5369E915318">RMessage::descriptor access methods</xref> </p> </li> |
|
231 <li id="GUID-CE72E73D-4BA9-566B-ABA0-6FC52F1E17EC"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-49869449-4440-5D20-97ED-32C14C5D1DAF">RMessagePtr</xref> </p> </li> |
|
232 <li id="GUID-F91895A2-E211-56AF-9DA8-372D312E5E1B"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-A94A9960-319C-51B5-B693-2538D3985004">RThread</xref> </p> </li> |
|
233 <li id="GUID-4C8AF2A5-72D9-5367-9A7E-3721CC94401F"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-9DA5C542-44B6-5277-837D-1D9150F43B10">RThread::RequestComplete()</xref> </p> </li> |
|
234 </ul> <p id="GUID-43CF1E50-8E60-5633-97B7-B030D1DEC182"><b>CServer</b> </p> <table id="GUID-BD8385C6-AEAA-5379-87F3-F3B3A9CA5397"> |
|
235 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
236 <tbody> |
|
237 <row> |
|
238 <entry><p>Version 1 class: </p> </entry> |
|
239 <entry><codeblock id="GUID-48ECE79F-22EA-5DE5-A52F-1F6689969E3C" xml:space="preserve">CServer</codeblock> </entry> |
|
240 </row> |
|
241 <row> |
|
242 <entry><p>Version 2 class: </p> </entry> |
|
243 <entry><codeblock id="GUID-F213E0FA-2708-5365-92F5-551D0A3B15FB" xml:space="preserve">CServer2</codeblock> </entry> |
|
244 </row> |
|
245 </tbody> |
|
246 </tgroup> |
|
247 </table> <p>Simply replace <codeph>CServer</codeph> with <codeph>CServer2</codeph>. </p> <p id="GUID-B05AFD51-FF98-5972-9F40-107D8F8FEA5A"><b>CServer::NewSessionL()</b> </p> <table id="GUID-1755D610-F3C5-50A8-9CE4-BE357883373B"> |
|
248 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
249 <tbody> |
|
250 <row> |
|
251 <entry><p>Version 1 function: </p> </entry> |
|
252 <entry><codeblock id="GUID-0E800CBB-6A25-5338-940C-93FD1D5EAB12" xml:space="preserve">CSharableSession* CServer::NewSessionL(const TVersion& aVersion) const</codeblock> </entry> |
|
253 </row> |
|
254 <row> |
|
255 <entry><p>Version 2 function: </p> </entry> |
|
256 <entry><codeblock id="GUID-515A05BB-AB3C-5231-B32A-C8812A55B414" xml:space="preserve">CSession2* CServer2::NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const</codeblock> </entry> |
|
257 </row> |
|
258 </tbody> |
|
259 </tgroup> |
|
260 </table> <p>In Version 1, <codeph>CServer::NewSessionL()</codeph> is implemented |
|
261 by a class derived from <codeph>CServer</codeph>. In Version 2, your derived |
|
262 class uses <codeph>CServer2</codeph> as the base class. </p> <p>The <codeph>RMessage2</codeph> argument |
|
263 in Version 2 is the 'connect' message from the client. It has been added to |
|
264 allow implementations to check identity and security information about the |
|
265 new client. </p> <p>This message argument can be ignored when migrating code |
|
266 from the Version 1 APIs. </p> <p id="GUID-77592C37-AF3E-59DE-981E-AF23B442163B"><b>CSharableSession</b> </p> <table id="GUID-3FE15D11-51FA-5B24-B153-47EF5B20C925"> |
|
267 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
268 <tbody> |
|
269 <row> |
|
270 <entry><p>Version 1 class: </p> </entry> |
|
271 <entry><codeblock id="GUID-067FF488-35CE-585F-94FE-BF350B0DA2E1" xml:space="preserve">CSharableSession</codeblock> </entry> |
|
272 </row> |
|
273 <row> |
|
274 <entry><p>Version 2 class: </p> </entry> |
|
275 <entry><codeblock id="GUID-241A9E7D-2FC5-5202-A9F1-FC17D5CA8F38" xml:space="preserve">CSession2</codeblock> </entry> |
|
276 </row> |
|
277 </tbody> |
|
278 </tgroup> |
|
279 </table> <p>Simply replace <codeph>CSharableSession</codeph> with <codeph>CSession2</codeph>. </p> <p id="GUID-1616B87E-A4C3-509B-AF79-D4A964032BF1"><b>CSharableSession::CreateL()</b> </p> <table id="GUID-7805C54A-7534-5C20-BE26-09575363F9C2"> |
|
280 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
281 <tbody> |
|
282 <row> |
|
283 <entry><p>Version 1 function: </p> </entry> |
|
284 <entry><codeblock id="GUID-D484349C-7B49-5DFE-8B0E-92AD511CC615" xml:space="preserve">void CSharableSession::CreateL(const CServer& aServer)</codeblock> </entry> |
|
285 </row> |
|
286 <row> |
|
287 <entry><p>Version 2 function: </p> </entry> |
|
288 <entry><codeblock id="GUID-7B9C9D6D-A20C-571A-A533-3A4359067B84" xml:space="preserve">void CSession2::CreateL()</codeblock> </entry> |
|
289 </row> |
|
290 </tbody> |
|
291 </tgroup> |
|
292 </table> <p>In Version 1, <codeph>CSharableSession::CreateL()</codeph> can |
|
293 be re-implemented by a class derived from <codeph>CSharableSession</codeph>. |
|
294 In Version 2, your derived class uses <codeph>CSession2</codeph> as the base |
|
295 class. </p> <p>The Version 2 <codeph>CreateL()</codeph> function has no arguments. |
|
296 If a derived session object overrides this function, then it will need modifying. </p> <p id="GUID-868E4703-DD82-5145-809D-91908237266C"><b>CSharableSession::ResourceCountMarkEnd()</b> </p> <table id="GUID-0E84FAD2-8007-5EA6-BCBB-659E67B0E94D"> |
|
297 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
298 <tbody> |
|
299 <row> |
|
300 <entry><p>Version 1 function: </p> </entry> |
|
301 <entry><codeblock id="GUID-52CC1805-86C8-5B3F-8AC2-D53020B93DDF" xml:space="preserve">void CSharableSession::ResourceCountMarkEnd()</codeblock> </entry> |
|
302 </row> |
|
303 <row> |
|
304 <entry><p>Version 2 function: </p> </entry> |
|
305 <entry><codeblock id="GUID-037656C1-A71D-52BA-80BE-9647B12D2E6E" xml:space="preserve">void CSession2::ResourceCountMarkEnd(const RMessage2& aMessage)</codeblock> </entry> |
|
306 </row> |
|
307 </tbody> |
|
308 </tgroup> |
|
309 </table> <p>In Version 2, the function requires a reference to the client |
|
310 message that requested the resource check. This message is used to panic the |
|
311 client if the check fails. </p> <p id="GUID-54BF8797-7AE5-57E0-B5FD-C36C45D8CFFB"><b>CSharableSession::RMessage()</b> </p> <table id="GUID-342A2BD3-8446-5437-B785-47BD8071B307"> |
|
312 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
313 <tbody> |
|
314 <row> |
|
315 <entry><p>Version 1 function: </p> </entry> |
|
316 <entry><codeblock id="GUID-86D3741D-F30E-5A9A-A211-5A1C008B70B2" xml:space="preserve">const RMessage& CSharableSession::Message() const</codeblock> </entry> |
|
317 </row> |
|
318 <row> |
|
319 <entry><p>Version 2 function: </p> </entry> |
|
320 <entry><p>No equivalent function. </p> </entry> |
|
321 </row> |
|
322 </tbody> |
|
323 </tgroup> |
|
324 </table> <p>In Version 1. this function returns a reference to the last message |
|
325 delivered to the server. It is usually used by a session implementation to |
|
326 mean <i>the current message being processed by the session</i>. </p> <p>This |
|
327 function is not available in Version 2. When a session needs to manipulate |
|
328 a message delivered to it, it should use the <codeph>RMessage2</codeph> argument |
|
329 passed to <codeph>ServiceL()</codeph>, instead. Achieving this may require |
|
330 passing this reference as an argument between function calls, or if that is |
|
331 complex, then storing a reference to the message in the session object. </p> <p id="GUID-F62D83DD-2A1C-5745-9813-E6646FF167BB"><b>CSession</b> </p> <table id="GUID-DB57B8A0-66D6-59CF-8DF6-15DBF0EDE488"> |
|
332 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
333 <tbody> |
|
334 <row> |
|
335 <entry><p>Version 1 class: </p> </entry> |
|
336 <entry><codeblock id="GUID-44314564-FEE3-57B5-8878-A989125074EB" xml:space="preserve">CSession</codeblock> </entry> |
|
337 </row> |
|
338 <row> |
|
339 <entry><p>Version 2 class: </p> </entry> |
|
340 <entry><codeblock id="GUID-18D7BC87-81E7-54D0-A4E0-E4BDAB172FD8" xml:space="preserve">CSession2</codeblock> </entry> |
|
341 </row> |
|
342 </tbody> |
|
343 </tgroup> |
|
344 </table> <p>Replace <codeph>CSession</codeph> with <codeph>CSession2</codeph>. </p> <p>The |
|
345 changes applicable to <codeph>CSharableSession</codeph> derived classes also |
|
346 apply to <codeph>CSession</codeph> derived classes. See: </p> <ul> |
|
347 <li id="GUID-5C5C37DF-5D39-571C-8998-43A3ECB48DA2"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-1616B87E-A4C3-509B-AF79-D4A964032BF1">CSharableSession::CreateL()</xref> </p> </li> |
|
348 <li id="GUID-F40EFC23-D7A3-5814-8660-DEE9E9CE7762"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-868E4703-DD82-5145-809D-91908237266C">CSharableSession::ResourceCountMarkEnd()</xref> </p> </li> |
|
349 <li id="GUID-74ED0DB9-10A1-5616-9CFE-3FE2A37F1905"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-54BF8797-7AE5-57E0-B5FD-C36C45D8CFFB">CSharableSession::RMessage()</xref> </p> </li> |
|
350 </ul> <p>In addition, if you use the following <codeph>CSession</codeph> functions, |
|
351 then you will need to change your code to use the equivalent functions in |
|
352 the <codeph>RMessage2</codeph> and/or <codeph>RMessagePtr2</codeph> classes. |
|
353 See <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-07F7FFA6-D421-54E2-90F7-69F002702C46">Using |
|
354 RMessagePtr2</xref>. </p> <codeblock id="GUID-97AE07E6-AA05-59D2-9F6E-4D063C40BAD2" xml:space="preserve">void ReadL(const TAny* aPtr,TDes8& aDes) const; |
|
355 void ReadL(const TAny* aPtr,TDes8& aDes,TInt anOffset) const; |
|
356 void ReadL(const TAny* aPtr,TDes16& aDes) const; |
|
357 void ReadL(const TAny* aPtr,TDes16& aDes,TInt anOffset) const; |
|
358 void WriteL(const TAny* aPtr,const TDesC8& aDes) const; |
|
359 void WriteL(const TAny* aPtr,const TDesC8& aDes,TInt anOffset) const; |
|
360 void WriteL(const TAny* aPtr,const TDesC16& aDes) const; |
|
361 void WriteL(const TAny* aPtr,const TDesC16& aDes,TInt anOffset) const; |
|
362 void Panic(const TDesC& aCategory,TInt aReason) const; |
|
363 void Kill(TInt aReason) const; |
|
364 void Terminate(TInt aReason) const;</codeblock> <p id="GUID-F0C1B0F6-BF72-5A52-84D1-E7E748D3E1A5"><b>CSession::CSession()</b> </p> <table id="GUID-8EE0CBE3-B5C4-54A4-9027-0DD37C00EDBD"> |
|
365 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
366 <tbody> |
|
367 <row> |
|
368 <entry><p>Version 1 function: </p> </entry> |
|
369 <entry><codeblock id="GUID-E445EA4B-C26A-5F19-BD11-8C420C005C9E" xml:space="preserve">CSession::CSession(RThread aClient)</codeblock> </entry> |
|
370 </row> |
|
371 <row> |
|
372 <entry><p>Version 2 function: </p> </entry> |
|
373 <entry><p>No equivalent constructor. </p> </entry> |
|
374 </row> |
|
375 </tbody> |
|
376 </tgroup> |
|
377 </table> <p>The Version 1 <codeph>CSession</codeph> object stores a handle |
|
378 for the client thread. This should no longer be required after moving over |
|
379 to Version 2, and indeed, a constructor taking a thread handle as an argument |
|
380 is not supplied. </p> <p id="GUID-F2BB351E-73DA-522A-96ED-361F2EB1A379"><b>RMessage</b> </p> <table id="GUID-AE303124-F8E6-5814-ABF3-86CE010AEB0D"> |
|
381 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
382 <tbody> |
|
383 <row> |
|
384 <entry><p>Version 1 class: </p> </entry> |
|
385 <entry><codeblock id="GUID-97B0E175-06DD-56D5-B72D-F248AA327E28" xml:space="preserve">RMessage</codeblock> </entry> |
|
386 </row> |
|
387 <row> |
|
388 <entry><p>Version 2 class: </p> </entry> |
|
389 <entry><codeblock id="GUID-F4DEABFB-9B23-5CA1-B8B4-2A83FA36F787" xml:space="preserve">RMessage2</codeblock> </entry> |
|
390 </row> |
|
391 </tbody> |
|
392 </tgroup> |
|
393 </table> <p>Replace <codeph>RMessage</codeph> with <codeph>RMessage2</codeph>. </p> <p>Note |
|
394 that <codeph>RMessage2</codeph> derives from <codeph>RMessagePtr2</codeph> and |
|
395 that most of the functions that were members of the Version 1 class <codeph>RMessage</codeph> are |
|
396 now implemented in the Version 2 class <codeph>RMessagePtr2</codeph>. </p> <p id="GUID-B0431DFE-C0E5-5767-A299-564EC502B01E"><b>RMessage::Client()</b> </p> <table id="GUID-D8B43D00-689F-5A63-B2D8-89D74E2D5ACE"> |
|
397 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
398 <tbody> |
|
399 <row> |
|
400 <entry><p>Version 1 function: </p> </entry> |
|
401 <entry><codeblock id="GUID-2E080CC6-801E-5E91-9146-BE08338C7F2E" xml:space="preserve">const RThread& RMessage::Client() const</codeblock> </entry> |
|
402 </row> |
|
403 <row> |
|
404 <entry><p>Version 2 function: </p> </entry> |
|
405 <entry><codeblock id="GUID-6FC3BD1F-11BC-5309-AFE3-EC3043B162E6" xml:space="preserve">TInt RMessage2::Client(RThread& aClient, TOwnerType aOwnerType=EOwnerProcess) const</codeblock> <p>(Note that the function is implemented by the <codeph>RMessagePtr2</codeph> base |
|
406 class.) </p> </entry> |
|
407 </row> |
|
408 </tbody> |
|
409 </tgroup> |
|
410 </table> <p>In Version 1, the kernel maintains a handle to the client thread |
|
411 which can be extracted from a message by calling <codeph>RMessage::Client()</codeph>. </p> <p>In |
|
412 Version 2, this special handle is not present; instead, a function is provided |
|
413 that explicitly opens a handle on the client thread. This should be treated |
|
414 just like any other thread handle, i.e. <codeph>Close()</codeph> should be |
|
415 called on the handle when it is no longer needed. </p> <p>Here's an example |
|
416 of its usage: </p> <codeblock id="GUID-60EB6ACF-4A2D-5EEA-9008-265DDEF3E332" xml:space="preserve">void CMySession::ServiceL(const RMessage2& aMessage) |
|
417 { |
|
418 ... |
|
419 RThread clientThread; |
|
420 // Open a handle on the client thread. Leaving if there is an error. |
|
421 User::LeaveIfError(aMessage.Client(clientThread)); |
|
422 // Do something with the handle. (Print its ID in this example) |
|
423 RDebug::Print(_L("Client Thread ID = %n"),clientThread.Id()); |
|
424 // Close handle |
|
425 clientThread.Close(); |
|
426 ... |
|
427 }</codeblock> <p> <b>You need to carefully examine all uses of RMessage::Client(), |
|
428 as most servers should not need to use this function after migrating to the |
|
429 Version 2 APIs. This is because the use of thread handles in a Version 1 server |
|
430 is likely to involve those functions that have been removed from the Version |
|
431 2 APIs.</b> See <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-A94A9960-319C-51B5-B693-2538D3985004">RThread</xref> for |
|
432 more information. </p> <p id="GUID-4EEFEF47-D875-5C16-8836-98DD03C0A91D"><b>RMessage::MessagePtr()</b> </p> <table id="GUID-C4466017-A740-505D-BFF2-90CCE1014878"> |
|
433 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
434 <tbody> |
|
435 <row> |
|
436 <entry><p>Version 1 function: </p> </entry> |
|
437 <entry><codeblock id="GUID-D771DA22-E50F-532E-AE35-16FCFD1194B9" xml:space="preserve">const RMessagePtr RMessage::MessagePtr() const</codeblock> </entry> |
|
438 </row> |
|
439 <row> |
|
440 <entry><p>Version 2 function: </p> </entry> |
|
441 <entry><p>No equivalent function. </p> </entry> |
|
442 </row> |
|
443 </tbody> |
|
444 </tgroup> |
|
445 </table> <p> <codeph>RMessage2</codeph> derives from <codeph>RMessagePtr2</codeph>, |
|
446 therefore an <codeph>RMessagePtr2</codeph> can be simply constructed or assigned |
|
447 directly from an <codeph>RMessage2</codeph>. There is no need for an explicit |
|
448 method of construction as was the case in the Version 1 APIs. </p> <p id="GUID-8754F52F-371C-546B-9290-B5369E915318"><b>RMessage::descriptor access |
|
449 methods</b> </p> <table id="GUID-E584453B-6BC7-56C1-9FDB-E531A3BC0A8C"> |
|
450 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
451 <tbody> |
|
452 <row> |
|
453 <entry><p>Version 1 functions: </p> </entry> |
|
454 <entry><codeblock id="GUID-9C3A91D8-FABE-5D70-91F0-0103FAD39E63" xml:space="preserve">void RMessage::ReadL(const TAny* aPtr,TDes8& aDes) const; |
|
455 void RMessage::ReadL(const TAny* aPtr,TDes8& aDes,TInt anOffset) const; |
|
456 void RMessage::ReadL(const TAny* aPtr,TDes16& aDes) const; |
|
457 void RMessage::ReadL(const TAny* aPtr,TDes16& aDes,TInt anOffset) const; |
|
458 void RMessage::WriteL(const TAny* aPtr,const TDesC8& aDes) const; |
|
459 void RMessage::WriteL(const TAny* aPtr,const TDesC8& aDes,TInt anOffset) const; |
|
460 void RMessage::WriteL(const TAny* aPtr,const TDesC16& aDes) const; |
|
461 void RMessage::WriteL(const TAny* aPtr,const TDesC16& aDes,TInt anOffset) const;</codeblock> </entry> |
|
462 </row> |
|
463 <row> |
|
464 <entry><p>Version 2 functions: </p> </entry> |
|
465 <entry><p>These functions are replaced by functions that take a message argument |
|
466 index instead of a <codeph>TAny*</codeph>. See <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-07F7FFA6-D421-54E2-90F7-69F002702C46">Using |
|
467 RMessagePtr2</xref>. </p> </entry> |
|
468 </row> |
|
469 </tbody> |
|
470 </tgroup> |
|
471 </table> <p id="GUID-49869449-4440-5D20-97ED-32C14C5D1DAF"><b>RMessagePtr</b> </p> <table id="GUID-D7F81784-48AD-5896-8DFF-F71CCE379E1D"> |
|
472 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
473 <tbody> |
|
474 <row> |
|
475 <entry><p>Version 1 class: </p> </entry> |
|
476 <entry><codeblock id="GUID-BF9BEDE9-DB54-5CEB-B66E-4ACA8D97AA92" xml:space="preserve">RMessagePtr</codeblock> </entry> |
|
477 </row> |
|
478 <row> |
|
479 <entry><p>Version 2 class: </p> </entry> |
|
480 <entry><codeblock id="GUID-AD8BAE63-C125-5912-8B97-FAEE0F41CB58" xml:space="preserve">RMessagePtr2</codeblock> </entry> |
|
481 </row> |
|
482 </tbody> |
|
483 </tgroup> |
|
484 </table> <p>Replace <codeph>RMessagePtr</codeph> with <codeph>RMessagePtr2</codeph>. </p> <p>See <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-07F7FFA6-D421-54E2-90F7-69F002702C46">Using |
|
485 RMessagePtr2</xref>. </p> <p id="GUID-A94A9960-319C-51B5-B693-2538D3985004"><b>RThread</b> </p> <p>Calls |
|
486 to the following functions need to be changed to use the equivalent functions |
|
487 in a <codeph>RMessage2</codeph> /<codeph>RMessagePtr2</codeph> class. See <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-07F7FFA6-D421-54E2-90F7-69F002702C46">Using |
|
488 RMessagePtr2</xref>. </p> <codeblock id="GUID-589B9378-3AF1-5AFF-99A1-ADF44D7AB575" xml:space="preserve">TInt RThread::GetDesLength(const TAny* aPtr) const |
|
489 TInt RThread::GetDesMaxLength(const TAny* aPtr) |
|
490 void RThread::ReadL(const TAny* aPtr,TDes8& aDes,TInt anOffset) const |
|
491 void RThread::ReadL(const TAny* aPtr,TDes16 &aDes,TInt anOffset) const |
|
492 void RThread::WriteL(const TAny* aPtr,const TDesC8& aDes,TInt anOffset) const |
|
493 void RThread::WriteL(const TAny* aPtr,const TDesC16& aDes,TInt anOffset) const |
|
494 void RThread::Kill(TInt aReason) |
|
495 void RThread::Terminate(TInt aReason) |
|
496 void RThread::Panic(const TDesC& aCategory,TInt aReason)</codeblock> <p id="GUID-9DA5C542-44B6-5277-837D-1D9150F43B10"><b>RThread::RequestComplete()</b> </p> <table id="GUID-CB602E73-0C6F-51DC-88BB-CC2D334008DD"> |
|
497 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
498 <tbody> |
|
499 <row> |
|
500 <entry><p>Version 1 function: </p> </entry> |
|
501 <entry><codeblock id="GUID-0338C808-E3B3-567E-95AE-EA577E286A7B" xml:space="preserve">void RThread::RequestComplete(TRequestStatus*& aStatus,TInt aReason) const</codeblock> </entry> |
|
502 </row> |
|
503 <row> |
|
504 <entry><p>Version 2 function: </p> </entry> |
|
505 <entry><codeblock id="GUID-6201C836-1533-5252-B68A-2AEE7CFA59D9" xml:space="preserve">void RMessagePtr2::Complete(TInt aReason) const</codeblock> </entry> |
|
506 </row> |
|
507 </tbody> |
|
508 </tgroup> |
|
509 </table> <p>With the Version 2 APIs, the only way of signalling a client's |
|
510 request status in a different process is by completing a message sent by the |
|
511 client to the session. This means that a call to <codeph>RThread::RequestComplete()</codeph> should |
|
512 be replaced by a call to <codeph>RMessagePtr2::Complete()</codeph>. This requires |
|
513 some minor changes to the internal architecture of the server. </p> <p>An |
|
514 example of a call to <codeph>RThread::RequestComplete()</codeph> is where |
|
515 a server implements a kind of notification service, where a client asks to |
|
516 be signalled when some event or change of state occurs. </p> <p><b>A |
|
517 version 1 server implementation</b> </p> <p>In a Version 1 server implementation, |
|
518 the notification scheme is often implemented with code similar to this: </p> <p>Client |
|
519 function: </p> <codeblock id="GUID-97208CAC-12F1-5871-A7FE-C9CD465B2C5E" xml:space="preserve">TInt RMySession::NotifyChanges(TRequestStatus& aStatus) |
|
520 { |
|
521 TAny* args[KMaxMessageArguments]; |
|
522 args[0]=&aStatus; |
|
523 return SendReceive(ERequestNotifyChanges, &args[0]); |
|
524 }</codeblock> <p>The server processes the request like this: </p> <codeblock id="GUID-34777BB5-E58B-5EA2-BF62-6CF96CBECA94" xml:space="preserve">void CMySession::ServiceL(const RMessage& aMessage) |
|
525 { |
|
526 ... |
|
527 // Get arguments needed to signal client |
|
528 RThread clientThread = aMessage.Client(); |
|
529 TRequestStatus* clientStatus = (TRequestStatus*)aMessage.Ptr0(); |
|
530 // Make notify object |
|
531 TMyNotifyChanges notifyObject(clientThread,clientStatus); |
|
532 // Add notify object to list of all requests |
|
533 TInt result=AddNotification(notifyObject); |
|
534 // Complete request message |
|
535 aMessage.Complete(result); |
|
536 ... |
|
537 }</codeblock> <p>When the event happens, clients are notified: </p> <codeblock id="GUID-E45B2795-EA7D-51EF-8892-0516E0BF53DB" xml:space="preserve">void CMySession::SignalNotifications(TInt aResult) |
|
538 { |
|
539 TMyNotifyChanges* notifyObject; |
|
540 while(notifyObject=RemoveNotifyObject()) |
|
541 { |
|
542 // Complete each NotifyChanges object |
|
543 RThread clientThread = notifyObject->ClientThread(); |
|
544 TRequestStatus* clientStatus = notifyObject->ClientStatus(); |
|
545 clientThread.RequestComplete(clientStatus,aResult); |
|
546 } |
|
547 }</codeblock> <p><b>A |
|
548 version 2 server implementation</b> </p> <p>In a Version 2 server implementation, |
|
549 the notification scheme could be implemented using the Version 2 APIs like |
|
550 this: </p> <p>Client function: </p> <codeblock id="GUID-0FC0A82A-1C12-5455-BD31-1439C1BC89E2" xml:space="preserve">void RMySession::NotifyChanges(TRequestStatus& aStatus) |
|
551 { |
|
552 TIpcArgs args(); // No arguments |
|
553 // Use asynchronous SendReceive for request |
|
554 SendReceive(ERequestNotifyChanges, args, aStatus); |
|
555 // void return type because errors will be signalled through aStatus |
|
556 }</codeblock> <p>The server processes the request like this: </p> <codeblock id="GUID-A27E21CB-C83E-5FA5-B06C-C7326B219314" xml:space="preserve">void CMySession::ServiceL(const RMessage2& aMessage) |
|
557 { |
|
558 ... |
|
559 RMessagePtr2 messagePtr = aMessage; |
|
560 // Make notify object |
|
561 TMyNotifyChanges notifyObject(messagePtr); |
|
562 // Add notify object to list of all requests |
|
563 TInt result=AddNotification(notifyObject); |
|
564 // Complete request message (only if error) |
|
565 if(result!=KErrNone) |
|
566 { |
|
567 aMessage.Complete(result); |
|
568 } |
|
569 ... |
|
570 }</codeblock> <p>When the event happens, clients will be notified: </p> <codeblock id="GUID-3CFBE6E0-226F-5893-BB8B-978D739A2379" xml:space="preserve">void CMySession::SignalNotifications(TInt aResult) |
|
571 { |
|
572 TMyNotifyChanges* notifyObject; |
|
573 while(notifyObject=RemoveNotifyObject()) |
|
574 { |
|
575 // Complete each NotifyChanges object |
|
576 RMessagePtr2 messagePtr = notifyObject->MessagePtr(); |
|
577 messagePtr.Complete(aResult) |
|
578 } |
|
579 }</codeblock> </section> |
|
580 <section id="GUID-07F7FFA6-D421-54E2-90F7-69F002702C46"><title>Using RMessagePtr2</title> <p>In |
|
581 Version 2, a server's interaction with its clients is channelled through <codeph>RMessagePtr2</codeph>, |
|
582 from which <codeph>RMessage2</codeph> is derived. An <codeph>RMessagePtr2</codeph> object |
|
583 acts as a handle to the message that the client has sent. The details of the |
|
584 original message are maintained within the kernel so that it can enforce correct |
|
585 use of the <codeph>RMessagePtr2</codeph> functions. </p> <p>The <codeph>RThread</codeph> and <codeph>RSession</codeph> functions |
|
586 for accessing descriptors, panicking the client and completing requests are |
|
587 not available in Version 2. Instead, this functionality is provided by <codeph>RMessagePtr2</codeph>. |
|
588 Because of this, server implementations may need to have a reference to the |
|
589 message available in many places. This may be done by passing such references |
|
590 as arguments between functions or by storing a reference in the session object |
|
591 processing the request. </p> <ul> |
|
592 <li id="GUID-522FC7B3-A4BA-5507-9BD3-05CBAE0DDED8"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-5D18833F-55D6-50C1-94DB-569F5CA30ECB">Descriptor access functions</xref> </p> </li> |
|
593 <li id="GUID-D78F8B64-0E73-56EC-A40D-FC7E8FB1D722"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1">RMessagePtr2::Complete()</xref> </p> </li> |
|
594 <li id="GUID-5DFDDBFB-41AE-5EBC-943A-528C1C42312F"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-460A24B8-6BA3-5059-BE3B-FF9287ACF965">RMessagePtr2::Kill()</xref> </p> </li> |
|
595 <li id="GUID-A21E615F-A19C-5673-A7A0-372309AC944F"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-FD417FCA-8EC2-568F-A848-1F5712828E7D">RMessagePtr2::Terminate()</xref> </p> </li> |
|
596 <li id="GUID-CC7E6514-B7C0-507D-902C-2FE3F8EE1D36"><p> <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-3005E91E-1930-5092-B89D-60772D5BD9CA">RMessagePtr2::Panic()</xref> </p> </li> |
|
597 </ul> <p id="GUID-5D18833F-55D6-50C1-94DB-569F5CA30ECB"><b>Descriptor access functions</b> </p> <codeblock id="GUID-959C66E7-9219-54F7-A104-374CCF8B9D5A" xml:space="preserve">TInt RMessagePtr2::GetDesLength(TInt aParam) const; |
|
598 TInt RMessagePtr2::GetDesMaxLength(TInt aParam) const; |
|
599 void RMessagePtr2::ReadL(TInt aParam,TDes8& aDes,TInt aOffset=0) const; |
|
600 void RMessagePtr2::ReadL(TInt aParam,TDes16 &aDes,TInt aOffset=0) const; |
|
601 void RMessagePtr2::WriteL(TInt aParam,const TDesC8& aDes,TInt aOffset=0) const; |
|
602 void RMessagePtr2::WriteL(TInt aParam,const TDesC16& aDes,TInt aOffset=0) const; |
|
603 TInt RMessagePtr2::Read(TInt aParam,TDes8& aDes,TInt aOffset=0) const; |
|
604 TInt RMessagePtr2::Read(TInt aParam,TDes16 &aDes,TInt aOffset=0) const; |
|
605 TInt RMessagePtr2::Write(TInt aParam,const TDesC8& aDes,TInt aOffset=0) const; |
|
606 TInt RMessagePtr2::Write(TInt aParam,const TDesC16& aDes,TInt aOffset=0) const</codeblock> <p>These |
|
607 are used in the same way as the equivalent <codeph>RThread</codeph> functions |
|
608 in the Version 1 APIs, except that instead of referring to the descriptor |
|
609 by an address in the client, the <codeph>aParam</codeph> argument is used. |
|
610 This is a value between 0 and 3 and indicates which of the four arguments |
|
611 in the original client message contains the pointer to the descriptor. </p> <p>For |
|
612 example, if a client sends a message using code like this </p> <codeblock id="GUID-CF62ABBF-824D-5E84-A39B-58068C85C38F" xml:space="preserve">TInt RMySession::Write(TDes8C& aDes, TInt aLength) |
|
613 { |
|
614 return SendReceive(ERequestWrite, TIpcArgs(&aDes, aLength) ); |
|
615 }</codeblock> <p>then the server would access <codeph>aDes</codeph> using |
|
616 an <codeph>aParam</codeph> value of 0. </p> <codeblock id="GUID-B608F856-8443-58DC-BBAE-D3253E911EA5" xml:space="preserve">void CMySession::ServiceL(const RMessage2& aMessage) |
|
617 { |
|
618 ... |
|
619 TInt length=aMessage.Int1(); // Get length from message param 1 |
|
620 TPtr8 buffer=MyNewBufferL(length); // Make a new buffer for the data |
|
621 aMessage.ReadL(0,buffer); // Read data from client descriptor (param 0) |
|
622 ...</codeblock> <p>Because <codeph>TIpcArgs</codeph> also stores type |
|
623 information about arguments, the kernel knows that argument 0 in the above |
|
624 message is an 8-bit constant descriptor. On Symbian OS platforms using the |
|
625 EKA2 kernel, this information is used to enforce correct usage of descriptor |
|
626 access methods; in this case, trying to write to <codeph>aDes</codeph>, or |
|
627 treating it as a 16-bit descriptor would fail with <codeph>KErrBadDescriptor</codeph>. |
|
628 (The latter case would have allowed access to data beyond the length of the |
|
629 8- bit descriptor. </p> <p>Note, both leaving and non-leaving versions of |
|
630 the <codeph>Read()</codeph> and <codeph>Write()</codeph> functions are provided. |
|
631 This allows the removal of some TRAP statements in code after migration to |
|
632 the Version 2 APIs. </p> <p id="GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1"><b>RMessagePtr2::Complete()</b> </p> <codeblock id="GUID-D0231B69-B33C-5EF5-89D3-0D332C840518" xml:space="preserve">void RMessagePtr2::Complete(TInt aReason) const;</codeblock> <p>This |
|
633 function signals completion of the client request, in the same way that <codeph>RMessage::Complete()</codeph> does |
|
634 in Version 1. After completion, the <codeph>iHandle</codeph> member is set |
|
635 to zero, and this means that <codeph>RMessagePtr2::Handle()</codeph> returns |
|
636 zero, and <codeph>RMessagePtr2::IsNull()</codeph> returns True. </p> <p>It |
|
637 is important to note that once a message has been completed, it cannot be |
|
638 used by the server, and any such attempt results in a KERN-EXEC 44 panic (Bad |
|
639 Message Handle). To avoid this situation, implementations may need to check <codeph>RMessagePtr2::IsNull()</codeph>, |
|
640 but be aware that any copies of the message made before completion will not |
|
641 have had their handles nulled. For this reason, it is best to avoid making |
|
642 copies of <codeph>RMessage2</codeph> or <codeph>RMessagePtr2</codeph> objects, |
|
643 this includes passing them as arguments to other functions 'by value'. Use |
|
644 references instead. </p> <p id="GUID-460A24B8-6BA3-5059-BE3B-FF9287ACF965"><b>RMessagePtr2::Kill()</b> </p> <codeblock id="GUID-E3A4E634-BCA5-5680-96F8-8D83429BB832" xml:space="preserve">void RMessagePtr2::Kill(TInt aReason) const;</codeblock> <p>This |
|
645 function is used in the same way as the equivalent <codeph>RMessage</codeph> or <codeph>RThread</codeph> functions |
|
646 in Version 1. Note that this function also performs the action of <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1">RMessagePtr2::Complete()</xref>, so care must be taken that the message is |
|
647 not used again. </p> <p id="GUID-FD417FCA-8EC2-568F-A848-1F5712828E7D"><b>RMessagePtr2::Terminate()</b> </p> <codeblock id="GUID-69309A0B-36C9-5F5F-9C9B-DD0C318B35DB" xml:space="preserve">void RMessagePtr2::Terminate(TInt aReason) const;</codeblock> <p>This |
|
648 function is used in the same way as the equivalent <codeph>RMessage</codeph> or <codeph>RThread</codeph> functions |
|
649 in Version 1. Note that this function also performs the action of <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1">RMessagePtr2::Complete()</xref>, so care must be taken that the message is |
|
650 not used again. </p> <p id="GUID-3005E91E-1930-5092-B89D-60772D5BD9CA"><b>RMessagePtr2::Panic()</b> </p> <codeblock id="GUID-F31F59D2-D286-57F6-A685-C255225B45C8" xml:space="preserve">void RMessagePtr2::Panic(const TDesC& aCategory,TInt aReason) const;</codeblock> <p>This |
|
651 function is used in the same way as the equivalent <codeph>RMessage</codeph> or <codeph>RThread</codeph> functions |
|
652 in Version 1. Note that this function also performs the action of <xref href="GUID-0A332D6E-E712-5186-8CD0-D5022FA54052.dita#GUID-0A332D6E-E712-5186-8CD0-D5022FA54052/GUID-4BCF7E62-3ACA-535C-B201-84E570F95DE1">RMessagePtr2::Complete()</xref>, so care must be taken that the message is |
|
653 not used again. </p> </section> |
|
654 <section id="GUID-1ABF5DC6-A957-5623-93AB-CD7631A36A33"><title>Migration quick |
|
655 reference</title> <p>This is a quick reference to show you which Version 2 |
|
656 APIs you should use to replace the Version 1 APIs. </p> <table id="GUID-0DAF9004-8A70-5F88-899D-996CC96090CC"> |
|
657 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
658 <tbody> |
|
659 <row> |
|
660 <entry><p> <b>Version 1 (where used)</b> </p> </entry> |
|
661 <entry><p> <b>Version 2 (replace with...)</b> </p> </entry> |
|
662 </row> |
|
663 <row> |
|
664 <entry><p> <codeph>CSharableSession</codeph> </p> </entry> |
|
665 <entry><p> <codeph>CSession2</codeph> </p> </entry> |
|
666 </row> |
|
667 <row> |
|
668 <entry><p> <codeph>CSession</codeph> </p> </entry> |
|
669 <entry><p> <codeph>CSession2</codeph> </p> </entry> |
|
670 </row> |
|
671 <row> |
|
672 <entry><p> <codeph>CServer</codeph> </p> </entry> |
|
673 <entry><p> <codeph>CServer2</codeph> </p> </entry> |
|
674 </row> |
|
675 <row> |
|
676 <entry><p> <codeph>RMessagePtr</codeph> </p> </entry> |
|
677 <entry><p> <codeph>RMessagePtr2</codeph> </p> </entry> |
|
678 </row> |
|
679 <row> |
|
680 <entry><p> <codeph>RMessage</codeph> </p> </entry> |
|
681 <entry><p> <codeph>RMessage2</codeph> </p> </entry> |
|
682 </row> |
|
683 <row> |
|
684 <entry><p> <codeph>RServer</codeph> </p> </entry> |
|
685 <entry><p> <codeph>RServer2</codeph> </p> </entry> |
|
686 </row> |
|
687 <row> |
|
688 <entry><p> <codeph>RThread::GetDesLength(const TAny* aPtr)</codeph> </p> </entry> |
|
689 <entry><p> <codeph>RMessagePtr2::GetDesLength(TInt aParam)</codeph> </p> </entry> |
|
690 </row> |
|
691 <row> |
|
692 <entry><p> <codeph>RThread::GetDesMaxLength(const TAny* aPtr)</codeph> </p> </entry> |
|
693 <entry><p> <codeph>RMessagePtr2::GetDesMaxLength(TInt aParam)</codeph> </p> </entry> |
|
694 </row> |
|
695 <row> |
|
696 <entry><p> <codeph>RThread::ReadL(const TAny* aPtr,TDes8& aDes,TInt |
|
697 anOffset)</codeph> </p> </entry> |
|
698 <entry><p> <codeph>RMessagePtr2::ReadL(TInt aParam,TDes8& aDes,TInt |
|
699 aOffset=0)</codeph> </p> <p>Note: use of <codeph>RThread::ReadL()</codeph> enclosed |
|
700 in a TRAP statement can be replaced by the non-leaving <codeph>RMessagePtr2::Read()</codeph>. </p> </entry> |
|
701 </row> |
|
702 <row> |
|
703 <entry><p> <codeph>RThread::ReadL(const TAny* aPtr,TDes16& aDes,TInt |
|
704 anOffset) </codeph> </p> </entry> |
|
705 <entry><p> <codeph>RMessagePtr2::ReadL(TInt aParam,TDes16& aDes,TInt |
|
706 aOffset=0)</codeph> </p> <p>Note: use of <codeph>RThread::ReadL()</codeph> enclosed |
|
707 in a TRAP statement can be replaced by the non-leaving <codeph>RMessagePtr2::Read()</codeph>. </p> </entry> |
|
708 </row> |
|
709 <row> |
|
710 <entry><p> <codeph>RThread::WriteL(const TAny* aPtr,const TDesC8& |
|
711 aDes,TInt anOffset) </codeph> </p> </entry> |
|
712 <entry><p> <codeph>RMessagePtr2::WriteL(TInt aParam,const TDesC8& |
|
713 aDes,TInt aOffset=0)</codeph> </p> <p>Note: use of <codeph>RThread::WriteL()</codeph> enclosed |
|
714 in a TRAP statement can be replaced by the non-leaving <codeph>RMessagePtr2::Write()</codeph>. </p> </entry> |
|
715 </row> |
|
716 <row> |
|
717 <entry><p> <codeph>RThread::WriteL(const TAny* aPtr,const TDesC16& |
|
718 aDes,TInt anOffset)</codeph> </p> </entry> |
|
719 <entry><p> <codeph>RMessagePtr2::WriteL(TInt aParam,const TDesC16& |
|
720 aDes,TInt aOffset=0)</codeph> </p> <p>Note: use of <codeph>RThread::WriteL()</codeph> enclosed |
|
721 in a TRAP statement can be replaced by the non-leaving <codeph>RMessagePtr2::Write()</codeph>. </p> </entry> |
|
722 </row> |
|
723 <row> |
|
724 <entry><p> <codeph>RThread::RequestComplete(TRequestStatus*& aStatus,TInt |
|
725 aReason)</codeph> </p> </entry> |
|
726 <entry><p> <codeph>RMessagePtr2::Complete(TInt aReason)</codeph> </p> <p>Note: |
|
727 the only way of signalling the client thread is by completing a message which |
|
728 the client sent to the session. </p> </entry> |
|
729 </row> |
|
730 <row> |
|
731 <entry><p> <codeph>RThread::Kill(TInt aReason)</codeph> </p> </entry> |
|
732 <entry><p> <codeph>RMessagePtr2::Kill(TInt aReason)</codeph> </p> </entry> |
|
733 </row> |
|
734 <row> |
|
735 <entry><p> <codeph>RThread::Terminate(TInt aReason)</codeph> </p> </entry> |
|
736 <entry><p> <codeph>RMessagePtr2::Terminate(TInt aReason)</codeph> </p> </entry> |
|
737 </row> |
|
738 <row> |
|
739 <entry><p> <codeph>RThread::Panic(const TDesC& aCategory,TInt |
|
740 aReason)</codeph> </p> </entry> |
|
741 <entry><p> <codeph>RMessagePtr2::Panic(const TDesC& aCategory,TInt |
|
742 aReason)</codeph> </p> </entry> |
|
743 </row> |
|
744 <row> |
|
745 <entry><p> <codeph>RSessionBase::Share()</codeph> </p> <p>or </p> <p> <codeph>RSessionBase::Share(EExplicitAttach)</codeph> </p> <p>or </p> <p> <codeph>RSessionBase::Share(EAutoAttach)</codeph> </p> </entry> |
|
746 <entry><p> <codeph>RSessionBase::ShareAuto()</codeph> </p> </entry> |
|
747 </row> |
|
748 <row> |
|
749 <entry><p> <codeph>RSessionBase::Attach()</codeph> </p> </entry> |
|
750 <entry><p>Not required in Version 2. </p> </entry> |
|
751 </row> |
|
752 <row> |
|
753 <entry><p> <codeph>RSessionBase::Send(TInt aFunction,TAny* aPtr)</codeph> </p> </entry> |
|
754 <entry><p> <codeph>RSessionBase::Send(TInt aFunction,const TIpcArgs& |
|
755 aArgs)</codeph> </p> </entry> |
|
756 </row> |
|
757 <row> |
|
758 <entry><p> <codeph>RSessionBase::SendReceive(TInt aFunction,TAny* |
|
759 aPtr,TRequestStatus& aStatus)</codeph> </p> </entry> |
|
760 <entry><p> <codeph>RSessionBase::SendReceive(TInt aFunction,const |
|
761 TIpcArgs& aArgs, TRequestStatus& aStatus)</codeph> </p> </entry> |
|
762 </row> |
|
763 <row> |
|
764 <entry><p> <codeph>RSessionBase::SendReceive(TInt aFunction,TAny* aPtr)</codeph> </p> </entry> |
|
765 <entry><p> <codeph>RSessionBase::SendReceive(TInt aFunction, const |
|
766 TIpcArgs& aArgs)</codeph> </p> </entry> |
|
767 </row> |
|
768 <row> |
|
769 <entry><p> <codeph>RSubSessionBase::CreateSubSession(RSessionBase& |
|
770 aSession,TInt aFunction,const TAny* aPtr)</codeph> </p> </entry> |
|
771 <entry><p> <codeph>RSubSessionBase::CreateSubSession(RSessionBase, TInt |
|
772 aFunction, const TIpcArgs& aArgs);</codeph> </p> </entry> |
|
773 </row> |
|
774 <row> |
|
775 <entry><p> <codeph>RSubSessionBase::Send(TInt aFunction,const TAny* |
|
776 aPtr)</codeph> </p> </entry> |
|
777 <entry><p> <codeph>RSubSessionBase::Send(TInt aFunction,const TIpcArgs& |
|
778 aArgs)</codeph> </p> </entry> |
|
779 </row> |
|
780 <row> |
|
781 <entry><p> <codeph>RSubSessionBase::SendReceive(TInt aFunction,const TAny* |
|
782 aPtr,TRequestStatus&)</codeph> </p> </entry> |
|
783 <entry><p> <codeph>RSubSessionBase::SendReceive(TInt aFunction,const |
|
784 TIpcArgs& aArgs, TRequestStatus&)</codeph> </p> </entry> |
|
785 </row> |
|
786 <row> |
|
787 <entry><p> <codeph>RSubSessionBase::SendReceive(TInt aFunction,const TAny* |
|
788 aPtr)</codeph> </p> </entry> |
|
789 <entry><p> <codeph>RSubSessionBase::SendReceive(TInt aFunction,const |
|
790 TIpcArgs& aArgs)</codeph> </p> </entry> |
|
791 </row> |
|
792 </tbody> |
|
793 </tgroup> |
|
794 </table> </section> |
|
795 </conbody></concept> |