Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // f32\sfsrv\cl_plugin.cpp
21 EXPORT_C TInt RFs::AddPlugin(const TDesC& aFileName) const
25 Loads a specified Plugin.
27 @param aFileName The file name of the plugin
29 @return KErrNone, if successful; otherwise one of the other system wide error codes.
34 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddPlugin, MODULEUID, Handle(), aFileName);
37 TInt r = loader.Connect();
40 r = loader.SendReceive(ELoadFSPlugin, TIpcArgs(0, &aFileName, 0));
44 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddPluginReturn, MODULEUID, r);
48 EXPORT_C TInt RFs::RemovePlugin(const TDesC& aPluginName) const
52 Removes the specified plugin.
54 @param aPluginName The full name of the plugin to be removed.
56 @return KErrNone, if successful;
57 KErrNotFound, if aPluginName is not found;
58 otrherwise one of the other system-wide error codes.
63 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemovePlugin, MODULEUID, Handle(), aPluginName);
65 TInt r = SendReceive(EFsRemovePlugin,TIpcArgs(&aPluginName));
67 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemovePluginReturn, MODULEUID, r);
71 EXPORT_C TInt RFs::MountPlugin(const TDesC& aPluginName) const
75 Mounts a specified plugin.
77 Note that this API uses unique position of the plugin.
79 This overload passes KPluginAutoAttach for the drive parameter
80 which mounts on all of the drives specified as supported by the plugin.
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.
86 @param aPluginName The fullname of the plugin, as returned from
87 a call to PluginName().
89 @return KErrNone if successful;
90 KErrNotFound, if the plugin cannot be found;
91 otherwise one of the other system-wide error codes.
98 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin1, MODULEUID, Handle(), aPluginName);
100 TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,KPluginAutoAttach,KPluginAutoLocate));
102 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin1Return, MODULEUID, r);
106 EXPORT_C TInt RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive) const
110 Mounts a specified plugin specifying the drive plugin will support.
112 @param aPluginName The fullname of the plugin, as returned from
113 a call to PluginName().
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.
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.
125 @return KErrNone if successful;
126 KErrNotFound, if the plugin cannot be found;
127 otherwise one of the other system-wide error codes.
131 @capability DiskAdmin
134 TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin2, MODULEUID, Handle(), aPluginName, aDrive);
136 TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,aDrive,KPluginAutoLocate));
138 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin2Return, MODULEUID, r);
142 EXPORT_C TInt RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive, TInt aPos) const
146 Mounts a specified plugin using absolute position and a specific drive
148 @param aPluginName The fullname of the plugin, as returned from
149 a call to PluginName().
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.
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.
161 @param aPos The position at which the plugin is to be mounted within the internal array of plugins.
163 Plugins wishing to be mounted using their CFsPlugin::iUniquePos
164 should use MountPlugin(TDesC&,TInt) or MountPlugin(TDesC&)
166 If there is already a plugin at aPos then this plugin is inserted
167 into aPos and other plugins are shifted downwards.
169 @return KErrNone if successful;
170 KErrNotFound, if the plugin cannot be found;
171 otherwise one of the other system-wide error codes.
174 @see RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive)
175 @capability DiskAdmin
178 TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin3, MODULEUID, Handle(), aPluginName, aDrive, aPos);
180 TInt r = SendReceive(EFsMountPlugin,TIpcArgs(&aPluginName,aDrive,aPos));
182 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountPlugin3Return, MODULEUID, r);
186 EXPORT_C TInt RFs::DismountPlugin(const TDesC& aPluginName) const
190 Dismounts the specified plugin from all drives on which it is mounted.
192 @param aPluginName The fullname of the plugin, as returned from
193 a call to PluginName().
195 @return KErrNone if successful;
196 KErrNotFound, if the plugin cannot be found;
197 otherwise one of the other system-wide error codes.
200 @capability DiskAdmin
203 TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin1, MODULEUID, Handle(), aPluginName);
205 TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,KPluginAutoAttach,KPluginAutoLocate));
207 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin1Return, MODULEUID, r);
212 EXPORT_C TInt RFs::DismountPlugin(const TDesC& aPluginName,TInt aDrive) const
216 Dismounts the specified plugin.
218 @param aPluginName The fullname of the plugin, as returned from
219 a call to PluginName().
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.
228 @return KErrNone if successful;
229 KErrNotFound, if the plugin cannot be found;
230 otherwise one of the other system-wide error codes.
233 @capability DiskAdmin
236 TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin2, MODULEUID, Handle(), aPluginName, aDrive);
238 TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,aDrive,KPluginAutoLocate));
240 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin2Return, MODULEUID, r);
244 EXPORT_C TInt RFs::DismountPlugin(const TDesC& aPluginName,TInt aDrive,TInt aPos) const
248 Dismounts the specified plugin.
250 @param aPluginName The fullname of the plugin, as returned from
251 a call to PluginName().
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.
258 @param aPos The position at which the plugin is located in the internal
260 To automatically locate the position of the plugin use
261 DismountPlugin::(TDesC&,TInt) or
262 DismountPlugin::(TDesC&)
264 @return KErrNone if successful;
265 KErrNotFound, if the plugin cannot be found;
266 otherwise one of the other system-wide error codes.
269 @capability DiskAdmin
272 TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin3, MODULEUID, Handle(), aPluginName, aDrive, aPos);
274 TInt r = SendReceive(EFsDismountPlugin,TIpcArgs(&aPluginName,aDrive,aPos));
276 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountPlugin3Return, MODULEUID, r);
281 EXPORT_C TInt RFs::PluginName(TDes& aPluginName,TInt aDrive,TInt aPos)
285 Gets the name of the plugin on the specified drive at the specified position
286 in the plugin hierarchy.
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.
292 @return KErrNone, if successful;
293 KErrNotFound if the plugin name is not found;
296 TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsPluginName, MODULEUID, Handle(), aDrive, aPos);
298 TInt r = SendReceive(EFsPluginName,TIpcArgs(&aPluginName,aDrive,aPos));
300 TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsPluginName, MODULEUID, r, aPluginName);
304 EXPORT_C TInt RPlugin::Open(RFs& aFs, TInt aPos)
308 Opens a plugin for userside engine conn
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
316 TRACE2(UTF::EBorder, UTraceModuleEfsrv::EPluginOpen, MODULEUID, aFs.Handle(), aPos);
318 TInt r = CreateSubSession(aFs,EFsPluginOpen,TIpcArgs(aPos,0,0));
320 TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EPluginOpenReturn, MODULEUID, r, SubSessionHandle());
324 EXPORT_C void RPlugin::Close()
331 TRACE2(UTF::EBorder, UTraceModuleEfsrv::EPluginClose, MODULEUID, Session().Handle(), SubSessionHandle());
333 CloseSubSession(EFsPluginSubClose);
335 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginCloseReturn, MODULEUID);
338 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus) const
342 Client requests a asynchronous operation
344 @param aReqNo: Number of the request
345 @param aStatus: status of the request
348 TRACE4(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest1, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus);
350 aStatus=KRequestPending;
351 SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, NULL, NULL), aStatus);
353 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest1Return, MODULEUID);
356 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus, TDes8& a1) const
360 Client requests a asynchronous operation
362 @param aReqNo: Number of the request
363 @param aStatus: status of the request
364 @param a1: returning value from plugin
367 TRACE5(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest2, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus, &a1);
369 aStatus=KRequestPending;
370 SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, &a1, NULL), aStatus);
372 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest2Return, MODULEUID);
375 EXPORT_C void RPlugin::DoRequest(TInt aReqNo, TRequestStatus& aStatus, TDes8& a1, TDes8& a2) const
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
385 TRACE6(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest3, MODULEUID, Session().Handle(), SubSessionHandle(), aReqNo, &aStatus, &a1, &a2);
387 aStatus=KRequestPending;
388 SendReceive(EFsPluginDoRequest, TIpcArgs(aReqNo, &a1, &a2), aStatus);
390 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoRequest3Return, MODULEUID);
393 EXPORT_C TInt RPlugin::DoControl(TInt aFunction) const
397 Client requests a synchronous operation
399 @param aFunction: The operation to be handled
402 TRACE3(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl1, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction);
404 TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,0,0));
406 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl1Return, MODULEUID, r);
410 EXPORT_C TInt RPlugin::DoControl(TInt aFunction, TDes8& a1) const
414 Client requests a synchronous operation
416 @param aFunction: The operation to be handled
417 @param a1: returned buffer from plugin on completion of the request
420 TRACE4(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl2, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction, &a1);
422 TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,&a1,0));
424 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl2Return, MODULEUID, r);
428 EXPORT_C TInt RPlugin::DoControl(TInt aFunction, TDes8& a1, TDes8& a2) const
432 Client requests a synchronous operation
434 @param aFunction: The operation to be handled
435 @param a1: returned buffer from plugin on completion of the request
436 @param a2: 2nd returned buffer from plugin on completion of the request
439 TRACE5(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl3, MODULEUID, Session().Handle(), SubSessionHandle(), aFunction, &a1, &a2);
441 TInt r = SendReceive(EFsPluginDoControl,TIpcArgs(aFunction,&a1,&a2));
443 TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EPluginDoControl3Return, MODULEUID, r);
447 EXPORT_C void RPlugin::DoCancel(TUint aReqMask) const
453 @param aReqMask: the bit mask for the operation to be cancelled
456 TRACE3(UTF::EBorder, UTraceModuleEfsrv::EPluginDoCancel, MODULEUID, Session().Handle(), SubSessionHandle(), aReqMask);
458 SendReceive(EFsPluginDoCancel,TIpcArgs(KMaxTInt,aReqMask,0));
460 TRACE0(UTF::EBorder, UTraceModuleEfsrv::EPluginDoCancelReturn, MODULEUID);