userlibandfileserver/fileserver/sfsrv/cl_cli.cpp
changeset 134 95847726fe57
parent 36 538db54a451d
child 199 189ece41fa29
equal deleted inserted replaced
133:2a0ada0a1bf8 134:95847726fe57
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 #include "cl_std.h"
    18 #include "cl_std.h"
    19 #include <f32fsys.h>
    19 #include <f32fsys.h>
    20 
    20 #ifdef OST_TRACE_COMPILER_IN_USE
    21 
    21 #include "cl_cliTraces.h"
    22 
    22 #endif
    23 
       
    24 
       
    25 
       
    26 
       
    27 EFSRV_EXPORT_C TBool RFs::IsValidDrive(TInt aDrive)
    23 EFSRV_EXPORT_C TBool RFs::IsValidDrive(TInt aDrive)
    28 /**
    24 /**
    29 Tests whether the specified drive number is valid.
    25 Tests whether the specified drive number is valid.
    30 
    26 
    31 A valid drive number is any number between 0 and (KMaxDrives-1) inclusive,
    27 A valid drive number is any number between 0 and (KMaxDrives-1) inclusive,
    95 */
    91 */
    96 	{
    92 	{
    97 
    93 
    98 	if (aDrive==KDefaultDrive)
    94 	if (aDrive==KDefaultDrive)
    99 		{
    95 		{
   100 		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveToChar, MODULEUID, aDrive);
    96 		OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVETOCHAR, "aDrive %d", aDrive);
   101 		RFs fs;
    97 		RFs fs;
   102 		TFileName path;
    98 		TFileName path;
   103 		TInt r=fs.Connect();
    99 		TInt r=fs.Connect();
   104 		if (r!=KErrNone)
   100 		if (r!=KErrNone)
   105 			return(r);
   101 			return(r);
   106 		r=fs.SessionPath(path);
   102 		r=fs.SessionPath(path);
   107 		fs.Close();
   103 		fs.Close();
   108 		if (r!=KErrNone)
   104 		if (r!=KErrNone)
   109 			return(r);
   105 			return(r);
   110 		aChar=path[0];
   106 		aChar=path[0];
   111 		TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsDriveToCharReturn, MODULEUID, KErrNone, aChar);
   107 		OstTraceExt2(TRACE_BORDER, EFSRV_EFSDRIVETOCHARRETURN, "r %d aChar %x", (TUint) KErrNone, (TUint) aChar);
   112 		return(KErrNone);
   108 		return(KErrNone);
   113 		}
   109 		}
   114 	if (!IsValidDrive(aDrive))
   110 	if (!IsValidDrive(aDrive))
   115 		return(KErrArgument);
   111 		return(KErrArgument);
   116 	aChar=aDrive+'A';
   112 	aChar=aDrive+'A';
   127 @param aPtr The address.
   123 @param aPtr The address.
   128 
   124 
   129 @return True, if the address is in ROM; false, if not.
   125 @return True, if the address is in ROM; false, if not.
   130 */
   126 */
   131 	{
   127 	{
   132 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsRomAddress, MODULEUID, aPtr);
   128 	OstTrace1(TRACE_BORDER, EFSRV_EFSISROMADDRESS, "aPtr %x", aPtr);
   133 
       
   134 	TBool res;
   129 	TBool res;
   135 	TInt r=User::IsRomAddress(res,aPtr); // Only returns error on WINS
   130 	TInt r=User::IsRomAddress(res,aPtr); // Only returns error on WINS
   136 	if (r!=KErrNone)
   131 	if (r!=KErrNone)
   137 		res=EFalse;
   132 		res=EFalse;
   138 
   133 	OstTrace1(TRACE_BORDER, EFSRV_EFSISROMADDRESSRETURN, "r %d", res);
   139 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsIsRomAddressReturn, MODULEUID, res);
       
   140 	return(res);
   134 	return(res);
   141 	}
   135 	}
   142 
   136 
   143 
   137 
   144 
   138 
   164 @see TDriveNumber
   158 @see TDriveNumber
   165 @return TDriveNumber contains the drive number of the system drive.
   159 @return TDriveNumber contains the drive number of the system drive.
   166  */
   160  */
   167 EFSRV_EXPORT_C TDriveNumber RFs::GetSystemDrive()
   161 EFSRV_EXPORT_C TDriveNumber RFs::GetSystemDrive()
   168     {
   162     {
   169 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDrive, MODULEUID);
   163 	OstTrace0(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVE, "");
   170     TInt drive;
   164     TInt drive;
   171 	TInt err = RProperty::Get(TSecureId(KFileServerUidValue), KSystemDriveKey, drive);
   165 	TInt err = RProperty::Get(TSecureId(KFileServerUidValue), KSystemDriveKey, drive);
   172     if(err==KErrNone)
   166     if(err==KErrNone)
   173         {
   167         {
   174         if((drive>=EDriveA) && (drive<=EDriveZ))
   168         if((drive>=EDriveA) && (drive<=EDriveZ))
   175             {
   169             {
   176 			TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveReturn, MODULEUID, drive);
   170 			OstTrace1(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVERETURN1, "r %d", drive);
   177             return static_cast<TDriveNumber>(drive);
   171             return static_cast<TDriveNumber>(drive);
   178             }
   172             }
   179         }
   173         }
   180 
   174 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVERETURN2, "r %d", EDriveC);
   181 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveReturn, MODULEUID, EDriveC);
       
   182     return EDriveC;
   175     return EDriveC;
   183 	}
   176 	}
   184     
   177     
   185 
   178 
   186 
   179 
   191 @return KErrNone if successful, otherwise one of the other system-wide error codes
   184 @return KErrNone if successful, otherwise one of the other system-wide error codes
   192 @see RFs::GetSystemDrive
   185 @see RFs::GetSystemDrive
   193 */
   186 */
   194 EFSRV_EXPORT_C TChar RFs::GetSystemDriveChar()
   187 EFSRV_EXPORT_C TChar RFs::GetSystemDriveChar()
   195 	{
   188 	{
   196 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveChar, MODULEUID);
   189 	OstTrace0(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVECHAR, "");
   197 
       
   198 	TInt r = 'A' + GetSystemDrive();
   190 	TInt r = 'A' + GetSystemDrive();
   199 
   191 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSYSTEMDRIVECHARRETURN, "RFs::GetSystemDriveChar() r %x", (char) r);
   200 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetSystemDriveCharReturn, MODULEUID, r);
       
   201 	return r;
   192 	return r;
   202 	}
   193 	}
   203 
   194 
   204 
   195 
   205 
   196 
   215 @return KErrNone if successful, otherwise one of the other system-wide error codes
   206 @return KErrNone if successful, otherwise one of the other system-wide error codes
   216 @capability TCB
   207 @capability TCB
   217 */
   208 */
   218 EFSRV_EXPORT_C TInt RFs::SetSystemDrive(TDriveNumber aSystemDrive)
   209 EFSRV_EXPORT_C TInt RFs::SetSystemDrive(TDriveNumber aSystemDrive)
   219 	{
   210 	{
   220 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetSystemDrive, MODULEUID, Handle(), aSystemDrive);
   211 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETSYSTEMDRIVE, "sess %x aSystemDrive %d", (TUint) Handle(), (TUint) aSystemDrive);
   221     TInt r = SendReceive(EFsSetSystemDrive, TIpcArgs(aSystemDrive));
   212     TInt r = SendReceive(EFsSetSystemDrive, TIpcArgs(aSystemDrive));
   222 
   213 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSYSTEMDRIVERETURN, "r %d", r);
   223 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSystemDriveReturn, MODULEUID, r);
       
   224 	return r;
   214 	return r;
   225 	}
   215 	}
   226 
   216 
   227     
   217     
   228 
   218 
   245 
   235 
   246 @return KErrNone, if successful, otherwise one of the other system-wide
   236 @return KErrNone, if successful, otherwise one of the other system-wide
   247         error codes.
   237         error codes.
   248 */
   238 */
   249 	{
   239 	{
   250 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsConnect, MODULEUID, aMessageSlots);
   240 	OstTrace1(TRACE_BORDER, EFSRV_EFSCONNECT, "aMessageSlots %d", aMessageSlots);
   251 	_LIT(KFileServerName,"!FileServer");
   241 	_LIT(KFileServerName,"!FileServer");
   252 	TInt r = CreateSession(KFileServerName,Version(),aMessageSlots);
   242 	TInt r = CreateSession(KFileServerName,Version(),aMessageSlots);
   253 
   243 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCONNECTRETURN, "r %d sess %x", (TUint) r, (TUint) Handle());
   254 	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsConnectReturn, MODULEUID, r, Handle());
       
   255 	return r;
   244 	return r;
   256 	}
   245 	}
   257 
   246 
   258 
   247 
   259 
   248 
   273 
   262 
   274 @return KErrNone, if successful, otherwise one of the other system-wide
   263 @return KErrNone, if successful, otherwise one of the other system-wide
   275         error codes.
   264         error codes.
   276 */
   265 */
   277 	{	
   266 	{	
   278 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionToPrivate, MODULEUID, Handle(), aDrive);
   267 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETSESSIONTOPRIVATE, "sess %x  aDrive %d", (TUint) Handle(), (TUint) aDrive);
   279 	TInt r = SendReceive(EFsSessionToPrivate,TIpcArgs(aDrive));
   268 	TInt r = SendReceive(EFsSessionToPrivate,TIpcArgs(aDrive));
   280 
   269 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSESSIONTOPRIVATERETURN, "r %d", r);
   281 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionToPrivateReturn, MODULEUID, r);
       
   282 	return r;
   270 	return r;
   283 	}
   271 	}
   284 
   272 
   285 
   273 
   286 
   274 
   292 where 13579BDF is the identity of the process.
   280 where 13579BDF is the identity of the process.
   293 
   281 
   294 @param aPath On successful return, contains the private path for a process.
   282 @param aPath On successful return, contains the private path for a process.
   295 */
   283 */
   296 	{
   284 	{
   297 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsPrivatePath, MODULEUID, Handle());
   285 	OstTrace1(TRACE_BORDER, EFSRV_EFSPRIVATEPATH, "sess %x", Handle());
   298 	TInt r = SendReceive(EFsPrivatePath,TIpcArgs(&aPath));
   286 	TInt r = SendReceive(EFsPrivatePath,TIpcArgs(&aPath));
   299 
   287 	OstTraceData(TRACE_BORDER, EFSRV_EFSPRIVATEPATH_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
   300 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsPrivatePathReturn, MODULEUID, r, aPath);
   288 	OstTrace1(TRACE_BORDER, EFSRV_EFSPRIVATEPATHRETURN, "r %d", r);
   301 	return r;
   289 	return r;
   302 	}
   290 	}
   303 
   291 
   304 
   292 
   305 
   293 
   316 
   304 
   317 @return KErrNone, if successful, otherwise one of the other system-wide
   305 @return KErrNone, if successful, otherwise one of the other system-wide
   318         error codes.
   306         error codes.
   319 */
   307 */
   320 	{
   308 	{
   321 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsCreatePrivatePath, MODULEUID, Handle(), aDrive);
   309 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCREATEPRIVATEPATH, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   322 	TInt r = SendReceive(EFsCreatePrivatePath,TIpcArgs(aDrive));
   310 	TInt r = SendReceive(EFsCreatePrivatePath,TIpcArgs(aDrive));
   323 
   311 	OstTrace1(TRACE_BORDER, EFSRV_EFSCREATEPRIVATEPATHRETURN, "r %d", r);
   324 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsCreatePrivatePathReturn, MODULEUID, r);
       
   325 	return r;
   312 	return r;
   326 	}	
   313 	}	
   327 
   314 
   328 
   315 
   329 
   316 
   333 Gets the client side version number.
   320 Gets the client side version number.
   334 
   321 
   335 @return The client side version number.
   322 @return The client side version number.
   336 */
   323 */
   337 	{
   324 	{
   338 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsVersion, MODULEUID, Handle());
   325 	OstTrace1(TRACE_BORDER, EFSRV_EFSVERSION, "sess %x", Handle());
   339 
       
   340 	TVersion r = TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
   326 	TVersion r = TVersion(KF32MajorVersionNumber,KF32MinorVersionNumber,KF32BuildVersionNumber);
   341 
   327 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSVERSIONRETURN, "iMajor %d iMinor %d iBuild %d", (TUint) r.iMajor, (TUint) r.iMinor, (TUint) r.iBuild);
   342 	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFsVersionReturn, MODULEUID, r.iMajor, r.iMinor, r.iBuild);
       
   343 	return r;
   328 	return r;
   344 	}
   329 	}
   345 
   330 
   346 
   331 
   347 
   332 
   362 @capability DiskAdmin
   347 @capability DiskAdmin
   363         
   348         
   364 @see RFs::MountFileSystem        
   349 @see RFs::MountFileSystem        
   365 */
   350 */
   366 	{
   351 	{
   367 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddFileSystem, MODULEUID, Handle(), aFileName);
   352 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM, "sess %x", Handle());
       
   353 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
   368 	RLoader loader;
   354 	RLoader loader;
   369 	TInt r = loader.Connect();
   355 	TInt r = loader.Connect();
   370 	if (r==KErrNone)
   356 	if (r==KErrNone)
   371 		{
   357 		{
   372 		r = loader.SendReceive(ELoadFileSystem, TIpcArgs(0, &aFileName, 0));
   358 		r = loader.SendReceive(ELoadFileSystem, TIpcArgs(0, &aFileName, 0));
   373 		loader.Close();
   359 		loader.Close();
   374 		}
   360 		}
   375 
   361 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDFILESYSTEMRETURN, "r %d", r);
   376 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddFileSystemReturn, MODULEUID, r);
       
   377 	return r;
   362 	return r;
   378 	}
   363 	}
   379 
   364 
   380 
   365 
   381 
   366 
   393 
   378 
   394 @capability DiskAdmin
   379 @capability DiskAdmin
   395 
   380 
   396 */
   381 */
   397 	{
   382 	{
   398 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveFileSystem, MODULEUID, Handle(), aFileSystemName);
   383 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM, "sess %x", Handle());
       
   384 	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   399 	TInt r = SendReceive(EFsRemoveFileSystem,TIpcArgs(&aFileSystemName));
   385 	TInt r = SendReceive(EFsRemoveFileSystem,TIpcArgs(&aFileSystemName));
   400 
   386 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEMRETURN, "r %d", r);
   401 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveFileSystemReturn, MODULEUID, r);
       
   402 	return r;
   387 	return r;
   403 	}
   388 	}
   404 
   389 
   405 
   390 
   406 
   391 
   421 
   406 
   422 @see RFs::AddFileSystem
   407 @see RFs::AddFileSystem
   423 @see RFs::FileSystemName
   408 @see RFs::FileSystemName
   424 */
   409 */
   425 	{
   410 	{
   426 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem1, MODULEUID, Handle(), aFileSystemName, aDrive);
   411 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
   412 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   427 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,EFalse));
   413 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,EFalse));
   428 
   414 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1RETURN, "r %d", r);
   429 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem1Return, MODULEUID, r);
       
   430 	return r;
   415 	return r;
   431 	}
   416 	}
   432 
   417 
   433 
   418 
   434 
   419 
   452 @param aIsSync         if ETrue  the drive will be mounted as synchronous one;
   437 @param aIsSync         if ETrue  the drive will be mounted as synchronous one;
   453                        if EFalse the drive will be mounted as Asynchronous.
   438                        if EFalse the drive will be mounted as Asynchronous.
   454 
   439 
   455 @return KErrNone if successful, otherwise one of the other system-wide error codes.
   440 @return KErrNone if successful, otherwise one of the other system-wide error codes.
   456 @capability DiskAdmin
   441 @capability DiskAdmin
   457 
       
   458 @see RFs::AddFileSystem
   442 @see RFs::AddFileSystem
   459 @see RFs::FileSystemName
   443 @see RFs::FileSystemName
   460 */
   444 */
   461 	{
   445 	{
   462 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem2, MODULEUID, Handle(), aFileSystemName, aDrive, aIsSync);
   446 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
   463 
   447 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   464 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,aIsSync));
   448 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,aIsSync));
   465 
   449 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2RETURN, "r %d", r);
   466 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem2Return, MODULEUID, r);
       
   467 	return r;
   450 	return r;
   468 	}
   451 	}
   469 
   452 
   470 
   453 
   471 
   454 
   487 
   470 
   488 @see RFs::AddFileSystem
   471 @see RFs::AddFileSystem
   489 @see RFs::FileSystemName
   472 @see RFs::FileSystemName
   490 */
   473 */
   491 	{
   474 	{
   492 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem3, MODULEUID, Handle(), aFileSystemName, aExtensionName, aDrive);
   475 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   493 
   476 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
       
   477 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   494 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,EFalse));
   478 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,EFalse));
   495 
   479 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3RETURN, "r %d", r);
   496 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem3Return, MODULEUID, r);
       
   497 	return r;
   480 	return r;
   498 	}
   481 	}
   499 
   482 
   500 
   483 
   501 
   484 
   526 
   509 
   527 @see RFs::AddFileSystem
   510 @see RFs::AddFileSystem
   528 @see RFs::FileSystemName
   511 @see RFs::FileSystemName
   529 */
   512 */
   530 	{
   513 	{
   531 	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem4, MODULEUID, Handle(), aFileSystemName, aExtensionName, aDrive, aIsSync);
   514 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
       
   515 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
       
   516 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   532 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,aIsSync));
   517 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,aIsSync));
   533 
   518 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4RETURN, "r %d", r);
   534 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystem4Return, MODULEUID, r);
       
   535 	return r;
   519 	return r;
   536 	}
   520 	}
   537 
   521 
   538 
   522 
   539 
   523 
   558 @see RFs::TDriveNumber
   542 @see RFs::TDriveNumber
   559 @see RFs::AddFileSystem
   543 @see RFs::AddFileSystem
   560 @see RFs::FileSystemName
   544 @see RFs::FileSystemName
   561 */
   545 */
   562 	{
   546 	{
   563 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan1, MODULEUID, Handle(), aFileSystemName, aDrive);
   547 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
   548 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   564 	aIsMountSuccess=EFalse;
   549 	aIsMountSuccess=EFalse;
   565 	TPckg<TInt> pckg(aIsMountSuccess);
   550 	TPckg<TInt> pckg(aIsMountSuccess);
   566 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,NULL,&pckg));
   551 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,NULL,&pckg));
   567 
   552 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
   568 	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan1Return, MODULEUID, r, aIsMountSuccess);
       
   569 	return r;
   553 	return r;
   570 	}
   554 	}
   571 
   555 
   572 EFSRV_EXPORT_C TInt RFs::MountFileSystemAndScan(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive,TBool& aIsMountSuccess) const
   556 EFSRV_EXPORT_C TInt RFs::MountFileSystemAndScan(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive,TBool& aIsMountSuccess) const
   573 /**
   557 /**
   596 @see RFs::TDriveNumber
   580 @see RFs::TDriveNumber
   597 @see RFs::AddFileSystem
   581 @see RFs::AddFileSystem
   598 @see RFs::FileSystemName
   582 @see RFs::FileSystemName
   599 */
   583 */
   600 	{
   584 	{
   601 	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan2, MODULEUID, 
   585 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2, "sess %x aDrive %d aIsMountSuccess %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsMountSuccess);
   602 		Handle(), aFileSystemName, aExtensionName, aDrive, aIsMountSuccess);
   586 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   603 
   587 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   604 	aIsMountSuccess=EFalse;
   588 	aIsMountSuccess=EFalse;
   605 	TPckg<TInt> pckg(aIsMountSuccess);
   589 	TPckg<TInt> pckg(aIsMountSuccess);
   606 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,&pckg));
   590 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,&pckg));
   607 
   591 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
   608 	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsMountFileSystemAndScan2Return, MODULEUID, r, aIsMountSuccess);
       
   609 	return r;
   592 	return r;
   610 	}
   593 	}
   611 
   594 
   612 EFSRV_EXPORT_C TInt RFs::DismountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const
   595 EFSRV_EXPORT_C TInt RFs::DismountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const
   613 /**
   596 /**
   630 @capability DiskAdmin
   613 @capability DiskAdmin
   631  		
   614  		
   632 @see RFs::FileSystemName 		
   615 @see RFs::FileSystemName 		
   633 */
   616 */
   634 	{
   617 	{
   635 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountFileSystem, MODULEUID, Handle(), aFileSystemName, aDrive);
   618 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
   619 	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   636 	TInt r = SendReceive(EFsDismountFileSystem,TIpcArgs(&aFileSystemName,aDrive));
   620 	TInt r = SendReceive(EFsDismountFileSystem,TIpcArgs(&aFileSystemName,aDrive));
   637 
   621 	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEMRETURN, "r %d", r);
   638 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountFileSystemReturn, MODULEUID, r);
       
   639 	return r;
   622 	return r;
   640 	}
   623 	}
   641 
   624 
   642 
   625 
   643 
   626 
   659 
   642 
   660     @see RFs::DismountFileSystem				
   643     @see RFs::DismountFileSystem				
   661 */
   644 */
   662 EFSRV_EXPORT_C TInt RFs::FileSystemName(TDes& aName,TInt aDrive) const
   645 EFSRV_EXPORT_C TInt RFs::FileSystemName(TDes& aName,TInt aDrive) const
   663 	{
   646 	{
   664 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemName, MODULEUID, Handle(), aDrive);
   647 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   665 
       
   666 	//-- ipc argument "-1" here is to indicate legacy FileSystemName() API
   648 	//-- ipc argument "-1" here is to indicate legacy FileSystemName() API
   667     TInt r = SendReceive(EFsFileSystemName,TIpcArgs(&aName, aDrive, -1)); 
   649     TInt r = SendReceive(EFsFileSystemName,TIpcArgs(&aName, aDrive, -1)); 
   668 
   650 	OstTraceData(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAME_EFILESYSTEMNAME, "FileSystemName %S", aName.Ptr(), aName.Length()<<1);
   669 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemNameReturn, MODULEUID, r, aName);
   651 	OstTrace1(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAMERETURN, "r %d", r);
   670 	return r;
   652 	return r;
   671 	}
   653 	}
   672 
   654 
   673 
   655 
   674 /**
   656 /**
   699 */
   681 */
   700 EFSRV_EXPORT_C TInt RFs::SupportedFileSystemName(TDes& aName, TInt aDrive, TInt aFsEnumerator) const
   682 EFSRV_EXPORT_C TInt RFs::SupportedFileSystemName(TDes& aName, TInt aDrive, TInt aFsEnumerator) const
   701     {
   683     {
   702 	if(aFsEnumerator < 0)
   684 	if(aFsEnumerator < 0)
   703         return KErrArgument; //-- see RFs::FileSystemName(). "-1" is a reserved value
   685         return KErrArgument; //-- see RFs::FileSystemName(). "-1" is a reserved value
   704 
   686     OstTraceExt2(TRACE_BORDER, EFSRV_EFSSUPPORTEDFILESYSTEMNAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   705     TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemName, MODULEUID, Handle(), aDrive);
       
   706     
   687     
   707     TInt r = SendReceive(EFsFileSystemName,TIpcArgs(&aName, aDrive, aFsEnumerator));
   688     TInt r = SendReceive(EFsFileSystemName,TIpcArgs(&aName, aDrive, aFsEnumerator));
   708 
   689 	OstTraceData(TRACE_BORDER, EFSRV_EFSFILESYSTEMNAME_ESUPPORTEDFILESYSTEMNAME, "SupportedFileSystemName %S", aName.Ptr(), aName.Length()<<1);
   709 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemNameReturn, MODULEUID, r, aName);
   690 	OstTrace1(TRACE_BORDER, EFSRV_EFSSUPPORTEDFILESYSTEMNAMERETURN, "r %d", r);
   710 	return r;
   691 	return r;
   711     }
   692     }
   712 
   693 
   713 
   694 
   714 
   695 
   721 @param aFileName The file name of the extension
   702 @param aFileName The file name of the extension
   722 
   703 
   723 @return KErrNone, if successful; otherwise one of the other system wide error codes.
   704 @return KErrNone, if successful; otherwise one of the other system wide error codes.
   724 */
   705 */
   725 	{
   706 	{
   726 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAddExtension, MODULEUID, Handle(), aFileName);
   707 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDEXTENSION, "sess %x", Handle());
       
   708 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aFileName.Ptr(), aFileName.Length()<<1);
   727 	RLoader loader;
   709 	RLoader loader;
   728 	TInt r = loader.Connect();
   710 	TInt r = loader.Connect();
   729 	if (r==KErrNone)
   711 	if (r==KErrNone)
   730 		{
   712 		{
   731 		r = loader.SendReceive(ELoadFSExtension, TIpcArgs(0, &aFileName, 0));
   713 		r = loader.SendReceive(ELoadFSExtension, TIpcArgs(0, &aFileName, 0));
   732 		loader.Close();
   714 		loader.Close();
   733 		}
   715 		}
   734 
   716 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDEXTENSIONRETURN, "r %d", r);
   735 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddExtensionReturn, MODULEUID, r);
       
   736 	return r;
   717 	return r;
   737 	}
   718 	}
   738 
   719 
   739 
   720 
   740 
   721 
   754         otherwise one of the other system-wide error codes.
   735         otherwise one of the other system-wide error codes.
   755 
   736 
   756 @see RFs::ExtensionName
   737 @see RFs::ExtensionName
   757 */
   738 */
   758 	{
   739 	{
   759 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsMountExtension, MODULEUID, Handle(), aExtensionName, aDrive);
   740 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
   741 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   760 	TInt r = SendReceive(EFsMountExtension,TIpcArgs(&aExtensionName,aDrive));
   742 	TInt r = SendReceive(EFsMountExtension,TIpcArgs(&aExtensionName,aDrive));
   761 
   743 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSIONRETURN, "r %d", r);
   762 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMountExtensionReturn, MODULEUID, r);
       
   763 	return r;
   744 	return r;
   764 	}
   745 	}
   765 
   746 
   766 
   747 
   767 
   748 
   778         
   759         
   779 @see RFs::ExtensionName
   760 @see RFs::ExtensionName
   780 */
   761 */
   781 EFSRV_EXPORT_C TInt RFs::DismountExtension(const TDesC& aExtensionName,TInt aDrive)
   762 EFSRV_EXPORT_C TInt RFs::DismountExtension(const TDesC& aExtensionName,TInt aDrive)
   782 	{
   763 	{
   783 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsDismountExtension, MODULEUID, Handle(), aExtensionName, aDrive);
   764 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTEXTENSION, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
   765 	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   784 	TInt r = SendReceive(EFsDismountExtension,TIpcArgs(&aExtensionName,aDrive));
   766 	TInt r = SendReceive(EFsDismountExtension,TIpcArgs(&aExtensionName,aDrive));
   785 
   767 	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTEXTENSIONRETURN, "r %d", r);
   786 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDismountExtensionReturn, MODULEUID, r);
       
   787 	return r;
   768 	return r;
   788 	}
   769 	}
   789 
   770 
   790 
   771 
   791 EFSRV_EXPORT_C TInt RFs::RemoveExtension(const TDesC& aExtensionName)
   772 EFSRV_EXPORT_C TInt RFs::RemoveExtension(const TDesC& aExtensionName)
   798 @return KErrNone, if successful;
   779 @return KErrNone, if successful;
   799         KErrNotFound, if aExtensionName is not found;
   780         KErrNotFound, if aExtensionName is not found;
   800         otrherwise one of the other system-wide error codes.
   781         otrherwise one of the other system-wide error codes.
   801 */
   782 */
   802 	{
   783 	{
   803 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveExtension, MODULEUID, Handle(), aExtensionName);
   784 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEEXTENSION, "sess %x", Handle());
       
   785 	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   804 	TInt r = SendReceive(EFsRemoveExtension,TIpcArgs(&aExtensionName));
   786 	TInt r = SendReceive(EFsRemoveExtension,TIpcArgs(&aExtensionName));
   805 
   787 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEEXTENSIONRETURN, "r %d", r);
   806 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemoveExtensionReturn, MODULEUID, r);
       
   807 	return r;
   788 	return r;
   808 	}
   789 	}
   809 
   790 
   810 
   791 
   811 
   792 
   821 
   802 
   822 @return KErrNone, if successful;
   803 @return KErrNone, if successful;
   823         KErrNotFound if the extension name is not found;
   804         KErrNotFound if the extension name is not found;
   824 */
   805 */
   825 	{
   806 	{
   826 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsExtensionName, MODULEUID, Handle(), aExtensionName, aDrive, aPos);
   807 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSEXTENSIONNAME, "sess %x aDrive %d aPos %x", (TUint) Handle(), (TUint) aDrive, (TUint) aPos);
       
   808 	OstTraceData(TRACE_BORDER, EFSRV_EFSEXTENSIONNAME_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   827 	TInt r = SendReceive(EFsExtensionName,TIpcArgs(&aExtensionName,aDrive,aPos));
   809 	TInt r = SendReceive(EFsExtensionName,TIpcArgs(&aExtensionName,aDrive,aPos));
   828 
   810 	OstTrace1(TRACE_BORDER, EFSRV_EFSEXTENSIONNAMERETURN, "r %d", r);
   829 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsExtensionNameReturn, MODULEUID, r);
       
   830 	return r;
   811 	return r;
   831 	}
   812 	}
   832 
   813 
   833 
   814 
   834 
   815 
   848 
   829 
   849 @return KErrNone if successful, otherwise one of
   830 @return KErrNone if successful, otherwise one of
   850         the other system wide error codes.
   831         the other system wide error codes.
   851 */
   832 */
   852 	{
   833 	{
   853 	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFsRemountDrive, MODULEUID, Handle(), aDrive, aMountInfo, aFlags);
   834 	OstTraceExt4(TRACE_BORDER, EFSRV_EFSREMOUNTDRIVE, "sess %x aDrive %d aMountInfo %x aFlags %x", (TUint) Handle(), aDrive, (TUint) aMountInfo, (TUint) aFlags);
   854 	TInt r = SendReceive(EFsRemountDrive,TIpcArgs(aDrive,aMountInfo,aFlags));
   835 	TInt r = SendReceive(EFsRemountDrive,TIpcArgs(aDrive,aMountInfo,aFlags));
   855 
   836 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOUNTDRIVERETURN, "r %d", r);
   856 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRemountDriveReturn, MODULEUID, r);
       
   857 	return r;
   837 	return r;
   858 	}
   838 	}
   859 
   839 
   860 
   840 
   861 
   841 
   897              This is set to KErrNone on completion, otherwise one of the other
   877              This is set to KErrNone on completion, otherwise one of the other
   898              system-wide error codes.
   878              system-wide error codes.
   899 
   879 
   900 */
   880 */
   901 	{
   881 	{
   902 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange1, MODULEUID, Handle(), aType, &aStat);
   882 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE1, "sess %x aType %x status %x", (TUint) Handle(), (TUint) aType, (TUint) &aStat);
   903 	aStat=KRequestPending;
   883 	aStat=KRequestPending;
   904 	// for backward compatibility
   884 	// for backward compatibility
   905 	TNotifyType type = (aType == 0 ? ENotifyEntry : aType);
   885 	TNotifyType type = (aType == 0 ? ENotifyEntry : aType);
   906 	RSessionBase::SendReceive(EFsNotifyChange, TIpcArgs(type,&aStat) , aStat );
   886 	RSessionBase::SendReceive(EFsNotifyChange, TIpcArgs(type,&aStat) , aStat );
   907 	//This call is to synchronise with the file server when this functions stack varibles can go out of scope
   887 	//This call is to synchronise with the file server when this functions stack varibles can go out of scope
   908 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(-1));		
   888 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(-1));		
   909 
   889 
   910 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange1Return, MODULEUID);
   890 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE1RETURN, "");
   911 	}
   891 	}
   912 
   892 
   913 
   893 
   914 
   894 
   915 
   895 
   964 @capability Dependent If aName begins with /Private and does not match this process' SID
   944 @capability Dependent If aName begins with /Private and does not match this process' SID
   965 					  then AllFiles capability is required.
   945 					  then AllFiles capability is required.
   966 
   946 
   967 */
   947 */
   968 	{
   948 	{
   969 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange2, MODULEUID, Handle(), (TUint) aType, (TUint) &aStat, aPathName);
   949 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE2, "sess %x aType %x status %x", (TUint) Handle(), (TUint) aType, (TUint) &aStat);
       
   950 	OstTraceData(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE2_EDIRNAME, "Dir %S", aPathName.Ptr(), aPathName.Length()<<1);
   970 	aStat=KRequestPending;
   951 	aStat=KRequestPending;
   971 	// for backward compatibility
   952 	// for backward compatibility
   972 	TNotifyType type = (aType == 0 ? ENotifyEntry : aType);
   953 	TNotifyType type = (aType == 0 ? ENotifyEntry : aType);
   973 	RSessionBase::SendReceive(EFsNotifyChangeEx,TIpcArgs(type,&aPathName,&aStat),aStat);
   954 	RSessionBase::SendReceive(EFsNotifyChangeEx,TIpcArgs(type,&aPathName,&aStat),aStat);
   974 	//This call is to synchronise with the file server when this functions stack varibles can go out of scope
   955 	//This call is to synchronise with the file server when this functions stack varibles can go out of scope
   975 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(-1));
   956 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(-1));
   976 
   957 
   977 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChange2Return, MODULEUID);
   958 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGE2RETURN, "");
   978 	}
   959 	}
   979 
   960 
   980 
   961 
   981 
   962 
   982 
   963 
   989 
   970 
   990 Note that this is a synchronous function.
   971 Note that this is a synchronous function.
   991 
   972 
   992 */
   973 */
   993 	{
   974 	{
   994 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel1, MODULEUID, Handle());
   975 	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL1, "sess %x", Handle());
   995 	RSessionBase::SendReceive(EFsNotifyChangeCancel);
   976 	RSessionBase::SendReceive(EFsNotifyChangeCancel);
   996 
   977 
   997 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel1Return, MODULEUID);
   978 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL1RETURN, "");
   998 	}
   979 	}
   999 
   980 
  1000 
   981 
  1001 
   982 
  1002 
   983 
  1013              to be cancelled. Note that the function does not change
   994              to be cancelled. Note that the function does not change
  1014              this parameter.
   995              this parameter.
  1015 
   996 
  1016 */
   997 */
  1017 	{
   998 	{
  1018 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel2, MODULEUID, Handle(), &aStat);
   999 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL2, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
  1019 	if (aStat==KRequestPending)			//	May be better to ASSERT this?
  1000 	if (aStat==KRequestPending)			//	May be better to ASSERT this?
  1020 		SendReceive(EFsNotifyChangeCancelEx,TIpcArgs(&aStat));
  1001 		SendReceive(EFsNotifyChangeCancelEx,TIpcArgs(&aStat));
  1021 
  1002 
  1022 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyChangeCancel2Return, MODULEUID);
  1003 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYCHANGECANCEL2RETURN, "");
  1023 	}
  1004 	}
  1024 
  1005 
  1025 
  1006 
  1026 
  1007 
  1027 
  1008 
  1068                   KErrArgument, if the threshold value is outside its limits.
  1049                   KErrArgument, if the threshold value is outside its limits.
  1069 
  1050 
  1070 @see TDriveNumber
  1051 @see TDriveNumber
  1071 */
  1052 */
  1072 	{
  1053 	{
  1073 	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpace, MODULEUID, 
  1054 	OstTraceExt5(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACE, "sess %x aThreshold %x:%x aDrive %d status %x", (TUint) Handle(), (TUint) I64HIGH(aThreshold), (TUint) I64LOW(aThreshold), (TUint) aDrive, (TUint) &aStat);
  1074 		Handle(), I64LOW(aThreshold),I64HIGH(aThreshold), aDrive,(TUint) &aStat);
  1055 		
  1075 	aStat=KRequestPending;
  1056 	aStat=KRequestPending;
  1076 	TPtrC8 tBuf((TUint8*)&aThreshold,sizeof(TInt64));
  1057 	TPtrC8 tBuf((TUint8*)&aThreshold,sizeof(TInt64));
  1077 	RSessionBase::SendReceive(EFsNotifyDiskSpace,TIpcArgs(&tBuf,aDrive,&aStat), aStat);
  1058 	RSessionBase::SendReceive(EFsNotifyDiskSpace,TIpcArgs(&tBuf,aDrive,&aStat), aStat);
  1078 	//This call is to synchronise with the driver thread as corresponding cancel function (NotifyDiskSpaceCancel)
  1059 	//This call is to synchronise with the driver thread as corresponding cancel function (NotifyDiskSpaceCancel)
  1079 	//is synchronous, so it can complete before this notify request has even been added to TDiskSpaceQue.
  1060 	//is synchronous, so it can complete before this notify request has even been added to TDiskSpaceQue.
  1080 	//This call guarantees that the notify request has been added to queue.
  1061 	//This call guarantees that the notify request has been added to queue.
  1081 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
  1062 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
  1082 
  1063 
  1083 
  1064 
  1084 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceReturn, MODULEUID);
  1065 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACERETURN, "");
  1085 	}
  1066 	}
  1086 
  1067 
  1087 
  1068 
  1088 
  1069 
  1089 
  1070 
  1096 
  1077 
  1097 @param aStat The request status object identified with the original
  1078 @param aStat The request status object identified with the original
  1098 			 notification request.
  1079 			 notification request.
  1099 */
  1080 */
  1100 	{
  1081 	{
  1101 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel1, MODULEUID, Handle(), &aStat);
  1082 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL1, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
  1102 	
  1083 	
  1103 	if(aStat==KRequestPending)
  1084 	if(aStat==KRequestPending)
  1104 		SendReceive(EFsNotifyDiskSpaceCancel,TIpcArgs(&aStat));
  1085 		SendReceive(EFsNotifyDiskSpaceCancel,TIpcArgs(&aStat));
  1105 
  1086 
  1106 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel1Return, MODULEUID);
  1087 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL1RETURN, "");
  1107 	}
  1088 	}
  1108 
  1089 
  1109 
  1090 
  1110 
  1091 
  1111 
  1092 
  1115 notification.
  1096 notification.
  1116 
  1097 
  1117 Outstanding requests complete with KErrCancel.
  1098 Outstanding requests complete with KErrCancel.
  1118 */
  1099 */
  1119 	{
  1100 	{
  1120 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel2, MODULEUID, Handle());
  1101 	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL2, "sess %x", Handle());
  1121 	SendReceive(EFsNotifyDiskSpaceCancel,TIpcArgs(NULL));
  1102 	SendReceive(EFsNotifyDiskSpaceCancel,TIpcArgs(NULL));
  1122 
  1103 
  1123 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDiskSpaceCancel2Return, MODULEUID);
  1104 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISKSPACECANCEL2RETURN, "");
  1124 	}
  1105 	}
  1125 
  1106 
  1126 
  1107 
  1127 
  1108 
  1128 
  1109 
  1144 @param aList On return, contains a list of drive attributes (only the first 8 bits) for the available non-remote and non-hidden drives.
  1125 @param aList On return, contains a list of drive attributes (only the first 8 bits) for the available non-remote and non-hidden drives.
  1145 
  1126 
  1146 @return KErrNone, successful, otherwise one of the other system-wide error codes.
  1127 @return KErrNone, successful, otherwise one of the other system-wide error codes.
  1147 */
  1128 */
  1148 	{
  1129 	{
  1149 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList1, MODULEUID, Handle());
  1130 	OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVELIST1, "sess %x", Handle());
  1150 	TInt r = SendReceive(EFsDriveList,TIpcArgs(&aList, KDriveAttExclude|KDriveAttRemote|KDriveAttHidden));
  1131 	TInt r = SendReceive(EFsDriveList,TIpcArgs(&aList, KDriveAttExclude|KDriveAttRemote|KDriveAttHidden));
  1151 
  1132 	OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVELIST1RETURN, "r %d", r);
  1152 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList1Return, MODULEUID, r);
       
  1153 	return r;
  1133 	return r;
  1154 	}
  1134 	}
  1155 
  1135 
  1156 
  1136 
  1157 
  1137 
  1178 
  1158 
  1179 @return KErrNone, successful, otherwise one of the other system-wide error codes;
  1159 @return KErrNone, successful, otherwise one of the other system-wide error codes;
  1180 		KErrArgument, If aFlags contains an invalid attribute combination.
  1160 		KErrArgument, If aFlags contains an invalid attribute combination.
  1181 */
  1161 */
  1182 	{
  1162 	{
  1183 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList2, MODULEUID, Handle(), aFlags);
  1163 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDRIVELIST2, "sess %x aFlags %x", (TUint) Handle(), (TUint) aFlags);
  1184 	TInt r = SendReceive(EFsDriveList,TIpcArgs(&aList,aFlags));
  1164 	TInt r = SendReceive(EFsDriveList,TIpcArgs(&aList,aFlags));
  1185 
  1165 	OstTrace1(TRACE_BORDER, EFSRV_EFSDRIVELIST2RETURN, "r %d", r);
  1186 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDriveList2Return, MODULEUID, r);
       
  1187 	return r;
  1166 	return r;
  1188 	}
  1167 	}
  1189 
  1168 
  1190 
  1169 
  1191 
  1170 
  1211               system-wide error codes.
  1190               system-wide error codes.
  1212 			 
  1191 			 
  1213 @see RFs::Volume
  1192 @see RFs::Volume
  1214 */
  1193 */
  1215 	{
  1194 	{
  1216 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsDrive, MODULEUID, Handle(), aDrive);
  1195 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDRIVE, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  1217 
       
  1218 	TPckg<TDriveInfo> m(anInfo);
  1196 	TPckg<TDriveInfo> m(anInfo);
  1219 	TInt r = SendReceive(EFsDrive,TIpcArgs(&m,aDrive));
  1197 	TInt r = SendReceive(EFsDrive,TIpcArgs(&m,aDrive));
  1220 
  1198 	OstTraceExt4(TRACE_BORDER, EFSRV_EFSDRIVERETURN, "r %d driveAtt %x mediaAtt %x type %x", r, (TUint) anInfo.iDriveAtt, (TUint) anInfo.iMediaAtt, (TUint) anInfo.iType);
  1221 	TRACERET4(UTF::EBorder, UTraceModuleEfsrv::EFsDriveReturn, MODULEUID, r, anInfo.iDriveAtt, anInfo.iMediaAtt, anInfo.iType);
       
  1222 	return r;
  1199 	return r;
  1223 	}
  1200 	}
  1224 
  1201 
  1225 
  1202 
  1226 
  1203 
  1248         otherwise one of the other system-wide error codes.
  1225         otherwise one of the other system-wide error codes.
  1249 			
  1226 			
  1250 @see RFs::Drive
  1227 @see RFs::Drive
  1251 */
  1228 */
  1252 	{
  1229 	{
  1253 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsVolume1, MODULEUID, Handle(), aDrive);
  1230 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUME1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  1254 	TPckg<TVolumeInfo> v(aVol);
  1231 	TPckg<TVolumeInfo> v(aVol);
  1255     TInt r = SendReceive(EFsVolume,TIpcArgs(&v,aDrive,NULL));
  1232     TInt r = SendReceive(EFsVolume,TIpcArgs(&v,aDrive,NULL));
  1256 
  1233 	OstTraceExt5(TRACE_BORDER, EFSRV_EFSVOLUME1RETURNA, "r %d iSize %x:%x iFree %x:%x", (TUint) r, (TUint) I64HIGH(aVol.iSize), (TUint) I64LOW(aVol.iSize), (TUint) I64HIGH(aVol.iFree), (TUint) I64LOW(aVol.iFree));
  1257 	TRACE7(UTF::EBorder, UTraceModuleEfsrv::EFsVolume1Return, MODULEUID, 
  1234 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUME1RETURNB, "iUniqueID %x iFileCacheFlags %x", (TUint) aVol.iUniqueID, (TUint) aVol.iFileCacheFlags);
  1258 		r, aVol.iUniqueID, I64LOW(aVol.iSize), I64HIGH(aVol.iSize),
       
  1259 		I64LOW(aVol.iFree), I64HIGH(aVol.iFree), aVol.iFileCacheFlags);
       
  1260 	return r;
  1235 	return r;
  1261 	}
  1236 	}
  1262 
  1237 
  1263 /**
  1238 /**
  1264 Gets volume information for a formatted device asynchronously.
  1239 Gets volume information for a formatted device asynchronously.
  1277 @publishedPartner
  1252 @publishedPartner
  1278 @prototype
  1253 @prototype
  1279 */
  1254 */
  1280 EFSRV_EXPORT_C void RFs::Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat) const
  1255 EFSRV_EXPORT_C void RFs::Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat) const
  1281     {
  1256     {
  1282 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsVolume2, MODULEUID, Handle(), aDrive, &aStat);
  1257 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSVOLUME2, "sess %x aDrive %d status %x", (TUint) Handle(), (TUint) aDrive, (TUint) &aStat);
  1283 	TPckg<TVolumeInfo> v(aVol);
  1258 	TPckg<TVolumeInfo> v(aVol);
  1284     aStat=KRequestPending;
  1259     aStat=KRequestPending;
  1285     RSessionBase::SendReceive(EFsVolume,TIpcArgs(&v,aDrive,&aStat), aStat);
  1260     RSessionBase::SendReceive(EFsVolume,TIpcArgs(&v,aDrive,&aStat), aStat);
  1286 
  1261 
  1287 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsVolume2Return, MODULEUID);
  1262 	OstTrace0(TRACE_BORDER, EFSRV_EFSVOLUME2RETURN, "");
  1288     }
  1263     }
  1289 
  1264 
  1290 
  1265 
  1291 EFSRV_EXPORT_C TInt RFs::SetVolumeLabel(const TDesC& aName,TInt aDrive)
  1266 EFSRV_EXPORT_C TInt RFs::SetVolumeLabel(const TDesC& aName,TInt aDrive)
  1292 /**
  1267 /**
  1312 @see TDriveNumber
  1287 @see TDriveNumber
  1313 @see TVolumeInfo::iName
  1288 @see TVolumeInfo::iName
  1314 @see RFs::Volume
  1289 @see RFs::Volume
  1315 */
  1290 */
  1316 	{
  1291 	{
  1317 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSetVolumeLabel, MODULEUID, 
  1292 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETVOLUMELABEL, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  1318 		Handle(), aName, aDrive);
  1293 		
  1319 
  1294 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETVOLUMELABEL_EVOLUMENAME, "VolumeName %S", aName.Ptr(), aName.Length()<<1);
  1320 	TInt r = SendReceive(EFsSetVolume,TIpcArgs(&aName,aDrive));
  1295 	TInt r = SendReceive(EFsSetVolume,TIpcArgs(&aName,aDrive));
  1321 
  1296 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETVOLUMELABELRETURN, "r %d", r);
  1322 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetVolumeLabelReturn, MODULEUID, r);
       
  1323 	return r;
  1297 	return r;
  1324 	}
  1298 	}
  1325 
  1299 
  1326 
  1300 
  1327 
  1301 
  1348 @see RFs::SetSubst
  1322 @see RFs::SetSubst
  1349 @see TDriveInfo
  1323 @see TDriveInfo
  1350 @see RFs::Drive
  1324 @see RFs::Drive
  1351 */
  1325 */
  1352 	{
  1326 	{
  1353 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSubst, MODULEUID, Handle(), aPath, aDrive);
  1327 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSUBST, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
  1328 	OstTraceData(TRACE_BORDER, EFSRV_EFSSUBST_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1354 	TInt r = SendReceive(EFsSubst,TIpcArgs(&aPath,aDrive));
  1329 	TInt r = SendReceive(EFsSubst,TIpcArgs(&aPath,aDrive));
  1355 
  1330 	OstTrace1(TRACE_BORDER, EFSRV_EFSSUBSTRETURN, "r %d", r);
  1356 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSubstReturn, MODULEUID, r);
       
  1357 	return r;
  1331 	return r;
  1358 	}
  1332 	}
  1359 
  1333 
  1360 
  1334 
  1361 
  1335 
  1400 @capability Dependent If aPath begins with /Private and does not match this process' SID
  1374 @capability Dependent If aPath begins with /Private and does not match this process' SID
  1401 					  then AllFiles capability is required.
  1375 					  then AllFiles capability is required.
  1402 @capability Dependent If aPath is /Resource then Tcb capability is required.
  1376 @capability Dependent If aPath is /Resource then Tcb capability is required.
  1403 */
  1377 */
  1404 	{
  1378 	{
  1405 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSetSubst, MODULEUID, Handle(), aPath, aDrive);
  1379 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETSUBST, "sess %x aPath %d", (TUint) Handle(), (TUint) aDrive);
       
  1380 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETSUBST_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1406 	TInt r = SendReceive(EFsSetSubst,TIpcArgs(&aPath,aDrive));
  1381 	TInt r = SendReceive(EFsSetSubst,TIpcArgs(&aPath,aDrive));
  1407 
  1382 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSUBSTRETURN, "r %d", r);
  1408 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSubstReturn, MODULEUID, r);
       
  1409 	return r;
  1383 	return r;
  1410 	}
  1384 	}
  1411 
  1385 
  1412 
  1386 
  1413 
  1387 
  1431 @capability Dependent If aName begins with /Private and does not match this process' SID
  1405 @capability Dependent If aName begins with /Private and does not match this process' SID
  1432 					  then AllFiles capability is required.
  1406 					  then AllFiles capability is required.
  1433 
  1407 
  1434 */
  1408 */
  1435 	{
  1409 	{
  1436 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRealName, MODULEUID, Handle(), aName);
  1410 	OstTrace1(TRACE_BORDER, EFSRV_EFSREALNAME, "sess %x", Handle());
       
  1411 	OstTraceData(TRACE_BORDER, EFSRV_EFSREALNAME_EFILENAME1, "FileName %S", aName.Ptr(), aName.Length()<<1);
  1437 	TInt r = SendReceive(EFsRealName,TIpcArgs(&aName,&aResult));
  1412 	TInt r = SendReceive(EFsRealName,TIpcArgs(&aName,&aResult));
  1438 
  1413 	OstTraceData(TRACE_BORDER, EFSRV_EFSREALNAME_EFILENAME2, "FileName %S", aResult.Ptr(), aResult.Length()<<1);
  1439 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRealNameReturn, MODULEUID, r, aResult);
  1414 	OstTrace1(TRACE_BORDER, EFSRV_EFSREALNAMERETURN, "r %d", r);
  1440 	return r;
  1415 	return r;
  1441 	}
  1416 	}
  1442 
  1417 
  1443 
  1418 
  1444 
  1419 
  1458 
  1433 
  1459 @see TMediaSerialNumber
  1434 @see TMediaSerialNumber
  1460 */
  1435 */
  1461 EFSRV_EXPORT_C TInt RFs::GetMediaSerialNumber(TMediaSerialNumber& aSerialNum, TInt aDrive)
  1436 EFSRV_EXPORT_C TInt RFs::GetMediaSerialNumber(TMediaSerialNumber& aSerialNum, TInt aDrive)
  1462     {
  1437     {
  1463 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetMediaSerialNumber, MODULEUID, Handle(), aDrive);
  1438 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETMEDIASERIALNUMBER, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  1464     TInt r = SendReceive(EFsGetMediaSerialNumber, TIpcArgs(&aSerialNum, aDrive));
  1439     TInt r = SendReceive(EFsGetMediaSerialNumber, TIpcArgs(&aSerialNum, aDrive));
  1465 
  1440 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETMEDIASERIALNUMBERRETURN, "r %d", r);
  1466 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetMediaSerialNumberReturn, MODULEUID, r, aSerialNum);
  1441 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETMEDIASERIALNUMBER_ESERIALNUMBER, "SerialNum %x", aSerialNum.Ptr(), aSerialNum.Length());
  1467 	return r;
  1442 	return r;
  1468     }
  1443     }
  1469 
  1444 
  1470 
  1445 
  1471 
  1446 
  1483 
  1458 
  1484 @return KErrNone if successful, otherwise one of the other
  1459 @return KErrNone if successful, otherwise one of the other
  1485         system-wide error codes.
  1460         system-wide error codes.
  1486 */
  1461 */
  1487 	{
  1462 	{
  1488 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsSessionPath, MODULEUID, Handle());
  1463 	OstTrace1(TRACE_BORDER, EFSRV_EFSSESSIONPATH, "sess %x", Handle());
  1489 	TInt r = SendReceive(EFsSessionPath,TIpcArgs(&aPath));
  1464 	TInt r = SendReceive(EFsSessionPath,TIpcArgs(&aPath));
  1490 
  1465 	OstTrace1(TRACE_BORDER, EFSRV_EFSSESSIONPATHRETURN, "r %d", r);
  1491 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSessionPathReturn, MODULEUID, r, aPath);
  1466 	OstTraceData(TRACE_BORDER, EFSRV_EFSSESSIONPATH_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1492 	return r;
  1467 	return r;
  1493 	}
  1468 	}
  1494 
  1469 
  1495 
  1470 
  1496 
  1471 
  1524 @capability Dependent If aPath begins with /Private and does not match this process' SID
  1499 @capability Dependent If aPath begins with /Private and does not match this process' SID
  1525 					  then AllFiles capability is required.
  1500 					  then AllFiles capability is required.
  1526 
  1501 
  1527 */
  1502 */
  1528 	{
  1503 	{
  1529 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionPath, MODULEUID, Handle(), aPath);
  1504 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSESSIONPATH, "sess %x", Handle());
       
  1505 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETSESSIONPATH_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1530 	TInt r = SendReceive(EFsSetSessionPath,TIpcArgs(&aPath));
  1506 	TInt r = SendReceive(EFsSetSessionPath,TIpcArgs(&aPath));
  1531 
  1507 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSESSIONPATHRETURN, "r %d", r);
  1532 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetSessionPathReturn, MODULEUID, r);
       
  1533 	return r;
  1508 	return r;
  1534 	}
  1509 	}
  1535 
  1510 
  1536 
  1511 
  1537 
  1512 
  1601         
  1576         
  1602 @see RFs::MkDirAll       
  1577 @see RFs::MkDirAll       
  1603 */
  1578 */
  1604 EFSRV_EXPORT_C TInt RFs::MkDir(const TDesC& aPath)
  1579 EFSRV_EXPORT_C TInt RFs::MkDir(const TDesC& aPath)
  1605 	{
  1580 	{
  1606 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMkDir, MODULEUID, Handle(), aPath);
  1581 	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIR, "sess %x", Handle());
       
  1582 	OstTraceData(TRACE_BORDER, EFSRV_EFSMKDIR_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1607 	TInt r = SendReceive(EFsMkDir,TIpcArgs(&aPath,NULL));
  1583 	TInt r = SendReceive(EFsMkDir,TIpcArgs(&aPath,NULL));
  1608 
  1584 	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIRRETURN, "r %d", r);
  1609 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMkDirReturn, MODULEUID, r);
       
  1610 	return r;
  1585 	return r;
  1611 	}
  1586 	}
  1612 
  1587 
  1613 
  1588 
  1614 
  1589 
  1651 
  1626 
  1652 @see RFs::MkDir
  1627 @see RFs::MkDir
  1653 */
  1628 */
  1654 EFSRV_EXPORT_C TInt RFs::MkDirAll(const TDesC& aPath)
  1629 EFSRV_EXPORT_C TInt RFs::MkDirAll(const TDesC& aPath)
  1655 	{
  1630 	{
  1656 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsMkDirAll, MODULEUID, Handle(), aPath);
  1631 	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIRALL, "sess %x", Handle());
       
  1632 	OstTraceData(TRACE_BORDER, EFSRV_EFSMKDIRALL_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1657 	TInt r = SendReceive(EFsMkDir,TIpcArgs(&aPath,TRUE));
  1633 	TInt r = SendReceive(EFsMkDir,TIpcArgs(&aPath,TRUE));
  1658 
  1634 	OstTrace1(TRACE_BORDER, EFSRV_EFSMKDIRALLRETURN, "r %d", r);
  1659 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsMkDirAllReturn, MODULEUID, r);
       
  1660 	return r;
  1635 	return r;
  1661 	}
  1636 	}
  1662 
  1637 
  1663 
  1638 
  1664 
  1639 
  1705 @capability Dependent If aPath is /Resource then Tcb capability is required.
  1680 @capability Dependent If aPath is /Resource then Tcb capability is required.
  1706 
  1681 
  1707 @see CFileMan
  1682 @see CFileMan
  1708 */
  1683 */
  1709 	{
  1684 	{
  1710 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsRmDir, MODULEUID, Handle(), aPath);
  1685 	OstTrace1(TRACE_BORDER, EFSRV_EFSRMDIR, "sess %x", Handle());
       
  1686 	OstTraceData(TRACE_BORDER, EFSRV_EFSRMDIR_EDIRNAME, "Dir %S", aPath.Ptr(), aPath.Length()<<1);
  1711 	TInt r = SendReceive(EFsRmDir,TIpcArgs(&aPath));
  1687 	TInt r = SendReceive(EFsRmDir,TIpcArgs(&aPath));
  1712 
  1688 	OstTrace1(TRACE_BORDER, EFSRV_EFSRMDIRRETURN, "r %d", r);
  1713 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRmDirReturn, MODULEUID, r);
       
  1714 	return r;
  1689 	return r;
  1715 	}
  1690 	}
  1716 
  1691 
  1717 
  1692 
  1718 
  1693 
  1823         system-wide error codes.
  1798         system-wide error codes.
  1824         
  1799         
  1825 @see TEntryKey
  1800 @see TEntryKey
  1826 */
  1801 */
  1827 	{
  1802 	{
  1828 	TRACEMULT6(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir1, MODULEUID, 
  1803 	OstTraceExt5(TRACE_BORDER, EFSRV_EFSGETDIR1, "sess %x aUidType0 %x aUidType1 %x aUidType2 %x aKey %x", (TUint) Handle(), (TUint) aUidType[0].iUid, (TUint) aUidType[1].iUid, (TUint) aUidType[2].iUid, (TUint) aKey);
  1829 		Handle(), aName, aUidType[0].iUid, aUidType[1].iUid, aUidType[2].iUid, aKey);
  1804 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDIR1_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
  1830 
       
  1831 	RDir d;
  1805 	RDir d;
  1832 	TRAPD(r,GetDirL(aName,aUidType,aKey,aFileList,d))
  1806 	TRAPD(r,GetDirL(aName,aUidType,aKey,aFileList,d))
  1833 	d.Close();
  1807 	d.Close();
  1834 	if (r!=KErrNone)
  1808 	if (r!=KErrNone)
  1835 		{
  1809 		{
  1836 		delete aFileList;
  1810 		delete aFileList;
  1837 		aFileList=NULL;
  1811 		aFileList=NULL;
  1838 		}
  1812 		}
  1839 
  1813 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDIR1RETURN, "r %d", r);
  1840 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir1Return, MODULEUID, r);
       
  1841 	return r;
  1814 	return r;
  1842 	}
  1815 	}
  1843 
  1816 
  1844 
  1817 
  1845 
  1818 
  1881         system-wide error codes.
  1854         system-wide error codes.
  1882         
  1855         
  1883 @see TEntryKey
  1856 @see TEntryKey
  1884 */
  1857 */
  1885 	{
  1858 	{
  1886 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir2, MODULEUID, Handle(), aName, anAttMask, aKey);
  1859 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSGETDIR2, "sess %x anAttMask %x aKey %x", (TUint) Handle(), (TUint) anAttMask, (TUint) aKey);
  1887 
  1860 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDIR2_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
  1888 	RDir d;
  1861 	RDir d;
  1889 	if ((aKey&0xff)==ESortByUid)
  1862 	if ((aKey&0xff)==ESortByUid)
  1890 		anAttMask|=KEntryAttAllowUid;
  1863 		anAttMask|=KEntryAttAllowUid;
  1891 	TRAPD(r,GetDirL(aName,anAttMask,aKey,aFileList,d))
  1864 	TRAPD(r,GetDirL(aName,anAttMask,aKey,aFileList,d))
  1892 	d.Close();
  1865 	d.Close();
  1893 	if (r!=KErrNone)
  1866 	if (r!=KErrNone)
  1894 		{
  1867 		{
  1895 		delete aFileList;
  1868 		delete aFileList;
  1896 		aFileList=NULL;
  1869 		aFileList=NULL;
  1897 		}
  1870 		}
  1898 
  1871 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDIR2RETURN, "r %d", r);
  1899 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir2Return, MODULEUID, r);
       
  1900 	return r;
  1872 	return r;
  1901 	}
  1873 	}
  1902 
  1874 
  1903 
  1875 
  1904 
  1876 
  1947         system-wide error codes.
  1919         system-wide error codes.
  1948 
  1920 
  1949 @see TEntryKey
  1921 @see TEntryKey
  1950 */
  1922 */
  1951 	{
  1923 	{
  1952 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir3, MODULEUID, Handle(), aName, anAttMask, aKey);
  1924 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSGETDIR3, "sess %x anAttMask %x aKey %x", (TUint) Handle(), (TUint) anAttMask, (TUint) aKey);
  1953 
  1925 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDIR3_EDIRNAME, "Dir %S", aName.Ptr(), aName.Length()<<1);
  1954 	RDir d;
  1926 	RDir d;
  1955 	if (aKey&ESortByUid)
  1927 	if (aKey&ESortByUid)
  1956 		anAttMask|=KEntryAttAllowUid;
  1928 		anAttMask|=KEntryAttAllowUid;
  1957 	TRAPD(r,GetDirL(aName,anAttMask,aKey,aFileList,aDirList,d))
  1929 	TRAPD(r,GetDirL(aName,anAttMask,aKey,aFileList,aDirList,d))
  1958 	d.Close();
  1930 	d.Close();
  1961 		delete aFileList;
  1933 		delete aFileList;
  1962 		aFileList=NULL;
  1934 		aFileList=NULL;
  1963 		delete aDirList;
  1935 		delete aDirList;
  1964 		aDirList=NULL;
  1936 		aDirList=NULL;
  1965 		}
  1937 		}
  1966 
  1938 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDIR3RETURN, "r %d", r);
  1967 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetDir3Return, MODULEUID, r);
       
  1968 	return r;
  1939 	return r;
  1969 	}
  1940 	}
  1970 
  1941 
  1971 
  1942 
  1972 
  1943 
  2009 
  1980 
  2010 @return KErrNone if successful, otherwise one of the other
  1981 @return KErrNone if successful, otherwise one of the other
  2011         system-wide error codes.
  1982         system-wide error codes.
  2012 */
  1983 */
  2013 	{
  1984 	{
  2014 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsParse1, MODULEUID, Handle(), aName);
  1985 	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE1, "sess %x", Handle());
       
  1986 	OstTraceData(TRACE_BORDER, EFSRV_EFSPARSE1_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1);
  2015 	TFileName session_path;
  1987 	TFileName session_path;
  2016 	TInt r = SessionPath(session_path);
  1988 	TInt r = SessionPath(session_path);
  2017 	if (r==KErrNone)
  1989 	if (r==KErrNone)
  2018 		r = aParse.Set(aName, NULL, &session_path);
  1990 		r = aParse.Set(aName, NULL, &session_path);
  2019 
  1991 	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE1RETURN, "r %d", r);
  2020 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsParse1Return, MODULEUID, r);
       
  2021 	return r;
  1992 	return r;
  2022 	}
  1993 	}
  2023 
  1994 
  2024 
  1995 
  2025 
  1996 
  2064 
  2035 
  2065 @return KErrNone if successful, otherwise one of the other
  2036 @return KErrNone if successful, otherwise one of the other
  2066         system-wide error codes.
  2037         system-wide error codes.
  2067 */
  2038 */
  2068 	{
  2039 	{
  2069 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsParse2, MODULEUID, Handle(), aName, aRelated);
  2040 	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE2, "sess %x", Handle());
       
  2041 	OstTraceData(TRACE_BORDER, EFSRV_EFSPARSE2_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
       
  2042 	OstTraceData(TRACE_BORDER, EFSRV_EFSPARSE2_ERELATED, "Related %S", aRelated.Ptr(), aRelated.Length()<<1);
  2070 	TFileName session_path;
  2043 	TFileName session_path;
  2071 	TInt r = SessionPath(session_path);
  2044 	TInt r = SessionPath(session_path);
  2072 	if (r==KErrNone)
  2045 	if (r==KErrNone)
  2073 		r = aParse.Set(aName, &aRelated, &session_path);
  2046 		r = aParse.Set(aName, &aRelated, &session_path);
  2074 
  2047 	OstTrace1(TRACE_BORDER, EFSRV_EFSPARSE2RETURN, "r %d", r);
  2075 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsParse2Return, MODULEUID, r);
       
  2076 	return r;
  2048 	return r;
  2077 	}
  2049 	}
  2078 
  2050 
  2079 
  2051 
  2080 
  2052 
  2103 @capability Dependent If aName is /Resource then Tcb capability is required.
  2075 @capability Dependent If aName is /Resource then Tcb capability is required.
  2104         
  2076         
  2105 @see CFileMan        
  2077 @see CFileMan        
  2106 */
  2078 */
  2107 	{
  2079 	{
  2108 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsDelete, MODULEUID, Handle(), aName);
  2080 	OstTrace1(TRACE_BORDER, EFSRV_EFSDELETE, "sess %x", Handle());
       
  2081 	OstTraceData(TRACE_BORDER, EFSRV_EFSDELETE_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2109 	TInt r = SendReceive(EFsDelete,TIpcArgs(&aName));
  2082 	TInt r = SendReceive(EFsDelete,TIpcArgs(&aName));
  2110 
  2083 	OstTrace1(TRACE_BORDER, EFSRV_EFSDELETERETURN, "r %d", r);
  2111 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsDeleteReturn, MODULEUID, r);
       
  2112 	return r;
  2084 	return r;
  2113 	}
  2085 	}
  2114 
  2086 
  2115 
  2087 
  2116 
  2088 
  2165 @capability Dependent If either anOldName or aNewName is /Resource then Tcb capability is required.
  2137 @capability Dependent If either anOldName or aNewName is /Resource then Tcb capability is required.
  2166         
  2138         
  2167 @see CFileMan        
  2139 @see CFileMan        
  2168 */
  2140 */
  2169 	{
  2141 	{
  2170 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsRename, MODULEUID, Handle(), anOldName, aNewName);
  2142 	OstTrace1(TRACE_BORDER, EFSRV_EFSRENAME, "sess %x", Handle());
  2171 
  2143 	OstTraceData(TRACE_BORDER, EFSRV_EFSRENAME_EOLDNAME, "OldName %S", anOldName.Ptr(), anOldName.Length()<<1);
       
  2144 	OstTraceData(TRACE_BORDER, EFSRV_EFSRENAME_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
  2172 	TInt r;
  2145 	TInt r;
  2173 	if (anOldName.Length() <= 0 || aNewName.Length() <= 0 )
  2146 	if (anOldName.Length() <= 0 || aNewName.Length() <= 0 )
  2174 		r = KErrBadName;
  2147 		r = KErrBadName;
  2175 	else
  2148 	else
  2176 		r = SendReceive(EFsRename,TIpcArgs(&anOldName,&aNewName));
  2149 		r = SendReceive(EFsRename,TIpcArgs(&anOldName,&aNewName));
  2177 
  2150 	OstTrace1(TRACE_BORDER, EFSRV_EFSRENAMERETURN, "r %d", r);
  2178 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsRenameReturn, MODULEUID, r);
       
  2179 	return r;
  2151 	return r;
  2180 	}
  2152 	}
  2181 
  2153 
  2182 
  2154 
  2183 
  2155 
  2224 					  this process' SID then AllFiles capability is required.
  2196 					  this process' SID then AllFiles capability is required.
  2225 @capability Dependent If either anOldName or aNewName is /Resource then Tcb capability is required.
  2197 @capability Dependent If either anOldName or aNewName is /Resource then Tcb capability is required.
  2226 
  2198 
  2227 */
  2199 */
  2228 	{
  2200 	{
  2229 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsReplace, MODULEUID, Handle(), anOldName, aNewName);
  2201 	OstTrace1(TRACE_BORDER, EFSRV_EFSREPLACE, "sess %x", Handle());
       
  2202 	OstTraceData(TRACE_BORDER, EFSRV_EFSREPLACE_EOLDNAME, "OldName %S", anOldName.Ptr(), anOldName.Length()<<1);
       
  2203 	OstTraceData(TRACE_BORDER, EFSRV_EFSREPLACE_ENEWNAME, "NewName %S", aNewName.Ptr(), aNewName.Length()<<1);
  2230 	TInt r = SendReceive(EFsReplace,TIpcArgs(&anOldName,&aNewName));
  2204 	TInt r = SendReceive(EFsReplace,TIpcArgs(&anOldName,&aNewName));
  2231 
  2205 	OstTrace1(TRACE_BORDER, EFSRV_EFSREPLACERETURN, "r %d", r);
  2232 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReplaceReturn, MODULEUID, r);
       
  2233 	return r;
  2206 	return r;
  2234 	}
  2207 	}
  2235 
  2208 
  2236 
  2209 
  2237 
  2210 
  2254 					  this process' SID then AllFiles capability is required.
  2227 					  this process' SID then AllFiles capability is required.
  2255         
  2228         
  2256 @see KEntryAttNormal
  2229 @see KEntryAttNormal
  2257 */
  2230 */
  2258 	{
  2231 	{
  2259 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsAtt, MODULEUID, Handle(), aName);
  2232 	OstTrace1(TRACE_BORDER, EFSRV_EFSATT, "sess %x", Handle());
  2260 
  2233 	OstTraceData(TRACE_BORDER, EFSRV_EFSATT_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2261 	TEntry e;
  2234 	TEntry e;
  2262 	TInt r=Entry(aName,e);
  2235 	TInt r=Entry(aName,e);
  2263 	if (r==KErrNone)
  2236 	if (r==KErrNone)
  2264 		aVal=e.iAtt;
  2237 		aVal=e.iAtt;
  2265 
  2238 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSATTRETURN, "r %d aVal %x", (TUint) r, (TUint) aVal);
  2266 	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsAttReturn, MODULEUID, r, aVal);
       
  2267 	return r;
  2239 	return r;
  2268 	}
  2240 	}
  2269 
  2241 
  2270 
  2242 
  2271 
  2243 
  2301 	
  2273 	
  2302 @see RFs::SetEntry
  2274 @see RFs::SetEntry
  2303 
  2275 
  2304 */
  2276 */
  2305 	{
  2277 	{
  2306 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsSetAtt, MODULEUID, 
  2278 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSSETATT, "sess %x aSetAttMask %x aClearAttMask %x", (TUint) Handle(), (TUint) aSetAttMask, (TUint) aClearAttMask);
  2307 		Handle(), aName, aSetAttMask, aClearAttMask);
  2279 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETATT_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2308 
       
  2309  	TInt r = SetEntry(aName,TTime(0),aSetAttMask,aClearAttMask);
  2280  	TInt r = SetEntry(aName,TTime(0),aSetAttMask,aClearAttMask);
  2310 
  2281 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETATTRETURN, "r %d", r);
  2311 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetAttReturn, MODULEUID, r);
       
  2312 	return r;
  2282 	return r;
  2313 	}
  2283 	}
  2314 
  2284 
  2315 
  2285 
  2316 
  2286 
  2334 @capability Dependent If aName contains /Private/ and does not match
  2304 @capability Dependent If aName contains /Private/ and does not match
  2335 					  this process' SID then AllFiles capability is required.
  2305 					  this process' SID then AllFiles capability is required.
  2336 
  2306 
  2337 */
  2307 */
  2338 	{
  2308 	{
  2339 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsModified, MODULEUID, Handle(), aName);
  2309 	OstTrace1(TRACE_BORDER, EFSRV_EFSMODIFIED, "sess %x", Handle());
  2340 
  2310 	OstTraceData(TRACE_BORDER, EFSRV_EFSMODIFIED_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2341 	TEntry e;
  2311 	TEntry e;
  2342 	TInt r=Entry(aName,e);
  2312 	TInt r=Entry(aName,e);
  2343 	if (r==KErrNone)
  2313 	if (r==KErrNone)
  2344 		aTime=e.iModified;
  2314 		aTime=e.iModified;
  2345 
  2315 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMODIFIEDRETURN, "r %d aTime %x:%x ", (TUint) r, (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()));
  2346 	TRACERET3(UTF::EBorder, UTraceModuleEfsrv::EFsModifiedReturn, MODULEUID, r, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()));
       
  2347 	return r;
  2316 	return r;
  2348 	}
  2317 	}
  2349 
  2318 
  2350 
  2319 
  2351 
  2320 
  2368 					  this process' SID then AllFiles capability is required.
  2337 					  this process' SID then AllFiles capability is required.
  2369 @capability Dependent If aName is /Resource then Tcb capability is required.
  2338 @capability Dependent If aName is /Resource then Tcb capability is required.
  2370 
  2339 
  2371 */
  2340 */
  2372 	{
  2341 	{
  2373 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsSetModified, MODULEUID, Handle(), aName, I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()) );
  2342 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSSETMODIFIED, "sess %x aTime %x:%x ", (TUint) Handle(), (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()) );
  2374 
  2343 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETMODIFIED_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2375 	TInt r = SetEntry(aName,aTime,KEntryAttModified,0);
  2344 	TInt r = SetEntry(aName,aTime,KEntryAttModified,0);
  2376 
  2345 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETMODIFIEDRETURN, "r %d", r);
  2377 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetModifiedReturn, MODULEUID, r);
       
  2378 	return r;
  2346 	return r;
  2379 	}
  2347 	}
  2380 
  2348 
  2381 
  2349 
  2382 
  2350 
  2401 					  this process' SID, then AllFiles capability is required. For example, the paths "c:\\private" and 
  2369 					  this process' SID, then AllFiles capability is required. For example, the paths "c:\\private" and 
  2402 					  "c:\\private\\" will always be readable, whereas the path "c:\\private\\<n>\\" will only be 
  2370 					  "c:\\private\\" will always be readable, whereas the path "c:\\private\\<n>\\" will only be 
  2403 					  readable with AllFiles capability or if <n> matches the process' SID.
  2371 					  readable with AllFiles capability or if <n> matches the process' SID.
  2404 */
  2372 */
  2405 	{
  2373 	{
  2406 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsEntry, MODULEUID, Handle(), aName);
  2374 	OstTrace1(TRACE_BORDER, EFSRV_EFSENTRY, "sess %x", Handle());
       
  2375 	OstTraceData(TRACE_BORDER, EFSRV_EFSENTRY_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2407 	TPckg<TEntry> e(anEntry);
  2376 	TPckg<TEntry> e(anEntry);
  2408 	TInt r = SendReceive(EFsEntry,TIpcArgs(&aName,&e));
  2377 	TInt r = SendReceive(EFsEntry,TIpcArgs(&aName,&e));
  2409 
  2378 	OstTraceExt5(TRACE_BORDER, EFSRV_EFSENTRYRETURN, "r %d att %x modified %x:%x  size %d", (TUint) r, (TUint) anEntry.iAtt, (TUint) I64HIGH(anEntry.iModified.Int64()), (TUint) I64LOW(anEntry.iModified.Int64()), (TUint) anEntry.iSize);
  2410 	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsEntryReturn, MODULEUID, 
       
  2411 		r, anEntry.iAtt, 
       
  2412 		I64LOW(anEntry.iModified.Int64()), I64HIGH(anEntry.iModified.Int64()), 
       
  2413 		anEntry.iSize);
       
  2414 	return r;
  2379 	return r;
  2415 	}
  2380 	}
  2416 
  2381 
  2417 
  2382 
  2418 
  2383 
  2448 @see KEntryAttNormal
  2413 @see KEntryAttNormal
  2449 @see KEntryAttDir
  2414 @see KEntryAttDir
  2450 @see KEntryAttVolume
  2415 @see KEntryAttVolume
  2451 */
  2416 */
  2452 	{
  2417 	{
  2453 	TRACEMULT6(UTF::EBorder, UTraceModuleEfsrv::EFsSetEntry, MODULEUID, 
  2418 	OstTraceExt5(TRACE_BORDER, EFSRV_EFSSETENTRY, "sess %x aTime %x:%x  aSetAttMask %x aClearAttMask %x", (TUint) Handle(), (TUint) I64HIGH(aTime.Int64()), (TUint) I64LOW(aTime.Int64()), (TUint) aSetAttMask, (TUint) aClearAttMask);
  2454 		Handle(), aName, 
  2419 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETENTRY_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2455 		I64LOW(aTime.Int64()), I64HIGH(aTime.Int64()), 
       
  2456 		aSetAttMask, aClearAttMask);
       
  2457 
       
  2458 	__ASSERT_ALWAYS((aSetAttMask&aClearAttMask)==0,Panic(EAttributesIllegal));
  2420 	__ASSERT_ALWAYS((aSetAttMask&aClearAttMask)==0,Panic(EAttributesIllegal));
  2459 	TPtrC8 timeBuf((TUint8*)&aTime,sizeof(TTime));
  2421 	TPtrC8 timeBuf((TUint8*)&aTime,sizeof(TTime));
  2460 	TInt r = SendReceive(EFsSetEntry,TIpcArgs(&aName,&timeBuf,aSetAttMask,aClearAttMask));
  2422 	TInt r = SendReceive(EFsSetEntry,TIpcArgs(&aName,&timeBuf,aSetAttMask,aClearAttMask));
  2461 
  2423 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETENTRYRETURN, "r %d", r);
  2462 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetEntryReturn, MODULEUID, r);
       
  2463 	return r;
  2424 	return r;
  2464 	}
  2425 	}
  2465 
  2426 
  2466 /**
  2427 /**
  2467 Reads data from a file without opening it.
  2428 Reads data from a file without opening it.
  2494                       the relevant SID capability AllFiles is required
  2455                       the relevant SID capability AllFiles is required
  2495 
  2456 
  2496 */
  2457 */
  2497 EFSRV_EXPORT_C TInt RFs::ReadFileSection(const TDesC& aName,TInt64 aPos,TDes8& aDes,TInt aLength) const
  2458 EFSRV_EXPORT_C TInt RFs::ReadFileSection(const TDesC& aName,TInt64 aPos,TDes8& aDes,TInt aLength) const
  2498 	{
  2459 	{
  2499 	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSection, MODULEUID, 
  2460 	OstTraceExt4(TRACE_BORDER, EFSRV_EFSREADFILESECTION, "sess %x aPos %x:%x aLength %d", (TUint) Handle(), (TUint) I64HIGH(aPos), (TUint) I64LOW(aPos), aLength);
  2500 		Handle(), aName, I64LOW(aPos), I64HIGH(aPos), aLength);
  2461 	OstTraceData(TRACE_BORDER, EFSRV_EFSREADFILESECTION_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2501 
       
  2502 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
  2462 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
  2503 	
  2463 	
  2504 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2464 #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2505 	if(aPos > KMaxTInt)
  2465 	if(aPos > KMaxTInt)
  2506 		{
  2466 		{
  2507 		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, KErrTooBig);
  2467 		OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTIONRETURN1, "r %d", KErrTooBig);
  2508 		return KErrTooBig;
  2468 		return KErrTooBig;
  2509 		}
  2469 		}
  2510 	if((aPos + aLength) > KMaxTInt)
  2470 	if((aPos + aLength) > KMaxTInt)
  2511 		aLength = KMaxTInt - (TInt)aPos;
  2471 		aLength = KMaxTInt - (TInt)aPos;
  2512 #endif
  2472 #endif
  2515 		__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2475 		__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2516   	 	}
  2476   	 	}
  2517 	else
  2477 	else
  2518 		{
  2478 		{
  2519 		aDes.Zero();
  2479 		aDes.Zero();
  2520 		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, KErrNone);
  2480 		OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTIONRETURN2, "r %d", KErrNone);
  2521 		return(KErrNone);
  2481 		return(KErrNone);
  2522 		}
  2482 		}
  2523 		
  2483 		
  2524 	__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2484 	__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2525 	
  2485 	
  2531 	else
  2491 	else
  2532 		{
  2492 		{
  2533 		TPckgC<TInt64> pkPos(aPos);
  2493 		TPckgC<TInt64> pkPos(aPos);
  2534 		r = SendReceive(EFsReadFileSection|KIpcArgSlot2Desc,TIpcArgs(&aDes,&aName,&pkPos,aLength));
  2494 		r = SendReceive(EFsReadFileSection|KIpcArgSlot2Desc,TIpcArgs(&aDes,&aName,&pkPos,aLength));
  2535 		}
  2495 		}
  2536 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, r);
  2496 	OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTIONRETURN3, "r %d", r);
  2537 	return r;
  2497 	return r;
  2538 	}
  2498 	}
  2539 /**
  2499 /**
  2540 Maintained for BC
  2500 Maintained for BC
  2541 
       
  2542 @internalTechnology
  2501 @internalTechnology
  2543 */
  2502 */
  2544 EFSRV_EXPORT_C TInt RFs::ReadFileSection_RESERVED(const TDesC& aName,TInt aPos,TDes8& aDes,TInt aLength) const
  2503 EFSRV_EXPORT_C TInt RFs::ReadFileSection_RESERVED(const TDesC& aName,TInt aPos,TDes8& aDes,TInt aLength) const
  2545 	{
  2504 	{
  2546 	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSection, MODULEUID, 
  2505 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED, "sess %x aPos %x aLength %d", (TUint) Handle(), (TUint) aPos, aLength);
  2547 		Handle(), aName, aPos, 0, aLength);
  2506 	OstTraceData(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  2548 
       
  2549 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
  2507 	__ASSERT_ALWAYS(aPos>=0,Panic(EPosNegative));
  2550 	
  2508 	
  2551 	if (aLength)	//	Number of characters to read
  2509 	if (aLength)	//	Number of characters to read
  2552 		{
  2510 		{
  2553 		__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2511 		__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2554   	 	}
  2512   	 	}
  2555 	else
  2513 	else
  2556 		{
  2514 		{
  2557 		aDes.Zero();
  2515 		aDes.Zero();
  2558 		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, KErrNone);
  2516 		OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED_RETURN1, "r %d", KErrNone);
  2559 		return(KErrNone);
  2517 		return(KErrNone);
  2560 		}
  2518 		}
  2561 		
  2519 		
  2562 	__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2520 	__ASSERT_ALWAYS(aDes.MaxLength()>=aLength,Panic(EBadLength));
  2563 		
  2521 		
  2564 	TInt r = SendReceive(EFsReadFileSection,TIpcArgs(&aDes,&aName,aPos,aLength));
  2522 	TInt r = SendReceive(EFsReadFileSection,TIpcArgs(&aDes,&aName,aPos,aLength));
  2565 
  2523 	OstTrace1(TRACE_BORDER, EFSRV_EFSREADFILESECTION_RESERVED_RETURN2, "r %d", r);
  2566 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReadFileSectionReturn, MODULEUID, r);
       
  2567 	return r;
  2524 	return r;
  2568 	}
  2525 	}
  2569 
  2526 
  2570 
  2527 
  2571 
  2528 
  2576 
  2533 
  2577 Typically, this function is called immediately after a client is connected
  2534 Typically, this function is called immediately after a client is connected
  2578 to the file server, and before any resources are opened.
  2535 to the file server, and before any resources are opened.
  2579 */
  2536 */
  2580 	{
  2537 	{
  2581 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkStart, MODULEUID, Handle());
  2538 	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKSTART, "sess %x", Handle());
  2582 	
  2539 	
  2583 	RSessionBase::SendReceive(EFsResourceCountMarkStart);
  2540 	RSessionBase::SendReceive(EFsResourceCountMarkStart);
  2584 
  2541 
  2585 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkStartReturn, MODULEUID);
  2542 	OstTrace0(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKSTARTRETURN, "");
  2586 	}
  2543 	}
  2587 
  2544 
  2588 
  2545 
  2589 
  2546 
  2590 
  2547 
  2595 
  2552 
  2596 @panic CSessionFs 2 if the number of resources opened since the start of resource 
  2553 @panic CSessionFs 2 if the number of resources opened since the start of resource 
  2597        count checking is not equal to the number of resources closed.
  2554        count checking is not equal to the number of resources closed.
  2598 */
  2555 */
  2599 	{
  2556 	{
  2600 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkEnd, MODULEUID, Handle());
  2557 	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKEND, "sess %x", Handle());
  2601 
       
  2602 	RSessionBase::SendReceive(EFsResourceCountMarkEnd);
  2558 	RSessionBase::SendReceive(EFsResourceCountMarkEnd);
  2603 
  2559 
  2604 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountMarkEndReturn, MODULEUID);
  2560 	OstTrace0(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTMARKENDRETURN, "");
  2605 	}
  2561 	}
  2606 
  2562 
  2607 
  2563 
  2608 
  2564 
  2609 
  2565 
  2616 to a disk is opened.
  2572 to a disk is opened.
  2617 
  2573 
  2618 @return The number of resources currently open.
  2574 @return The number of resources currently open.
  2619 */
  2575 */
  2620 	{
  2576 	{
  2621 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCount, MODULEUID, Handle());
  2577 	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNT, "sess %x", Handle());
  2622 
       
  2623 	TInt count;
  2578 	TInt count;
  2624 	TPckg<TInt> pckg(count);
  2579 	TPckg<TInt> pckg(count);
  2625 	SendReceive(EFsResourceCount,TIpcArgs(&pckg));
  2580 	SendReceive(EFsResourceCount,TIpcArgs(&pckg));
  2626 	TInt r = *(TInt*)pckg.Ptr();
  2581 	TInt r = *(TInt*)pckg.Ptr();
  2627 
  2582 	OstTrace1(TRACE_BORDER, EFSRV_EFSRESOURCECOUNTRETURN, "r %d", r);
  2628 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsResourceCountReturn, MODULEUID, r);
  2583 	return r;
  2629 	return r;
  2584 	}
  2630 	}
  2585 
  2631 
  2586 
  2632 
  2587 /**
  2633 
  2588 Checks the integrity of the File System mounted on the specified drive.
  2634 /**
  2589 The behaviour of this API and return codes are File System specific,
  2635 Checks the integrity of the disk on the specified drive.
  2590 dependent on how the File System implements its CheckDisk functionality.
  2636 On FAT, this checks if a cluster number is invalid, if a cluster is allocated to
  2591 Note that CheckDisk does not fix any errors that may be found,
  2637 more than one file entry, if an unallocated cluster is not set free, and if size
  2592 it just reports the first problem it has found.
  2638 of an entry is invalid.
  2593 
  2639 
  2594 @param	aDrive	Path containing the drive to be checked.
  2640 @param aDrive Path indicating the drive which contains the disk to be checked. If the drive 
  2595 				If the drive letter is not specified, the current session drive is taken by default.
  2641         information is not specified the current session drive is taken by default.
  2596 
  2642 		Checkdisk is performed on the requested drive irrespective of the correctness or
  2597 @return	KErrNone				If CheckDisk has not found any errors it knows about.
  2643 		existance of the given path.
  2598         KErrNotReady			If the specified drive is not ready.
  2644 
  2599         KErrNotSupported		If this functionality is not supported.
  2645 @return KErrNone, if successful;
  2600         KErrPermissionDenied	If the caller does not have DiskAdmin capability.
  2646 		1, if successful but a file cluster contains a bad value;
  2601         Other system-wide error codes.
  2647 		2, if successful but two files are linked to the same cluster;
  2602 
  2648 		3, if successful but an unallocated cluster contains a value;
  2603 @capability	DiskAdmin
  2649 		4, if successful but the size of a file is not equal to the number of clusters in chain;
  2604 
  2650         KErrNotReady, if the specified drive is empty;
  2605 FAT File System specific information:
  2651         KErrNotSupported, if the drive cannot handle this request;
  2606 
  2652         KErrPermissionDenied, if the caller doesn't have DiskAdmin capability;
  2607 CheckDisk checks for a limited amount of possible corruption cases such as
  2653         Other system wide error codes may also be returned.
  2608 invalid cluster numbers in the FAT table, lost and cross-linked cluster chains,
  2654 
  2609 various errors within the directory entry etc.
  2655 @capability DiskAdmin
  2610 
       
  2611 If CheckDisk returns KErrNone, this means that there are no errors that CheckDisk on FAT is aware of.
       
  2612 
       
  2613 Error codes returned by the FAT version of CheckDisk include: 
       
  2614 		1	Bad cluster value in FAT table detected.
       
  2615 		2	Cross-linked cluster chain detected.
       
  2616 		3	Lost cluster chain detected.
       
  2617 		4	File size does not correspond to the number of clusters reported in the FAT table.
  2656 */
  2618 */
  2657 EFSRV_EXPORT_C TInt RFs::CheckDisk(const TDesC& aDrive) const
  2619 EFSRV_EXPORT_C TInt RFs::CheckDisk(const TDesC& aDrive) const
  2658 	{
  2620 	{
  2659 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsCheckDisk, MODULEUID, Handle(), aDrive);
  2621 	OstTrace1(TRACE_BORDER, EFSRV_EFSCHECKDISK, "sess %x", Handle());
       
  2622 	OstTraceData(TRACE_BORDER, EFSRV_EFSCHECKDISK_EDIRNAME, "Dir %S", aDrive.Ptr(), aDrive.Length()<<1);
  2660 	TInt r = SendReceive(EFsCheckDisk,TIpcArgs(&aDrive));
  2623 	TInt r = SendReceive(EFsCheckDisk,TIpcArgs(&aDrive));
  2661 
  2624 	OstTrace1(TRACE_BORDER, EFSRV_EFSCHECKDISKRETURN, "r %d", r);
  2662 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsCheckDiskReturn, MODULEUID, r);
       
  2663 	return r;
  2625 	return r;
  2664 	}
  2626 	}
  2665 
  2627 
  2666 
  2628 
  2667 
  2629 
  2668 
  2630 
  2669 EFSRV_EXPORT_C TInt RFs::ScanDrive(const TDesC& aDrive) const
  2631 EFSRV_EXPORT_C TInt RFs::ScanDrive(const TDesC& aDrive) const
  2670 /**
  2632 /**
  2671 Checks the specified drive for errors and corrects them. Specifically, it
  2633 Checks the integrity of the File System mounted on the specified drive
  2672 checks if long file name entries' IDs are in sequence and short name is valid,
  2634 and attempts to correct some known File System errors.
  2673 and file's allocated clusters are not used by other files.
  2635 The behaviour of this API and return codes are File System specific,
  2674 
  2636 dependent on how the File System implements its ScanDrive functionality.
  2675 This does not run on the internal RAM drive, and only applies to a
  2637 
  2676 FAT file system.
  2638 ScanDrive will not run on drives that have files or directories opened.
  2677 
  2639 
  2678 @param aDrive Path indicating the drive which contains the disk to be checked. If the drive 
  2640 @param	aDrive	Path indicating the drive which contains the disk to be checked.
  2679         information is not specified the current session drive is taken by default.
  2641 				If the drive letter is not specified, the current session drive is taken by default.
  2680 		ScanDrive is performed on the requested drive irrespective of the correctness or
  2642 
  2681 		existance of the given path.
  2643 @return KErrNone				On success.
  2682 
  2644 		KErrInUse				If drive is in use (i.e. if there are files and/or directories opened in the drive).
  2683 @return KErrNone if successful,
  2645 		KErrCorrupt				If ScanDrive has detected a file system corruption that it cannot fix.
  2684         KErrPermissionDenied if caller doesn't have capability DiskAdmin,
  2646         KErrNotSupported		If this functionality is not supported.
  2685         KErrInUse if drive is in use,
  2647         KErrPermissionDenied	If the caller does not have DiskAdmin capability.
  2686         otherwise one of the other system-wide error codes
  2648 		Other system-wide error codes.
  2687 
  2649 
  2688 @capability DiskAdmin
  2650 @capability	DiskAdmin
  2689 */
  2651 
  2690 	{
  2652 FAT File System specific information:
  2691 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsScanDrive, MODULEUID, Handle(), aDrive);
  2653 
       
  2654 ScanDrive is intended to be run ONLY on "Rugged-FAT" file system
       
  2655 which is applicable to internal non-removable drives.
       
  2656 Internal RAM drives are not supported.
       
  2657 
       
  2658 The "Rugged FAT" file system is designed in such a way that only a limited number
       
  2659 of known cases of corruption can be caused by sudden power loss.
       
  2660 All of these known cases can be corrected by ScanDrive.
       
  2661 Hence, running ScanDrive on "Rugged FAT" file system will result in:
       
  2662 		KErrNone	If there was no File System corruption or ScanDrive has successfully repaired the File System.
       
  2663 		KErrCorrupt If ScanDrive has found a File System error that it cannot repair.
       
  2664 		Other system-wide error codes, see above.
       
  2665 
       
  2666 Running ScanDrive on removable media or media that has FAT file system not in
       
  2667 "Rugged FAT" mode is not practical, because ScanDrive is not designed for this.
       
  2668 Therefore, do not treat ScanDrive on removable media as a generic "disk repair utility".
       
  2669 */
       
  2670 	{
       
  2671 	OstTrace1(TRACE_BORDER, EFSRV_EFSSCANDRIVE, "sess %x", Handle());
       
  2672 	OstTraceData(TRACE_BORDER, EFSRV_EFSSCANDRIVE_EDIRNAME, "Dir %S", aDrive.Ptr(), aDrive.Length()<<1);
  2692 	TInt r = SendReceive(EFsScanDrive,TIpcArgs(&aDrive));
  2673 	TInt r = SendReceive(EFsScanDrive,TIpcArgs(&aDrive));
  2693 
  2674 	OstTrace1(TRACE_BORDER, EFSRV_EFSSCANDRIVERETURN, "r %d", r);
  2694 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsScanDriveReturn, MODULEUID, r);
       
  2695 	return r;
  2675 	return r;
  2696 	}
  2676 	}
  2697 
  2677 
  2698 
  2678 
  2699 
  2679 
  2718 @capability Dependent If the path for aLongName starts with /Sys capability AllFiles is required
  2698 @capability Dependent If the path for aLongName starts with /Sys capability AllFiles is required
  2719 @capability Dependent If the path for aLongName starts with /Private and this process does not
  2699 @capability Dependent If the path for aLongName starts with /Private and this process does not
  2720 					  have the relevant SID capability AllFiles is required
  2700 					  have the relevant SID capability AllFiles is required
  2721 */
  2701 */
  2722 	{
  2702 	{
  2723 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetShortName, MODULEUID, Handle(), aLongName);
  2703 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSHORTNAME, "sess %x", Handle());
       
  2704 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETSHORTNAME_ELONGNAME, "LongName %S", aLongName.Ptr(), aLongName.Length()<<1);
  2724 	TInt r = SendReceive(EFsGetShortName,TIpcArgs(&aLongName,&aShortName));
  2705 	TInt r = SendReceive(EFsGetShortName,TIpcArgs(&aLongName,&aShortName));
  2725 
  2706 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETSHORTNAME_ESHORTNAME, "ShortName %S", aShortName.Ptr(), aShortName.Length()<<1);
  2726 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetShortNameReturn, MODULEUID, r, aShortName);
  2707 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSHORTNAMERETURN, "r %d", r);
  2727 	return r;
  2708 	return r;
  2728 	}
  2709 	}
  2729 
  2710 
  2730 
  2711 
  2731 
  2712 
  2750 @capability Dependent If the path for aShortName starts with /Private and this process does not
  2731 @capability Dependent If the path for aShortName starts with /Private and this process does not
  2751 					  have the relevant SID capability AllFiles is required
  2732 					  have the relevant SID capability AllFiles is required
  2752 
  2733 
  2753 */
  2734 */
  2754 	{
  2735 	{
  2755 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetLongName, MODULEUID, Handle(), aShortName);
  2736 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETLONGNAME, "sess %x", Handle());
       
  2737 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETLONGNAME_ESHORTNAME, "ShortName %S", aShortName.Ptr(), aShortName.Length()<<1);
  2756 	TInt r = SendReceive(EFsGetLongName,TIpcArgs(&aShortName,&aLongName));
  2738 	TInt r = SendReceive(EFsGetLongName,TIpcArgs(&aShortName,&aLongName));
  2757 
  2739 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETLONGNAME_ELONGNAME, "LongName %S", aLongName.Ptr(), aLongName.Length()<<1);
  2758 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetLongNameReturn, MODULEUID, r, aLongName);
  2740 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETLONGNAMERETURN, "r %d", r);
  2759 	return r;
  2741 	return r;
  2760 	}
  2742 	}
  2761 
  2743 
  2762 
  2744 
  2763 
  2745 
  2786 @see RFs::Delete
  2768 @see RFs::Delete
  2787 @see RFs::Rename 
  2769 @see RFs::Rename 
  2788 @see RFs::Replace
  2770 @see RFs::Replace
  2789 */
  2771 */
  2790 	{
  2772 	{
  2791 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileOpen, MODULEUID, Handle(), aFileName);
  2773 	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEOPEN, "sess %x", Handle());
       
  2774 	OstTraceData(TRACE_BORDER, EFSRV_EFSISFILEOPEN_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
  2792 	TPckg<TBool> b(anAnswer);
  2775 	TPckg<TBool> b(anAnswer);
  2793 	TInt r = SendReceive(EFsIsFileOpen,TIpcArgs(&aFileName,&b));
  2776 	TInt r = SendReceive(EFsIsFileOpen,TIpcArgs(&aFileName,&b));
  2794 
  2777 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISFILEOPENRETURN, "r %d anAnswer %d", (TUint) r, (TUint) anAnswer);
  2795 	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileOpenReturn, MODULEUID, r, anAnswer);
       
  2796 	return r;
  2778 	return r;
  2797 	}
  2779 	}
  2798 
  2780 
  2799 
  2781 
  2800 
  2782 
  2822 Tests whether user notification of file read or write failure is in effect.
  2804 Tests whether user notification of file read or write failure is in effect.
  2823 
  2805 
  2824 @return True if notification in effect, false if not.
  2806 @return True if notification in effect, false if not.
  2825 */
  2807 */
  2826 	{
  2808 	{
  2827 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetNotifyUser, MODULEUID, Handle());
  2809 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETNOTIFYUSER, "sess %x", Handle());
  2828 
       
  2829 	TInt notifyUser;
  2810 	TInt notifyUser;
  2830 	TPckg<TInt> pckgNotify(notifyUser);
  2811 	TPckg<TInt> pckgNotify(notifyUser);
  2831 	SendReceive(EFsGetNotifyUser,TIpcArgs(&pckgNotify));
  2812 	SendReceive(EFsGetNotifyUser,TIpcArgs(&pckgNotify));
  2832 	TBool r = notifyUser;
  2813 	TBool r = notifyUser;
  2833 
  2814 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETNOTIFYUSERRETURN, "r %d", r);
  2834 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetNotifyUserReturn, MODULEUID, r);
       
  2835 	return r;
  2815 	return r;
  2836 	}
  2816 	}
  2837 
  2817 
  2838 
  2818 
  2839 
  2819 
  2846 
  2826 
  2847 @param aValue ETrue, if user is to be notified of read or write failures;
  2827 @param aValue ETrue, if user is to be notified of read or write failures;
  2848               EFalse, for no notification.
  2828               EFalse, for no notification.
  2849 */
  2829 */
  2850 	{
  2830 	{
  2851 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyUser, MODULEUID, Handle(), aValue);
  2831 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETNOTIFYUSER, "sess %x aValue %d", (TUint) Handle(), (TUint) aValue);
  2852 	SendReceive(EFsSetNotifyUser,TIpcArgs(aValue));
  2832 	SendReceive(EFsSetNotifyUser,TIpcArgs(aValue));
  2853 
  2833 
  2854 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyUserReturn, MODULEUID);
  2834 	OstTrace0(TRACE_BORDER, EFSRV_EFSSETNOTIFYUSERRETURN, "");
  2855 	}
  2835 	}
  2856 
  2836 
  2857 
  2837 
  2858 
  2838 
  2859 
  2839 
  2879 @capability Dependent If the path for aFileName starts with /Private and this process does not
  2859 @capability Dependent If the path for aFileName starts with /Private and this process does not
  2880 					  have the relevant SID capability AllFiles is required
  2860 					  have the relevant SID capability AllFiles is required
  2881 
  2861 
  2882 */
  2862 */
  2883 	{
  2863 	{
  2884 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileInRom, MODULEUID, Handle(), aFileName);
  2864 	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEINROM, "sess %x", Handle());
  2885 
  2865 	OstTraceData(TRACE_BORDER, EFSRV_EFSISFILEINROM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
  2886 	TPckgBuf<TUint8*> start;
  2866 	TPckgBuf<TUint8*> start;
  2887 
  2867 
  2888 	TUint8* r;
  2868 	TUint8* r;
  2889 	if (SendReceive(EFsIsFileInRom,TIpcArgs(&aFileName,&start))!=KErrNone)
  2869 	if (SendReceive(EFsIsFileInRom,TIpcArgs(&aFileName,&start))!=KErrNone)
  2890 		r = NULL;
  2870 		r = NULL;
  2891 	else
  2871 	else
  2892 		r = start();
  2872 		r = start();
  2893 
  2873 
  2894 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileInRomReturn, MODULEUID, r);
  2874 	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEINROMRETURN, "r %d", r);
  2895 	return r;
  2875 	return r;
  2896 	}
  2876 	}
  2897 
  2877 
  2898 
  2878 
  2899 
  2879 
  2929 
  2909 
  2930 @return ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.
  2910 @return ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.
  2931 */
  2911 */
  2932 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName) const
  2912 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName) const
  2933 	{
  2913 	{
  2934 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName1, MODULEUID, Handle(), aFileName);
  2914 	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME1, "sess %x", Handle());
       
  2915 	OstTraceData(TRACE_BORDER, EFSRV_EFSISVALIDNAME1_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
  2935 	TBool returnInvalidChar=EFalse;
  2916 	TBool returnInvalidChar=EFalse;
  2936 	TPckg<TBool> bPckg(returnInvalidChar);
  2917 	TPckg<TBool> bPckg(returnInvalidChar);
  2937 	TBool b;
  2918 	TBool b;
  2938 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&bPckg,NULL,NULL))!=KErrNone)
  2919 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&bPckg,NULL,NULL))!=KErrNone)
  2939 		b = EFalse;
  2920 		b = EFalse;
  2940 	else
  2921 	else
  2941 		b = ETrue;
  2922 		b = ETrue;
  2942 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName1Return, MODULEUID, b);
  2923 	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME1RETURN, "r %d", b);
  2943 	return b;
  2924 	return b;
  2944 	}
  2925 	}
  2945 
  2926 
  2946 
  2927 
  2947 
  2928 
  2980 
  2961 
  2981 @return ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.
  2962 @return ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.
  2982 */
  2963 */
  2983 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName,TText& aBadChar) const
  2964 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName,TText& aBadChar) const
  2984 	{
  2965 	{
  2985 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName2, MODULEUID, Handle(), aFileName);
  2966 	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME2, "sess %x", Handle());
       
  2967 	OstTraceData(TRACE_BORDER, EFSRV_EFSISVALIDNAME2_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
  2986 	TBool returnInvalidChar=ETrue;
  2968 	TBool returnInvalidChar=ETrue;
  2987 	TPckg<TBool> boolPckg(returnInvalidChar);
  2969 	TPckg<TBool> boolPckg(returnInvalidChar);
  2988 	TPckg<TText> textPckg(aBadChar);
  2970 	TPckg<TText> textPckg(aBadChar);
  2989 	TBool b;
  2971 	TBool b;
  2990 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&boolPckg,&textPckg,NULL))!=KErrNone)
  2972 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&boolPckg,&textPckg,NULL))!=KErrNone)
  2991 		b = EFalse;
  2973 		b = EFalse;
  2992 	else 
  2974 	else 
  2993 		b = ETrue;
  2975 		b = ETrue;
  2994 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName2Return, MODULEUID, b, aBadChar);
  2976 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISVALIDNAME2RETURN, "r %d aBadChar %x", (TUint) b, (TUint) aBadChar);
  2995 	return b;
  2977 	return b;
  2996 	}
  2978 	}
  2997 /**
  2979 /**
  2998 This API can be used to validate both directory and file names.
  2980 This API can be used to validate both directory and file names.
  2999 If the name ends with a trailing backslash '\\' then it is considered to be a directory
  2981 If the name ends with a trailing backslash '\\' then it is considered to be a directory
  3038 					   if the optional sessionPath is used, then the length of the sessionPath is also used to determine whether the length exceeds 256 characters.
  3020 					   if the optional sessionPath is used, then the length of the sessionPath is also used to determine whether the length exceeds 256 characters.
  3039 @return ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.
  3021 @return ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.
  3040 */
  3022 */
  3041 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aName, TNameValidParam& aParam )
  3023 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aName, TNameValidParam& aParam )
  3042 	{
  3024 	{
  3043 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName3, MODULEUID, Handle(), aName);
  3025 	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME3, "sess %x", Handle());
       
  3026 	OstTraceData(TRACE_BORDER, EFSRV_EFSISVALIDNAME3_EFILENAME, "FileName %S", aName.Ptr(), aName.Length()<<1);
  3044 	TPckg<TNameValidParam> paramPckg(aParam);
  3027 	TPckg<TNameValidParam> paramPckg(aParam);
  3045 	TBool b;
  3028 	TBool b;
  3046 	if (SendReceive(EFsIsValidName,TIpcArgs(&aName,NULL,NULL,&paramPckg))!=KErrNone)
  3029 	if (SendReceive(EFsIsValidName,TIpcArgs(&aName,NULL,NULL,&paramPckg))!=KErrNone)
  3047 		b = EFalse;
  3030 		b = EFalse;
  3048 	else
  3031 	else
  3049 		b = ETrue;
  3032 		b = ETrue;
  3050 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName3Return, MODULEUID, b, aParam.ErrorCode());
  3033 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISVALIDNAME3RETURN, "r %d err %d", (TUint) b, (TUint) aParam.ErrorCode());
  3051 	return b;
  3034 	return b;
  3052 	}
  3035 	}
  3053 
  3036 
  3054 
  3037 
  3055 
  3038 
  3071         system-wide error codes.
  3054         system-wide error codes.
  3072 
  3055 
  3073 @see TDriveNumber
  3056 @see TDriveNumber
  3074 */
  3057 */
  3075 	{
  3058 	{
  3076 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetDriveName, MODULEUID, Handle(), aDrive);
  3059 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETDRIVENAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3077 	TInt r = SendReceive(EFsGetDriveName,TIpcArgs(aDrive,&aDriveName));
  3060 	TInt r = SendReceive(EFsGetDriveName,TIpcArgs(aDrive,&aDriveName));
  3078 
  3061 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDRIVENAME_EDRIVENAME, "DriveName %S", aDriveName.Ptr(), aDriveName.Length()<<1);
  3079 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetDriveNameReturn, MODULEUID, r, aDriveName);
  3062 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDRIVENAMERETURN, "r %d", r);
  3080 	return r;
  3063 	return r;
  3081 	}
  3064 	}
  3082 
  3065 
  3083 
  3066 
  3084 
  3067 
  3102 
  3085 
  3103 @capability DiskAdmin
  3086 @capability DiskAdmin
  3104 
  3087 
  3105 */
  3088 */
  3106 	{
  3089 	{
  3107 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsSetDriveName, MODULEUID, Handle(), aDrive, aDriveName);
  3090 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETDRIVENAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
  3091 	OstTraceData(TRACE_BORDER, EFSRV_EFSSETDRIVENAME_EDRIVENAME, "DriveName %S", aDriveName.Ptr(), aDriveName.Length()<<1);
  3108 	TInt r = SendReceive(EFsSetDriveName,TIpcArgs(aDrive,&aDriveName));
  3092 	TInt r = SendReceive(EFsSetDriveName,TIpcArgs(aDrive,&aDriveName));
  3109 
  3093 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETDRIVENAMERETURN, "r %d", r);
  3110 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetDriveNameReturn, MODULEUID, r);
       
  3111 	return r;
  3094 	return r;
  3112 	}
  3095 	}
  3113 
  3096 
  3114 
  3097 
  3115 
  3098 
  3136 
  3119 
  3137 @capability DiskAdmin
  3120 @capability DiskAdmin
  3138 
  3121 
  3139 */
  3122 */
  3140 	{
  3123 	{
  3141 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsLockDrive, MODULEUID, Handle(), aDrv, aStore);
  3124 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSLOCKDRIVE, "sess %x aDrv %d aStore %d", (TUint) Handle(), (TUint) aDrv, (TUint) aStore);
  3142 	TInt r = SendReceive(EFsLockDrive,TIpcArgs(aDrv,&aOld,&aNew,aStore));
  3125 	TInt r = SendReceive(EFsLockDrive,TIpcArgs(aDrv,&aOld,&aNew,aStore));
  3143 
  3126 	OstTrace1(TRACE_BORDER, EFSRV_EFSLOCKDRIVERETURN, "r %d", r);
  3144 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsLockDriveReturn, MODULEUID, r);
       
  3145 	return r;
  3127 	return r;
  3146 	}
  3128 	}
  3147 
  3129 
  3148 
  3130 
  3149 
  3131 
  3168 
  3150 
  3169 @capability DiskAdmin
  3151 @capability DiskAdmin
  3170 
  3152 
  3171 */
  3153 */
  3172 	{
  3154 	{
  3173 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsUnlockDrive, MODULEUID, Handle(), aDrive, aStore);
  3155 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSUNLOCKDRIVE, "sess %x aDrv %d aStore %d", (TUint) Handle(), (TUint) aDrive, (TUint) aStore);
  3174 	TInt r = SendReceive(EFsUnlockDrive,TIpcArgs(aDrive,&aPassword,aStore));
  3156 	TInt r = SendReceive(EFsUnlockDrive,TIpcArgs(aDrive,&aPassword,aStore));
  3175 
  3157 	OstTrace1(TRACE_BORDER, EFSRV_EFSUNLOCKDRIVERETURN, "r %d", r);
  3176 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsUnlockDriveReturn, MODULEUID, r);
       
  3177 	return r;
  3158 	return r;
  3178 	}
  3159 	}
  3179 
  3160 
  3180 
  3161 
  3181 
  3162 
  3197 
  3178 
  3198 @capability DiskAdmin
  3179 @capability DiskAdmin
  3199 
  3180 
  3200 */
  3181 */
  3201 	{
  3182 	{
  3202 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsClearPassword, MODULEUID, Handle(), aDrv);
  3183 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCLEARPASSWORD, "sess %x aDrv %d", (TUint) Handle(), (TUint) aDrv);
  3203 	TInt r = SendReceive(EFsClearPassword,TIpcArgs(aDrv,&aPswd));
  3184 	TInt r = SendReceive(EFsClearPassword,TIpcArgs(aDrv,&aPswd));
  3204 
  3185 	OstTrace1(TRACE_BORDER, EFSRV_EFSCLEARPASSWORDRETURN, "r %d", r);
  3205 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsClearPasswordReturn, MODULEUID, r);
       
  3206 	return r;
  3186 	return r;
  3207 	}
  3187 	}
  3208 
  3188 
  3209 
  3189 
  3210 
  3190 
  3225 
  3205 
  3226 @capability DiskAdmin
  3206 @capability DiskAdmin
  3227 
  3207 
  3228 */
  3208 */
  3229 	{
  3209 	{
  3230 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsErasePassword, MODULEUID, Handle(), aDrv);
  3210 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSERASEPASSWORD, "sess %x aDrv %d", (TUint) Handle(), (TUint) aDrv);
  3231 	TInt r = SendReceive(EFsErasePassword,TIpcArgs(aDrv));
  3211 	TInt r = SendReceive(EFsErasePassword,TIpcArgs(aDrv));
  3232 
  3212 	OstTrace1(TRACE_BORDER, EFSRV_EFSERASEPASSWORDRETURN, "r %d", r);
  3233 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsErasePasswordReturn, MODULEUID, r);
       
  3234 	return r;
  3213 	return r;
  3235 	}
  3214 	}
  3236 
  3215 
  3237 
  3216 
  3238 
  3217 
  3245 */
  3224 */
  3246 //
  3225 //
  3247 // Notify file server that startup initialisation has been completed
  3226 // Notify file server that startup initialisation has been completed
  3248 //
  3227 //
  3249 	{
  3228 	{
  3250 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsStartupInitComplete, MODULEUID, Handle(), &aStat);
  3229 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSTARTUPINITCOMPLETE, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
  3251 	aStat=KRequestPending;
  3230 	aStat=KRequestPending;
  3252 	RSessionBase::SendReceive(EFsStartupInitComplete,aStat);
  3231 	RSessionBase::SendReceive(EFsStartupInitComplete,aStat);
  3253 
  3232 
  3254 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsStartupInitCompleteReturn, MODULEUID);
  3233 	OstTrace0(TRACE_BORDER, EFSRV_EFSSTARTUPINITCOMPLETERETURN, "");
  3255 	}
  3234 	}
  3256 
  3235 
  3257 
  3236 
  3258 
  3237 
  3259 
  3238 
  3260 EFSRV_EXPORT_C TInt RFs::SetLocalDriveMapping(const TDesC8& aMapping)
  3239 EFSRV_EXPORT_C TInt RFs::SetLocalDriveMapping(const TDesC8& aMapping)
  3261 //
  3240 //
  3262 // Set the local drive mapping
  3241 // Set the local drive mapping
  3263 //
  3242 //
  3264 	{
  3243 	{
  3265 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSetLocalDriveMapping, MODULEUID, Handle(), aMapping);
  3244 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPING, "sess %x", Handle());
  3266 
  3245 	
       
  3246 	OstTraceData( TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPING_ELOCALDRIVEMAPPING, "aMapping %{int32[]}", aMapping.Ptr(), aMapping.Length());
  3267 	TInt r = SendReceive(EFsSetLocalDriveMapping,TIpcArgs(&aMapping));
  3247 	TInt r = SendReceive(EFsSetLocalDriveMapping,TIpcArgs(&aMapping));
  3268 
  3248 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPINGRETURN, "r %d", r);
  3269 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetLocalDriveMappingReturn, MODULEUID, r);
       
  3270 	return r;
  3249 	return r;
  3271 	}
  3250 	}
  3272 
  3251 
  3273 
  3252 
  3274 /**
  3253 /**
  3286 
  3265 
  3287     @capability DiskAdmin
  3266     @capability DiskAdmin
  3288 */
  3267 */
  3289 EFSRV_EXPORT_C TInt RFs::FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const
  3268 EFSRV_EXPORT_C TInt RFs::FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const
  3290     {
  3269     {
  3291 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrive, MODULEUID, Handle(), aDriveNo, aMode);
  3270 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSFINALISEDRIVE, "sess %x aDriveNo %d aMode %d", (TUint) Handle(), (TUint) aDriveNo, (TUint) aMode);
  3292     TInt r = SendReceive(EFsFinaliseDrive,TIpcArgs(aDriveNo, (TInt)aMode));
  3271     TInt r = SendReceive(EFsFinaliseDrive,TIpcArgs(aDriveNo, (TInt)aMode));
  3293 
  3272 	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVERETURN, "r %d", r);
  3294 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDriveReturn, MODULEUID, r);
       
  3295 	return r;
  3273 	return r;
  3296     }
  3274     }
  3297 
  3275 
  3298 
  3276 
  3299 /**
  3277 /**
  3305     @return KErrNone, if successful; otherwise one of the other system-wide error codes.
  3283     @return KErrNone, if successful; otherwise one of the other system-wide error codes.
  3306     @capability DiskAdmin
  3284     @capability DiskAdmin
  3307 */
  3285 */
  3308 EFSRV_EXPORT_C TInt RFs::FinaliseDrives()
  3286 EFSRV_EXPORT_C TInt RFs::FinaliseDrives()
  3309 	{
  3287 	{
  3310 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrives, MODULEUID, Handle());
  3288 	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVES, "sess %x", Handle());
  3311 	TInt nRes;
  3289 	TInt nRes;
  3312 	TDriveList driveList;
  3290 	TDriveList driveList;
  3313 	TDriveInfo driveInfo;
  3291 	TDriveInfo driveInfo;
  3314 	
  3292 	
  3315 	nRes=DriveList(driveList);
  3293 	nRes=DriveList(driveList);
  3316 	if(nRes != KErrNone)
  3294 	if(nRes != KErrNone)
  3317 		{
  3295 		{
  3318 		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrivesReturn, MODULEUID, nRes);
  3296 		OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVESRETURN1, "r %d", nRes);
  3319 	    return nRes; //-- unable to obtain drives list
  3297 	    return nRes; //-- unable to obtain drives list
  3320 		}
  3298 		}
  3321 	
  3299 	
  3322 	//-- walk through all drives in the system sending them "Finalise" request
  3300 	//-- walk through all drives in the system sending them "Finalise" request
  3323 	for (TInt i=0; i<KMaxDrives; ++i)
  3301 	for (TInt i=0; i<KMaxDrives; ++i)
  3335         	 
  3313         	 
  3336 	    nRes = FinaliseDrive(i, EFinal_RW);
  3314 	    nRes = FinaliseDrive(i, EFinal_RW);
  3337 	    }
  3315 	    }
  3338 	
  3316 	
  3339 
  3317 
  3340 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrivesReturn, MODULEUID, KErrNone);
  3318 	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVESRETURN2, "r %d", KErrNone);
  3341 	return 	KErrNone;
  3319 	return 	KErrNone;
  3342 	}
  3320 	}
  3343 
  3321 
  3344 
  3322 
  3345 
  3323 
  3362 		KErrNotFound If the filesystem name provided could not be found.
  3340 		KErrNotFound If the filesystem name provided could not be found.
  3363 		
  3341 		
  3364 @capability DiskAdmin
  3342 @capability DiskAdmin
  3365 */
  3343 */
  3366 	{
  3344 	{
  3367 	TRACEMULT4(UTF::EBorder, UTraceModuleEfsrv::EFsSwapFileSystem, MODULEUID, Handle(), aOldFileSystemName, aNewFileSystemName, aDrive);
  3345 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
       
  3346 	OstTraceData(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEM_EOLDNAME, "OldName %S", aOldFileSystemName.Ptr(), aOldFileSystemName.Length()<<1);
       
  3347 	OstTraceData(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEM_ENEWNAME, "NewName %S", aNewFileSystemName.Ptr(), aNewFileSystemName.Length()<<1);
  3368 	TInt r = SendReceive(EFsSwapFileSystem,TIpcArgs(&aNewFileSystemName,aDrive,&aOldFileSystemName));
  3348 	TInt r = SendReceive(EFsSwapFileSystem,TIpcArgs(&aNewFileSystemName,aDrive,&aOldFileSystemName));
  3369 
  3349 	OstTrace1(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEMRETURN, "r %d", r);
  3370 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSwapFileSystemReturn, MODULEUID, r);
       
  3371 	return r;
  3350 	return r;
  3372 	}
  3351 	}
  3373 
  3352 
  3374 
  3353 
  3375 EFSRV_EXPORT_C TInt RFs::AddCompositeMount(const TDesC& aFileSystemName,TInt aLocalDriveToMount,TInt aCompositeDrive, TBool aSync) const
  3354 EFSRV_EXPORT_C TInt RFs::AddCompositeMount(const TDesC& aFileSystemName,TInt aLocalDriveToMount,TInt aCompositeDrive, TBool aSync) const
  3390 		KErrNotSupported If the composite filesystem is already mounted or the parameters passed are unsupported
  3369 		KErrNotSupported If the composite filesystem is already mounted or the parameters passed are unsupported
  3391 		
  3370 		
  3392 @capability DiskAdmin
  3371 @capability DiskAdmin
  3393 */
  3372 */
  3394 	{
  3373 	{
  3395 	TRACEMULT5(UTF::EBorder, UTraceModuleEfsrv::EFsAddCompositeMount, MODULEUID, 
  3374 	OstTraceExt4(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNT, "sess %x aLocalDriveToMount %d aCompositeDrive %d aSync %d", (TUint) Handle(), aLocalDriveToMount, aCompositeDrive, aSync);
  3396 		Handle(), aFileSystemName, aLocalDriveToMount, aCompositeDrive, aSync);
  3375 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNT_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
  3397 	TInt r = SendReceive(EFsAddCompositeMount,TIpcArgs(&aFileSystemName,aLocalDriveToMount,aCompositeDrive,aSync));
  3376 	TInt r = SendReceive(EFsAddCompositeMount,TIpcArgs(&aFileSystemName,aLocalDriveToMount,aCompositeDrive,aSync));
  3398 
  3377 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNTRETURN, "r %d", r);
  3399 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddCompositeMountReturn, MODULEUID, r);
       
  3400 	return r;
  3378 	return r;
  3401 	}
  3379 	}
  3402 
  3380 
  3403 
  3381 
  3404 EFSRV_EXPORT_C TInt RFs::ReserveDriveSpace(TInt aDriveNo, TInt aSpace)
  3382 EFSRV_EXPORT_C TInt RFs::ReserveDriveSpace(TInt aDriveNo, TInt aSpace)
  3433         KErrDiskFull if insufficient space is left on the drive to service the request
  3411         KErrDiskFull if insufficient space is left on the drive to service the request
  3434         KErrTooBig if this request would overflow the available reserve (greater than KMaxTotalDriveReserved)
  3412         KErrTooBig if this request would overflow the available reserve (greater than KMaxTotalDriveReserved)
  3435         any of the possible error return codes from TDrive::Volume()
  3413         any of the possible error return codes from TDrive::Volume()
  3436 */
  3414 */
  3437 	{
  3415 	{
  3438 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsReserveDriveSpace, MODULEUID, Handle(), aDriveNo, aSpace);
  3416 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSRESERVEDRIVESPACE, "sess %x aDriveNo %d aSpace %d", (TUint) Handle(), (TUint) aDriveNo, (TUint) aSpace);
  3439 	TInt r = SendReceive(EFsReserveDriveSpace, TIpcArgs(aDriveNo, aSpace));
  3417 	TInt r = SendReceive(EFsReserveDriveSpace, TIpcArgs(aDriveNo, aSpace));
  3440 
  3418 	OstTrace1(TRACE_BORDER, EFSRV_EFSRESERVEDRIVESPACERETURN, "r %d", r);
  3441 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReserveDriveSpaceReturn, MODULEUID, r);
       
  3442 	return r;
  3419 	return r;
  3443 	}
  3420 	}
  3444 
  3421 
  3445 
  3422 
  3446 
  3423 
  3454 
  3431 
  3455 @return KErrNone if successful
  3432 @return KErrNone if successful
  3456         KErrPermissionDenied if the drive has no spare reserved space
  3433         KErrPermissionDenied if the drive has no spare reserved space
  3457 */
  3434 */
  3458 	{
  3435 	{
  3459 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetReserveAccess, MODULEUID, Handle(), aDriveNo);
  3436 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETRESERVEACCESS, "sess %x aDriveNo %d", (TUint) Handle(), (TUint) aDriveNo);
  3460 	TInt r = SendReceive(EFsGetReserveAccess, TIpcArgs(aDriveNo));
  3437 	TInt r = SendReceive(EFsGetReserveAccess, TIpcArgs(aDriveNo));
  3461 
  3438 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETRESERVEACCESSRETURN, "r %d", r);
  3462 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetReserveAccessReturn, MODULEUID, r);
       
  3463 	return r;
  3439 	return r;
  3464 	}
  3440 	}
  3465 
  3441 
  3466 EFSRV_EXPORT_C TInt RFs::ReleaseReserveAccess(TInt aDriveNo)
  3442 EFSRV_EXPORT_C TInt RFs::ReleaseReserveAccess(TInt aDriveNo)
  3467 /**
  3443 /**
  3471 
  3447 
  3472 @return KErrNone (always returned)
  3448 @return KErrNone (always returned)
  3473 
  3449 
  3474 */
  3450 */
  3475 	{
  3451 	{
  3476 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsReleaseReserveAccess, MODULEUID, Handle(), aDriveNo);
  3452 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSRELEASERESERVEACCESS, "sess %x aDriveNo %d", (TUint) Handle(), (TUint) aDriveNo);
  3477 	TInt r = SendReceive(EFsReleaseReserveAccess, TIpcArgs(aDriveNo));
  3453 	TInt r = SendReceive(EFsReleaseReserveAccess, TIpcArgs(aDriveNo));
  3478 
  3454 	OstTrace1(TRACE_BORDER, EFSRV_EFSRELEASERESERVEACCESSRETURN, "r %d", r);
  3479 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReleaseReserveAccessReturn, MODULEUID, r);
       
  3480 	return r;
  3455 	return r;
  3481 	}
  3456 	}
  3482 
  3457 
  3483 
  3458 
  3484 
  3459 
  3531     @param aMode    specifies the behaviour of the notification API
  3506     @param aMode    specifies the behaviour of the notification API
  3532     @param aStat    Asynchronous request state.
  3507     @param aStat    Asynchronous request state.
  3533 */
  3508 */
  3534 EFSRV_EXPORT_C void RFs::NotifyDismount(TInt aDrive, TRequestStatus& aStat, TNotifyDismountMode aMode /*=EFsDismountRegisterClient*/) const
  3509 EFSRV_EXPORT_C void RFs::NotifyDismount(TInt aDrive, TRequestStatus& aStat, TNotifyDismountMode aMode /*=EFsDismountRegisterClient*/) const
  3535 	{
  3510 	{
  3536 	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismount, MODULEUID, Handle(), aDrive, &aStat, aMode);
  3511 	OstTraceExt4(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNT, "sess %x aDrive %d status %x aMode %d", (TUint) Handle(), aDrive, (TUint) &aStat, (TInt) aMode);
  3537 	aStat = KRequestPending;
  3512 	aStat = KRequestPending;
  3538 	RSessionBase::SendReceive(EFsNotifyDismount, TIpcArgs(aDrive,aMode,&aStat), aStat);
  3513 	RSessionBase::SendReceive(EFsNotifyDismount, TIpcArgs(aDrive,aMode,&aStat), aStat);
  3539 	// This call is to synchronise with the driver thread as the corresponding cancel function (NotifyDismountCancel)
  3514 	// This call is to synchronise with the driver thread as the corresponding cancel function (NotifyDismountCancel)
  3540 	// is synchronous, so it can complete before this notify request has even been added to TDismountNotifyQue.
  3515 	// is synchronous, so it can complete before this notify request has even been added to TDismountNotifyQue.
  3541 	// This call guarantees that the notify request has been added to queue.
  3516 	// This call guarantees that the notify request has been added to queue.
  3542 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
  3517 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
  3543 
  3518 
  3544 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountReturn, MODULEUID);
  3519 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTRETURN, "");
  3545 	}
  3520 	}
  3546 
  3521 
  3547 
  3522 
  3548 
  3523 
  3549 
  3524 
  3554 
  3529 
  3555     @see RFs::NotifyDismount
  3530     @see RFs::NotifyDismount
  3556 */
  3531 */
  3557 EFSRV_EXPORT_C void RFs::NotifyDismountCancel(TRequestStatus& aStat) const
  3532 EFSRV_EXPORT_C void RFs::NotifyDismountCancel(TRequestStatus& aStat) const
  3558 	{
  3533 	{
  3559 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel1, MODULEUID, Handle(), &aStat);
  3534 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL1, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
  3560 	
  3535 	
  3561 	if (aStat == KRequestPending)
  3536 	if (aStat == KRequestPending)
  3562 		SendReceive(EFsNotifyDismountCancel, TIpcArgs(&aStat));
  3537 		SendReceive(EFsNotifyDismountCancel, TIpcArgs(&aStat));
  3563 
  3538 
  3564 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel1Return, MODULEUID);
  3539 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL1RETURN, "");
  3565 	}
  3540 	}
  3566 
  3541 
  3567 
  3542 
  3568 
  3543 
  3569 /**
  3544 /**
  3571 
  3546 
  3572     @see RFs::NotifyDismount
  3547     @see RFs::NotifyDismount
  3573 */
  3548 */
  3574 EFSRV_EXPORT_C void RFs::NotifyDismountCancel() const
  3549 EFSRV_EXPORT_C void RFs::NotifyDismountCancel() const
  3575 	{
  3550 	{
  3576 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel2, MODULEUID, Handle());
  3551 	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL2, "sess %x", Handle());
  3577 
       
  3578 	SendReceive(EFsNotifyDismountCancel, TIpcArgs(NULL));
  3552 	SendReceive(EFsNotifyDismountCancel, TIpcArgs(NULL));
  3579 
  3553 
  3580 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel2Return, MODULEUID);
  3554 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL2RETURN, "");
  3581 	}
  3555 	}
  3582 
  3556 
  3583 
  3557 
  3584 
  3558 
  3585 
  3559 
  3595 
  3569 
  3596     @see RFs::NotifyDismount
  3570     @see RFs::NotifyDismount
  3597 */
  3571 */
  3598 EFSRV_EXPORT_C TInt RFs::AllowDismount(TInt aDrive) const
  3572 EFSRV_EXPORT_C TInt RFs::AllowDismount(TInt aDrive) const
  3599 	{
  3573 	{
  3600 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsAllowDismount, MODULEUID, Handle(), aDrive);
  3574 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSALLOWDISMOUNT, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3601 	TInt r = SendReceive(EFsAllowDismount, TIpcArgs(aDrive));
  3575 	TInt r = SendReceive(EFsAllowDismount, TIpcArgs(aDrive));
  3602 
  3576 	OstTrace1(TRACE_BORDER, EFSRV_EFSALLOWDISMOUNTRETURN, "r %d", r);
  3603 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAllowDismountReturn, MODULEUID, r);
       
  3604 	return r;
  3577 	return r;
  3605 	}
  3578 	}
  3606 
  3579 
  3607 EFSRV_EXPORT_C TInt RFs::SetStartupConfiguration(TInt aCommand,TAny* aParam1,TAny* aParam2) const
  3580 EFSRV_EXPORT_C TInt RFs::SetStartupConfiguration(TInt aCommand,TAny* aParam1,TAny* aParam2) const
  3608 /**
  3581 /**
  3619        aParam2 Command specific parameter.
  3592        aParam2 Command specific parameter.
  3620 
  3593 
  3621 @return KErrNone if successful, KErrPermissionDenied if called outside estart
  3594 @return KErrNone if successful, KErrPermissionDenied if called outside estart
  3622 */
  3595 */
  3623     {
  3596     {
  3624 	TRACE4(UTF::EBorder, UTraceModuleEfsrv::EFsSetStartupConfiguration, MODULEUID, Handle(), aCommand, aParam1, aParam2);
  3597 	OstTraceExt4(TRACE_BORDER, EFSRV_EFSSETSTARTUPCONFIGURATION, "sess %x aCommand %d aParam1 %x aParam2 %x", (TUint) Handle(), aCommand, (TUint) aParam1, (TUint) aParam2);
  3625     TInt r = SendReceive(EFsSetStartupConfiguration, TIpcArgs(aCommand,aParam1,aParam2));
  3598     TInt r = SendReceive(EFsSetStartupConfiguration, TIpcArgs(aCommand,aParam1,aParam2));
  3626 
  3599 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSTARTUPCONFIGURATIONRETURN, "r %d", r);
  3627 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetStartupConfigurationReturn, MODULEUID, r);
       
  3628 	return r;
  3600 	return r;
  3629     }
  3601     }
  3630 
  3602 
  3631 
  3603 
  3632 EFSRV_EXPORT_C TInt RFs::SetNotifyChange(TBool aNotifyChange)
  3604 EFSRV_EXPORT_C TInt RFs::SetNotifyChange(TBool aNotifyChange)
  3642 @capability DiskAdmin
  3614 @capability DiskAdmin
  3643         
  3615         
  3644 @see RFs::NotifyChange
  3616 @see RFs::NotifyChange
  3645  */
  3617  */
  3646 	{
  3618 	{
  3647 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyChange, MODULEUID, Handle(), aNotifyChange);
  3619 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETNOTIFYCHANGE, "sess %x aNotifyChange %d", (TUint) Handle(), (TUint) aNotifyChange);
  3648 	TInt r = SendReceive(EFsSetSessionFlags, TIpcArgs(aNotifyChange ? EFsSessionNotifyChange: 0, aNotifyChange ? 0 : EFsSessionNotifyChange));
  3620 	TInt r = SendReceive(EFsSetSessionFlags, TIpcArgs(aNotifyChange ? EFsSessionNotifyChange: 0, aNotifyChange ? 0 : EFsSessionNotifyChange));
  3649 
  3621 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETNOTIFYCHANGERETURN, "r %d", r);
  3650 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyChangeReturn, MODULEUID, r);
       
  3651 	return r;
  3622 	return r;
  3652 	}
  3623 	}
  3653 
  3624 
  3654 
  3625 
  3655 TInt RFs::Unclamp(const RFileClamp& aHandle)
  3626 TInt RFs::Unclamp(const RFileClamp& aHandle)
  3679 @return KErrNone if successful.
  3650 @return KErrNone if successful.
  3680 
  3651 
  3681 @capability KDiskAdmin
  3652 @capability KDiskAdmin
  3682 */
  3653 */
  3683 	{
  3654 	{
  3684 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsInitialisePropertiesFile, MODULEUID, Handle(), aPtr.Ptr(), aPtr.Length());
  3655 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSINITIALISEPROPERTIESFILE, "sess %x filePtr %x fileLen %d", (TUint) Handle(), (TUint) aPtr.Ptr(), (TUint) aPtr.Length());
  3685 	TInt r = SendReceive(EFsInitialisePropertiesFile, TIpcArgs(aPtr.Ptr(), aPtr.Length(), ETrue));
  3656 	TInt r = SendReceive(EFsInitialisePropertiesFile, TIpcArgs(aPtr.Ptr(), aPtr.Length(), ETrue));
  3686 
  3657 	OstTrace1(TRACE_BORDER, EFSRV_EFSINITIALISEPROPERTIESFILERETURN, "r %d", r);
  3687 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsInitialisePropertiesFileReturn, MODULEUID, r);
       
  3688 	return r;
  3658 	return r;
  3689 	}
  3659 	}
  3690 
  3660 
  3691 EFSRV_EXPORT_C TInt RFs::QueryVolumeInfoExt(TInt aDrive, TQueryVolumeInfoExtCmd aCommand, TDes8& aInfo) const
  3661 EFSRV_EXPORT_C TInt RFs::QueryVolumeInfoExt(TInt aDrive, TQueryVolumeInfoExtCmd aCommand, TDes8& aInfo) const
  3692 /**
  3662 /**
  3701         
  3671         
  3702 @see TQueryVolumeInfoExtCmd
  3672 @see TQueryVolumeInfoExtCmd
  3703 @see TVolumeIOParamInfo
  3673 @see TVolumeIOParamInfo
  3704  */
  3674  */
  3705 	{
  3675 	{
  3706 	TRACE3(UTF::EBorder, UTraceModuleEfsrv::EFsQueryVolumeInfoExt, MODULEUID, Handle(), aDrive, aCommand);
  3676 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSQUERYVOLUMEINFOEXT, "sess %x aDrive %d aCommand %d", (TUint) Handle(), (TUint) aDrive, (TUint) aCommand);
  3707 	TInt r = SendReceive(EFsQueryVolumeInfoExt, TIpcArgs(aDrive, aCommand, &aInfo));
  3677 	TInt r = SendReceive(EFsQueryVolumeInfoExt, TIpcArgs(aDrive, aCommand, &aInfo));
  3708 
  3678 	OstTrace1(TRACE_BORDER, EFSRV_EFSQUERYVOLUMEINFOEXTRETURN, "r %d", r);
  3709 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsQueryVolumeInfoExtReturn, MODULEUID, r);
       
  3710 	return r;
  3679 	return r;
  3711 	}
  3680 	}
  3712 
  3681 
  3713 
  3682 
  3714 EFSRV_EXPORT_C TInt RFs::VolumeIOParam(TInt aDrive, TVolumeIOParamInfo& aParamInfo) const
  3683 EFSRV_EXPORT_C TInt RFs::VolumeIOParam(TInt aDrive, TVolumeIOParamInfo& aParamInfo) const
  3723 @param aParamInfo A TVolumeIOParamInfo containing the volume parameters.
  3692 @param aParamInfo A TVolumeIOParamInfo containing the volume parameters.
  3724 
  3693 
  3725 @return KErrNone if successful; otherwise, another system wide error code is returned.
  3694 @return KErrNone if successful; otherwise, another system wide error code is returned.
  3726 */
  3695 */
  3727 	{
  3696 	{
  3728 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsVolumeIOParam, MODULEUID, Handle(), aDrive);
  3697 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUMEIOPARAM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3729 
       
  3730 	TInt r = KErrNone;
  3698 	TInt r = KErrNone;
  3731 
  3699 
  3732 	if (!IsValidDrive(aDrive))
  3700 	if (!IsValidDrive(aDrive))
  3733 		r = KErrArgument;
  3701 		r = KErrArgument;
  3734 	
  3702 	
  3737 		TPckgBuf<TVolumeIOParamInfo> infoPckg;
  3705 		TPckgBuf<TVolumeIOParamInfo> infoPckg;
  3738 		r = QueryVolumeInfoExt(aDrive, EIOParamInfo, infoPckg);
  3706 		r = QueryVolumeInfoExt(aDrive, EIOParamInfo, infoPckg);
  3739 		if (r == KErrNone)
  3707 		if (r == KErrNone)
  3740 			aParamInfo = infoPckg();
  3708 			aParamInfo = infoPckg();
  3741 		}
  3709 		}
  3742 
  3710 	OstTraceExt5(TRACE_BORDER, EFSRV_EFSVOLUMEIOPARAMRETURN, "r %d iBlockSize %d iClusterSize %d iRecReadBufSize %d iRecWriteBufSize %d", (TUint) r, (TUint) aParamInfo.iBlockSize, (TUint) aParamInfo.iClusterSize, (TUint) aParamInfo.iRecReadBufSize, (TUint) aParamInfo.iRecWriteBufSize);
  3743 	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsVolumeIOParamReturn, MODULEUID, 
  3711 		
  3744 		r, aParamInfo.iBlockSize, aParamInfo.iClusterSize, aParamInfo.iRecReadBufSize, aParamInfo.iRecWriteBufSize);
       
  3745 	return r;
  3712 	return r;
  3746 	}
  3713 	}
  3747 
  3714 
  3748 
  3715 
  3749 /**
  3716 /**
  3768 
  3735 
  3769     @see TFSName
  3736     @see TFSName
  3770 */
  3737 */
  3771 EFSRV_EXPORT_C TInt RFs::FileSystemSubType(TInt aDrive, TDes& aName) const
  3738 EFSRV_EXPORT_C TInt RFs::FileSystemSubType(TInt aDrive, TDes& aName) const
  3772 	{
  3739 	{
  3773 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemSubType, MODULEUID, Handle(), aDrive, aName);
  3740 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPE, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3774 
  3741 
  3775 	TInt r = KErrNone;
  3742 	TInt r = KErrNone;
  3776 
  3743 
  3777 	if (!IsValidDrive(aDrive))
  3744 	if (!IsValidDrive(aDrive))
  3778 		r = KErrArgument;
  3745 		r = KErrArgument;
  3782 		TPckgBuf<TFSName> namePckg;
  3749 		TPckgBuf<TFSName> namePckg;
  3783 		r = QueryVolumeInfoExt(aDrive, EFileSystemSubType, namePckg);
  3750 		r = QueryVolumeInfoExt(aDrive, EFileSystemSubType, namePckg);
  3784 		if (r == KErrNone || r == KErrNotSupported)
  3751 		if (r == KErrNone || r == KErrNotSupported)
  3785 			aName = namePckg();
  3752 			aName = namePckg();
  3786 		}
  3753 		}
  3787 
  3754 	
  3788 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemSubTypeReturn, MODULEUID, r);
  3755 	OstTraceData(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPE_EFILESYSTEMNAME, "FileSystemName %S", aName.Ptr(), aName.Length()<<1);
       
  3756 
       
  3757 	OstTrace1(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPERETURN, "r %d", r);
       
  3758 
  3789 	return r;
  3759 	return r;
  3790 	}
  3760 	}
  3791 
  3761 
  3792 EXPORT_C TInt RFs::AddProxyDrive(const TDesC& aFileName)
  3762 EXPORT_C TInt RFs::AddProxyDrive(const TDesC& aFileName)
  3793 /**
  3763 /**
  3866 */
  3836 */
  3867 	{
  3837 	{
  3868 	return SendReceive(EFsDismountProxyDrive,TIpcArgs(aProxyDriveNumber));
  3838 	return SendReceive(EFsDismountProxyDrive,TIpcArgs(aProxyDriveNumber));
  3869 	}
  3839 	}
  3870 
  3840 
       
  3841 
       
  3842 /**
       
  3843 Closes the file server session.
       
  3844 
       
  3845 NB This function was added to support tracing and was not present in earlier versions of Symbian OS.
       
  3846 For this reason no extra funcitonality should be added to this function.
       
  3847 
       
  3848 */
  3871 EFSRV_EXPORT_C void RFs::Close()
  3849 EFSRV_EXPORT_C void RFs::Close()
  3872 	{
  3850 	{
  3873 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsClose, MODULEUID, Handle());
  3851 	OstTrace1(TRACE_BORDER, EFSRV_EFSCLOSE, "sess %x", Handle());
  3874 	RFTRACE_CLOSE;
       
  3875 
  3852 
  3876 	RSessionBase::Close();
  3853 	RSessionBase::Close();
  3877 
  3854 
  3878 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsCloseReturn, MODULEUID);
  3855 	OstTrace0(TRACE_BORDER, EFSRV_EFSCLOSERETURN, "");
  3879 	}
  3856 	}
  3880 
  3857 
  3881 
  3858