|
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // f32\sfsrv\cl_plugin.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "cl_std.h" |
|
19 |
|
20 |
|
21 EXPORT_C TInt RFs::AddPlugin(const TDesC& aFileName) const |
|
22 /** |
|
23 @internalTechnology |
|
24 |
|
25 Loads a specified Plugin. |
|
26 |
|
27 @param aFileName The file name of the plugin |
|
28 |
|
29 @return KErrNone, if successful; otherwise one of the other system wide error codes. |
|
30 |
|
31 @capability DiskAdmin |
|
32 */ |
|
33 { |
|
34 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddPlugin, MODULEUID, Handle(), aFileName); |
|
35 |
|
36 RLoader loader; |
|
37 TInt r = loader.Connect(); |
|
38 if (r==KErrNone) |
|
39 { |
|
40 r = loader.SendReceive(ELoadFSPlugin, TIpcArgs(0, &aFileName, 0)); |
|
41 loader.Close(); |
|
42 } |
|
43 |
|
44 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddPluginReturn, MODULEUID, r); |
|
45 return r; |
|
46 } |
|
47 |
|
48 EXPORT_C TInt RFs::RemovePlugin(const TDesC& aPluginName) const |
|
49 /** |
|
50 @internalTechnology |
|
51 |
|
52 Removes the specified plugin. |
|
53 |
|
54 @param aPluginName The full name of the plugin to be removed. |
|
55 |
|
56 @return KErrNone, if successful; |
|
57 KErrNotFound, if aPluginName is not found; |
|
58 otrherwise one of the other system-wide error codes. |
|
59 |
|
60 @capability DiskAdmin |
|
61 */ |
|
62 { |
|
63 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemovePlugin, MODULEUID, Handle(), aPluginName); |
|
64 |
|
65 TInt r = SendReceive(EFsRemovePlugin,TIpcArgs(&aPluginName)); |
|
66 |
|
67 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemovePluginReturn, MODULEUID, r); |
|
68 return r; |
|
69 } |
|
70 |
|
71 EXPORT_C TInt RFs::MountPlugin(const TDesC& aPluginName) const |
|
72 /** |
|
73 @internalTechnology |
|
74 |
|
75 Mounts a specified plugin. |
|
76 |
|
77 Note that this API uses unique position of the plugin. |
|
78 |
|
79 This overload passes KPluginAutoAttach for the drive parameter |
|
80 which mounts on all of the drives specified as supported by the plugin. |
|
81 |
|
82 Note - Plugins cannot be mounted on demand paged drives. |
|
83 KErrNone is returned so long as it has been able to mount on |
|
84 at least one drive; otherwise KErrNotSupported. |
|
85 |
|
86 @param aPluginName The fullname of the plugin, as returned from |
|
87 a call to PluginName(). |
|
88 |
|
89 @return KErrNone if successful; |
|
90 KErrNotFound, if the plugin cannot be found; |
|
91 otherwise one of the other system-wide error codes. |
|
92 |
|
93 @see RFs::PluginName |
|
94 |
|
95 @capability DiskAdmin |
|
96 */ |
|
97 { |
|
98 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin1, MODULEUID, Handle(), aPluginName); |
|
99 |
|
100 TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,KPluginAutoAttach,KPluginAutoLocate)); |
|
101 |
|
102 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin1Return, MODULEUID, r); |
|
103 return r; |
|
104 } |
|
105 |
|
106 EXPORT_C TInt RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive) const |
|
107 /** |
|
108 @internalTechnology |
|
109 |
|
110 Mounts a specified plugin specifying the drive plugin will support. |
|
111 |
|
112 @param aPluginName The fullname of the plugin, as returned from |
|
113 a call to PluginName(). |
|
114 |
|
115 @param aDrive If the mounted plugin is a version2 plugin, then in order to |
|
116 mount on drive z, KPluginMountDriveZ should be passed as a parameter. |
|
117 For all other drive letters use values 0 to 24 for A to Y. |
|
118 Version1 plugins cannot mount on Z drive. |
|
119 To let the plugin decide on which drives to mount, use KPluginAutoAttach. |
|
120 |
|
121 Plugins cannot be mounted on demand paged drives. If KPluginAutoAttach is passed |
|
122 in, it will return KErrNone so long as it has been able to mount on at |
|
123 least one drive; otherwise KErrNotSupported. |
|
124 |
|
125 @return KErrNone if successful; |
|
126 KErrNotFound, if the plugin cannot be found; |
|
127 otherwise one of the other system-wide error codes. |
|
128 |
|
129 @see RFs::PluginName |
|
130 |
|
131 @capability DiskAdmin |
|
132 */ |
|
133 { |
|
134 TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin2, MODULEUID, Handle(), aPluginName, aDrive); |
|
135 |
|
136 TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,aDrive,KPluginAutoLocate)); |
|
137 |
|
138 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin2Return, MODULEUID, r); |
|
139 return r; |
|
140 } |
|
141 |
|
142 EXPORT_C TInt RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive, TInt aPos) const |
|
143 /** |
|
144 @internalTechnology |
|
145 |
|
146 Mounts a specified plugin using absolute position and a specific drive |
|
147 |
|
148 @param aPluginName The fullname of the plugin, as returned from |
|
149 a call to PluginName(). |
|
150 |
|
151 @param aDrive If the mounted plugin is a version2 plugin, then in order to |
|
152 mount on drive z, KPluginMountDriveZ should be passed as a parameter. |
|
153 For all other drive letters use values 0 to 24 for A to Y. |
|
154 Version1 plugins cannot mount on Z drive. |
|
155 To let the plugin decide on which drives to mount, use KPluginAutoAttach. |
|
156 |
|
157 Plugins cannot be mounted on demand paged drives. If KPluginAutoAttach is passed |
|
158 in, it will return KErrNone so long as it has been able to mount on at |
|
159 least one drive; otherwise KErrNotSupported. |
|
160 |
|
161 @param aPos The position at which the plugin is to be mounted within the internal array of plugins. |
|
162 |
|
163 Plugins wishing to be mounted using their CFsPlugin::iUniquePos |
|
164 should use MountPlugin(TDesC&,TInt) or MountPlugin(TDesC&) |
|
165 |
|
166 If there is already a plugin at aPos then this plugin is inserted |
|
167 into aPos and other plugins are shifted downwards. |
|
168 |
|
169 @return KErrNone if successful; |
|
170 KErrNotFound, if the plugin cannot be found; |
|
171 otherwise one of the other system-wide error codes. |
|
172 |
|
173 @see RFs::PluginName |
|
174 @see RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive) |
|
175 @capability DiskAdmin |
|
176 */ |
|
177 { |
|
178 TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin3, MODULEUID, Handle(), aPluginName, aDrive, aPos); |
|
179 |
|
180 TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,aDrive,aPos)); |
|
181 |
|
182 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin3Return, MODULEUID, r); |
|
183 return r; |
|
184 } |
|
185 |
|
186 EXPORT_C TInt RFs::DismountPlugin(const TDesC& aPluginName) const |
|
187 /** |
|
188 @internalTechnology |
|
189 |
|
190 Dismounts the specified plugin from all drives on which it is mounted. |
|
191 |
|
192 @param aPluginName The fullname of the plugin, as returned from |
|
193 a call to PluginName(). |
|
194 |
|
195 @return KErrNone if successful; |
|
196 KErrNotFound, if the plugin cannot be found; |
|
197 otherwise one of the other system-wide error codes. |
|
198 |
|
199 @see RFs::PluginName |
|
200 @capability DiskAdmin |
|
201 */ |
|
202 { |
|
203 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin1, MODULEUID, Handle(), aPluginName); |
|
204 |
|
205 TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,KPluginAutoAttach,KPluginAutoLocate)); |
|
206 |
|
207 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin1Return, MODULEUID, r); |
|
208 return r; |
|
209 } |
|
210 |
|
211 |
|
212 EXPORT_C TInt RFs::DismountPlugin(const TDesC& aPluginName,TInt aDrive) const |
|
213 /** |
|
214 @internalTechnology |
|
215 |
|
216 Dismounts the specified plugin. |
|
217 |
|
218 @param aPluginName The fullname of the plugin, as returned from |
|
219 a call to PluginName(). |
|
220 |
|
221 @param aDrive The drive on which the plugin is to be dismounted; |
|
222 If the mounted plugin is a version2 plugin, then in order to |
|
223 dismount drive z, KPluginMountDriveZ should be passed as a parameter. |
|
224 For all other drive letters use values 0 to 24 for A to Y. |
|
225 Version1 plugins cannot mount on Z drive. |
|
226 |
|
227 |
|
228 @return KErrNone if successful; |
|
229 KErrNotFound, if the plugin cannot be found; |
|
230 otherwise one of the other system-wide error codes. |
|
231 |
|
232 @see RFs::PluginName |
|
233 @capability DiskAdmin |
|
234 */ |
|
235 { |
|
236 TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin2, MODULEUID, Handle(), aPluginName, aDrive); |
|
237 |
|
238 TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,aDrive,KPluginAutoLocate)); |
|
239 |
|
240 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin2Return, MODULEUID, r); |
|
241 return r; |
|
242 } |
|
243 |
|
244 EXPORT_C TInt RFs::DismountPlugin(const TDesC& aPluginName,TInt aDrive,TInt aPos) const |
|
245 /** |
|
246 @internalTechnology |
|
247 |
|
248 Dismounts the specified plugin. |
|
249 |
|
250 @param aPluginName The fullname of the plugin, as returned from |
|
251 a call to PluginName(). |
|
252 |
|
253 @param aDrive If the mounted plugin is a version2 plugin, then in order to |
|
254 dismount drive z, KPluginMountDriveZ should be passed as a parameter. |
|
255 For all other drive letters use values 0 to 24 for A to Y. |
|
256 Version1 plugins cannot mount on Z drive. |
|
257 |
|
258 @param aPos The position at which the plugin is located in the internal |
|
259 array of plugins. |
|
260 To automatically locate the position of the plugin use |
|
261 DismountPlugin::(TDesC&,TInt) or |
|
262 DismountPlugin::(TDesC&) |
|
263 |
|
264 @return KErrNone if successful; |
|
265 KErrNotFound, if the plugin cannot be found; |
|
266 otherwise one of the other system-wide error codes. |
|
267 |
|
268 @see RFs::PluginName |
|
269 @capability DiskAdmin |
|
270 */ |
|
271 { |
|
272 TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin3, MODULEUID, Handle(), aPluginName, aDrive, aPos); |
|
273 |
|
274 TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,aDrive,aPos)); |
|
275 |
|
276 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin3Return, MODULEUID, r); |
|
277 return r; |
|
278 } |
|
279 |
|
280 |
|
281 EXPORT_C TInt RFs::PluginName(TDes& aPluginName,TInt aDrive,TInt aPos) |
|
282 /** |
|
283 @internalTechnology |
|
284 |
|
285 Gets the name of the plugin on the specified drive at the specified position |
|
286 in the plugin hierarchy. |
|
287 |
|
288 @param aPluginName On successful return, contains the name of the plugin. |
|
289 @param aDrive The drive for which the plugin name is required. |
|
290 @param aPos The position of the plugin in the plugin hierarchy. |
|
291 |
|
292 @return KErrNone, if successful; |
|
293 KErrNotFound if the plugin name is not found; |
|
294 */ |
|
295 { |
|
296 TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsPluginName, MODULEUID, Handle(), aDrive, aPos); |
|
297 |
|
298 TInt r = SendReceive(EFsPluginName,TIpcArgs(&aPluginName,aDrive,aPos)); |
|
299 |
|
300 TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsPluginName, MODULEUID, r, aPluginName); |
|
301 return r; |
|
302 } |
|
303 |
|
304 EXPORT_C TInt RPlugin::Open(RFs& aFs, TInt aPos) |
|
305 /** |
|
306 @internalTechnology |
|
307 |
|
308 Opens a plugin for userside engine conn |
|
309 |
|
310 @param aFs: File server session |
|
311 @prama aPos: Unique position of the plugin |
|
312 @return KErrNotFound if it didn't find the plugin, else KErrNone |
|
313 |
|
314 */ |
|
315 { |
|
316 TRACE2(UTF::EBorder, UTraceModuleEfsrv::EPluginOpen, MODULEUID, aFs.Handle(), aPos); |
|
317 |
|
318 TInt r = CreateSubSession(aFs,EFsPluginOpen,TIpcArgs(aPos,0,0)); |
|
319 |
|
320 TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EPluginOpenReturn, MODULEUID, r, SubSessionHandle()); |
|
321 return r; |
|
322 } |
|
323 |
|
324 EXPORT_C void RPlugin::Close() |
|
325 /** |
|
326 @internalTechnology |
|
327 |
|
328 Closes a plugin |
|
329 */ |
|
330 { |
|
331 TRACE2(UTF::EBorder, UTraceModuleEfsrv::EPluginClose, MODULEUID, Session().Handle(), SubSessionHandle()); |
|
332 |
|
333 CloseSubSession(EFsPluginSubClose); |
|
334 |
|
335 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginCloseReturn, MODULEUID); |
|
336 } |
|
337 |
|
338 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus) const |
|
339 /** |
|
340 @internalTechnology |
|
341 |
|
342 Client requests a asynchronous operation |
|
343 |
|
344 @param aReqNo: Number of the request |
|
345 @param aStatus: status of the request |
|
346 */ |
|
347 { |
|
348 TRACE4(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest1, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus); |
|
349 |
|
350 aStatus=KRequestPending; |
|
351 SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, NULL, NULL), aStatus); |
|
352 |
|
353 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest1Return, MODULEUID); |
|
354 } |
|
355 |
|
356 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus, TDes8& a1) const |
|
357 /** |
|
358 @internalTechnology |
|
359 |
|
360 Client requests a asynchronous operation |
|
361 |
|
362 @param aReqNo: Number of the request |
|
363 @param aStatus: status of the request |
|
364 @param a1: returning value from plugin |
|
365 */ |
|
366 { |
|
367 TRACE5(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest2, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus, &a1); |
|
368 |
|
369 aStatus=KRequestPending; |
|
370 SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, &a1, NULL), aStatus); |
|
371 |
|
372 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest2Return, MODULEUID); |
|
373 } |
|
374 |
|
375 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus, TDes8& a1, TDes8& a2) const |
|
376 /** |
|
377 @internalTechnology |
|
378 |
|
379 @param aReqNo: Number of the request |
|
380 @param aStatus: status of the request |
|
381 @param a1: returning value from plugin |
|
382 @param a2: 2nd returning value from plugin |
|
383 */ |
|
384 { |
|
385 TRACE6(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest3, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus, &a1, &a2); |
|
386 |
|
387 aStatus=KRequestPending; |
|
388 SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, &a1, &a2), aStatus); |
|
389 |
|
390 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest3Return, MODULEUID); |
|
391 } |
|
392 |
|
393 EXPORT_C TInt RPlugin::DoControl(TInt aFunction) const |
|
394 /** |
|
395 @internalTechnology |
|
396 |
|
397 Client requests a synchronous operation |
|
398 |
|
399 @param aFunction: The operation to be handled |
|
400 */ |
|
401 { |
|
402 TRACE3(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl1, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction); |
|
403 |
|
404 TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,0,0)); |
|
405 |
|
406 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl1Return, MODULEUID, r); |
|
407 return r; |
|
408 } |
|
409 |
|
410 EXPORT_C TInt RPlugin::DoControl(TInt aFunction, TDes8& a1) const |
|
411 /** |
|
412 @internalTechnology |
|
413 |
|
414 Client requests a synchronous operation |
|
415 |
|
416 @param aFunction: The operation to be handled |
|
417 @param a1: returned buffer from plugin on comletion of the request |
|
418 */ |
|
419 { |
|
420 TRACE4(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl2, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction, &a1); |
|
421 |
|
422 TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,&a1,0)); |
|
423 |
|
424 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl2Return, MODULEUID, r); |
|
425 return r; |
|
426 } |
|
427 |
|
428 EXPORT_C TInt RPlugin::DoControl(TInt aFunction, TDes8& a1, TDes8& a2) const |
|
429 /** |
|
430 @internalTechnology |
|
431 |
|
432 Client requests a synchronous operation |
|
433 |
|
434 @param aFunction: The operation to be handled |
|
435 @param a1: returned buffer from plugin on comletion of the request |
|
436 @param a2: 2nd returned buffer from plugin on comletion of the request |
|
437 */ |
|
438 { |
|
439 TRACE5(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl3, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction, &a1, &a2); |
|
440 |
|
441 TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,&a1,&a2)); |
|
442 |
|
443 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl3Return, MODULEUID, r); |
|
444 return r; |
|
445 } |
|
446 |
|
447 EXPORT_C void RPlugin::DoCancel(TUint aReqMask) const |
|
448 /** |
|
449 @internalTechnology |
|
450 |
|
451 Cancels a request |
|
452 |
|
453 @param aReqMask: the bit mask for the operation to be cancelled |
|
454 */ |
|
455 { |
|
456 TRACE3(UTF::EBorder, UTraceModuleEfsrv::EPluginDoCancel, MODULEUID, Session().Handle(), SubSessionHandle(), aReqMask); |
|
457 |
|
458 SendReceive(EFsPluginDoCancel,TIpcArgs(KMaxTInt,aReqMask,0)); |
|
459 |
|
460 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoCancelReturn, MODULEUID); |
|
461 } |
|
462 |