userlibandfileserver/fileserver/sfsrv/cl_cli.cpp
changeset 152 657f875b013e
parent 102 ef2a444a7410
child 247 d8d70de2bd36
equal deleted inserted replaced
139:95f71bcdcdb7 152:657f875b013e
    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);
       
  2629 	return r;
  2583 	return r;
  2630 	}
  2584 	}
  2631 
  2585 
  2632 
  2586 
  2633 /**
  2587 /**
  2662 		3	Lost cluster chain detected.
  2616 		3	Lost cluster chain detected.
  2663 		4	File size does not correspond to the number of clusters reported in the FAT table.
  2617 		4	File size does not correspond to the number of clusters reported in the FAT table.
  2664 */
  2618 */
  2665 EFSRV_EXPORT_C TInt RFs::CheckDisk(const TDesC& aDrive) const
  2619 EFSRV_EXPORT_C TInt RFs::CheckDisk(const TDesC& aDrive) const
  2666 	{
  2620 	{
  2667 	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);
  2668 	TInt r = SendReceive(EFsCheckDisk,TIpcArgs(&aDrive));
  2623 	TInt r = SendReceive(EFsCheckDisk,TIpcArgs(&aDrive));
  2669 
  2624 	OstTrace1(TRACE_BORDER, EFSRV_EFSCHECKDISKRETURN, "r %d", r);
  2670 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsCheckDiskReturn, MODULEUID, r);
       
  2671 	return r;
  2625 	return r;
  2672 	}
  2626 	}
  2673 
  2627 
  2674 
  2628 
  2675 
  2629 
  2712 Running ScanDrive on removable media or media that has FAT file system not in
  2666 Running ScanDrive on removable media or media that has FAT file system not in
  2713 "Rugged FAT" mode is not practical, because ScanDrive is not designed for this.
  2667 "Rugged FAT" mode is not practical, because ScanDrive is not designed for this.
  2714 Therefore, do not treat ScanDrive on removable media as a generic "disk repair utility".
  2668 Therefore, do not treat ScanDrive on removable media as a generic "disk repair utility".
  2715 */
  2669 */
  2716 	{
  2670 	{
  2717 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsScanDrive, MODULEUID, Handle(), aDrive);
  2671 	OstTrace1(TRACE_BORDER, EFSRV_EFSSCANDRIVE, "sess %x", Handle());
       
  2672 	OstTraceData(TRACE_BORDER, EFSRV_EFSSCANDRIVE_EDIRNAME, "Dir %S", aDrive.Ptr(), aDrive.Length()<<1);
  2718 	TInt r = SendReceive(EFsScanDrive,TIpcArgs(&aDrive));
  2673 	TInt r = SendReceive(EFsScanDrive,TIpcArgs(&aDrive));
  2719 
  2674 	OstTrace1(TRACE_BORDER, EFSRV_EFSSCANDRIVERETURN, "r %d", r);
  2720 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsScanDriveReturn, MODULEUID, r);
       
  2721 	return r;
  2675 	return r;
  2722 	}
  2676 	}
  2723 
  2677 
  2724 
  2678 
  2725 
  2679 
  2744 @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
  2745 @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
  2746 					  have the relevant SID capability AllFiles is required
  2700 					  have the relevant SID capability AllFiles is required
  2747 */
  2701 */
  2748 	{
  2702 	{
  2749 	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);
  2750 	TInt r = SendReceive(EFsGetShortName,TIpcArgs(&aLongName,&aShortName));
  2705 	TInt r = SendReceive(EFsGetShortName,TIpcArgs(&aLongName,&aShortName));
  2751 
  2706 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETSHORTNAME_ESHORTNAME, "ShortName %S", aShortName.Ptr(), aShortName.Length()<<1);
  2752 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetShortNameReturn, MODULEUID, r, aShortName);
  2707 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETSHORTNAMERETURN, "r %d", r);
  2753 	return r;
  2708 	return r;
  2754 	}
  2709 	}
  2755 
  2710 
  2756 
  2711 
  2757 
  2712 
  2776 @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
  2777 					  have the relevant SID capability AllFiles is required
  2732 					  have the relevant SID capability AllFiles is required
  2778 
  2733 
  2779 */
  2734 */
  2780 	{
  2735 	{
  2781 	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);
  2782 	TInt r = SendReceive(EFsGetLongName,TIpcArgs(&aShortName,&aLongName));
  2738 	TInt r = SendReceive(EFsGetLongName,TIpcArgs(&aShortName,&aLongName));
  2783 
  2739 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETLONGNAME_ELONGNAME, "LongName %S", aLongName.Ptr(), aLongName.Length()<<1);
  2784 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetLongNameReturn, MODULEUID, r, aLongName);
  2740 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETLONGNAMERETURN, "r %d", r);
  2785 	return r;
  2741 	return r;
  2786 	}
  2742 	}
  2787 
  2743 
  2788 
  2744 
  2789 
  2745 
  2812 @see RFs::Delete
  2768 @see RFs::Delete
  2813 @see RFs::Rename 
  2769 @see RFs::Rename 
  2814 @see RFs::Replace
  2770 @see RFs::Replace
  2815 */
  2771 */
  2816 	{
  2772 	{
  2817 	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);
  2818 	TPckg<TBool> b(anAnswer);
  2775 	TPckg<TBool> b(anAnswer);
  2819 	TInt r = SendReceive(EFsIsFileOpen,TIpcArgs(&aFileName,&b));
  2776 	TInt r = SendReceive(EFsIsFileOpen,TIpcArgs(&aFileName,&b));
  2820 
  2777 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISFILEOPENRETURN, "r %d anAnswer %d", (TUint) r, (TUint) anAnswer);
  2821 	TRACERET2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileOpenReturn, MODULEUID, r, anAnswer);
       
  2822 	return r;
  2778 	return r;
  2823 	}
  2779 	}
  2824 
  2780 
  2825 
  2781 
  2826 
  2782 
  2848 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.
  2849 
  2805 
  2850 @return True if notification in effect, false if not.
  2806 @return True if notification in effect, false if not.
  2851 */
  2807 */
  2852 	{
  2808 	{
  2853 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsGetNotifyUser, MODULEUID, Handle());
  2809 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETNOTIFYUSER, "sess %x", Handle());
  2854 
       
  2855 	TInt notifyUser;
  2810 	TInt notifyUser;
  2856 	TPckg<TInt> pckgNotify(notifyUser);
  2811 	TPckg<TInt> pckgNotify(notifyUser);
  2857 	SendReceive(EFsGetNotifyUser,TIpcArgs(&pckgNotify));
  2812 	SendReceive(EFsGetNotifyUser,TIpcArgs(&pckgNotify));
  2858 	TBool r = notifyUser;
  2813 	TBool r = notifyUser;
  2859 
  2814 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETNOTIFYUSERRETURN, "r %d", r);
  2860 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetNotifyUserReturn, MODULEUID, r);
       
  2861 	return r;
  2815 	return r;
  2862 	}
  2816 	}
  2863 
  2817 
  2864 
  2818 
  2865 
  2819 
  2872 
  2826 
  2873 @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;
  2874               EFalse, for no notification.
  2828               EFalse, for no notification.
  2875 */
  2829 */
  2876 	{
  2830 	{
  2877 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyUser, MODULEUID, Handle(), aValue);
  2831 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETNOTIFYUSER, "sess %x aValue %d", (TUint) Handle(), (TUint) aValue);
  2878 	SendReceive(EFsSetNotifyUser,TIpcArgs(aValue));
  2832 	SendReceive(EFsSetNotifyUser,TIpcArgs(aValue));
  2879 
  2833 
  2880 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyUserReturn, MODULEUID);
  2834 	OstTrace0(TRACE_BORDER, EFSRV_EFSSETNOTIFYUSERRETURN, "");
  2881 	}
  2835 	}
  2882 
  2836 
  2883 
  2837 
  2884 
  2838 
  2885 
  2839 
  2905 @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
  2906 					  have the relevant SID capability AllFiles is required
  2860 					  have the relevant SID capability AllFiles is required
  2907 
  2861 
  2908 */
  2862 */
  2909 	{
  2863 	{
  2910 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileInRom, MODULEUID, Handle(), aFileName);
  2864 	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEINROM, "sess %x", Handle());
  2911 
  2865 	OstTraceData(TRACE_BORDER, EFSRV_EFSISFILEINROM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
  2912 	TPckgBuf<TUint8*> start;
  2866 	TPckgBuf<TUint8*> start;
  2913 
  2867 
  2914 	TUint8* r;
  2868 	TUint8* r;
  2915 	if (SendReceive(EFsIsFileInRom,TIpcArgs(&aFileName,&start))!=KErrNone)
  2869 	if (SendReceive(EFsIsFileInRom,TIpcArgs(&aFileName,&start))!=KErrNone)
  2916 		r = NULL;
  2870 		r = NULL;
  2917 	else
  2871 	else
  2918 		r = start();
  2872 		r = start();
  2919 
  2873 
  2920 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsFileInRomReturn, MODULEUID, r);
  2874 	OstTrace1(TRACE_BORDER, EFSRV_EFSISFILEINROMRETURN, "r %d", r);
  2921 	return r;
  2875 	return r;
  2922 	}
  2876 	}
  2923 
  2877 
  2924 
  2878 
  2925 
  2879 
  2955 
  2909 
  2956 @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.
  2957 */
  2911 */
  2958 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName) const
  2912 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aFileName) const
  2959 	{
  2913 	{
  2960 	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);
  2961 	TBool returnInvalidChar=EFalse;
  2916 	TBool returnInvalidChar=EFalse;
  2962 	TPckg<TBool> bPckg(returnInvalidChar);
  2917 	TPckg<TBool> bPckg(returnInvalidChar);
  2963 	TBool b;
  2918 	TBool b;
  2964 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&bPckg,NULL,NULL))!=KErrNone)
  2919 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&bPckg,NULL,NULL))!=KErrNone)
  2965 		b = EFalse;
  2920 		b = EFalse;
  2966 	else
  2921 	else
  2967 		b = ETrue;
  2922 		b = ETrue;
  2968 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName1Return, MODULEUID, b);
  2923 	OstTrace1(TRACE_BORDER, EFSRV_EFSISVALIDNAME1RETURN, "r %d", b);
  2969 	return b;
  2924 	return b;
  2970 	}
  2925 	}
  2971 
  2926 
  2972 
  2927 
  2973 
  2928 
  3006 
  2961 
  3007 @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.
  3008 */
  2963 */
  3009 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
  3010 	{
  2965 	{
  3011 	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);
  3012 	TBool returnInvalidChar=ETrue;
  2968 	TBool returnInvalidChar=ETrue;
  3013 	TPckg<TBool> boolPckg(returnInvalidChar);
  2969 	TPckg<TBool> boolPckg(returnInvalidChar);
  3014 	TPckg<TText> textPckg(aBadChar);
  2970 	TPckg<TText> textPckg(aBadChar);
  3015 	TBool b;
  2971 	TBool b;
  3016 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&boolPckg,&textPckg,NULL))!=KErrNone)
  2972 	if (SendReceive(EFsIsValidName,TIpcArgs(&aFileName,&boolPckg,&textPckg,NULL))!=KErrNone)
  3017 		b = EFalse;
  2973 		b = EFalse;
  3018 	else 
  2974 	else 
  3019 		b = ETrue;
  2975 		b = ETrue;
  3020 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName2Return, MODULEUID, b, aBadChar);
  2976 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISVALIDNAME2RETURN, "r %d aBadChar %x", (TUint) b, (TUint) aBadChar);
  3021 	return b;
  2977 	return b;
  3022 	}
  2978 	}
  3023 /**
  2979 /**
  3024 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.
  3025 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
  3064 					   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.
  3065 @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.
  3066 */
  3022 */
  3067 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aName, TNameValidParam& aParam )
  3023 EFSRV_EXPORT_C TBool RFs::IsValidName(const TDesC& aName, TNameValidParam& aParam )
  3068 	{
  3024 	{
  3069 	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);
  3070 	TPckg<TNameValidParam> paramPckg(aParam);
  3027 	TPckg<TNameValidParam> paramPckg(aParam);
  3071 	TBool b;
  3028 	TBool b;
  3072 	if (SendReceive(EFsIsValidName,TIpcArgs(&aName,NULL,NULL,&paramPckg))!=KErrNone)
  3029 	if (SendReceive(EFsIsValidName,TIpcArgs(&aName,NULL,NULL,&paramPckg))!=KErrNone)
  3073 		b = EFalse;
  3030 		b = EFalse;
  3074 	else
  3031 	else
  3075 		b = ETrue;
  3032 		b = ETrue;
  3076 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsIsValidName3Return, MODULEUID, b, aParam.ErrorCode());
  3033 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSISVALIDNAME3RETURN, "r %d err %d", (TUint) b, (TUint) aParam.ErrorCode());
  3077 	return b;
  3034 	return b;
  3078 	}
  3035 	}
  3079 
  3036 
  3080 
  3037 
  3081 
  3038 
  3097         system-wide error codes.
  3054         system-wide error codes.
  3098 
  3055 
  3099 @see TDriveNumber
  3056 @see TDriveNumber
  3100 */
  3057 */
  3101 	{
  3058 	{
  3102 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetDriveName, MODULEUID, Handle(), aDrive);
  3059 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETDRIVENAME, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3103 	TInt r = SendReceive(EFsGetDriveName,TIpcArgs(aDrive,&aDriveName));
  3060 	TInt r = SendReceive(EFsGetDriveName,TIpcArgs(aDrive,&aDriveName));
  3104 
  3061 	OstTraceData(TRACE_BORDER, EFSRV_EFSGETDRIVENAME_EDRIVENAME, "DriveName %S", aDriveName.Ptr(), aDriveName.Length()<<1);
  3105 	TRACERETMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsGetDriveNameReturn, MODULEUID, r, aDriveName);
  3062 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETDRIVENAMERETURN, "r %d", r);
  3106 	return r;
  3063 	return r;
  3107 	}
  3064 	}
  3108 
  3065 
  3109 
  3066 
  3110 
  3067 
  3128 
  3085 
  3129 @capability DiskAdmin
  3086 @capability DiskAdmin
  3130 
  3087 
  3131 */
  3088 */
  3132 	{
  3089 	{
  3133 	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);
  3134 	TInt r = SendReceive(EFsSetDriveName,TIpcArgs(aDrive,&aDriveName));
  3092 	TInt r = SendReceive(EFsSetDriveName,TIpcArgs(aDrive,&aDriveName));
  3135 
  3093 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETDRIVENAMERETURN, "r %d", r);
  3136 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetDriveNameReturn, MODULEUID, r);
       
  3137 	return r;
  3094 	return r;
  3138 	}
  3095 	}
  3139 
  3096 
  3140 
  3097 
  3141 
  3098 
  3162 
  3119 
  3163 @capability DiskAdmin
  3120 @capability DiskAdmin
  3164 
  3121 
  3165 */
  3122 */
  3166 	{
  3123 	{
  3167 	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);
  3168 	TInt r = SendReceive(EFsLockDrive,TIpcArgs(aDrv,&aOld,&aNew,aStore));
  3125 	TInt r = SendReceive(EFsLockDrive,TIpcArgs(aDrv,&aOld,&aNew,aStore));
  3169 
  3126 	OstTrace1(TRACE_BORDER, EFSRV_EFSLOCKDRIVERETURN, "r %d", r);
  3170 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsLockDriveReturn, MODULEUID, r);
       
  3171 	return r;
  3127 	return r;
  3172 	}
  3128 	}
  3173 
  3129 
  3174 
  3130 
  3175 
  3131 
  3194 
  3150 
  3195 @capability DiskAdmin
  3151 @capability DiskAdmin
  3196 
  3152 
  3197 */
  3153 */
  3198 	{
  3154 	{
  3199 	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);
  3200 	TInt r = SendReceive(EFsUnlockDrive,TIpcArgs(aDrive,&aPassword,aStore));
  3156 	TInt r = SendReceive(EFsUnlockDrive,TIpcArgs(aDrive,&aPassword,aStore));
  3201 
  3157 	OstTrace1(TRACE_BORDER, EFSRV_EFSUNLOCKDRIVERETURN, "r %d", r);
  3202 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsUnlockDriveReturn, MODULEUID, r);
       
  3203 	return r;
  3158 	return r;
  3204 	}
  3159 	}
  3205 
  3160 
  3206 
  3161 
  3207 
  3162 
  3223 
  3178 
  3224 @capability DiskAdmin
  3179 @capability DiskAdmin
  3225 
  3180 
  3226 */
  3181 */
  3227 	{
  3182 	{
  3228 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsClearPassword, MODULEUID, Handle(), aDrv);
  3183 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSCLEARPASSWORD, "sess %x aDrv %d", (TUint) Handle(), (TUint) aDrv);
  3229 	TInt r = SendReceive(EFsClearPassword,TIpcArgs(aDrv,&aPswd));
  3184 	TInt r = SendReceive(EFsClearPassword,TIpcArgs(aDrv,&aPswd));
  3230 
  3185 	OstTrace1(TRACE_BORDER, EFSRV_EFSCLEARPASSWORDRETURN, "r %d", r);
  3231 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsClearPasswordReturn, MODULEUID, r);
       
  3232 	return r;
  3186 	return r;
  3233 	}
  3187 	}
  3234 
  3188 
  3235 
  3189 
  3236 
  3190 
  3251 
  3205 
  3252 @capability DiskAdmin
  3206 @capability DiskAdmin
  3253 
  3207 
  3254 */
  3208 */
  3255 	{
  3209 	{
  3256 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsErasePassword, MODULEUID, Handle(), aDrv);
  3210 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSERASEPASSWORD, "sess %x aDrv %d", (TUint) Handle(), (TUint) aDrv);
  3257 	TInt r = SendReceive(EFsErasePassword,TIpcArgs(aDrv));
  3211 	TInt r = SendReceive(EFsErasePassword,TIpcArgs(aDrv));
  3258 
  3212 	OstTrace1(TRACE_BORDER, EFSRV_EFSERASEPASSWORDRETURN, "r %d", r);
  3259 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsErasePasswordReturn, MODULEUID, r);
       
  3260 	return r;
  3213 	return r;
  3261 	}
  3214 	}
  3262 
  3215 
  3263 
  3216 
  3264 
  3217 
  3271 */
  3224 */
  3272 //
  3225 //
  3273 // Notify file server that startup initialisation has been completed
  3226 // Notify file server that startup initialisation has been completed
  3274 //
  3227 //
  3275 	{
  3228 	{
  3276 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsStartupInitComplete, MODULEUID, Handle(), &aStat);
  3229 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSTARTUPINITCOMPLETE, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
  3277 	aStat=KRequestPending;
  3230 	aStat=KRequestPending;
  3278 	RSessionBase::SendReceive(EFsStartupInitComplete,aStat);
  3231 	RSessionBase::SendReceive(EFsStartupInitComplete,aStat);
  3279 
  3232 
  3280 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsStartupInitCompleteReturn, MODULEUID);
  3233 	OstTrace0(TRACE_BORDER, EFSRV_EFSSTARTUPINITCOMPLETERETURN, "");
  3281 	}
  3234 	}
  3282 
  3235 
  3283 
  3236 
  3284 
  3237 
  3285 
  3238 
  3286 EFSRV_EXPORT_C TInt RFs::SetLocalDriveMapping(const TDesC8& aMapping)
  3239 EFSRV_EXPORT_C TInt RFs::SetLocalDriveMapping(const TDesC8& aMapping)
  3287 //
  3240 //
  3288 // Set the local drive mapping
  3241 // Set the local drive mapping
  3289 //
  3242 //
  3290 	{
  3243 	{
  3291 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsSetLocalDriveMapping, MODULEUID, Handle(), aMapping);
  3244 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPING, "sess %x", Handle());
  3292 
  3245 	
       
  3246 	OstTraceData( TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPING_ELOCALDRIVEMAPPING, "aMapping %{int32[]}", aMapping.Ptr(), aMapping.Length());
  3293 	TInt r = SendReceive(EFsSetLocalDriveMapping,TIpcArgs(&aMapping));
  3247 	TInt r = SendReceive(EFsSetLocalDriveMapping,TIpcArgs(&aMapping));
  3294 
  3248 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETLOCALDRIVEMAPPINGRETURN, "r %d", r);
  3295 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetLocalDriveMappingReturn, MODULEUID, r);
       
  3296 	return r;
  3249 	return r;
  3297 	}
  3250 	}
  3298 
  3251 
  3299 
  3252 
  3300 /**
  3253 /**
  3312 
  3265 
  3313     @capability DiskAdmin
  3266     @capability DiskAdmin
  3314 */
  3267 */
  3315 EFSRV_EXPORT_C TInt RFs::FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const
  3268 EFSRV_EXPORT_C TInt RFs::FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const
  3316     {
  3269     {
  3317 	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);
  3318     TInt r = SendReceive(EFsFinaliseDrive,TIpcArgs(aDriveNo, (TInt)aMode));
  3271     TInt r = SendReceive(EFsFinaliseDrive,TIpcArgs(aDriveNo, (TInt)aMode));
  3319 
  3272 	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVERETURN, "r %d", r);
  3320 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDriveReturn, MODULEUID, r);
       
  3321 	return r;
  3273 	return r;
  3322     }
  3274     }
  3323 
  3275 
  3324 
  3276 
  3325 /**
  3277 /**
  3331     @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.
  3332     @capability DiskAdmin
  3284     @capability DiskAdmin
  3333 */
  3285 */
  3334 EFSRV_EXPORT_C TInt RFs::FinaliseDrives()
  3286 EFSRV_EXPORT_C TInt RFs::FinaliseDrives()
  3335 	{
  3287 	{
  3336 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrives, MODULEUID, Handle());
  3288 	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVES, "sess %x", Handle());
  3337 	TInt nRes;
  3289 	TInt nRes;
  3338 	TDriveList driveList;
  3290 	TDriveList driveList;
  3339 	TDriveInfo driveInfo;
  3291 	TDriveInfo driveInfo;
  3340 	
  3292 	
  3341 	nRes=DriveList(driveList);
  3293 	nRes=DriveList(driveList);
  3342 	if(nRes != KErrNone)
  3294 	if(nRes != KErrNone)
  3343 		{
  3295 		{
  3344 		TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrivesReturn, MODULEUID, nRes);
  3296 		OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVESRETURN1, "r %d", nRes);
  3345 	    return nRes; //-- unable to obtain drives list
  3297 	    return nRes; //-- unable to obtain drives list
  3346 		}
  3298 		}
  3347 	
  3299 	
  3348 	//-- walk through all drives in the system sending them "Finalise" request
  3300 	//-- walk through all drives in the system sending them "Finalise" request
  3349 	for (TInt i=0; i<KMaxDrives; ++i)
  3301 	for (TInt i=0; i<KMaxDrives; ++i)
  3361         	 
  3313         	 
  3362 	    nRes = FinaliseDrive(i, EFinal_RW);
  3314 	    nRes = FinaliseDrive(i, EFinal_RW);
  3363 	    }
  3315 	    }
  3364 	
  3316 	
  3365 
  3317 
  3366 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsFinaliseDrivesReturn, MODULEUID, KErrNone);
  3318 	OstTrace1(TRACE_BORDER, EFSRV_EFSFINALISEDRIVESRETURN2, "r %d", KErrNone);
  3367 	return 	KErrNone;
  3319 	return 	KErrNone;
  3368 	}
  3320 	}
  3369 
  3321 
  3370 
  3322 
  3371 
  3323 
  3388 		KErrNotFound If the filesystem name provided could not be found.
  3340 		KErrNotFound If the filesystem name provided could not be found.
  3389 		
  3341 		
  3390 @capability DiskAdmin
  3342 @capability DiskAdmin
  3391 */
  3343 */
  3392 	{
  3344 	{
  3393 	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);
  3394 	TInt r = SendReceive(EFsSwapFileSystem,TIpcArgs(&aNewFileSystemName,aDrive,&aOldFileSystemName));
  3348 	TInt r = SendReceive(EFsSwapFileSystem,TIpcArgs(&aNewFileSystemName,aDrive,&aOldFileSystemName));
  3395 
  3349 	OstTrace1(TRACE_BORDER, EFSRV_EFSSWAPFILESYSTEMRETURN, "r %d", r);
  3396 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSwapFileSystemReturn, MODULEUID, r);
       
  3397 	return r;
  3350 	return r;
  3398 	}
  3351 	}
  3399 
  3352 
  3400 
  3353 
  3401 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
  3416 		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
  3417 		
  3370 		
  3418 @capability DiskAdmin
  3371 @capability DiskAdmin
  3419 */
  3372 */
  3420 	{
  3373 	{
  3421 	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);
  3422 		Handle(), aFileSystemName, aLocalDriveToMount, aCompositeDrive, aSync);
  3375 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNT_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
  3423 	TInt r = SendReceive(EFsAddCompositeMount,TIpcArgs(&aFileSystemName,aLocalDriveToMount,aCompositeDrive,aSync));
  3376 	TInt r = SendReceive(EFsAddCompositeMount,TIpcArgs(&aFileSystemName,aLocalDriveToMount,aCompositeDrive,aSync));
  3424 
  3377 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDCOMPOSITEMOUNTRETURN, "r %d", r);
  3425 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAddCompositeMountReturn, MODULEUID, r);
       
  3426 	return r;
  3378 	return r;
  3427 	}
  3379 	}
  3428 
  3380 
  3429 
  3381 
  3430 EFSRV_EXPORT_C TInt RFs::ReserveDriveSpace(TInt aDriveNo, TInt aSpace)
  3382 EFSRV_EXPORT_C TInt RFs::ReserveDriveSpace(TInt aDriveNo, TInt aSpace)
  3459         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
  3460         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)
  3461         any of the possible error return codes from TDrive::Volume()
  3413         any of the possible error return codes from TDrive::Volume()
  3462 */
  3414 */
  3463 	{
  3415 	{
  3464 	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);
  3465 	TInt r = SendReceive(EFsReserveDriveSpace, TIpcArgs(aDriveNo, aSpace));
  3417 	TInt r = SendReceive(EFsReserveDriveSpace, TIpcArgs(aDriveNo, aSpace));
  3466 
  3418 	OstTrace1(TRACE_BORDER, EFSRV_EFSRESERVEDRIVESPACERETURN, "r %d", r);
  3467 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReserveDriveSpaceReturn, MODULEUID, r);
       
  3468 	return r;
  3419 	return r;
  3469 	}
  3420 	}
  3470 
  3421 
  3471 
  3422 
  3472 
  3423 
  3480 
  3431 
  3481 @return KErrNone if successful
  3432 @return KErrNone if successful
  3482         KErrPermissionDenied if the drive has no spare reserved space
  3433         KErrPermissionDenied if the drive has no spare reserved space
  3483 */
  3434 */
  3484 	{
  3435 	{
  3485 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsGetReserveAccess, MODULEUID, Handle(), aDriveNo);
  3436 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSGETRESERVEACCESS, "sess %x aDriveNo %d", (TUint) Handle(), (TUint) aDriveNo);
  3486 	TInt r = SendReceive(EFsGetReserveAccess, TIpcArgs(aDriveNo));
  3437 	TInt r = SendReceive(EFsGetReserveAccess, TIpcArgs(aDriveNo));
  3487 
  3438 	OstTrace1(TRACE_BORDER, EFSRV_EFSGETRESERVEACCESSRETURN, "r %d", r);
  3488 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsGetReserveAccessReturn, MODULEUID, r);
       
  3489 	return r;
  3439 	return r;
  3490 	}
  3440 	}
  3491 
  3441 
  3492 EFSRV_EXPORT_C TInt RFs::ReleaseReserveAccess(TInt aDriveNo)
  3442 EFSRV_EXPORT_C TInt RFs::ReleaseReserveAccess(TInt aDriveNo)
  3493 /**
  3443 /**
  3497 
  3447 
  3498 @return KErrNone (always returned)
  3448 @return KErrNone (always returned)
  3499 
  3449 
  3500 */
  3450 */
  3501 	{
  3451 	{
  3502 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsReleaseReserveAccess, MODULEUID, Handle(), aDriveNo);
  3452 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSRELEASERESERVEACCESS, "sess %x aDriveNo %d", (TUint) Handle(), (TUint) aDriveNo);
  3503 	TInt r = SendReceive(EFsReleaseReserveAccess, TIpcArgs(aDriveNo));
  3453 	TInt r = SendReceive(EFsReleaseReserveAccess, TIpcArgs(aDriveNo));
  3504 
  3454 	OstTrace1(TRACE_BORDER, EFSRV_EFSRELEASERESERVEACCESSRETURN, "r %d", r);
  3505 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsReleaseReserveAccessReturn, MODULEUID, r);
       
  3506 	return r;
  3455 	return r;
  3507 	}
  3456 	}
  3508 
  3457 
  3509 
  3458 
  3510 
  3459 
  3557     @param aMode    specifies the behaviour of the notification API
  3506     @param aMode    specifies the behaviour of the notification API
  3558     @param aStat    Asynchronous request state.
  3507     @param aStat    Asynchronous request state.
  3559 */
  3508 */
  3560 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
  3561 	{
  3510 	{
  3562 	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);
  3563 	aStat = KRequestPending;
  3512 	aStat = KRequestPending;
  3564 	RSessionBase::SendReceive(EFsNotifyDismount, TIpcArgs(aDrive,aMode,&aStat), aStat);
  3513 	RSessionBase::SendReceive(EFsNotifyDismount, TIpcArgs(aDrive,aMode,&aStat), aStat);
  3565 	// 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)
  3566 	// 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.
  3567 	// 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.
  3568 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
  3517 	SendReceive(EFsSynchroniseDriveThread, TIpcArgs(aDrive));
  3569 
  3518 
  3570 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountReturn, MODULEUID);
  3519 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTRETURN, "");
  3571 	}
  3520 	}
  3572 
  3521 
  3573 
  3522 
  3574 
  3523 
  3575 
  3524 
  3580 
  3529 
  3581     @see RFs::NotifyDismount
  3530     @see RFs::NotifyDismount
  3582 */
  3531 */
  3583 EFSRV_EXPORT_C void RFs::NotifyDismountCancel(TRequestStatus& aStat) const
  3532 EFSRV_EXPORT_C void RFs::NotifyDismountCancel(TRequestStatus& aStat) const
  3584 	{
  3533 	{
  3585 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel1, MODULEUID, Handle(), &aStat);
  3534 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL1, "sess %x status %x", (TUint) Handle(), (TUint) &aStat);
  3586 	
  3535 	
  3587 	if (aStat == KRequestPending)
  3536 	if (aStat == KRequestPending)
  3588 		SendReceive(EFsNotifyDismountCancel, TIpcArgs(&aStat));
  3537 		SendReceive(EFsNotifyDismountCancel, TIpcArgs(&aStat));
  3589 
  3538 
  3590 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel1Return, MODULEUID);
  3539 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL1RETURN, "");
  3591 	}
  3540 	}
  3592 
  3541 
  3593 
  3542 
  3594 
  3543 
  3595 /**
  3544 /**
  3597 
  3546 
  3598     @see RFs::NotifyDismount
  3547     @see RFs::NotifyDismount
  3599 */
  3548 */
  3600 EFSRV_EXPORT_C void RFs::NotifyDismountCancel() const
  3549 EFSRV_EXPORT_C void RFs::NotifyDismountCancel() const
  3601 	{
  3550 	{
  3602 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel2, MODULEUID, Handle());
  3551 	OstTrace1(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL2, "sess %x", Handle());
  3603 
       
  3604 	SendReceive(EFsNotifyDismountCancel, TIpcArgs(NULL));
  3552 	SendReceive(EFsNotifyDismountCancel, TIpcArgs(NULL));
  3605 
  3553 
  3606 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsNotifyDismountCancel2Return, MODULEUID);
  3554 	OstTrace0(TRACE_BORDER, EFSRV_EFSNOTIFYDISMOUNTCANCEL2RETURN, "");
  3607 	}
  3555 	}
  3608 
  3556 
  3609 
  3557 
  3610 
  3558 
  3611 
  3559 
  3621 
  3569 
  3622     @see RFs::NotifyDismount
  3570     @see RFs::NotifyDismount
  3623 */
  3571 */
  3624 EFSRV_EXPORT_C TInt RFs::AllowDismount(TInt aDrive) const
  3572 EFSRV_EXPORT_C TInt RFs::AllowDismount(TInt aDrive) const
  3625 	{
  3573 	{
  3626 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsAllowDismount, MODULEUID, Handle(), aDrive);
  3574 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSALLOWDISMOUNT, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3627 	TInt r = SendReceive(EFsAllowDismount, TIpcArgs(aDrive));
  3575 	TInt r = SendReceive(EFsAllowDismount, TIpcArgs(aDrive));
  3628 
  3576 	OstTrace1(TRACE_BORDER, EFSRV_EFSALLOWDISMOUNTRETURN, "r %d", r);
  3629 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsAllowDismountReturn, MODULEUID, r);
       
  3630 	return r;
  3577 	return r;
  3631 	}
  3578 	}
  3632 
  3579 
  3633 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
  3634 /**
  3581 /**
  3645        aParam2 Command specific parameter.
  3592        aParam2 Command specific parameter.
  3646 
  3593 
  3647 @return KErrNone if successful, KErrPermissionDenied if called outside estart
  3594 @return KErrNone if successful, KErrPermissionDenied if called outside estart
  3648 */
  3595 */
  3649     {
  3596     {
  3650 	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);
  3651     TInt r = SendReceive(EFsSetStartupConfiguration, TIpcArgs(aCommand,aParam1,aParam2));
  3598     TInt r = SendReceive(EFsSetStartupConfiguration, TIpcArgs(aCommand,aParam1,aParam2));
  3652 
  3599 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETSTARTUPCONFIGURATIONRETURN, "r %d", r);
  3653 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetStartupConfigurationReturn, MODULEUID, r);
       
  3654 	return r;
  3600 	return r;
  3655     }
  3601     }
  3656 
  3602 
  3657 
  3603 
  3658 EFSRV_EXPORT_C TInt RFs::SetNotifyChange(TBool aNotifyChange)
  3604 EFSRV_EXPORT_C TInt RFs::SetNotifyChange(TBool aNotifyChange)
  3668 @capability DiskAdmin
  3614 @capability DiskAdmin
  3669         
  3615         
  3670 @see RFs::NotifyChange
  3616 @see RFs::NotifyChange
  3671  */
  3617  */
  3672 	{
  3618 	{
  3673 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyChange, MODULEUID, Handle(), aNotifyChange);
  3619 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSSETNOTIFYCHANGE, "sess %x aNotifyChange %d", (TUint) Handle(), (TUint) aNotifyChange);
  3674 	TInt r = SendReceive(EFsSetSessionFlags, TIpcArgs(aNotifyChange ? EFsSessionNotifyChange: 0, aNotifyChange ? 0 : EFsSessionNotifyChange));
  3620 	TInt r = SendReceive(EFsSetSessionFlags, TIpcArgs(aNotifyChange ? EFsSessionNotifyChange: 0, aNotifyChange ? 0 : EFsSessionNotifyChange));
  3675 
  3621 	OstTrace1(TRACE_BORDER, EFSRV_EFSSETNOTIFYCHANGERETURN, "r %d", r);
  3676 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsSetNotifyChangeReturn, MODULEUID, r);
       
  3677 	return r;
  3622 	return r;
  3678 	}
  3623 	}
  3679 
  3624 
  3680 
  3625 
  3681 TInt RFs::Unclamp(const RFileClamp& aHandle)
  3626 TInt RFs::Unclamp(const RFileClamp& aHandle)
  3705 @return KErrNone if successful.
  3650 @return KErrNone if successful.
  3706 
  3651 
  3707 @capability KDiskAdmin
  3652 @capability KDiskAdmin
  3708 */
  3653 */
  3709 	{
  3654 	{
  3710 	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());
  3711 	TInt r = SendReceive(EFsInitialisePropertiesFile, TIpcArgs(aPtr.Ptr(), aPtr.Length(), ETrue));
  3656 	TInt r = SendReceive(EFsInitialisePropertiesFile, TIpcArgs(aPtr.Ptr(), aPtr.Length(), ETrue));
  3712 
  3657 	OstTrace1(TRACE_BORDER, EFSRV_EFSINITIALISEPROPERTIESFILERETURN, "r %d", r);
  3713 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsInitialisePropertiesFileReturn, MODULEUID, r);
       
  3714 	return r;
  3658 	return r;
  3715 	}
  3659 	}
  3716 
  3660 
  3717 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
  3718 /**
  3662 /**
  3727         
  3671         
  3728 @see TQueryVolumeInfoExtCmd
  3672 @see TQueryVolumeInfoExtCmd
  3729 @see TVolumeIOParamInfo
  3673 @see TVolumeIOParamInfo
  3730  */
  3674  */
  3731 	{
  3675 	{
  3732 	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);
  3733 	TInt r = SendReceive(EFsQueryVolumeInfoExt, TIpcArgs(aDrive, aCommand, &aInfo));
  3677 	TInt r = SendReceive(EFsQueryVolumeInfoExt, TIpcArgs(aDrive, aCommand, &aInfo));
  3734 
  3678 	OstTrace1(TRACE_BORDER, EFSRV_EFSQUERYVOLUMEINFOEXTRETURN, "r %d", r);
  3735 	TRACERET1(UTF::EBorder, UTraceModuleEfsrv::EFsQueryVolumeInfoExtReturn, MODULEUID, r);
       
  3736 	return r;
  3679 	return r;
  3737 	}
  3680 	}
  3738 
  3681 
  3739 
  3682 
  3740 EFSRV_EXPORT_C TInt RFs::VolumeIOParam(TInt aDrive, TVolumeIOParamInfo& aParamInfo) const
  3683 EFSRV_EXPORT_C TInt RFs::VolumeIOParam(TInt aDrive, TVolumeIOParamInfo& aParamInfo) const
  3749 @param aParamInfo A TVolumeIOParamInfo containing the volume parameters.
  3692 @param aParamInfo A TVolumeIOParamInfo containing the volume parameters.
  3750 
  3693 
  3751 @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.
  3752 */
  3695 */
  3753 	{
  3696 	{
  3754 	TRACE2(UTF::EBorder, UTraceModuleEfsrv::EFsVolumeIOParam, MODULEUID, Handle(), aDrive);
  3697 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSVOLUMEIOPARAM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3755 
       
  3756 	TInt r = KErrNone;
  3698 	TInt r = KErrNone;
  3757 
  3699 
  3758 	if (!IsValidDrive(aDrive))
  3700 	if (!IsValidDrive(aDrive))
  3759 		r = KErrArgument;
  3701 		r = KErrArgument;
  3760 	
  3702 	
  3763 		TPckgBuf<TVolumeIOParamInfo> infoPckg;
  3705 		TPckgBuf<TVolumeIOParamInfo> infoPckg;
  3764 		r = QueryVolumeInfoExt(aDrive, EIOParamInfo, infoPckg);
  3706 		r = QueryVolumeInfoExt(aDrive, EIOParamInfo, infoPckg);
  3765 		if (r == KErrNone)
  3707 		if (r == KErrNone)
  3766 			aParamInfo = infoPckg();
  3708 			aParamInfo = infoPckg();
  3767 		}
  3709 		}
  3768 
  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);
  3769 	TRACE5(UTF::EBorder, UTraceModuleEfsrv::EFsVolumeIOParamReturn, MODULEUID, 
  3711 		
  3770 		r, aParamInfo.iBlockSize, aParamInfo.iClusterSize, aParamInfo.iRecReadBufSize, aParamInfo.iRecWriteBufSize);
       
  3771 	return r;
  3712 	return r;
  3772 	}
  3713 	}
  3773 
  3714 
  3774 
  3715 
  3775 /**
  3716 /**
  3794 
  3735 
  3795     @see TFSName
  3736     @see TFSName
  3796 */
  3737 */
  3797 EFSRV_EXPORT_C TInt RFs::FileSystemSubType(TInt aDrive, TDes& aName) const
  3738 EFSRV_EXPORT_C TInt RFs::FileSystemSubType(TInt aDrive, TDes& aName) const
  3798 	{
  3739 	{
  3799 	TRACEMULT3(UTF::EBorder, UTraceModuleEfsrv::EFsFileSystemSubType, MODULEUID, Handle(), aDrive, aName);
  3740 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSFILESYSTEMSUBTYPE, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
  3800 
  3741 
  3801 	TInt r = KErrNone;
  3742 	TInt r = KErrNone;
  3802 
  3743 
  3803 	if (!IsValidDrive(aDrive))
  3744 	if (!IsValidDrive(aDrive))
  3804 		r = KErrArgument;
  3745 		r = KErrArgument;
  3808 		TPckgBuf<TFSName> namePckg;
  3749 		TPckgBuf<TFSName> namePckg;
  3809 		r = QueryVolumeInfoExt(aDrive, EFileSystemSubType, namePckg);
  3750 		r = QueryVolumeInfoExt(aDrive, EFileSystemSubType, namePckg);
  3810 		if (r == KErrNone || r == KErrNotSupported)
  3751 		if (r == KErrNone || r == KErrNotSupported)
  3811 			aName = namePckg();
  3752 			aName = namePckg();
  3812 		}
  3753 		}
  3813 
  3754 	
  3814 	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 
  3815 	return r;
  3759 	return r;
  3816 	}
  3760 	}
  3817 
  3761 
  3818 EXPORT_C TInt RFs::AddProxyDrive(const TDesC& aFileName)
  3762 EXPORT_C TInt RFs::AddProxyDrive(const TDesC& aFileName)
  3819 /**
  3763 /**
  3892 */
  3836 */
  3893 	{
  3837 	{
  3894 	return SendReceive(EFsDismountProxyDrive,TIpcArgs(aProxyDriveNumber));
  3838 	return SendReceive(EFsDismountProxyDrive,TIpcArgs(aProxyDriveNumber));
  3895 	}
  3839 	}
  3896 
  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 */
  3897 EFSRV_EXPORT_C void RFs::Close()
  3849 EFSRV_EXPORT_C void RFs::Close()
  3898 	{
  3850 	{
  3899 	TRACE1(UTF::EBorder, UTraceModuleEfsrv::EFsClose, MODULEUID, Handle());
  3851 	OstTrace1(TRACE_BORDER, EFSRV_EFSCLOSE, "sess %x", Handle());
  3900 	RFTRACE_CLOSE;
       
  3901 
  3852 
  3902 	RSessionBase::Close();
  3853 	RSessionBase::Close();
  3903 
  3854 
  3904 	TRACE0(UTF::EBorder, UTraceModuleEfsrv::EFsCloseReturn, MODULEUID);
  3855 	OstTrace0(TRACE_BORDER, EFSRV_EFSCLOSERETURN, "");
  3905 	}
  3856 	}
  3906 
  3857 
  3907 
  3858