os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/src/T_FsDataMounts.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20 @test
    21 @internalComponent
    22 
    23 This contains CT_FsData
    24 */
    25 
    26 //	User includes
    27 #include "T_FsData.h"
    28 
    29 //	EPOC includes
    30 #include <f32fsys.h>
    31 
    32 /*@{*/
    33 /// Enumerations
    34 _LIT(KDriveA,							"EDriveA");
    35 _LIT(KDriveB,							"EDriveB");
    36 _LIT(KDriveC,							"EDriveC");
    37 _LIT(KDriveD,							"EDriveD");
    38 _LIT(KDriveE,							"EDriveE");
    39 _LIT(KDriveF,							"EDriveF");
    40 _LIT(KDriveG,							"EDriveG");
    41 _LIT(KDriveH,							"EDriveH");
    42 _LIT(KDriveI,							"EDriveI");
    43 _LIT(KDriveJ,							"EDriveJ");
    44 _LIT(KDriveK,							"EDriveK");
    45 _LIT(KDriveL,							"EDriveL");
    46 _LIT(KDriveM,							"EDriveM");
    47 _LIT(KDriveN,							"EDriveN");
    48 _LIT(KDriveO,							"EDriveO");
    49 _LIT(KDriveP,							"EDriveP");
    50 _LIT(KDriveQ,							"EDriveQ");
    51 _LIT(KDriveR,							"EDriveR");
    52 _LIT(KDriveS,							"EDriveS");
    53 _LIT(KDriveT,							"EDriveT");
    54 _LIT(KDriveU,							"EDriveU");
    55 _LIT(KDriveV,							"EDriveV");
    56 _LIT(KDriveW,							"EDriveW");
    57 _LIT(KDriveX,							"EDriveX");
    58 _LIT(KDriveY,							"EDriveY");
    59 _LIT(KDriveZ,							"EDriveZ");
    60 
    61 _LIT(KWriteMappingsAndSet,				"EWriteMappingsAndSet");
    62 _LIT(KWriteMappingsNoSet,				"EWriteMappingsNoSet");
    63 _LIT(KSwapIntMappingAndSet,				"ESwapIntMappingAndSet");
    64 
    65 
    66 ///	Parameters
    67 _LIT(KDrive,							"drive");
    68 _LIT(KDriveMappingElement,				"drive_mapping_element_");
    69 _LIT(KDriveMappingSize,					"drive_mapping_size");
    70 _LIT(KDriveMappingOperation,			"drive_mapping_operation");
    71 _LIT(KFileName,							"file_name");
    72 _LIT(KFileSystemName,					"file_system_name");
    73 _LIT(KNewFileSystemName,				"new_file_system_name");
    74 _LIT(KFlags,							"flags");
    75 _LIT(KIsSync,							"is_sync");
    76 _LIT(KExtensionName,					"extension_name");
    77 _LIT(KPosition,							"position");
    78 _LIT(KMode,								"mode");
    79 _LIT(KAll,								"all");
    80 _LIT(KCommandNum,						"command_num");
    81 _LIT(KSaveInInstance,					"save_in_instance");
    82 _LIT(KLocalDrive,						"local_drive");
    83 _LIT(KCompositeDrive,					"composite_drive");
    84 _LIT(KIsMountSuccess,					"is_mount_success");
    85 _LIT(KParam1,							"param1");
    86 _LIT(KParam2,							"param2");
    87 _LIT(KIndex,							"index");
    88 _LIT(KSubTypeName,						"sub_type_name");
    89 
    90 
    91 ///	Commands
    92 _LIT(KCmdAddFileSystem,					"AddFileSystem");
    93 _LIT(KCmdDismountFileSystem,			"DismountFileSystem");
    94 _LIT(KCmdFileSystemName,				"FileSystemName");
    95 _LIT(KCmdMountFileSystem,				"MountFileSystem");
    96 _LIT(KCmdMountFileSystemAndScan,		"MountFileSystemAndScan");
    97 _LIT(KCmdRemountDrive,					"RemountDrive");
    98 _LIT(KCmdRemoveFileSystem,				"RemoveFileSystem");
    99 _LIT(KCmdAddExtension,					"AddExtension");
   100 _LIT(KCmdMountExtension,				"MountExtension");
   101 _LIT(KCmdRemoveExtension,				"RemoveExtension");
   102 _LIT(KCmdExtensionName,					"ExtensionName");
   103 _LIT(KCmdAddCompositeMount,				"AddCompositeMount");
   104 _LIT(KCmdAllowDismount,					"AllowDismount");
   105 _LIT(KCmdNotifyDismount,				"NotifyDismount");
   106 _LIT(KCmdNotifyDismountCancel,			"NotifyDismountCancel");
   107 _LIT(KCmdStartupInitComplete,			"StartupInitComplete");
   108 _LIT(KCmdSwapFileSystem,				"SwapFileSystem");
   109 _LIT(KCmdSetStartupConfiguration,		"SetStartupConfiguration");
   110 _LIT(KCmdDismountExtension,				"DismountExtension");
   111 _LIT(KCmdSetLocalDriveMapping,			"SetLocalDriveMapping");
   112 _LIT(KCmdFinaliseDrives,				"FinaliseDrives");
   113 _LIT(KCmdFileSystemSubType,				"FileSystemSubType");
   114 /*@}*/
   115 
   116 
   117 TBool CT_FsData::DoCommandMountsL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
   118 /**
   119  * Process a mounts related command read from the ini file
   120  *
   121  * @param aCommand	the command to process
   122  * @param aSection		the entry in the ini file requiring the command to be processed
   123  *
   124  * @return ETrue if the command is processed
   125  */
   126 	{
   127 	TBool retVal = ETrue;
   128 	
   129 	if (aCommand == KCmdAddFileSystem)
   130 		{
   131 		DoCmdAddFileSystem(aSection);
   132 		}
   133 	else if (aCommand == KCmdDismountFileSystem)
   134 		{
   135 		DoCmdDismountFileSystem(aSection);
   136 		}
   137 	else if (aCommand == KCmdFileSystemName)
   138 		{
   139 		DoCmdFileSystemName(aSection);
   140 		}
   141 	else if (aCommand == KCmdMountFileSystem)
   142 		{
   143 		DoCmdMountFileSystem(aSection);
   144 		}
   145 	else if (aCommand == KCmdMountFileSystemAndScan)
   146 		{
   147 		DoCmdMountFileSystemAndScan(aSection);
   148 		}
   149 	else if (aCommand == KCmdRemoveFileSystem)
   150 		{
   151 		DoCmdRemoveFileSystem(aSection);
   152 		}
   153 	else if (aCommand == KCmdRemountDrive)
   154 		{
   155 		DoCmdRemountDriveL(aSection);
   156 		}
   157 	else if (aCommand == KCmdAddExtension)
   158 		{
   159 		DoCmdAddExtension(aSection);
   160 		}
   161 	else if (aCommand == KCmdRemoveExtension)
   162 		{
   163 		DoCmdRemoveExtension(aSection);
   164 		}
   165 	else if (aCommand == KCmdExtensionName)
   166 		{
   167 		DoCmdExtensionName(aSection);
   168 		}
   169 	else if (aCommand == KCmdMountExtension)
   170 		{
   171 		DoCmdMountExtension(aSection);
   172 		}
   173 	else if (aCommand == KCmdAllowDismount)
   174 		{
   175 		DoCmdAllowDismount(aSection);
   176 		}
   177 	else if (aCommand == KCmdNotifyDismount)
   178 		{
   179 		DoCmdNotifyDismountL(aSection, aAsyncErrorIndex);
   180 		}
   181 	else if (aCommand == KCmdNotifyDismountCancel)
   182 		{
   183 		DoCmdNotifyDismountCancel(aSection);
   184 		}
   185 	else if (aCommand == KCmdStartupInitComplete)
   186 		{
   187 		DoCmdStartupInitCompleteL(aAsyncErrorIndex);
   188 		}
   189 	else if (aCommand == KCmdSwapFileSystem)
   190 		{
   191 		DoCmdSwapFileSystem(aSection);
   192 		}
   193 	else if (aCommand == KCmdSetStartupConfiguration)
   194 		{
   195 		DoCmdSetStartupConfigurationL(aSection);
   196 		}
   197 	else if (aCommand == KCmdFinaliseDrives)
   198 		{
   199 		DoCmdFinaliseDrives();
   200 		}
   201     else if (aCommand == KCmdAddCompositeMount)
   202 		{
   203 		DoCmdAddCompositeMount(aSection);
   204 		}
   205     else if (aCommand == KCmdDismountExtension)
   206 		{
   207 		DoCmdDismountExtension(aSection);
   208 		}
   209 	else if (aCommand == KCmdSetLocalDriveMapping)
   210 		{
   211 		DoCmdSetLocalDriveMappingL(aSection);
   212 		}
   213     else if (aCommand == KCmdFileSystemSubType)
   214 		{
   215 		DoCmdFileSystemSubType(aSection);
   216 		}
   217  	else
   218 		{
   219 		retVal = EFalse;
   220 		}
   221 
   222 	return retVal;
   223 	}
   224 
   225 
   226 void CT_FsData::DoCmdAddFileSystem(const TDesC& aSection)
   227 /** Calls RFs::AddFileSystem() */
   228 	{
   229 	INFO_PRINTF1(_L("Calls RFs::AddFileSystem()"));
   230 
   231 	// get file name from parameters
   232 	TPtrC	fileName;
   233 	if ( GET_MANDATORY_STRING_PARAMETER(KFileName(), aSection, fileName))
   234 		{
   235 		// call AddFileSystem()
   236 		TInt	err = iFs->AddFileSystem(fileName);
   237 
   238 		// check error code
   239 		if (err != KErrNone)
   240 			{
   241 			ERR_PRINTF2(_L("AddFileSystem error: %d"), err);
   242 			SetError(err);
   243 			}
   244 		}
   245 	}
   246 
   247 void CT_FsData::DoCmdMountFileSystem(const TDesC& aSection)
   248 /** Calls RFs::MountFileSystem() */
   249 	{
   250 	INFO_PRINTF1(_L("Calls RFs::MountFileSystem()"));
   251 
   252 	TBool dataOk = ETrue;
   253 
   254 	// get drive number from parameters
   255 	TDriveNumber	driveNumber = EDriveA;
   256 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   257 		{
   258 		ERR_PRINTF2(_L("No %S"), &KDrive());
   259 		SetBlockResult(EFail);
   260 		dataOk = EFalse;
   261 		}
   262 
   263 	// get file system name from parameters
   264 	TPtrC	fileSystemName;
   265 	if ( !GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fileSystemName) )
   266 		{
   267 		fileSystemName.Set(iFileSystemName);
   268 		}
   269 
   270 	if(dataOk)
   271 		{
   272 		// get file system name from parameters
   273 		TBool	isSync = EFalse;
   274 		TInt	err = KErrNone;
   275 
   276 		TPtrC	extensionName;
   277 		TBool	hasExtensionName=GET_OPTIONAL_STRING_PARAMETER(KExtensionName(), aSection, extensionName);
   278 		if (GET_OPTIONAL_BOOL_PARAMETER(KIsSync(), aSection, isSync))
   279 			{
   280 			if ( hasExtensionName )
   281 				{
   282 				// call MountFileSystem()
   283 				INFO_PRINTF5(_L("MountFileSystem(%S, %S, %d, %d)"), &fileSystemName, &extensionName, driveNumber, isSync);
   284 				err = iFs->MountFileSystem(fileSystemName, extensionName, driveNumber, isSync);
   285 				}
   286 			else
   287 				{
   288 				// call MountFileSystem()
   289 				INFO_PRINTF4(_L("MountFileSystem(%S, %d, %d)"), &fileSystemName, driveNumber, isSync);
   290 				err = iFs->MountFileSystem(fileSystemName, driveNumber, isSync);
   291 				}
   292 			}
   293 		else
   294 			{
   295 			if ( hasExtensionName )
   296 				{
   297 				// call MountFileSystem()
   298 				INFO_PRINTF4(_L("MountFileSystem(%S, %S, %d)"), &fileSystemName, &extensionName, driveNumber);
   299 				err = iFs->MountFileSystem(fileSystemName, extensionName, driveNumber);
   300 				}
   301 			else
   302 				{
   303 				// call MountFileSystem()
   304 				INFO_PRINTF3(_L("MountFileSystem(%S, %d)"), &fileSystemName, driveNumber);
   305 				err = iFs->MountFileSystem(fileSystemName, driveNumber);
   306 				}
   307 			}
   308 		// check error code
   309 		if (err != KErrNone)
   310 			{
   311 			ERR_PRINTF2(_L("MountFileSystem error: %d"), err);
   312 			SetError(err);
   313 			}
   314 		}
   315 	}
   316 
   317 
   318 void CT_FsData::DoCmdMountFileSystemAndScan(const TDesC& aSection)
   319 /** Calls RFs::MountFileSystemAndScan() */
   320 	{
   321 	INFO_PRINTF1(_L("Calls RFs::MountFileSystemAndScan()"));
   322 
   323 	TBool dataOk = ETrue;
   324 
   325 	// get drive number from parameters
   326 	TDriveNumber	driveNumber = EDriveA;
   327 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   328 		{
   329 		ERR_PRINTF2(_L("No %S"), &KDrive());
   330 		SetBlockResult(EFail);
   331 		dataOk = EFalse;
   332 		}
   333 
   334 	// get file system name from parameters
   335 	TPtrC	fileSystemName;
   336 	if ( !GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fileSystemName) )
   337 		{
   338 		fileSystemName.Set(iFileSystemName);
   339 		}
   340 
   341 	if(dataOk)
   342 		{
   343 		TInt	err=KErrNone;
   344 		TBool	isMountSuccess = EFalse;
   345 		// get extension name from parameters
   346 		TPtrC	extensionName;
   347 		if (GET_OPTIONAL_STRING_PARAMETER(KExtensionName(), aSection, extensionName))
   348 			{
   349 			//call MountFileSystemAndScan
   350 			INFO_PRINTF4(_L("MountFileSystemAndScan(%S, %S, %d, isMountSuccess)"), &fileSystemName, &extensionName, driveNumber);
   351 			err = iFs->MountFileSystemAndScan(fileSystemName, extensionName, driveNumber, isMountSuccess);
   352 			}
   353 		else
   354 			{
   355 			//call MountFileSystemAndScan
   356 			INFO_PRINTF3(_L("MountFileSystemAndScan(%S, %d, isMountSuccess)"), &fileSystemName, driveNumber);
   357 			err = iFs->MountFileSystemAndScan(fileSystemName, driveNumber, isMountSuccess);
   358 			}
   359 
   360 		// check error code
   361 		if (err != KErrNone)
   362 			{
   363 			ERR_PRINTF2(_L("MountFileSystemAndScan error: %d"), err);
   364 			SetError(err);
   365 			}
   366 
   367 		//Only for info
   368 		if(isMountSuccess)
   369 			{
   370 			INFO_PRINTF1(_L("MountFileSystemAndScan() successfully mounted"));
   371 			}
   372 		else
   373 			{
   374 			INFO_PRINTF1(_L("MountFileSystemAndScan() not mounted"));
   375 			}
   376 
   377 		//check if mount was successful
   378 		TBool	expected = EFalse;
   379 		if ( GET_OPTIONAL_BOOL_PARAMETER(KIsMountSuccess(), aSection, expected) )
   380 			{
   381 			if ( isMountSuccess!=expected )
   382 				{
   383 				ERR_PRINTF1(_L("MountFileSystemAndScan() does not match expected value"));
   384 				SetBlockResult(EFail);
   385 				}
   386 			}
   387 		}
   388 	}
   389 
   390 
   391 void CT_FsData::DoCmdDismountFileSystem(const TDesC& aSection)
   392 /** Calls RFs::DismountFileSystem() */
   393 	{
   394 	INFO_PRINTF1(_L("Calls RFs::DismountFileSystem()"));
   395 
   396 	TBool dataOk = ETrue;
   397 
   398 	// get drive number from parameters
   399 	TDriveNumber	driveNumber = EDriveA;
   400 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   401 		{
   402 		ERR_PRINTF2(_L("No %S"), &KDrive());
   403 		SetBlockResult(EFail);
   404 		dataOk = EFalse;
   405 		}
   406 	// get file system name from parameters
   407 	TPtrC	fileSystemName;
   408 	if (!GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fileSystemName))
   409 		{
   410 		fileSystemName.Set(iFileSystemName);
   411 		}
   412 
   413 	if(dataOk)
   414 		{
   415 		// call DismountFileSystem()
   416 		TInt err = iFs->DismountFileSystem(fileSystemName, driveNumber);
   417 
   418 		// check error code
   419 		if (err != KErrNone)
   420 			{
   421 			ERR_PRINTF2(_L("DismountFileSystem error: %d"), err);
   422 			SetError(err);
   423 			}
   424 		}
   425 	}
   426 
   427 
   428 void CT_FsData::DoCmdRemoveFileSystem(const TDesC& aSection)
   429 /** Calls RFs::RemoveFileSystem() */
   430 	{
   431 	INFO_PRINTF1(_L("Calls RFs::RemoveFileSystem()"));
   432 
   433 	// get file name from parameters
   434 	TPtrC	fileSystemName;
   435 	if ( !GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fileSystemName) )
   436 		{
   437 		fileSystemName.Set(iFileSystemName);
   438 		}
   439 
   440 	// call RemoveFileSystem()
   441 	TInt err = iFs->RemoveFileSystem(fileSystemName);
   442 
   443 	// check error code
   444 	if (err != KErrNone)
   445 		{
   446 		ERR_PRINTF2(_L("RemoveFileSystem error: %d"), err);
   447 		SetError(err);
   448 		}
   449 	}
   450 
   451 
   452 void CT_FsData::DoCmdFileSystemName(const TDesC& aSection)
   453 /** Calls RFs::FileSystemName() */
   454 	{
   455 	INFO_PRINTF1(_L("Calls RFs::FileSystemName()"));
   456 
   457 	// get a flag if we need to remember the file system name in an instance variable
   458 	TBool	save=ETrue;
   459 	GET_OPTIONAL_BOOL_PARAMETER(KSaveInInstance(), aSection, save);
   460 
   461 	// get drive number from parameters
   462 	TDriveNumber	driveNumber = EDriveA;
   463 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   464 		{
   465 		ERR_PRINTF2(_L("No %S"), &KDrive());
   466 		SetBlockResult(EFail);
   467 		}
   468 	else
   469 		{
   470 		// call FileSystemName()
   471 		TFullName	fileSystemName;
   472 		TInt		err = iFs->FileSystemName(fileSystemName, driveNumber);
   473 		INFO_PRINTF2(_L("File system name: %S"), &fileSystemName);
   474 
   475 		// check error code
   476 		if (err == KErrNone)
   477 			{
   478 			if ( save )
   479 				{
   480 				iFileSystemName=fileSystemName;
   481 				}
   482 			}
   483 		else
   484 			{
   485 			ERR_PRINTF2(_L("FileSystemName error: %d"), err);
   486 			SetError(err);
   487 			}
   488 
   489 		//Check expected result
   490 		TPtrC	fsNameExpect;
   491 		if (GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fsNameExpect))
   492 			{
   493 			if ( fsNameExpect != fileSystemName)
   494 				{
   495 				ERR_PRINTF1(_L("File system name != expected name"));
   496 				SetBlockResult(EFail);
   497 				}
   498 			}
   499 		}
   500 	}
   501 
   502 
   503 void CT_FsData::DoCmdAddExtension(const TDesC& aSection)
   504 /** Calls RFs::AddExtension() */
   505 	{
   506 	INFO_PRINTF1(_L("Calls RFs::AddExtension()"));
   507 	TPtrC fileName;
   508 	if ( GET_MANDATORY_STRING_PARAMETER(KFileName(), aSection, fileName) )
   509 		{
   510 		//call AddExtension
   511 		TInt err = iFs->AddExtension(fileName);
   512 
   513 		// check error code
   514 		if (err != KErrNone)
   515 			{
   516 			ERR_PRINTF2(_L("AddExtension error: %d"), err);
   517 			SetError(err);
   518 			}
   519 		}
   520 	}
   521 
   522 
   523 void CT_FsData::DoCmdMountExtension(const TDesC& aSection)
   524 /** Calls RFs::MountExtension() */
   525 	{
   526 	INFO_PRINTF1(_L("Calls RFs::MountExtension()"));
   527 
   528 	TBool dataOk = ETrue;
   529 
   530 	// get drive number from parameters
   531 	TDriveNumber	driveNumber = EDriveA;
   532 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   533 		{
   534 		ERR_PRINTF2(_L("No %S"), &KDrive());
   535 		SetBlockResult(EFail);
   536 		dataOk = EFalse;
   537 		}
   538 
   539 	// get extension name from parameters
   540 	TPtrC extensionName;
   541 	if (!GET_MANDATORY_STRING_PARAMETER(KExtensionName(), aSection, extensionName))
   542 		{
   543 		dataOk = EFalse;
   544 		}
   545 
   546 	if(dataOk)
   547 		{
   548 		TInt	err = iFs->MountExtension(extensionName, driveNumber);
   549 		if (err != KErrNone)
   550 			{
   551 			ERR_PRINTF2(_L("MountExtension error: %d"), err);
   552 			SetError(err);
   553 			}
   554 		}
   555 	}
   556 
   557 void CT_FsData::DoCmdDismountExtension(const TDesC& aSection)
   558 /** Calls RFs::DismountExtension() */
   559 	{
   560 	INFO_PRINTF1(_L("Calls RFs::DismountExtension()"));
   561 
   562 	TBool dataOk = ETrue;
   563 
   564 	// get drive number from parameters
   565 	TDriveNumber	driveNumber = EDriveA;
   566 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   567 		{
   568 		ERR_PRINTF2(_L("No %S"), &KDrive());
   569 		SetBlockResult(EFail);
   570 		dataOk = EFalse;
   571 		}
   572 
   573 	TPtrC extensionName;
   574 	if (!GET_MANDATORY_STRING_PARAMETER(KExtensionName(), aSection, extensionName))
   575 		{
   576 		dataOk = EFalse;
   577 		}
   578 	if(dataOk)
   579 		{
   580 		//call DismountExtension
   581 		TInt err = iFs->DismountExtension(extensionName, driveNumber);
   582 
   583 		//check error code
   584 		if (err != KErrNone)
   585 			{
   586 			ERR_PRINTF2(_L("DismountExtension error: %d"), err);
   587 			SetError(err);
   588 			}
   589 		}
   590 
   591 	}
   592 
   593 
   594 void CT_FsData::DoCmdRemoveExtension(const TDesC& aSection)
   595 /** Calls RFs::RemoveExtension() */
   596 	{
   597 	INFO_PRINTF1(_L("Calls RFs::RemoveExtension()"));
   598 
   599 	TPtrC extensionName;
   600 	if (GET_MANDATORY_STRING_PARAMETER(KExtensionName(), aSection, extensionName))
   601 		{
   602 		//call RemoveExtension
   603 		TInt err = iFs->RemoveExtension(extensionName);
   604 
   605 		// check error code
   606 		if (err != KErrNone)
   607 			{
   608 			ERR_PRINTF2(_L("RemoveExtension error: %d"), err);
   609 			SetError(err);
   610 			}
   611 		}
   612 	}
   613 
   614 
   615 void CT_FsData::DoCmdExtensionName(const TDesC& aSection)
   616 /** Calls RFs::ExtensionName() */
   617 	{
   618 	INFO_PRINTF1(_L("Calls RFs::ExtensionName()"));
   619 
   620 	TBool dataOk = ETrue;
   621 
   622 	// get drive number from parameters
   623 	TDriveNumber	driveNumber = EDriveA;
   624 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   625 		{
   626 		ERR_PRINTF2(_L("No %S"), &KDrive());
   627 		SetBlockResult(EFail);
   628 		dataOk = EFalse;
   629 		}
   630 	//get position of the extension in the extension hierarchy.
   631 	TInt pos = 0;
   632 	if (!GET_MANDATORY_INT_PARAMETER(KPosition(), aSection, pos))
   633 		{
   634 		dataOk = EFalse;
   635 		}
   636 
   637 	if(dataOk)
   638 		{
   639 
   640 		TInt err = iFs->ExtensionName(iExtensionName, driveNumber, pos);
   641 
   642 		if(err == KErrNone)
   643 			{
   644 			TPtrC extNameExpect;
   645 			if (GET_OPTIONAL_STRING_PARAMETER(KExtensionName(), aSection, extNameExpect))
   646 				{
   647 				if(extNameExpect != iExtensionName)
   648 					{
   649 					ERR_PRINTF3(_L("ExtensionName: %S != %S expected name"), &iExtensionName, &extNameExpect);
   650 					SetBlockResult(EFail);
   651 					}
   652 				else
   653 					{
   654 					INFO_PRINTF2(_L("ExtensionName: %S"), &iExtensionName);
   655 					}
   656 				}
   657 			else
   658 				{
   659 				INFO_PRINTF2(_L("ExtensionName: %S"), &iExtensionName);
   660 				}
   661 			}
   662 		// check error code
   663 		else
   664 			{
   665 			ERR_PRINTF2(_L("ExtensionName error: %d"), err);
   666 			SetError(err);
   667 			}
   668 		}
   669 	}
   670 
   671 
   672 void CT_FsData::DoCmdRemountDriveL(const TDesC& aSection)
   673 /** Calls RFs::RemountDrive() */
   674 	{
   675 	INFO_PRINTF1(_L("Calls RFs::RemountDrive()"));
   676 	TBool	dataOk = ETrue;
   677 
   678 	// get drive number from parameters
   679 	TDriveNumber	driveNumber = EDriveA;
   680 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   681 		{
   682 		ERR_PRINTF2(_L("No %S"), &KDrive());
   683 		SetBlockResult(EFail);
   684 		dataOk = EFalse;
   685 		}
   686 
   687 	// get flags from parameters can be in hex(0x00000001) or in decimal(1)
   688 	TUint	flags = 0;
   689 	TInt	tempVal = 0;
   690 	
   691 	if(GetHexFromConfig(aSection, KFlags, tempVal))
   692 		{
   693 		flags = tempVal;
   694 		}
   695 	else if(GET_OPTIONAL_INT_PARAMETER(KFlags(), aSection, tempVal))
   696 		{
   697 		flags = tempVal;
   698 		}
   699 	else
   700 		{
   701 		ERR_PRINTF2(_L("No parameter %S"), &KFlags());
   702 		SetBlockResult(EFail);
   703 		dataOk = EFalse;
   704 		}
   705 
   706 	RFile	file;
   707 	HBufC8*	fileDataBuff = NULL;
   708 
   709 	// get file name from parameters
   710 	TPtrC	fileName;
   711 	TBool	useMountInfo = GET_OPTIONAL_STRING_PARAMETER(KFileName(), aSection, fileName);
   712 	if ( useMountInfo )
   713 		{
   714 		// open file
   715 		TInt error = file.Open(FileServer(), fileName, EFileRead | EFileShareAny);
   716 		if(error == KErrNone)
   717 			{
   718 			CleanupClosePushL(file);
   719 			INFO_PRINTF1(_L("File Opened."));
   720 			// get size
   721 			TInt	size = 0;
   722 			error = file.Size(size);
   723 			INFO_PRINTF2(_L("File Size=%d."), size);
   724 			if(error == KErrNone)
   725 				{
   726 				// read file
   727 				fileDataBuff = HBufC8::NewL(size);
   728 				INFO_PRINTF1(_L("Buffer created."));
   729 
   730 				CleanupStack::PushL(fileDataBuff);
   731 				TPtr8	fileData = fileDataBuff->Des();
   732 				error = file.Read(fileData);
   733 				if(error != KErrNone)
   734 					{
   735 					ERR_PRINTF2(_L("Reading File, Error: %d"), error);
   736 					dataOk = EFalse;
   737 					SetBlockResult(EFail);
   738 					}
   739 				}
   740 			else
   741 				{
   742 				ERR_PRINTF2(_L("File Size, Error: %d."), error);
   743 				dataOk = EFalse;
   744 				SetBlockResult(EFail);
   745 				}
   746 			}
   747 		else
   748 			{
   749 			ERR_PRINTF2(_L("File Open, Error: %d"), error);
   750 			dataOk = EFalse;
   751 			SetBlockResult(EFail);
   752 			}
   753 		}
   754 
   755 	if ( dataOk )
   756 		{
   757 		// call RemountDrive()
   758 		TInt err = iFs->RemountDrive(driveNumber, fileDataBuff, flags);
   759 		INFO_PRINTF2(_L("RemountDrive Flags: %u"), flags);
   760 
   761 		// check error code
   762 		if (err != KErrNone)
   763 			{
   764 			ERR_PRINTF2(_L("RemountDrive error: %d"), err);
   765 			SetError(err);
   766 			}
   767 		}
   768 
   769 	// cleanup if mountInfo was used
   770 	if (useMountInfo)
   771 		{
   772 		CleanupStack::PopAndDestroy(2, &file); // file, fileDataBuff
   773 		}
   774 
   775 	}
   776 
   777 
   778 void CT_FsData::DoCmdNotifyDismountL(const TDesC& aSection, const TInt aAsyncErrorIndex)
   779 /** Calls RFs::NotifyDismount() */
   780 	{
   781 	INFO_PRINTF1(_L("Calls RFs::NotifyDismount()"));
   782 
   783 	TNotifyDismountMode mode = EFsDismountRegisterClient;
   784 	TPtrC modeStr;
   785 	//get NotifyDismountMode from parameters
   786 	if(GET_MANDATORY_STRING_PARAMETER(KMode(), aSection, modeStr))
   787 		{
   788 		if(modeStr == _L("EFsDismountRegisterClient"))
   789 			{
   790 			mode = EFsDismountRegisterClient;
   791 			}
   792 		else if(modeStr == _L("EFsDismountNotifyClients"))
   793 			{
   794 			mode = EFsDismountNotifyClients;
   795 			}
   796 		else if(modeStr == _L("EFsDismountForceDismount"))
   797 			{
   798 			mode = EFsDismountForceDismount;
   799 			}
   800 		else
   801 			{
   802 			TInt modeNumber;
   803 			if(GET_OPTIONAL_INT_PARAMETER(KMode, aSection, modeNumber))
   804 				{
   805 				mode = (TNotifyDismountMode)modeNumber;
   806 				}
   807 			else
   808 				{
   809 				ERR_PRINTF3(_L("NotifyDismount() incorrect parameter %S in %S"), &modeStr, &KMode());
   810 				SetBlockResult(EFail);
   811 				}
   812 			}
   813 		}
   814 
   815 	TDriveNumber	driveNumber = EDriveA;
   816 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   817 		{
   818 		ERR_PRINTF2(_L("No %S"), &KDrive());
   819 		SetBlockResult(EFail);
   820 		}
   821 	else
   822 		{
   823 		// call NotifyDismount()
   824 		CActiveCallback*	active = CActiveCallback::NewLC(*this);
   825 		iNotifyDismount.AppendL(active);
   826 		CleanupStack::Pop(active);
   827 		
   828 		iFs->NotifyDismount(driveNumber, active->iStatus, mode);
   829 		active->Activate(aAsyncErrorIndex);
   830 		IncOutstanding();
   831 		}
   832 	}
   833 
   834 
   835 void CT_FsData::DoCmdNotifyDismountCancel(const TDesC& aSection)
   836 /** Calls RFs::NotifyDismountCancel() */
   837 	{
   838 	INFO_PRINTF1(_L("Calls RFs::NotifyDismountCancel()"));
   839 
   840 	TBool all = ETrue;
   841 
   842 	if(GET_MANDATORY_BOOL_PARAMETER(KAll(), aSection, all))
   843 		{
   844 		if(all)
   845 			{
   846 			//Cancels all outstanding requests.
   847 			iFs->NotifyDismountCancel();
   848 			INFO_PRINTF1(_L("NotifyDismountCancel()"));
   849 			}
   850 		else
   851 			{
   852 			// Cancels a specific outstanding request
   853 			TInt	index=0;
   854 			GET_OPTIONAL_INT_PARAMETER(KIndex, aSection, index);
   855 
   856 			//Cancels a specific outstanding request
   857 			iFs->NotifyDismountCancel(iNotifyDismount[index]->iStatus);
   858 			INFO_PRINTF1(_L("NotifyDismountCancel(TRequestStatus)"));
   859 			}
   860 		}
   861 	}
   862 
   863 
   864 void CT_FsData::DoCmdAllowDismount(const TDesC& aSection)
   865 /** Calls RFs::AllowDismount() */
   866 	{
   867 	INFO_PRINTF1(_L("Calls RFs::AllowDismount()"));
   868 
   869 	// get drive number from parameters
   870 	TDriveNumber	driveNumber = EDriveA;
   871 	if(!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
   872 		{
   873 		ERR_PRINTF2(_L("No %S"), &KDrive());
   874 		SetBlockResult(EFail);
   875 		}
   876 	else
   877 		{
   878 		//call AllowDismount
   879 		TInt err = iFs->AllowDismount(driveNumber);
   880 		// check error code
   881 		if (err != KErrNone)
   882 			{
   883 			ERR_PRINTF2(_L("AllowDismount error: %d"), err);
   884 			SetError(err);
   885 			}
   886 		}
   887 	}
   888 
   889 
   890 void CT_FsData::DoCmdSetStartupConfigurationL(const TDesC& aSection)
   891 /** Calls RFs::SetStartupConfiguration() */
   892 	{
   893 	INFO_PRINTF1(_L("Calls RFs::SetStartupConfiguration()"));
   894 
   895 	//get Command from parameters
   896 	TPtrC commandNum;
   897 	TStartupConfigurationCmd configCommand = ELoaderPriority;
   898 	if(GET_MANDATORY_STRING_PARAMETER(KCommandNum(), aSection, commandNum))
   899 		{
   900 		//Converting from string to TStartupConfigurationCmd
   901 		if(commandNum == _L("ELoaderPriority"))
   902 			{
   903 			configCommand = ELoaderPriority;
   904 			}
   905         else if(commandNum == _L("ESetRugged"))
   906 			{
   907 			configCommand = ESetRugged;
   908 			}
   909 		else if(commandNum == _L("EMaxStartupConfigurationCmd"))
   910 			{
   911 			configCommand = EMaxStartupConfigurationCmd;
   912 			}
   913 		TAny* param1 = NULL;
   914 		TPtrC name;
   915 		if(GET_OPTIONAL_STRING_PARAMETER(KParam1(), aSection, name))
   916 			{
   917 			param1 = GetDataObjectL(name);
   918 			}
   919 		TAny* param2 = NULL;
   920 
   921 		if(GET_OPTIONAL_STRING_PARAMETER(KParam2(), aSection, name))
   922 			{		
   923 			param2 = GetDataObjectL(name);
   924 			}
   925 		//call SetStartupConfiguration
   926 		TInt err = iFs->SetStartupConfiguration(configCommand, param1, param2);
   927 		INFO_PRINTF2(_L("RFs::SetStartupConfiguration() %S"), &commandNum);
   928 		// check error code
   929 		if (err != KErrNone)
   930 			{
   931 			ERR_PRINTF2(_L("SetStartupConfiguration() error: %d"), err);
   932 			SetError(err);
   933 			}
   934 		}
   935 	}
   936 
   937 void CT_FsData::DoCmdAddCompositeMount(const TDesC& aSection)
   938 	{
   939 	INFO_PRINTF1(_L("Calls RFs::AddCompositeMount()"));
   940 
   941 	TBool dataOk = ETrue;
   942 
   943 	// get drive number from parameters
   944 	TDriveNumber	localDriveToMount = EDriveA;
   945 	if (!GetDriveNumberFromConfig(aSection, KLocalDrive(), localDriveToMount))
   946 		{
   947 		ERR_PRINTF2(_L("No %S"), &KLocalDrive());
   948 		SetBlockResult(EFail);
   949 		dataOk = EFalse;
   950 		}
   951 
   952 	// get composite drive number from parameters
   953 	TDriveNumber	compositeDrive = EDriveA;
   954 	if (!GetDriveNumberFromConfig(aSection, KCompositeDrive(), compositeDrive))
   955 		{
   956 		ERR_PRINTF2(_L("No %S"), &KCompositeDrive());
   957 		SetBlockResult(EFail);
   958 		dataOk = EFalse;
   959 		}
   960 
   961 	// 	get Sync from parameters
   962 	TBool	sync = EFalse;
   963 	if(!GET_MANDATORY_BOOL_PARAMETER(KIsSync(), aSection, sync))
   964 		{
   965 		dataOk = EFalse;
   966 		}
   967 
   968 	// get fileSystemName from parameters
   969 	TPtrC	fileSystemName;
   970 	if ( !GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fileSystemName) )
   971 		{
   972 		fileSystemName.Set(iFileSystemName);
   973 		}
   974 
   975 	if(dataOk)
   976 		{
   977 		TInt	err = iFs->AddCompositeMount(fileSystemName, localDriveToMount, compositeDrive, sync);
   978 		INFO_PRINTF1(_L("Calls RFs::AddCompositeMount()"));
   979 		// check error code
   980 		if (err != KErrNone)
   981 			{
   982 			ERR_PRINTF2(_L("AddCompositeMount() error: %d"), err);
   983 			SetError(err);
   984 			}
   985 		}
   986 	}
   987 void CT_FsData::DoCmdStartupInitCompleteL(TInt aAsyncErrorIndex)
   988 /** Calls RFs::StartupInitComplete() */
   989 	{
   990 	INFO_PRINTF1(_L("Calls RFs::StartupInitComplete()"));
   991 
   992 	// call StartupInitComplete()
   993 	CActiveCallback*	active = CActiveCallback::NewLC(*this);
   994 	iStartupInitComplete.AppendL(active);
   995 	CleanupStack::Pop(active);
   996 		
   997 	iFs->StartupInitComplete(active->iStatus);
   998 	active->Activate(aAsyncErrorIndex);
   999 	IncOutstanding();
  1000 	}
  1001 
  1002 
  1003 void CT_FsData::DoCmdFinaliseDrives()
  1004 /** Calls RFs::FinaliseDrives() */
  1005 	{
  1006 	INFO_PRINTF1(_L("Calls RFs::FinaliseDrives()"));
  1007 
  1008 	TInt err = iFs->FinaliseDrives();
  1009 
  1010 	// check error code
  1011 	if (err != KErrNone)
  1012 		{
  1013 		ERR_PRINTF2(_L("FinaliseDrives() error: %d"), err);
  1014 		SetError(err);
  1015 		}
  1016 	}
  1017 
  1018 
  1019 void CT_FsData::DoCmdSetLocalDriveMappingL(const TDesC& aSection)
  1020 /** Calls RFs::SetLocalDriveMapping() */
  1021 	{
  1022 	INFO_PRINTF1(_L("Calls RFs::SetLocalDriveMapping()"));
  1023 
  1024 	// get operation from config	
  1025 	TLocalDriveMappingInfo::TDrvMapOperation operation = TLocalDriveMappingInfo::EWriteMappingsAndSet;
  1026 	if (!GetDrvMapOperationFromConfig(aSection, KDriveMappingOperation(), operation))
  1027 		{
  1028 		ERR_PRINTF2(_L("No %S"), &KDriveMappingOperation());
  1029 		SetBlockResult(EFail);
  1030 		}
  1031 		
  1032 	// create an info buffer and set the operation
  1033 	TLocalDriveMappingInfoBuf infoBuf;
  1034 	TLocalDriveMappingInfo& info = infoBuf();
  1035 	info.iOperation = operation;
  1036 
  1037 	// get drive mapping array from config
  1038 	TInt driveMappingSize = 0;
  1039 	if (GET_MANDATORY_INT_PARAMETER(KDriveMappingSize(), aSection, driveMappingSize))
  1040 		{
  1041 		for(TInt i = 0; i < driveMappingSize; i++)
  1042 			{
  1043 			TBuf<KBufferStringLength> tmpBuff;
  1044 
  1045 			tmpBuff.Append(KDriveMappingElement);
  1046 			tmpBuff.AppendNum(i);
  1047 
  1048 			TDriveNumber driveNumber;
  1049 			if (GetDriveNumberFromConfig(aSection, tmpBuff, driveNumber))
  1050 				{
  1051 				info.iDriveMapping[i] = driveNumber;
  1052 				INFO_PRINTF3(_L("Drive mapping element[%d] = %d"), i, driveNumber);
  1053 				}
  1054 			else
  1055 				{
  1056 				ERR_PRINTF2(_L("No %S"), &tmpBuff);
  1057 				SetBlockResult(EFail);
  1058 				}
  1059 			}
  1060 		}
  1061 
  1062 	// call SetLocalDriveMapping()
  1063 	TInt err = iFs->SetLocalDriveMapping(infoBuf);
  1064 
  1065 	// check error code
  1066 	if (err != KErrNone)
  1067 		{
  1068 		ERR_PRINTF2(_L("SetLocalDriveMapping() error: %d"), err);
  1069 		SetError(err);
  1070 		}
  1071 	}
  1072 
  1073 
  1074 void CT_FsData::DoCmdSwapFileSystem(const TDesC& aSection)
  1075 /** Calls RFs::SwapFileSystem() */
  1076 	{
  1077 	INFO_PRINTF1(_L("Calls RFs::SwapFileSystem()"));
  1078 
  1079 	//get OldFileSystemName
  1080 	// get fileSystemName from parameters
  1081 	TPtrC	fileSystemName;
  1082 	if ( !GET_OPTIONAL_STRING_PARAMETER(KFileSystemName(), aSection, fileSystemName) )
  1083 		{
  1084 		fileSystemName.Set(iFileSystemName);
  1085 		}
  1086 
  1087 	//get NewFileSystemName
  1088 	TPtrC newFsName;
  1089 	if(!GET_OPTIONAL_STRING_PARAMETER(KNewFileSystemName(), aSection, newFsName))
  1090 		{
  1091 		newFsName.Set(iFileSystemName);
  1092 		}
  1093 
  1094 	// get drive number from parameters
  1095 	TBool dataOk = ETrue;
  1096 	TDriveNumber	driveNumber = EDriveA;
  1097 	if (!GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
  1098 		{
  1099 		ERR_PRINTF2(_L("No %S"), &KDrive());
  1100 		SetBlockResult(EFail);
  1101 		dataOk = EFalse;
  1102 		}
  1103 
  1104 	if(dataOk)
  1105 		{
  1106 		TInt err = iFs->SwapFileSystem(fileSystemName, newFsName, driveNumber);
  1107 		// check error code
  1108 		if (err != KErrNone)
  1109 			{
  1110 			ERR_PRINTF2(_L("SwapFileSystem() error: %d"), err);
  1111 			SetError(err);
  1112 			}
  1113 		}
  1114 
  1115 	}
  1116 
  1117 void CT_FsData::DoCmdFileSystemSubType(const TDesC& aSection)
  1118 	{
  1119 	INFO_PRINTF1(_L("Calls RFs::FileSystemSubType()"));
  1120 
  1121 	// get drive number from parameters
  1122 	TDriveNumber	driveNumber = EDriveA;
  1123 	if (GetDriveNumberFromConfig(aSection, KDrive(), driveNumber))
  1124 		{
  1125 		TFSName subTypeName;
  1126 		TInt err = iFs->FileSystemSubType(driveNumber, subTypeName);
  1127 		// check error code
  1128 		if (err != KErrNone)
  1129 			{
  1130 			ERR_PRINTF2(_L("FileSystemSubType() error: %d"), err);
  1131 			SetError(err);
  1132 			}
  1133 		else
  1134 			{
  1135 			INFO_PRINTF2(_L("FileSystemSubType() subTypeName = %S"), &subTypeName);
  1136 			//Check expected result
  1137 			TPtrC	subTypeNameExpect;
  1138 			if (GET_OPTIONAL_STRING_PARAMETER(KSubTypeName(), aSection, subTypeNameExpect))
  1139 				{
  1140 				if ( subTypeNameExpect != subTypeName)
  1141 					{
  1142 					ERR_PRINTF1(_L("File system name != expected name"));
  1143 					SetBlockResult(EFail);
  1144 					}
  1145 				}
  1146 			}
  1147 		}
  1148 	else
  1149 		{
  1150 		ERR_PRINTF2(_L("No %S"), &KDrive());
  1151 		SetBlockResult(EFail);
  1152 		}
  1153 	}
  1154 
  1155 TBool CT_FsData::GetDriveNumberFromConfig(const TDesC& aSection, const TDesC& aParameterName, TDriveNumber& aDriveNumber)
  1156 /** Reads drive number from INI-file */
  1157 	{
  1158 	// Read drive number from INI file
  1159 	TPtrC	driveNumberStr;
  1160 	TBool	ret = GET_OPTIONAL_STRING_PARAMETER(aParameterName, aSection, driveNumberStr);
  1161 	if (ret)
  1162 		{
  1163 		if (driveNumberStr == KDriveA)
  1164 			{
  1165 			aDriveNumber = EDriveA;
  1166 			}
  1167 		else if (driveNumberStr == KDriveB)
  1168 			{
  1169 			aDriveNumber = EDriveB;
  1170 			}
  1171 		else if (driveNumberStr == KDriveC)
  1172 			{
  1173 			aDriveNumber = EDriveC;
  1174 			}
  1175 		else if (driveNumberStr == KDriveD)
  1176 			{
  1177 			aDriveNumber = EDriveD;
  1178 			}
  1179 		else if (driveNumberStr == KDriveE)
  1180 			{
  1181 			aDriveNumber = EDriveE;
  1182 			}
  1183 		else if (driveNumberStr == KDriveF)
  1184 			{
  1185 			aDriveNumber = EDriveF;
  1186 			}
  1187 		else if (driveNumberStr == KDriveG)
  1188 			{
  1189 			aDriveNumber = EDriveG;
  1190 			}
  1191 		else if (driveNumberStr == KDriveH)
  1192 			{
  1193 			aDriveNumber = EDriveH;
  1194 			}
  1195 		else if (driveNumberStr == KDriveI)
  1196 			{
  1197 			aDriveNumber = EDriveI;
  1198 			}
  1199 		else if (driveNumberStr == KDriveJ)
  1200 			{
  1201 			aDriveNumber = EDriveJ;
  1202 			}
  1203 		else if (driveNumberStr == KDriveK)
  1204 			{
  1205 			aDriveNumber = EDriveK;
  1206 			}
  1207 		else if (driveNumberStr == KDriveL)
  1208 			{
  1209 			aDriveNumber = EDriveL;
  1210 			}
  1211 		else if (driveNumberStr == KDriveM)
  1212 			{
  1213 			aDriveNumber = EDriveM;
  1214 			}
  1215 		else if (driveNumberStr == KDriveN)
  1216 			{
  1217 			aDriveNumber = EDriveN;
  1218 			}
  1219 		else if (driveNumberStr == KDriveO)
  1220 			{
  1221 			aDriveNumber = EDriveO;
  1222 			}
  1223 		else if (driveNumberStr == KDriveP) // Sorry, it's a bit long. But looks nice!
  1224 			{
  1225 			aDriveNumber = EDriveP;
  1226 			}
  1227 		else if (driveNumberStr == KDriveQ)
  1228 			{
  1229 			aDriveNumber = EDriveQ;
  1230 			}
  1231 		else if (driveNumberStr == KDriveR)
  1232 			{
  1233 			aDriveNumber = EDriveR;
  1234 			}
  1235 		else if (driveNumberStr == KDriveS)
  1236 			{
  1237 			aDriveNumber = EDriveS;
  1238 			}
  1239 		else if (driveNumberStr == KDriveT)
  1240 			{
  1241 			aDriveNumber = EDriveT;
  1242 			}
  1243 		else if (driveNumberStr == KDriveU)
  1244 			{
  1245 			aDriveNumber = EDriveU;
  1246 			}
  1247 		else if (driveNumberStr == KDriveV)
  1248 			{
  1249 			aDriveNumber = EDriveV;
  1250 			}
  1251 		else if (driveNumberStr == KDriveW)
  1252 			{
  1253 			aDriveNumber = EDriveW;
  1254 			}
  1255 		else if (driveNumberStr == KDriveX)
  1256 			{
  1257 			aDriveNumber = EDriveX;
  1258 			}
  1259 		else if (driveNumberStr == KDriveY)
  1260 			{
  1261 			aDriveNumber = EDriveY;
  1262 			}
  1263 		else if (driveNumberStr == KDriveZ)
  1264 			{
  1265 			aDriveNumber = EDriveZ;
  1266 			}
  1267 		else
  1268 			{
  1269 			TInt driveNumber = 0;
  1270 			ret = GET_OPTIONAL_INT_PARAMETER(aParameterName, aSection, driveNumber);
  1271 			if (ret)
  1272 				{
  1273 				aDriveNumber = (TDriveNumber) driveNumber;
  1274 				}
  1275 			}
  1276 		}
  1277 
  1278 	return ret;
  1279 	}
  1280 
  1281 
  1282 TBool CT_FsData::GetDrvMapOperationFromConfig(const TDesC& aSection, const TDesC& aParameterName, TLocalDriveMappingInfo::TDrvMapOperation& aOperation)
  1283 /** Reads drive mapping operation name from INI-file */
  1284 	{
  1285 	// Read drives mapping operation name from INI file
  1286 	TPtrC operationStr;
  1287 	TBool ret = GET_OPTIONAL_STRING_PARAMETER(aParameterName, aSection, operationStr);
  1288 	if (ret)
  1289 		{
  1290 		if (operationStr == KWriteMappingsAndSet)
  1291 			{
  1292 			aOperation = TLocalDriveMappingInfo::EWriteMappingsAndSet;
  1293 			}
  1294 		else if (operationStr == KWriteMappingsNoSet)
  1295 			{
  1296 			aOperation = TLocalDriveMappingInfo::EWriteMappingsNoSet;
  1297 			}
  1298 		else if (operationStr == KSwapIntMappingAndSet)
  1299 			{
  1300 			aOperation = TLocalDriveMappingInfo::ESwapIntMappingAndSet;
  1301 			}
  1302 		else
  1303 			{
  1304 			TInt operation = 0;
  1305 			ret = GET_OPTIONAL_INT_PARAMETER(aParameterName, aSection, operation);
  1306 			if (ret)
  1307 				{
  1308 				aOperation = (TLocalDriveMappingInfo::TDrvMapOperation) operation;
  1309 				}
  1310 			}
  1311 		}
  1312 
  1313 	return ret;
  1314 	}
  1315