|
1 /* |
|
2 * Copyright (c) 2005 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: Global services for LBT server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef LBTGLOBAL_H |
|
20 #define LBTGLOBAL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // CLASS DECLARATION |
|
26 |
|
27 /** |
|
28 * Global functions for the server |
|
29 * |
|
30 */ |
|
31 class LbtGlobal |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Writes to the message and panics the client if any error |
|
37 * If the returned error code is negative, the RMessage must |
|
38 * not be completed. |
|
39 * |
|
40 * @param aMessage Message instance |
|
41 * @param aPtr Pointer to write to |
|
42 * @param aDes Descriptor to write from |
|
43 * @param aOffset offset to start write |
|
44 * @return Error code |
|
45 */ |
|
46 |
|
47 static TInt Write( |
|
48 /* IN */ const RMessage2& aMessage, |
|
49 /* IN */ const TInt aParam, |
|
50 /* IN */ const TDesC8& aDes, |
|
51 /* IN */ TInt aOffset=0 |
|
52 ); |
|
53 |
|
54 /** |
|
55 * Read and kill the client if it leaves. If the returned error code |
|
56 * is negative, the RMessage must not be completed. Complete after |
|
57 * client is paniced crashes the server with USER 70. |
|
58 * |
|
59 * @param aMessage Message instance |
|
60 * @param aPtr Pointer to read from |
|
61 * @param aDes Descriptor to read to |
|
62 * @param aOffset offset to start read |
|
63 * @return Error code |
|
64 */ |
|
65 static TInt Read( |
|
66 /* IN */ const RMessage2& aMessage, |
|
67 /* IN */ const TInt aParam, |
|
68 /* OUT */ TDes8& aDes, |
|
69 /* IN */ TInt aOffset=0 |
|
70 ); |
|
71 |
|
72 /** |
|
73 * Copies an 8-bit buffer from the address space of the client and puts |
|
74 * the result in the returned argument. If the method leaves it the |
|
75 * client may have been paniced and in that case it is forbidden to |
|
76 * complete the RMessage. If a client is paniced can be verified by the |
|
77 * call chain: |
|
78 * aMessage.Client().ExitType() |
|
79 * |
|
80 * @param aMessage the message from the client. |
|
81 * @param aClientBuffer a pointer to an 8-bit descriptor located in the |
|
82 * address space of the client. |
|
83 * @return a copy of the client buffer. |
|
84 */ |
|
85 static HBufC8* CopyClientBuffer8LC( |
|
86 /* IN */ const RMessage2& aMessage, |
|
87 /* IN */ const TInt aClientBufferParam |
|
88 ); |
|
89 |
|
90 static void RequestComplete( |
|
91 /* IN */ const RMessage2& aMessage, |
|
92 /* IN */ const TInt aError |
|
93 ); |
|
94 }; |
|
95 |
|
96 |
|
97 #endif // LBTGLOBAL_H |
|
98 |
|
99 // end of file |