sysstatemgmt/systemstatemgr/cmd/src/cmdcustomcommand.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <ssm/ssmcustomcommand.h>
       
    17 #include <ssm/ssmcustomcommandinfo.h>
       
    18 #include <f32file.h>
       
    19 #include <s32file.h>
       
    20 
       
    21 #include "cmdcustomcommand.h"
       
    22 #include "ssmcommandparameters.h"
       
    23 #include "ssmcommandutilprovider.h"
       
    24 
       
    25 #include "ssmdebug.h"
       
    26 #include "ssmpanic.h"
       
    27 
       
    28 // This file is used to store the handles of the libraries which has unload option as ENeverUnload.
       
    29 // This is also defined in the CleSrv and these handles are used to release those libraries from
       
    30 // CleSrv destrcutor.
       
    31 _LIT(KNeverUnloadLibHandleFile, ":\\private\\2000d75b\\temp\\unloadlibhandles.bin");
       
    32 
       
    33 /**
       
    34 Used to create an instance of CCmdCustomCommand class from a read stream.
       
    35 CSsmCommandList::InternalizeL() uses this method to construct a command from stream.
       
    36 
       
    37 @param aReadStream 	Read stream containing data through which object can be created
       
    38 @return				A pointer to an object of type CCmdCustomCommand.
       
    39 */
       
    40 CCmdCustomCommand* CCmdCustomCommand::NewL(RReadStream& aReadStream)
       
    41 	{
       
    42 	CCmdCustomCommand* self = new (ELeave) CCmdCustomCommand();
       
    43 	CleanupStack::PushL(self);
       
    44 	self->ConstructL(aReadStream);
       
    45 	CleanupStack::Pop(self);
       
    46 	return self;
       
    47 	}
       
    48 
       
    49 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
    50 /**
       
    51 Used to create an instance of CCmdCustomCommand class from given parameters.
       
    52 This method is used by SsmCommandFactory to create a command.
       
    53 
       
    54 @param aSeverity 			The severity of the command
       
    55 @param aExecutionBehaviour 	Execution behaviour of this command
       
    56 @param aInfo 				CustomCommand-specific info
       
    57 @param aPriority 			The priority of the command in the list
       
    58 @return						A pointer to an object of type CCmdCustomCommand.
       
    59 */
       
    60 CCmdCustomCommand* CCmdCustomCommand::NewL(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, 
       
    61 		const CSsmCustomCommandInfo& aInfo, const TUint16 aPriority)
       
    62 	{
       
    63 	CCmdCustomCommand* self = new (ELeave) CCmdCustomCommand(aSeverity, aExecutionBehaviour, aPriority);
       
    64 	CleanupStack::PushL(self);
       
    65 	self->ConstructL(aInfo);
       
    66 	CleanupStack::Pop(self);
       
    67 	return self;
       
    68 	}
       
    69 #endif
       
    70 
       
    71 /**
       
    72 Used to create an instance of CCmdCustomCommand class from given parameters.
       
    73 This method is used by SsmCommandFactory to create a command.
       
    74 
       
    75 @param aSeverity 			The severity of the command
       
    76 @param aExecutionBehaviour 	Execution behaviour of this command
       
    77 @param aInfo 				CustomCommand-specific info
       
    78 @return						A pointer to an object of type CCmdCustomCommand.
       
    79 */
       
    80 CCmdCustomCommand* CCmdCustomCommand::NewL(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, const CSsmCustomCommandInfo& aInfo)
       
    81 	{
       
    82 	CCmdCustomCommand* self = new (ELeave) CCmdCustomCommand(aSeverity, aExecutionBehaviour);
       
    83 	CleanupStack::PushL(self);
       
    84 	self->ConstructL(aInfo);
       
    85 	CleanupStack::Pop(self);
       
    86 	return self;
       
    87 	}
       
    88 
       
    89 /**
       
    90 Used to create an instance of CCmdCustomCommand class from resource.
       
    91 
       
    92 @param aCommandParameters 	Object data from a resource file
       
    93 @return						A pointer to an object of type CCmdCustomCommand.
       
    94 */
       
    95 CCmdCustomCommand* CCmdCustomCommand::NewL(TSsmCommandParameters& aCommandParameters)
       
    96 	{
       
    97 	CCmdCustomCommand* self = new (ELeave) CCmdCustomCommand();
       
    98 	CleanupStack::PushL(self);
       
    99 	self->ConstructL(aCommandParameters);
       
   100 	CleanupStack::Pop(self);
       
   101 	return self;
       
   102 	}
       
   103 
       
   104 /**
       
   105 Used to create an instance of CCmdCustomCommand class from CCmdCustomCommand object
       
   106 Must be used only by CLE
       
   107 @param aCmdCustomCommand CCmdCustomCommand reference 
       
   108 @param aUtilProvider CSsmCommandUtilProvider reference 
       
   109 @return A pointer to an object of type CCmdCustomCommand.
       
   110 */
       
   111 CCmdCustomCommand* CCmdCustomCommand::NewLC(const CCmdCustomCommand& aCmdCustomCommand, CSsmCommandUtilProvider* aUtilProvider)
       
   112     {
       
   113 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   114     CCmdCustomCommand* self = new (ELeave) CCmdCustomCommand(aCmdCustomCommand.Severity(),aCmdCustomCommand.ExecutionBehaviour(),
       
   115                                                              aCmdCustomCommand.Priority());
       
   116 #else
       
   117     CCmdCustomCommand* self = new (ELeave) CCmdCustomCommand(aCmdCustomCommand.Severity(),aCmdCustomCommand.ExecutionBehaviour());
       
   118 #endif
       
   119     CleanupStack::PushL(self);
       
   120     self->ConstructL(aCmdCustomCommand, aUtilProvider);
       
   121     return self;
       
   122     }
       
   123 
       
   124 void CCmdCustomCommand::ConstructL(const CCmdCustomCommand& aCmdCustomCommand, CSsmCommandUtilProvider* aUtilProvider)
       
   125     {
       
   126     iConditionalResourceId = aCmdCustomCommand.ConditionalInformation();
       
   127 	SetUtilProvider(*aUtilProvider);
       
   128 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   129 	if (iConditionalResourceId != 0)
       
   130         {
       
   131         SetCommandResourceFileNameL(aCmdCustomCommand.GetCommandResourceFileName());
       
   132         }
       
   133 #endif
       
   134     iInfo = new (ELeave) CSsmCustomCommandInfo();
       
   135     (*iInfo) = aCmdCustomCommand.SsmCustomCommandInfo();
       
   136 	}
       
   137 
       
   138 /**
       
   139 Destructor
       
   140 */	
       
   141 CCmdCustomCommand::~CCmdCustomCommand()
       
   142 	{
       
   143 	Cancel();
       
   144 	
       
   145 	if (iCustomCommand)	// we requested it so we are responsible for deleting it
       
   146 		{
       
   147 		iCustomCommand->Release();
       
   148 		}
       
   149 		
       
   150 	if (iInfo)
       
   151 		{
       
   152 		// release the DLL if instructed, DLL's with ENeverUnload option needs unloading atleast when the server dies.
       
   153 		if (iInfo->Unloading() == EUnloadOnCommandCompletion)
       
   154 			{
       
   155 			iLibrary.Close();
       
   156 			}
       
   157 
       
   158 		delete iInfo;
       
   159 		}
       
   160 	if(iCmdEnv)
       
   161 		{
       
   162 		delete iCmdEnv;
       
   163 		}
       
   164 	}
       
   165 
       
   166 /**
       
   167 Initialises the BIC's active object and initiates the command
       
   168  
       
   169 @param aStatus 	the TRequestStatus of the active object calling this BIC
       
   170 */	
       
   171 void CCmdCustomCommand::Execute(TRequestStatus& aStatus)
       
   172 	{
       
   173 	aStatus = KRequestPending;
       
   174 	iExecuteRequest = &aStatus;
       
   175 	iAction = EPrepareDll;
       
   176 
       
   177 	if (iExecutionBehaviour != ESsmWaitForSignal)
       
   178 		{
       
   179 		CompleteExecuteRequest(KErrNone);
       
   180 		}
       
   181 
       
   182 	CompleteRequest(iStatus, KErrNone);
       
   183 	SetActive();
       
   184 	}
       
   185 
       
   186 /**
       
   187 Releases resources associated with this BIC
       
   188 */	
       
   189 void CCmdCustomCommand::Release()
       
   190 	{
       
   191 	delete this;
       
   192 	}
       
   193 
       
   194 /**
       
   195 Initiates a Cancel on the object. 
       
   196 */	
       
   197 void CCmdCustomCommand::ExecuteCancel()
       
   198 	{
       
   199 	Cancel();
       
   200 	CompleteDeferredExecuteRequest(KErrCancel);	
       
   201 	}
       
   202 
       
   203 /**
       
   204 Returns the type of the BIC
       
   205  
       
   206 @return The type of the BIC
       
   207 */	
       
   208 TSsmCommandType CCmdCustomCommand::Type() const
       
   209 	{
       
   210 	return (ESsmCmdCustomCommand);
       
   211 	}
       
   212 
       
   213 /**
       
   214 Returns the Version of the BIC
       
   215  
       
   216 @return	The maximum supported version of the BIC
       
   217 */	
       
   218 TInt CCmdCustomCommand::MaxSupportedVersion()
       
   219 	{
       
   220 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   221 	return (static_cast<TInt>(ECmdCustomCommandVersionWithPriority));
       
   222 #else
       
   223 	return (static_cast<TInt>(ECmdCustomCommandInitialVersion));
       
   224 #endif
       
   225 	}
       
   226 
       
   227 /**
       
   228 Configures the BIC using data contained in a ReadStream
       
   229  
       
   230 @param aReadStream 	A read stream containing BIC data
       
   231 */
       
   232 void CCmdCustomCommand::InternalizeL(RReadStream& aReadStream)
       
   233 	{
       
   234 	iSeverity = static_cast<TCmdErrorSeverity>(aReadStream.ReadInt16L());
       
   235 	iExecutionBehaviour = static_cast<TSsmExecutionBehaviour>(aReadStream.ReadUint8L());
       
   236 
       
   237 	iInfo = new (ELeave) CSsmCustomCommandInfo();
       
   238 	iInfo->InternalizeL(aReadStream);
       
   239 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   240 	iPriority = aReadStream.ReadUint16L();
       
   241 #endif	
       
   242 	}
       
   243 
       
   244 /**
       
   245 Externalises the configuration of the BIC
       
   246  
       
   247 @param aWriteStream A write stream to write BIC data to
       
   248 @leave	One of the system-wide error codes.
       
   249 */
       
   250 void CCmdCustomCommand::ExternalizeL(RWriteStream& aWriteStream) const
       
   251 	{
       
   252 	aWriteStream.WriteInt16L(iSeverity);
       
   253 	aWriteStream.WriteUint8L(iExecutionBehaviour);
       
   254 	iInfo->ExternalizeL(aWriteStream);
       
   255 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   256 	aWriteStream.WriteUint16L(iPriority);
       
   257 #endif
       
   258 	}
       
   259 
       
   260 /**
       
   261 Performs the tasks of the BIC
       
   262 
       
   263 @leave	One of the system-wide error codes.
       
   264 */
       
   265 void CCmdCustomCommand::RunL()
       
   266 	{
       
   267 	switch(iAction)
       
   268 		{
       
   269 		case EPrepareDll:
       
   270 			{
       
   271 			PrepareCustomCmdL();
       
   272 			break;
       
   273 			}
       
   274 		case EInitialiseDll:
       
   275 			{
       
   276 			InitialiseCmdL();
       
   277 			break;
       
   278 			}
       
   279 		case EExecuteMethod:
       
   280 			{
       
   281 			SSMLOGLEAVEIFNULL(iCustomCommand);
       
   282 			iCustomCommand->Execute(iInfo->Params(), iStatus);
       
   283 			MoveToNextStateL(KErrNone, EClose, EFalse);	// custom command will complete this request
       
   284 			break;
       
   285 			}
       
   286 		case EClose:
       
   287 			{
       
   288 			TInt err = iStatus.Int();
       
   289 			if (err != KErrNone)
       
   290 				{
       
   291 				// custom cmd call failed so try it again
       
   292 				MoveToNextStateL(err, EExecuteMethod);
       
   293 				}
       
   294 			else
       
   295 				{
       
   296 				SSMLOGLEAVEIFNULL(iCustomCommand);
       
   297 				iCustomCommand->Close();
       
   298 				CompleteDeferredExecuteRequest(KErrNone);		// success
       
   299 				}
       
   300 			break;
       
   301 			}
       
   302 		default:
       
   303 			{
       
   304 			PanicNow(KPanicCmdCustomCommand, EInvalidRunLAction);
       
   305 			break;		
       
   306 			}
       
   307 		};
       
   308 	}
       
   309 
       
   310 /**
       
   311 Called to handle any cleanup if RunL leaves
       
   312  
       
   313 @param aError 	The error to finish with
       
   314 @return			KErrNone
       
   315 */
       
   316 TInt CCmdCustomCommand::RunError(TInt aError)
       
   317 	{
       
   318 	CompleteDeferredExecuteRequest(aError);
       
   319 	return KErrNone;
       
   320 	}
       
   321 
       
   322 /**
       
   323 Called during cancellation of the active BIC
       
   324 */
       
   325 void CCmdCustomCommand::DoCancel()
       
   326 	{
       
   327 	if (iCustomCommand)	// only cancel if Execute has been called
       
   328 		{
       
   329 		iCustomCommand->ExecuteCancel();
       
   330 		}
       
   331 	}
       
   332 
       
   333 /**
       
   334  Default Constructor.
       
   335  */
       
   336 CCmdCustomCommand::CCmdCustomCommand()
       
   337 	{
       
   338 	}
       
   339 
       
   340 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   341 /**
       
   342  Overloaded constructor.
       
   343  @param aSeverity 			The severity of the command
       
   344  @param aExecutionBehaviour The execution behaviour of the command
       
   345  @param aPriority 			The priority of the command in the list
       
   346  */
       
   347 CCmdCustomCommand::CCmdCustomCommand(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour,const TUint16 aPriority)
       
   348 	: CSsmDeferrableCommand(aSeverity, aExecutionBehaviour, aPriority)
       
   349 	{
       
   350 	}
       
   351 #endif
       
   352 
       
   353 /**
       
   354  Overloaded constructor.
       
   355  @param aSeverity 			The severity of the command
       
   356  @param aExecutionBehaviour The execution behaviour of the command
       
   357  */
       
   358 CCmdCustomCommand::CCmdCustomCommand(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour)
       
   359 	: CSsmDeferrableCommand(aSeverity, aExecutionBehaviour)
       
   360 	{
       
   361 	}
       
   362 
       
   363 /**
       
   364  Constructs the object from custom command info.
       
   365  @param aInfo A custom command info object containing BIC data
       
   366 */
       
   367 void CCmdCustomCommand::ConstructL(const CSsmCustomCommandInfo& aInfo)
       
   368 	{
       
   369 	iInfo = new (ELeave) CSsmCustomCommandInfo();
       
   370 	(*iInfo) = aInfo;
       
   371 	ValidateL();
       
   372 	}
       
   373 
       
   374 /**
       
   375  Constructs the object through read stream.
       
   376  @param aReadStream A read stream containing BIC data
       
   377 */
       
   378 void CCmdCustomCommand::ConstructL(RReadStream& aReadStream)
       
   379 	{
       
   380 	InternalizeL(aReadStream);
       
   381 	ValidateL();
       
   382 	}
       
   383 
       
   384 /**
       
   385  Constructs an object from resource file.
       
   386  @param aCommandParameters Object data from a resource file
       
   387 */
       
   388 void CCmdCustomCommand::ConstructL(TSsmCommandParameters& aCommandParameters)
       
   389 	{
       
   390 	RResourceReader& reader = aCommandParameters.MainReader();
       
   391 	const TSsmCommandType type = static_cast<TSsmCommandType>(reader.ReadInt16L());
       
   392 	SSMLOGLEAVEIFFALSE(type == Type(), KErrNotSupported);
       
   393 	const TInt version = reader.ReadInt16L();
       
   394 	SSMLOGLEAVEIFFALSE(__COMPARE_VERSION(version, CCmdCustomCommand::MaxSupportedVersion()), KErrNotSupported);
       
   395 	iSeverity = static_cast<TCmdErrorSeverity>(reader.ReadInt16L());
       
   396 	iExecutionBehaviour = static_cast<TSsmExecutionBehaviour>(reader.ReadUint8L());
       
   397 	const TPtrC name = reader.ReadTPtrCL();
       
   398 	const TInt32 ordinal = reader.ReadInt32L();
       
   399 	TCmdCustomCommandLibUnloading unloading = static_cast<TCmdCustomCommandLibUnloading>(reader.ReadUint8L());
       
   400 	TInt16 retries = reader.ReadInt16L();
       
   401 
       
   402 	// read dll data
       
   403 	const TInt32 paramDataId = reader.ReadUint32L();
       
   404 	HBufC8* params = NULL;
       
   405 	if (paramDataId > 0)
       
   406 		{
       
   407 		params = aCommandParameters.AllocBufferForResourceIdL(paramDataId);
       
   408 		}
       
   409 	else
       
   410 		{
       
   411 		params = HBufC8::NewL(0);
       
   412 		}
       
   413 	CleanupStack::PushL(params);
       
   414 
       
   415 	iInfo = new (ELeave) CSsmCustomCommandInfo();
       
   416 	iInfo->SetL(name, ordinal, unloading, retries, *params);
       
   417 
       
   418 	ValidateL();
       
   419 	CleanupStack::PopAndDestroy(params);	
       
   420 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
   421 	iPriority = (version > ECmdCustomCommandInitialVersion) ? reader.ReadUint16L() : KDefaultCommandPriority;
       
   422 #endif	
       
   423 	}
       
   424 
       
   425 /**
       
   426  Loads and sets up the custom command dll
       
   427 */
       
   428 void CCmdCustomCommand::PrepareCustomCmdL()
       
   429 	{
       
   430 	TInt err = KErrNone;
       
   431 	if (!iLoaded)
       
   432 		{
       
   433 		// load the dll
       
   434 		DEBUGPRINT2(_L("Loading library %S..."), &iInfo->FileName());
       
   435 		err = iLibrary.Load(iInfo->FileName());
       
   436 		if (err == KErrNone)
       
   437 			{
       
   438 			iLoaded = ETrue;
       
   439 			if(iInfo->Unloading() == ENeverUnload)
       
   440 				{
       
   441 				//Record the handle into the file.
       
   442 				//If it fails to write the handle, ignore it.
       
   443 				//We don't want to stop the processing of the command due to this failure. 
       
   444 				TRAP_IGNORE(WriteHandleToFileL(iLibrary.Handle()));
       
   445 				}
       
   446 			}
       
   447 		}
       
   448 
       
   449 	if (iLoaded)
       
   450 		{
       
   451 		err = KErrNotFound;
       
   452 
       
   453 		// get a pointer to the function
       
   454 		DEBUGPRINT2A("Looking up ordinal %d...", iInfo->Ordinal());
       
   455 		TLibraryFunction function = iLibrary.Lookup(iInfo->Ordinal());
       
   456 		if (function)
       
   457 			{	
       
   458 			// cast the pointer to our custom cmd type
       
   459 			CustomCmdFunctionType customCmdFunction = reinterpret_cast<CustomCmdFunctionType>(function);
       
   460 			iCustomCommand = (*customCmdFunction)();
       
   461 			if (iCustomCommand)
       
   462 				{
       
   463 				err = KErrNone;
       
   464 				}
       
   465 			}
       
   466 		}
       
   467 
       
   468 	MoveToNextStateL(err, EInitialiseDll);
       
   469 	}
       
   470 
       
   471 void CCmdCustomCommand::WriteHandleToFileL(TInt aHandle)
       
   472 	{
       
   473 	const TChar sysDrive = RFs::GetSystemDriveChar();
       
   474 	RBuf filename;
       
   475 	filename.CreateL(KNeverUnloadLibHandleFile().Length() + 1);
       
   476 	filename.Append(sysDrive);
       
   477 	filename.Append(KNeverUnloadLibHandleFile());
       
   478 	filename.CleanupClosePushL();
       
   479 	RFs fs;
       
   480 	User::LeaveIfError(fs.Connect());
       
   481 	CleanupClosePushL(fs);
       
   482 
       
   483 	fs.MkDirAll(filename); // ignore any error
       
   484 	RFile file;
       
   485 	CleanupClosePushL(file);
       
   486 	TInt err=KErrNone;
       
   487 	TInt pos = 0;
       
   488 	if(KErrNotFound == (err = file.Open(fs, filename, EFileShareExclusive|EFileStream|EFileWrite)))
       
   489 		{
       
   490 		User::LeaveIfError(file.Replace(fs, filename, EFileShareExclusive|EFileStream|EFileWrite));
       
   491 		}
       
   492 	else
       
   493 		{
       
   494 		User::LeaveIfError(err);
       
   495 		file.Seek(ESeekEnd, pos);
       
   496 		}
       
   497 	RFileWriteStream targetStream;
       
   498 	targetStream.Attach(file, pos); // file gets closed by this call, but that's okay, we don't need it any more (targetStream has its own copy of this RFile object that it owns)
       
   499 	CleanupClosePushL(targetStream);
       
   500 	targetStream.WriteInt32L(aHandle);
       
   501 	targetStream.CommitL();
       
   502 	CleanupStack::PopAndDestroy(4); 
       
   503 	}
       
   504 
       
   505 /**
       
   506  Calls the Initialize() method on the DLL
       
   507 */
       
   508 void CCmdCustomCommand::InitialiseCmdL()
       
   509 	{
       
   510 	SSMLOGLEAVEIFNULL(iCustomCommand);
       
   511 	SSMLOGLEAVEIFNULL(iUtilProvider);
       
   512 	iCmdEnv = CSsmCustomCommandEnv::NewL(iUtilProvider->RfsL());
       
   513 	TInt err = iCustomCommand->Initialize(iCmdEnv);
       
   514 	if (err!=KErrNone)
       
   515 		{
       
   516 		iCustomCommand->Close();	
       
   517 		delete iCmdEnv;
       
   518 		iCmdEnv=NULL;
       
   519 		}
       
   520 	MoveToNextStateL(err, EExecuteMethod);
       
   521 	}
       
   522 
       
   523 /**
       
   524  Sets the command up to run for another iteration
       
   525 */
       
   526 void CCmdCustomCommand::MoveToNextStateL(TInt aError, TCustomCmdAction aNextState, TBool aCompleteRequest)
       
   527 	{
       
   528 	if (aError == KErrNone)
       
   529 		{
       
   530 		iAction = aNextState;
       
   531 		}
       
   532 	else
       
   533 		{
       
   534 		if (++iAttempts >= iInfo->Retries())
       
   535 			{
       
   536 			DEBUGPRINT4A("Error encountered %d attempt %d retries %d", aError, iAttempts, iInfo->Retries());
       
   537 			SSMLOGLEAVE(aError);
       
   538 			}
       
   539 		}
       
   540 
       
   541 	if (aCompleteRequest)
       
   542 		{
       
   543 		CompleteRequest(iStatus, aError);
       
   544 		}
       
   545 
       
   546 	SetActive();
       
   547 	}
       
   548 
       
   549 /**
       
   550  Performs command-specific validation
       
   551 */
       
   552 void CCmdCustomCommand::ValidateL()
       
   553 	{
       
   554 	CSsmDeferrableCommand::ValidateL();
       
   555 
       
   556 	SSMLOGLEAVEIFFALSE(iInfo->FileName().Length()>0, KErrArgument);
       
   557 	SSMLOGLEAVEIFFALSE(iInfo->Ordinal()>0, KErrArgument);
       
   558 	SSMLOGLEAVEIFFALSE(iInfo->Unloading()>=EUnloadOnCommandCompletion, KErrArgument);
       
   559 	SSMLOGLEAVEIFFALSE(iInfo->Unloading()<=ENeverUnload, KErrArgument);
       
   560 	SSMLOGLEAVEIFFALSE(iInfo->Retries()>=0, KErrArgument);
       
   561 	}
       
   562