201039_07
authorhgs
Mon, 04 Oct 2010 12:03:52 +0100
changeset 279 957c583b417b
parent 275 2b433474f2ba
child 280 2bfb1feef9de
201039_07
kernel/eka/drivers/locmedia/dmasupport.h
kernel/eka/drivers/locmedia/dmasupport.inl
kernel/eka/drivers/locmedia/locmedia.cpp
kernel/eka/drivers/pbus/mmc/session.cpp
kernel/eka/drivers/pbus/mmc/stack.cpp
kernel/eka/drivers/resmanus/d_resmanus.cpp
kernel/eka/include/drivers/mmc.inl
kernel/eka/include/e32ver.h
kernel/eka/include/kernel/kdebug.h
kernel/eka/include/kernel/monitor.h
kernel/eka/kernel/kdebug.cpp
kernel/eka/kernel/smondebug.cpp
kernel/eka/kernel/sthread.cpp
kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp
kernel/eka/memmodel/epoc/flexible/x86/xmonitor.cpp
kernel/eka/memmodel/epoc/multiple/x86/xmonitor.cpp
kernel/eka/nkern/win32/ncthrd.cpp
kernel/eka/nkernsmp/nk_mon.cpp
kernel/eka/nkernsmp/x86/vectors.cia
kernel/eka/release.txt
kernel/eka/rombuild/bootx86.bat
kernel/eka/rombuild/bootx86d.bat
kernel/eka/rombuild/copyx86.bat
kernel/eka/rombuild/tshell_haltests.oby
kernel/eka/rombuild/vmboot.bat
kernel/eka/rombuild/vmbootsmp.bat
kerneltest/e32test/bmarm/domainpolicy99u.def
kerneltest/e32test/bwins/domainpolicy99u.def
kerneltest/e32test/bx86/domainpolicy99u.def
kerneltest/e32test/debug/d_debugapi.cpp
kerneltest/e32test/debug/d_debugapi.h
kerneltest/e32test/debug/t_debugapi.cpp
kerneltest/e32test/domainmgr/dm_tests.iby
kerneltest/e32test/domainmgr/dmtest.all.bat
kerneltest/e32test/domainmgr/dmtest.auto.bat
kerneltest/e32test/domainmgr/domainpolicy94.cpp
kerneltest/e32test/domainmgr/domainpolicy94.mmp
kerneltest/e32test/domainmgr/domainpolicy95.cpp
kerneltest/e32test/domainmgr/domainpolicy95.mmp
kerneltest/e32test/domainmgr/domainpolicy96.cpp
kerneltest/e32test/domainmgr/domainpolicy96.mmp
kerneltest/e32test/domainmgr/domainpolicy97.cpp
kerneltest/e32test/domainmgr/domainpolicy97.mmp
kerneltest/e32test/domainmgr/domainpolicy98.cpp
kerneltest/e32test/domainmgr/domainpolicy98.mmp
kerneltest/e32test/domainmgr/domainpolicy99.cpp
kerneltest/e32test/domainmgr/domainpolicy99.mmp
kerneltest/e32test/domainmgr/domainpolicydll.mmh
kerneltest/e32test/domainmgr/domainpolicytest.cpp
kerneltest/e32test/domainmgr/domainpolicytest.h
kerneltest/e32test/domainmgr/t_dmslave_nocaps.cpp
kerneltest/e32test/domainmgr/t_dmslave_nocaps.mmp
kerneltest/e32test/domainmgr/t_dmslave_onecap.cpp
kerneltest/e32test/domainmgr/t_dmslave_protsrv.mmp
kerneltest/e32test/domainmgr/t_dmslave_wdd.mmp
kerneltest/e32test/domainmgr/t_domain.cpp
kerneltest/e32test/domainmgr/t_domain.h
kerneltest/e32test/domainmgr/t_domain.mmp
kerneltest/e32test/domainmgr/t_domain_cmn.cpp
kerneltest/e32test/domainmgr/t_domain_manual.cpp
kerneltest/e32test/domainmgr/t_domain_manual.mmp
kerneltest/e32test/domainmgr/t_domain_monitor.cpp
kerneltest/e32test/domainmgr/t_domain_monitor.mmp
kerneltest/e32test/domainmgr/test.inf
kerneltest/e32test/eabi/domainpolicy99u.def
kerneltest/e32test/group/bld.inf
kerneltest/e32test/group/d_mmctest.mmp
kerneltest/e32test/group/t_mmcinfo.mmp
kerneltest/e32test/pccd/d_mmctest.cpp
kerneltest/e32test/pccd/d_mmctest.h
kerneltest/e32test/pccd/t_mmcinfo.cpp
kerneltest/e32test/resmanus/t_resmanus.cpp
kerneltest/f32test/loader/security/t_ldrcheck.cpp
kerneltest/f32test/server/t_fsys.cpp
userlibandfileserver/domainmgr/bmarm/domaincliu.def
userlibandfileserver/domainmgr/bmarm/domainpolicy_v2u.def
userlibandfileserver/domainmgr/bwins/domaincliu.def
userlibandfileserver/domainmgr/bwins/domainpolicy_v2u.def
userlibandfileserver/domainmgr/bx86/domaincliu.def
userlibandfileserver/domainmgr/bx86/domainpolicy_v2u.def
userlibandfileserver/domainmgr/eabi/domaincliu.def
userlibandfileserver/domainmgr/eabi/domainpolicy_v2u.def
userlibandfileserver/domainmgr/group/bld.inf
userlibandfileserver/domainmgr/group/domaincli.mmp
userlibandfileserver/domainmgr/group/domainsrv.mmp
userlibandfileserver/domainmgr/inc/domaincfg.h
userlibandfileserver/domainmgr/inc/domaindefs.h
userlibandfileserver/domainmgr/inc/domainmanager.h
userlibandfileserver/domainmgr/inc/domainmanager_private.h
userlibandfileserver/domainmgr/inc/domainmember.h
userlibandfileserver/domainmgr/inc/domainmember_private.h
userlibandfileserver/domainmgr/inc/domainpolicy.h
userlibandfileserver/domainmgr/inc/domainsrv.h
userlibandfileserver/domainmgr/src/domaincfg.cpp
userlibandfileserver/domainmgr/src/domaincli.cpp
userlibandfileserver/domainmgr/src/domainpolicy.cpp
userlibandfileserver/domainmgr/src/domainsrv.cpp
userlibandfileserver/domainmgr/src/domainsrv.h
userlibandfileserver/fileserver/bmarm/efsrvu.def
userlibandfileserver/fileserver/bwins/efsrvu.def
userlibandfileserver/fileserver/bx86/efsrvu.def
userlibandfileserver/fileserver/eabi/efsrvu.def
userlibandfileserver/fileserver/etshell/ts_com.cpp
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/f32file.h
userlibandfileserver/fileserver/inc/f32file.inl
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/sfsrv/cl_drive.cpp
--- a/kernel/eka/drivers/locmedia/dmasupport.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/drivers/locmedia/dmasupport.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -26,7 +26,6 @@
 
 /**
 @internalTechnology
-@prototype
 
 Class used for read / write requests to the local media subsystem to gain access
 to physical memory address to make use of DMA without the need of an intermediate buffer.
@@ -68,7 +67,6 @@
 	
 private:
 
-	static inline TInt PageSizeLog2();
 	static inline TBool IsPageAligned(TLinAddr aAddr);
 	static inline TLinAddr PageAlign(TLinAddr aAddr);
 	static inline TLinAddr PageOffset(TLinAddr aAddr);
@@ -77,7 +75,6 @@
 	inline void SetFragLength(TInt aLength);
 	inline TInt FragLength()	const;
 	inline TInt LengthRemaining() const;
-	inline TUint32 LengthConsumed() const;
 
 	inline TBool IsDmaAligned(TLinAddr aAddr);
 	inline TBool IsBlockAligned(TInt64 aPos);
--- a/kernel/eka/drivers/locmedia/dmasupport.inl	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/drivers/locmedia/dmasupport.inl	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -14,7 +14,6 @@
 //
 
 
-inline TInt DDmaHelper::PageSizeLog2()	{ return iPageSizeLog2; }
 inline TBool DDmaHelper::IsPageAligned(TLinAddr aAddr)		{ return !(aAddr & iPageSizeMsk); }
 inline TLinAddr DDmaHelper::PageAlign(TLinAddr aAddr)	{ return aAddr & ~iPageSizeMsk; }
 inline TLinAddr DDmaHelper::PageOffset(TLinAddr aAddr)		{ return aAddr & iPageSizeMsk; }
@@ -24,7 +23,6 @@
 inline void DDmaHelper::SetFragLength(TInt aLength) { iFragLen = iFragLenRemaining = aLength; }
 inline TInt DDmaHelper::FragLength()	const { return iFragLen; }
 inline TInt DDmaHelper::LengthRemaining() const { return iReqLenClient - iLenConsumed; }
-inline TUint32 DDmaHelper::LengthConsumed() const {return iLenConsumed; }
 
 
 inline TBool DDmaHelper::IsDmaAligned(TLinAddr aAddr)		{ return !(aAddr & (iDmaAlignment-1)); }
--- a/kernel/eka/drivers/locmedia/locmedia.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/drivers/locmedia/locmedia.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -338,9 +338,9 @@
 		iIndex++;
 		}
 
-	for (iDrive = NULL; iIndex < KMaxLocalDrives; iIndex++)
+	for (iDrive = NULL; Index() < KMaxLocalDrives; iIndex++)
 		{
-		iDrive = TheDrives[iIndex];
+		iDrive = TheDrives[Index()];
 		if (iDrive)
 			break;
 		}
@@ -1630,7 +1630,7 @@
 //		    Otherwise the media driver adjust it internally
 		case DMediaPagingDevice::ECodePageInRequest:
 			__KTRACE_OPT(KLOCDPAGING,Kern::Printf("Adjusted Paging read request %lx@%lx",Length(),Pos()));
-			OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_DEMANDPAGING, TLOCDRVREQUESTCHECKANDADJUSTFORPARTITION5, "Adjusted Paging read request length=%x:%x; position=%x%:%x", (TUint) I64HIGH(Length()), (TUint) I64LOW(Length()),  (TUint) I64HIGH (Pos()), (TUint) I64LOW (Pos()));
+			OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_DEMANDPAGING, TLOCDRVREQUESTCHECKANDADJUSTFORPARTITION5, "Adjusted Paging read request length=%x:%x; position=%x:%x", (TUint) I64HIGH(Length()), (TUint) I64LOW(Length()),  (TUint) I64HIGH(Pos()), (TUint) I64LOW(Pos()));
 			if (Pos()+Length()>d.iPartitionLen)
 			    {
 				r = KErrArgument;
@@ -2030,8 +2030,8 @@
 	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::Request(%08x)",iMediaId,&aReq));
 	__KTRACE_OPT(KLOCDRV,Kern::Printf("this=%x, ReqId=%d, Pos=%lx, Len=%lx, remote thread %O",this,aReq.Id(),aReq.Pos(),aReq.Length(),aReq.RemoteThread()));
 
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_REQUEST, "reqId=%d; remote thread=0x%x", (TInt) aReq.Id(), (TUint) aReq.RemoteThread());
-	OstTraceDefExt4(OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_REQUEST2, "length=%x:%x; position=%x:%x", (TUint) I64HIGH(aReq.Length()), (TUint) I64LOW(aReq.Length()), (TUint) I64HIGH(aReq.Pos()), (TUint) I64LOW(aReq.Pos()));
+	OstTraceDefExt5(OST_TRACE_CATEGORY_RND, TRACE_PRIMARYMEDIAREQUEST, DPRIMARYMEDIABASE_REQUEST, "Request=0x%x; reqId=%d; remote thread=0x%x; mediaId=%d; driveNum=%d", (TUint) &aReq, (TInt) aReq.Id(), (TUint) aReq.RemoteThread(), iMediaId, (aReq.Drive())->iDriveNumber);
+	OstTraceDefExt5(OST_TRACE_CATEGORY_RND, TRACE_PRIMARYMEDIAREQUEST, DPRIMARYMEDIABASE_REQUEST2, "Request=0x%x; length=%x:%x; position=%x:%x", (TUint) &aReq, (TUint) I64HIGH(aReq.Length()), (TUint) I64LOW(aReq.Length()), (TUint) I64HIGH(aReq.Pos()), (TUint) I64LOW(aReq.Pos()));
 	
 	TInt reqId = aReq.Id();
 
@@ -2216,6 +2216,7 @@
 	
 	TLocDrvRequest fragment = aReq;		// create a request on the stack for use during fragmentation, pre-fill with the original req args, leave original Kernel message as repository (thread will block, message contents won't change)
 	TInt r = KErrNone;
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_PRIMARYMEDIAREQUEST, DPRIMARYMEDIABASE_PinFragmentSendReceive, "Request=0x%x; FragmentRequest=0x%x", (TUint) &aReq,(TUint) &fragment);
 
 //	Kern::Printf(">PFSR %02X aReq %08X aLinAddress %08X aLen %08X offset %08X", aReq.Id(), &aReq, aLinAddress, aLength, aReq.RemoteDesOffset());
 
@@ -3303,7 +3304,7 @@
 void DPrimaryMediaBase::CompleteRequest(TLocDrvRequest& aMsg, TInt aResult)
 	{
 	OstTraceFunctionEntry1( DPRIMARYMEDIABASE_COMPLETEREQUEST_ENTRY, this );
-	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_REQUEST, DPRIMARYMEDIABASE_COMPLETEREQUEST1, "TLocDrvRequest Object=0x%x; aResult=%d", (TUint) &aMsg, aResult);
+	OstTraceDefExt2(OST_TRACE_CATEGORY_RND, TRACE_PRIMARYMEDIAREQUEST, DPRIMARYMEDIABASE_COMPLETEREQUEST1, "Request=0x%x; aResult=%d", (TUint) &aMsg, aResult);
 
 
 	__KTRACE_OPT(KLOCDRV,Kern::Printf("DPrimaryMediaBase(%d)::CompleteRequest(%08x) r %d",iMediaId,&aMsg, aResult));
--- a/kernel/eka/drivers/pbus/mmc/session.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/drivers/pbus/mmc/session.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -54,7 +54,7 @@
 	OstTraceFunctionEntry1( DUP1_DMMCSESSION_DMMCSESSION_ENTRY, this );
 	// Ensure that the stack isn't currently running in another thread's context, otherwise this session won't be 
 	// removed from the stack's workset until some time later - by which time the session will have been deleted
-	__ASSERT_ALWAYS(!iStackP->StackRunning(), DMMCSocket::Panic(DMMCSocket::EMMCNotInDfcContext));
+	__ASSERT_ALWAYS(!StackP()->StackRunning(), DMMCSocket::Panic(DMMCSocket::EMMCNotInDfcContext));
 	Abort();
 	UnlockStack();
 	OstTraceFunctionExit1( DUP1_DMMCSESSION_DMMCSESSION_EXIT, this );
@@ -392,7 +392,7 @@
 
 	ResetCommandStack();
 
-	iMachine.Setup(f, iStackP);
+	iMachine.Setup(f, StackP());
 	OstTraceFunctionExit1( DMMCSESSION_SETUPCIMCONTROL_EXIT, this );
 	}
 
@@ -440,20 +440,20 @@
 	OstTraceFunctionEntry1( DMMCSESSION_ENGAGE_ENTRY, this );
 	__KTRACE_OPT(KPBUS1,Kern::Printf(">ms:eng"));
 
-	if( iStackP == NULL )
+	if( StackP() == NULL )
 	    {
 		OstTraceFunctionExitExt( DMMCSESSION_ENGAGE_EXIT, this, KErrBadDriver );
 		return KErrBadDriver;
 	    }
 
-	if( iStackP->iLockingSessionP != NULL && iStackP->iLockingSessionP != this &&
-		(iStackP->EffectiveModes(iConfig) & KMMCModeEnqueIfLocked) == 0 )
+	if( StackP()->iLockingSessionP != NULL && StackP()->iLockingSessionP != this &&
+		(StackP()->EffectiveModes(iConfig) & KMMCModeEnqueIfLocked) == 0 )
 	    {
 		OstTraceFunctionExitExt( DUP1_DMMCSESSION_ENGAGE_EXIT, this, KErrServerBusy );
 		return KErrServerBusy;
 	    }
 
-	const TMediaState doorState=iStackP->MMCSocket()->iMediaChange->MediaState();
+	const TMediaState doorState=StackP()->MMCSocket()->iMediaChange->MediaState();
 
 	__KTRACE_OPT(KPBUS1,Kern::Printf(">MMC:Eng ds = %x", doorState));
 	OstTrace1( TRACE_INTERNALS, DMMCSESSION_ENGAGE, "doorState = 0x%x", doorState);
@@ -470,7 +470,7 @@
 
 	SetupCIMControl(iSessionID);
 
-	iStackP->Add(this);
+	StackP()->Add(this);
 
 	__KTRACE_OPT(KPBUS1,Kern::Printf("<ms:eng"));
 	OstTraceFunctionExitExt( DUP3_DMMCSESSION_ENGAGE_EXIT, this, KErrNone );
--- a/kernel/eka/drivers/pbus/mmc/stack.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/drivers/pbus/mmc/stack.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -3078,7 +3078,7 @@
 			s.iSessionID == ECIMNakedSession )
 			SMF_EXIT
 
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc( ECmdSendStatus, 0 );
 		m.SetTraps( KMMCErrBasic );		// to restore command stack position to its original level
 		SMF_INVOKES( ExecCommandSMST, EStAttStatus )
@@ -3086,7 +3086,7 @@
 	SMF_STATE(EStAttStatus)
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_ATTACHCARDSM3, "EStAttStatus" );
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		OstTraceFunctionExitExt( DMMCSTACK_ATTACHCARDSM_EXIT3, this, (TInt) err );
 		SMF_RETURN( err )
 
@@ -3358,8 +3358,8 @@
 
 		m.SetTraps(KMMCErrResponseTimeOut | KMMCErrStatus | KMMCErrDataCRC | KMMCErrBypass);	// KMMCErrDataCRC will pick up if the card is not in 1-bit mode
 
-		s.FillCommandDesc(ECmdSendExtendedCSD);
-		s.FillCommandArgs(0, KMMCExtendedCSDLength, iPSLBuf, KMMCExtendedCSDLength);
+		CurrentSessFillCmdDesc(ECmdSendExtendedCSD);
+		CurrentSessFillCmdArgs(0, KMMCExtendedCSDLength, iPSLBuf, KMMCExtendedCSDLength);
 
 		__KTRACE_OPT(KPBUS1, Kern::Printf(">ConfigureHighSpeed(), Sending ECmdSendExtendedCSD"));
 		SMF_INVOKES(CIMReadWriteBlocksSMST, EStGotExtendedCSD)
@@ -3815,7 +3815,7 @@
 		TMMCard &cd = *(iCardArray->CardP(iAutoUnlockIndex));
 		s.SetCard(&cd);
 		
-		s.PushCommandStack();		
+		CurrentSessPushCmdStack();		
 		s.FillCommandDesc(ECmdSleepAwake, KBit15);
 		
 		// CMD5 is an AC command, ExecCommandSMST will automatically issue a deselect
@@ -3828,7 +3828,7 @@
 		
 		const TMMCStatus status(s.ResponseP());
 		
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 
 		if(status.State() == ECardStateStby || status.State() == ECardStateSlp)
 			{			
@@ -3906,7 +3906,7 @@
 		__KTRACE_OPT(KPBUS1, Kern::Printf("VccQ Powered Up"));
 		
 		//Issue CMD5 to awaken media
-		s.PushCommandStack();		
+		CurrentSessPushCmdStack();		
 		s.FillCommandDesc(ECmdSleepAwake);
 		s.Command().iArgument.SetRCA(s.CardP()->RCA());
 		
@@ -3935,7 +3935,7 @@
 			return KMMCErrStatus;
 			}
 
-		s.PopCommandStack();	
+		CurrentSessPopCmdStack();	
 	
 	// Fall through to the next state
 	SMF_STATE(EStDone)
@@ -5113,7 +5113,7 @@
 	SMF_BEGIN
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_EXECCOMMANDSM2, "EStBegin" );
-		if ( ( s.CardRCA() != 0 ) && ( (s.CardP()->iStatus.State()) == ECardStateSlp) )
+		if ( ( CurrentSessCardRCA() != 0 ) && ( (s.CardP()->iStatus.State()) == ECardStateSlp) )
 			{
 			// Currently selected media is asleep, so it must be awoken
 			SMF_INVOKES(ExecAwakeCommandSMST,EStExecCmd)
@@ -5147,7 +5147,7 @@
 
 				// Check if this card is already in the appropriate selected/deselected
 				// state for the forthcoming command.
-				if (s.CardRCA() != iSelectedCard)
+				if (CurrentSessCardRCA() != iSelectedCard)
 					{
 					DeselectsToIssue(1);
 					}
@@ -5159,8 +5159,8 @@
 			SMF_GOTOS( EStAnalyseCommand )
 
 		// Save the top-level command while we issue de-selects
-		s.PushCommandStack();
-		s.FillCommandDesc( ECmdSelectCard, 0 );		// Deselect - RCA=0
+		CurrentSessPushCmdStack();
+		CurrentSessFillCmdDesc( ECmdSelectCard, 0 );      // Deselect - RCA=0
 		iCxDeselectCount=iDeselectsToIssue;
 
 	// Fall through to the next state
@@ -5174,7 +5174,7 @@
 		// If we got an error and this is the last de-select then give up
 		if (err && iCxDeselectCount == 1)
 			{
-			s.PopCommandStack();
+		    CurrentSessPopCmdStack();
 			OstTraceFunctionExitExt( DMMCSTACK_EXECCOMMANDSM_EXIT1, this, (TInt) err );
 			SMF_RETURN(err)
 			}
@@ -5182,7 +5182,7 @@
 		if (--iCxDeselectCount > 0)
 			SMF_INVOKES(RetryGapTimerSMST,EStDeselectLoop)
 
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		iStackState &= ~KMMCStackStateDoDeselect;
 
 	// Fall through to the next state
@@ -5238,7 +5238,7 @@
 
 		// Need to select (or deselect by using RCA(0)) the card so push the
 		// top-level command onto the command stack while we issue the select command.
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc(ECmdSelectCard,targetRCA);
 		SMF_INVOKES(IssueCommandCheckResponseSMST,EStSelectDone)	
 
@@ -5254,7 +5254,7 @@
 			if (err == KMMCErrBusyTimeOut)
 				cmd.iFlags |= KMMCCmdFlagExecSelBusy;
 
-			s.PopCommandStack();
+			CurrentSessPopCmdStack();
 			SMF_NEXTS(EStErrRecover)
 			OstTraceFunctionExitExt( DMMCSTACK_EXECCOMMANDSM_EXIT4, this, (TInt) err );
 			return err;		// re-enter the next state with that error
@@ -5277,7 +5277,7 @@
 			cmd.iPollAttempts = 0;
 			}
 
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		
 		cmd = s.Command();
 		if (!cmd.iSpec.iUseStopTransmission && cmd.iSpec.iMultipleBlocks)
@@ -5287,7 +5287,7 @@
 			// therefore need to re-issue SET_BLOCK_COUNT.....
 	  		const TUint blocks = cmd.NumBlocks();
 	
-			s.PushCommandStack();
+			CurrentSessPushCmdStack();
 			s.FillCommandDesc( ECmdSetBlockCount, blocks );
 			SMF_INVOKES( IssueCommandCheckResponseSMST, EStBlockCountCmdIssued )
 			}
@@ -5300,7 +5300,7 @@
 		
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_EXECCOMMANDSM9, "EStBlockCountCmdIssued" );
 		const TMMCStatus status(s.ResponseP());
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		if (status.Error())
 		    {
 		    OstTraceFunctionExitExt( DMMCSTACK_EXECCOMMANDSM_EXIT5, this, (TInt) KMMCErrStatus );
@@ -5320,13 +5320,13 @@
 		if (cmd.iSpec.iCommandClass != KMMCCmdClassApplication)
 			SMF_GOTOS( EStIssueCommand )
 
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc(ECmdAppCmd, s.CardRCA()); // Send APP_CMD (CMD55)	
 		SMF_INVOKES(IssueCommandCheckResponseSMST,EStIssueAppCommandDone)
 		
 	SMF_STATE(EStIssueAppCommandDone)
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_EXECCOMMANDSM11, "EStIssueAppCommandDone" );
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		if ( err )
 			{
 			SMF_NEXTS(EStErrRecover)
@@ -5760,7 +5760,7 @@
 	SMF_BEGIN
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMREADWRITEBLOCKSSM2, "EStBegin" );
-		if(s.iSessionID == ECIMWriteBlock || s.iSessionID == ECIMWriteMBlock)
+		if(s.SessionID() == ECIMWriteBlock || s.SessionID() == ECIMWriteMBlock)
 			{
 			// Check that the card supports class 4 (Write) commands
 			const TUint ccc = s.iCardP->CSD().CCC();
@@ -5818,7 +5818,7 @@
 			}
 
 		s.iCardP->iSetBlockLen = 0;
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc( ECmdSetBlockLen, blockLength );
 		SMF_INVOKES( ExecCommandSMST, EStLength1 )
 
@@ -5826,7 +5826,7 @@
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMREADWRITEBLOCKSSM5, "EStAttached" );
 		const TMMCStatus status(s.ResponseP());
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		if (status.Error())
 		    {
 		    OstTraceFunctionExitExt( DMMCSTACK_CIMREADWRITEBLOCKSSM_EXIT4, this, (TInt) KMMCErrStatus );
@@ -5930,7 +5930,7 @@
 			args |= KMMCCmdReliableWrite;
 			}
 		
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc( ECmdSetBlockCount, args );
 		SMF_INVOKES( ExecCommandSMST, EStBlockCountCmdIssued )
 
@@ -5938,7 +5938,7 @@
 		
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMREADWRITEBLOCKSSM9, "EStBlockCountCmdIssued" );
 		const TMMCStatus status(s.ResponseP());
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		if (status.Error())
 		    {
 		    OstTraceFunctionExitExt( DMMCSTACK_CIMREADWRITEBLOCKSSM_EXIT5, this, (TInt) KMMCErrStatus );
@@ -5957,7 +5957,7 @@
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMREADWRITEBLOCKSSM10, "EStAppCmdIssued" );
 		const TMMCStatus status(s.ResponseP());
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 		if (status.Error())
 		    {
 		    OstTraceFunctionExitExt( DMMCSTACK_CIMREADWRITEBLOCKSSM_EXIT6, this, (TInt) KMMCErrStatus );
@@ -5993,14 +5993,14 @@
 		// have bee a Deselect/Select issued), but we do know last response is stored in iLastStatus
 		TMMC::BigEndian4Bytes(s.ResponseP(), s.iLastStatus);
 
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc(ECmdSendStatus, 0);
 		SMF_INVOKES(ExecCommandSMST, EStWaitFinish1)
 
 	SMF_STATE(EStWaitFinish1)
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMREADWRITEBLOCKSSM14, "EStWaitFinish1" );
 		const TMMCStatus status(s.ResponseP());
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 
 #ifdef __WINS__
 		SMF_GOTOS(EStRWFinish);
@@ -6161,7 +6161,7 @@
 			command = ECmdTagEraseGroupEnd;
 			}
 
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc( command, endAddr );
 		SMF_INVOKES( ExecCommandSMST, EStEndTagged )
 
@@ -6191,7 +6191,7 @@
 	SMF_STATE(EStWaitFinish)
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMERASESM10, "EStWaitFinish" );
-		s.PushCommandStack();
+		CurrentSessPushCmdStack();
 		s.FillCommandDesc(ECmdSendStatus, 0);
 		SMF_INVOKES(ExecCommandSMST, EStWaitFinish1)
 
@@ -6199,7 +6199,7 @@
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_CIMERASESM11, "EStWaitFinish1" );
 		const TMMCStatus st(s.ResponseP());
-		s.PopCommandStack();
+		CurrentSessPopCmdStack();
 
 #ifdef __WINS__
 		SMF_GOTOS(EStEraseFinish);
--- a/kernel/eka/drivers/resmanus/d_resmanus.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/drivers/resmanus/d_resmanus.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -498,7 +498,6 @@
 		{
 		case RBusDevResManUs::EChangeResourceState:
 			{
-			__ASSERT_ALWAYS(m.Ptr2() != NULL, RESMANUS_FAULT());
 #ifdef _DUMP_TRACKERS
 			DumpTracker(iSetStateTracker);
 #endif
--- a/kernel/eka/include/drivers/mmc.inl	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/include/drivers/mmc.inl	Mon Oct 04 12:03:52 2010 +0100
@@ -1094,7 +1094,7 @@
 	Command().iDataMemoryP = aMemoryP;
 	EnableDoubleBuffering(aNumBlocks);
 
-	iStackP->UnBlock(this, KMMCBlockOnMoreData, aError == KErrNone ? KMMCErrNone : KMMCErrGeneral);
+	UnBlock(KMMCBlockOnMoreData, aError == KErrNone ? KMMCErrNone : KMMCErrGeneral);
 	}
 
 inline TBool DMMCSession::RequestMoreData()
@@ -1119,7 +1119,7 @@
 	
 	if(Command().IsDoubleBuffered() && (Command().iBytesDone + Command().BufferLength() < Command().iTotalLength))
 		{
-		iStackP->Block(this, KMMCBlockOnMoreData);
+		Block(KMMCBlockOnMoreData);
 		iDataTransferCallback.CallBack();
 		return(ETrue);
 		}
@@ -1229,7 +1229,7 @@
  * @param aCardNumber The card number.
  * @return A pointer to the specified card.
  */
-	{return( (aCardNumber<iMaxCardsInStack) ? (iCardArray->CardP(aCardNumber)) : NULL );}
+	{return( (aCardNumber<MaxCardsInStack()) ? (iCardArray->CardP(aCardNumber)) : NULL );}
 
 inline DMMCSocket* DMMCStack::MMCSocket() const
 /** 
--- a/kernel/eka/include/e32ver.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/include/e32ver.h	Mon Oct 04 12:03:52 2010 +0100
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=4004;
+const TInt KE32BuildVersionNumber=4005;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/kernel/kdebug.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/include/kernel/kdebug.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -39,9 +39,9 @@
 @released
 */
 #ifdef __MEMMODEL_MULTIPLE__
-const TInt KDebuggerMinorVersionNumber	= 6;
+const TInt KDebuggerMinorVersionNumber	= 7;
 #else
-const TInt KDebuggerMinorVersionNumber	= 5;
+const TInt KDebuggerMinorVersionNumber	= 6;
 #endif
 /**
 Defines the build number of the stop-mode debug API
@@ -113,7 +113,7 @@
 */
 const TInt KDebuggerOffsetInvalid		= -1;
 
-const TUint32 KFilterBufferSize = 1024;
+const TUint32 KFilterBufferSize = 16384;
 const TUint32 KFilterBufferSignature = 0x4642444B;
 
 /**
--- a/kernel/eka/include/kernel/monitor.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/include/kernel/monitor.h	Mon Oct 04 12:03:52 2010 +0100
@@ -56,7 +56,7 @@
 class DMonObject
 	{
 public:
-#ifdef __GCC32__				// GCC uses a different class layout
+#if defined(__GCC32__) && !defined(__EABI__) && defined(__MARM__)	// old GCC uses a different class layout
 	DBase* iAsyncDeleteNext;
 	TAny* iVptr;
 #else
--- a/kernel/eka/kernel/kdebug.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/kernel/kdebug.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -75,7 +75,7 @@
 	_FOFF(DThread, iNThread.iSavedSP),
 	_FOFF(DThread, iNThread.iPriority),
 	_FOFF(DThread, iThreadType),
-	KDebuggerOffsetInvalid,
+	_FOFF(DThread, iFlags),
 
 // process info
 	_FOFF(DProcess, iName),
--- a/kernel/eka/kernel/smondebug.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/kernel/smondebug.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -28,7 +28,7 @@
 #if 1 /*#ifndef __X86__*/
 const char* InitialInput="";
 #else
-const char* InitialInput="replacement\rf\ri\rr\rc0\rc1\rc2\rc3\rc4\rc5\rc6\rc7\rc8\rc9\rca\rcb\rcc\rcd\rce\rcf\r";
+const char* InitialInput="replacement\rf\ri\rr\rc0\rc1\rc2\rc3\rc4\rc5\rc6\rc7\rc8\rc9\rca\rcb\rcc\rcd\rce\rcf\rc10\rS\r";
 #endif
 
 CrashDebugger::CrashDebugger() 
--- a/kernel/eka/kernel/sthread.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/kernel/sthread.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -140,6 +140,24 @@
 		Kern::Free(iNThread.iExtraContext);
 	}
 
+#if defined(__EPOC32__) && defined(KTHREAD)
+void CheckSupervisorStackUsage(DThread* aT)
+	{
+	const TUint32* p = (const TUint32*)aT->iSupervisorStack;
+	TUint32 used = 0;
+	TUint32 free = 0;
+	if (p)
+		{
+		const TUint32* pE = p + (aT->iSupervisorStackSize / sizeof(TUint32));
+		while(p<pE && *p==0xeeeeeeeeu)
+			++p;
+		used = (pE - p) * sizeof(TUint32);
+		free = TUint32(aT->iSupervisorStackSize) - used;
+		}
+	Kern::Printf("Thread %O used %d bytes of kernel stack (%d bytes free)", aT, used, free);
+	}
+#endif
+
 // Enter and return with system unlocked.
 void DThread::Release()
 	{
@@ -185,6 +203,9 @@
 	iTimer.Cancel(NULL);
 
 	__KTRACE_OPT(KTHREAD,Kern::Printf("Freeing supervisor-mode stack"));
+#if defined(__EPOC32__) && defined(KTHREAD)
+	__KTRACE_OPT(KTHREAD,CheckSupervisorStackUsage(this));
+#endif
 	FreeSupervisorStack();
 #ifdef BTRACE_THREAD_IDENTIFICATION
 	BTrace12(BTrace::EThreadIdentification,BTrace::EThreadDestroy,&iNThread,iOwningProcess,iId);
@@ -665,6 +686,31 @@
 	}
 #endif
 
+#if defined(__SMP__) && defined(KTIMING)
+void TraceStatsOnThreadExit(DThread* aT)
+	{
+	TUint64 rc = aT->iNThread.iRunCount.i64;
+	NSchedulable::SCpuStats stats;
+	NKern::Lock();
+	aT->iNThread.GetCpuStats(NSchedulable::E_RunTime|NSchedulable::E_ActiveTime, stats);
+	NKern::Unlock();
+	TUint64 cputime = stats.iRunTime;
+	TUint64 acttime = stats.iActiveTime;
+	TUint32 f = NKern::CpuTimeMeasFreq();
+	TUint64 avgcpu = rc ? cputime / rc : 0;
+	TUint64 ratio = (acttime*100)/cputime;
+	TUint64 cpud = tix2us(cputime, f);
+	TUint64 actd = tix2us(acttime, f);
+	TUint64 avgd = tix2us(avgcpu, f);
+	Kern::Printf("Thread %O RC=%u CPU=%u.%06us ACT=%u.%06us AVG=%u.%06us RATIO=%d%%",
+					aT, TUint32(rc),
+					I64HIGH(cpud), I64LOW(cpud),
+					I64HIGH(actd), I64LOW(actd),
+					I64HIGH(avgd), I64LOW(avgd),
+					TUint32(ratio));
+	}
+#endif
+
 void DThread::Exit()
 //
 // This function runs in the context of the exiting thread
@@ -673,27 +719,7 @@
 	{
 #if defined(__SMP__) && defined(KTIMING)
 	if (KDebugNum(KTIMING))
-		{
-		TUint64 rc = iNThread.iRunCount.i64;
-		NSchedulable::SCpuStats stats;
-		NKern::Lock();
-		iNThread.GetCpuStats(NSchedulable::E_RunTime|NSchedulable::E_ActiveTime, stats);
-		NKern::Unlock();
-		TUint64 cputime = stats.iRunTime;
-		TUint64 acttime = stats.iActiveTime;
-		TUint32 f = NKern::CpuTimeMeasFreq();
-		TUint64 avgcpu = rc ? cputime / rc : 0;
-		TUint64 ratio = (acttime*100)/cputime;
-		TUint64 cpud = tix2us(cputime, f);
-		TUint64 actd = tix2us(acttime, f);
-		TUint64 avgd = tix2us(avgcpu, f);
-		Kern::Printf("Thread %O RC=%u CPU=%u.%06us ACT=%u.%06us AVG=%u.%06us RATIO=%d%%",
-						this, TUint32(rc),
-						I64HIGH(cpud), I64LOW(cpud),
-						I64HIGH(actd), I64LOW(actd),
-						I64HIGH(avgd), I64LOW(avgd),
-						TUint32(ratio));
-		}
+		TraceStatsOnThreadExit(this);
 #endif
 #ifdef KPANIC
 	if (iExitType==EExitPanic)
--- a/kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/x86/xmmu.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -616,6 +616,8 @@
 	TPde* pd = Mmu::PageDirectory(osAsid);
 	TInt pdeIndex = aAddr>>KChunkShift;
 	TPde pde = pd[pdeIndex];
+	// Get os asid, this is the current thread's process so no need for reference.
+	TUint32 local_asid = ((DMemModelProcess*)iOwningProcess)->OsAsid();
 #ifdef __SMP__
 	TLinAddr aliasAddr;
 #else
@@ -647,7 +649,7 @@
 #ifdef __SMP__
 		TSubScheduler& ss = SubScheduler();		// OK since we are locked to this CPU
 		aliasAddr = TLinAddr(ss.i_AliasLinAddr) + (aAddr & (KChunkMask & ~KPageMask));
-		iAliasPdePtr = (TPde*)(TLinAddr(ss.i_AliasPdePtr) + (osAsid << KPageTableShift));
+		iAliasPdePtr = (TPde*)(TLinAddr(ss.i_AliasPdePtr) + (local_asid << KPageTableShift));
 #endif
 		iAliasLinAddr = aliasAddr;
 		*iAliasPdePtr = pde;
--- a/kernel/eka/memmodel/epoc/flexible/x86/xmonitor.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/memmodel/epoc/flexible/x86/xmonitor.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -58,7 +58,9 @@
 
 	const TPde* kpd=(const TPde*)KPageDirectoryBase;
 	const TPde* ppd=(const TPde*)(KPageDirectoryBase+(aProcess->iOsAsid<<KPageTableShift));
-	if (!PdesEqual(kpd, ppd, KGlobalMemoryBase, 0x00000000))			// kernel mappings
+
+	// Check kernel mappings are the same except for IPC alias region
+	if (!PdesEqual(kpd, ppd, KGlobalMemoryBase, KIPCAlias) || !PdesEqual(kpd, ppd, KIPCAlias+KIPCAliasAreaSize, 0x00000000))
 		{
 		if (!aForce)
 			return KErrCorrupt;
--- a/kernel/eka/memmodel/epoc/multiple/x86/xmonitor.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/memmodel/epoc/multiple/x86/xmonitor.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -64,8 +64,10 @@
 
 	const TPde* kpd=(const TPde*)KPageDirectoryBase;
 	const TPde* ppd=(const TPde*)(KPageDirectoryBase+(aProcess->iOsAsid<<KPageTableShift));
-	if (!PdesEqual(kpd, ppd, KRomLinearBase, KUserGlobalDataEnd) ||		// ROM + user global
-		!PdesEqual(kpd, ppd, KRamDriveEndAddress, 0x00000000))			// kernel mappings
+	if (!PdesEqual(kpd, ppd, KRomLinearBase, KUserGlobalDataEnd)		||	// ROM + user global
+		!PdesEqual(kpd, ppd, KRamDriveEndAddress, KIPCAlias)			||	// kernel mappings other than IPC aliases
+		!PdesEqual(kpd, ppd, KIPCAlias+KIPCAliasAreaSize, 0x00000000u)		// kernel mappings other than IPC aliases
+		)			// kernel mappings
 		{
 		if (!aForce)
 			return KErrCorrupt;
--- a/kernel/eka/nkern/win32/ncthrd.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/nkern/win32/ncthrd.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -443,15 +443,16 @@
 // This function is called in the context of a thread that is being diverted.
 // This can be for either of two reasons: if iDivertFn has been set, that
 // function will be called and is not expected to return i.e.  it should force
-// the thread to exit. Otherwise, the thread will make a null trip through the
-// kernel, causing it to run pending user-mode callbacks on the way out.
+// the thread to exit (in this case, the thread may already be in the kernel,
+// but only at a place where it's safe for it to be killed).  Otherwise, the
+// thread must be in user mode, and it's forced to make a null trip through
+// the kernel, causing it to run pending user-mode callbacks on the way out.
 //
 // On entry, the kernel is locked and interrupts enabled
 //
 	{
 	NThread& me = *static_cast<NThread*>(TheScheduler.iCurrentThread);
 	__NK_ASSERT_ALWAYS(TheScheduler.iKernCSLocked == 1);
-	__NK_ASSERT_ALWAYS(me.iInKernel == 0);
 	__NK_ASSERT_ALWAYS(me.iDiverting);
 	NThread::TDivert divertFn = me.iDivertFn;
 	me.iDivertFn = NULL;
--- a/kernel/eka/nkernsmp/nk_mon.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/nkernsmp/nk_mon.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -123,6 +123,13 @@
 
 	m.Printf("DeferShutdown %4d RdyThrdC %d Uncached %08x\r\n", ss.iDeferShutdown, ss.iRdyThreadCount, ss.iUncached);
 	DisplaySubSchedulerExt(m, ss);
+
+	volatile TUint32* ssc = (volatile TUint32*)&ss.iSubSchedScratch[0];
+	m.Printf("Scratch 0: %08x  1: %08x  2: %08x  3: %08x\r\n", ssc[ 0], ssc[ 1], ssc[ 2], ssc[ 3]);
+	m.Printf("Scratch 4: %08x  5: %08x  6: %08x  7: %08x\r\n", ssc[ 4], ssc[ 5], ssc[ 6], ssc[ 7]);
+	m.Printf("Scratch 8: %08x  9: %08x  A: %08x  B: %08x\r\n", ssc[ 8], ssc[ 9], ssc[10], ssc[11]);
+	m.Printf("Scratch C: %08x  D: %08x  E: %08x  F: %08x\r\n", ssc[12], ssc[13], ssc[14], ssc[15]);
+
 	TPriListBase* b = (TPriListBase*)&ss;
 	m.Printf("PriClassThrdC %4d %4d %4d %4d\r\n", ss.iPriClassThreadCount[0], ss.iPriClassThreadCount[1], ss.iPriClassThreadCount[2], ss.iPriClassThreadCount[3]);
 	m.Printf("Present %08x %08x\r\n", b->iPresent[1], b->iPresent[0]);
@@ -164,10 +171,10 @@
 
 	DisplaySchedulerExt(*this, *pS);
 	volatile TUint32* sc = (volatile TUint32*)&pS->iSchedScratch[0];
-	Printf("Scratch 0: %08x  1: %08x  2: %08x  3: %08x\r\n",sc[0],sc[1],sc[2],sc[3]);
-	Printf("Scratch 4: %08x  5: %08x  6: %08x  7: %08x\r\n",sc[4],sc[5],sc[6],sc[7]);
-	Printf("Scratch 8: %08x  9: %08x  A: %08x  B: %08x\r\n",sc[8],sc[9],sc[10],sc[11]);
-	Printf("Scratch C: %08x  D: %08x  E: %08x  F: %08x\r\n",sc[12],sc[13],sc[14],sc[15]);
+	Printf("Scratch 0: %08x  1: %08x  2: %08x  3: %08x\r\n", sc[ 0], sc[ 1], sc[ 2], sc[ 3]);
+	Printf("Scratch 4: %08x  5: %08x  6: %08x  7: %08x\r\n", sc[ 4], sc[ 5], sc[ 6], sc[ 7]);
+	Printf("Scratch 8: %08x  9: %08x  A: %08x  B: %08x\r\n", sc[ 8], sc[ 9], sc[10], sc[11]);
+	Printf("Scratch C: %08x  D: %08x  E: %08x  F: %08x\r\n", sc[12], sc[13], sc[14], sc[15]);
 
 	TInt i;
 	for (i=0; i<KMaxCpus; ++i)
--- a/kernel/eka/nkernsmp/x86/vectors.cia	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/nkernsmp/x86/vectors.cia	Mon Oct 04 12:03:52 2010 +0100
@@ -514,9 +514,17 @@
 	asm("add eax, 8 ");			// EAX = ESP at point of exception if ring 3
 	asm("mov cx, %0" : : "i" (KRing0DS));
 	asm("mov gs, cx ");			// exception in user mode -> GS = user mode DS
+	asm("mov [ebp], eax ");
+	asm("jmp short ring3_exception ");
+
 	asm("ring0_exception: ");
 	asm("mov [ebp], eax ");
+	asm("cmp dword ptr [ebp+%0], 13 " : : "i" _FOFF(TX86ExcInfo, iExcId)); // check for GPF
+	asm("jnz short ring3_exception ");
+	asm("cmp dword ptr [ebp+%0], 0x7fa " : : "i" _FOFF(TX86ExcInfo, iExcErrorCode)); // check for int 0xff
+	asm("jz short fatal_exception_crash ");		// explicit crash instruction, so die immediately
 
+	asm("ring3_exception: ");
 	asm("cmp dword ptr [esi+%0], -1 " : : "i" _FOFF(TSubScheduler, iSSX.iIrqNestCount));
 	asm("jnz short fatal_exception_irq ");
 	asm("cmp dword ptr [esi+%0], 0 " : : "i" _FOFF(TSubScheduler, iKernLockCount));
@@ -567,6 +575,7 @@
 
 	asm("fatal_exception_irq: ");
 	asm("fatal_exception_locked: ");
+	asm("fatal_exception_crash: ");
 	asm("mov eax, %0" : : "i" (addressof_TheScheduler)); 
 	asm("lea eax, [eax+%0]" : : "i" _FOFF(TScheduler,iMonitorExceptionHandler));
 	asm("mov eax, [eax] ");
--- a/kernel/eka/release.txt	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/release.txt	Mon Oct 04 12:03:52 2010 +0100
@@ -1,3 +1,30 @@
+Version 2.00.4005
+=================
+(Made by vfebvre 24/09/2010)
+
+1.	lforynsk
+	1.	ou1cimx1#584587 PRM RBusDevResManUs::ChangeResourceState() to set a resource level to "0", causes FAULT: RESMANUS 0x000001e3 (483)
+
+2.	seolney
+	1.	ou1cimx1#553109 REQ 405-4716, Feature 405-5174: Staged shutdown server monitor
+
+3.	necliffo
+	1.	ou1cimx1#584508 Improve Code Coverage for LocalMedia Subsystem and MMC Stack
+
+4.	anhaigh
+	1.	ou1cimx1#588810 Critical thread identification in SMDG for Platsim : 417-74689 Increase SMDG buffer size: 417-74690
+		KDebug Critical Thread Identification and KDebug Event Filter Buffer Size Increase
+
+5.	davegord
+	1.	ou1cimx1#586071 Emulator panics with kernel assertion failure in nc_thrd.cpp, line 454
+
+6.	paconway
+	1.	ou1cimx1#586843 Local media subsystem instrumentation outputs incomplete information
+
+7.	ricoles
+	1.	ou1cimx1#562414 [mcl] ENV X86GMP ROMs hang on boot
+
+
 Version 2.00.4004
 =================
 (Made by vfebvre 24/09/2010)
--- a/kernel/eka/rombuild/bootx86.bat	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/rombuild/bootx86.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -17,7 +17,7 @@
 setlocal
 set IMAGE_PATH=\
 set IMAGE_NAME=floppy
-set X86PC_PATH=\os\boardsupport\x86pc\
+set X86PC_PATH=\os\boardsupport_internal\x86pc\
 set TEMP_PATH=%IMAGE_PATH%_bfi_temp
 rem set BOCHS_PATH=C:\Program Files\Bochs-2.2.1
 set BOCHS_PATH=C:\Program Files\Bochs-2.2.6
--- a/kernel/eka/rombuild/bootx86d.bat	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/rombuild/bootx86d.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -17,7 +17,7 @@
 setlocal
 set IMAGE_PATH=\
 set IMAGE_NAME=floppy
-set X86PC_PATH=\os\boardsupport\x86pc\
+set X86PC_PATH=\os\boardsupport_internal\x86pc\
 set TEMP_PATH=%IMAGE_PATH%_bfi_temp
 rem set BOCHS_PATH=C:\Program Files\Bochs-2.2.1
 set BOCHS_PATH=C:\Program Files\Bochs-2.2.6
--- a/kernel/eka/rombuild/copyx86.bat	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/rombuild/copyx86.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -16,4 +16,4 @@
 rem
 del %1.zip
 zip %1.zip %1.img
-copy /b \os\boardsupport\x86pc\pcboot\inflate.bin+%1.zip %2\E32ROM.IMG
+copy /b \os\boardsupport_internal\x86pc\pcboot\inflate.bin+%1.zip %2\E32ROM.IMG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/rombuild/tshell_haltests.oby	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#define BASE_ROM
+#include <rom\##VARIANT##\header.iby>
+
+
+files=
+
+#include <rom\##VARIANT##\kernel.iby>
+#include "user.iby"
+#include <rom\hal\hal.iby>
+#include <rom\f32\f32.iby>
+
+#include <rom\include\haltests.iby>
--- a/kernel/eka/rombuild/vmboot.bat	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/rombuild/vmboot.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -18,7 +18,7 @@
 set IMAGE_PATH=\_vmx\
 set IMAGE_NAME=floppy
 set ROMBUILD_PATH=\os\kernelhwsrv\kernel\eka\rombuild\
-set X86PC_PATH=\os\boardsupport\x86pc\
+set X86PC_PATH=\os\boardsupport_internal\x86pc\
 set TEMP_PATH=%IMAGE_PATH%_bfi_temp
 if exist "%ProgramFiles%\VMWare\VMWare Workstation" (
 	set VMPLAYER=%ProgramFiles%\VMWare\VMWare Workstation\vmplayer.exe
--- a/kernel/eka/rombuild/vmbootsmp.bat	Tue Sep 28 15:28:31 2010 +0100
+++ b/kernel/eka/rombuild/vmbootsmp.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -18,7 +18,7 @@
 set IMAGE_PATH=\_vmx\
 set IMAGE_NAME=floppy
 set ROMBUILD_PATH=\os\kernelhwsrv\kernel\eka\rombuild\
-set X86PC_PATH=\os\boardsupport\x86pc\
+set X86PC_PATH=\os\boardsupport_internal\x86pc\
 set TEMP_PATH=%IMAGE_PATH%_bfi_temp
 if exist "%ProgramFiles%\VMWare\VMWare Workstation" (
 	set VMPLAYER=%ProgramFiles%\VMWare\VMWare Workstation\vmplayer.exe
--- a/kerneltest/e32test/bmarm/domainpolicy99u.def	Tue Sep 28 15:28:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	GetDomainSpecs__8DmPolicy @ 1 NONAME R3UNUSED ; DmPolicy::GetDomainSpecs(void)
-	Release__8DmPolicyPC13TDmDomainSpec @ 2 NONAME R3UNUSED ; DmPolicy::Release(TDmDomainSpec const *)
-	GetPolicy__8DmPolicyR18TDmHierarchyPolicy @ 3 NONAME R3UNUSED ; DmPolicy::GetPolicy(TDmHierarchyPolicy &)
-
--- a/kerneltest/e32test/bwins/domainpolicy99u.def	Tue Sep 28 15:28:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-EXPORTS
-	?GetDomainSpecs@DmPolicy@@SAPBUTDmDomainSpec@@XZ @ 1 NONAME ; public: static struct TDmDomainSpec const * __cdecl DmPolicy::GetDomainSpecs(void)
-	?Release@DmPolicy@@SAXPBUTDmDomainSpec@@@Z @ 2 NONAME ; public: static void __cdecl DmPolicy::Release(struct TDmDomainSpec const *)
-	?GetPolicy@DmPolicy@@SAHAAVTDmHierarchyPolicy@@@Z @ 3 NONAME ; public: static int __cdecl DmPolicy::GetPolicy(class TDmHierarchyPolicy &)
--- a/kerneltest/e32test/bx86/domainpolicy99u.def	Tue Sep 28 15:28:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	?GetDomainSpecs@DmPolicy@@SAPBUTDmDomainSpec@@XZ @ 1 NONAME ; public: static struct TDmDomainSpec const * __cdecl DmPolicy::GetDomainSpecs(void)
-	?Release@DmPolicy@@SAXPBUTDmDomainSpec@@@Z @ 2 NONAME ; public: static void __cdecl DmPolicy::Release(struct TDmDomainSpec const *)
-	?GetPolicy@DmPolicy@@SAHAAVTDmHierarchyPolicy@@@Z @ 3 NONAME ; public: static int __cdecl DmPolicy::GetPolicy(class TDmHierarchyPolicy &)
-
--- a/kerneltest/e32test/debug/d_debugapi.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/debug/d_debugapi.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -268,7 +268,7 @@
 	TInt** containerObjects = (TInt**)Read(processCon, iOffsetTable->iObjectCon_Objects);
 
 	Kern::Printf("THREAD TABLE:");
-	Kern::Printf("Id Pri Typ SupStack+Size UsrStack+Size ContType SavedSP   ThreadName    Process");
+	Kern::Printf("Id Pri Typ SupStack+Size UsrStack+Size ContType SavedSP   ThreadName    Process   ThreadFlags");
 
 	for (TInt i = 0; i < containerCount; i++)
 		{
@@ -287,8 +287,10 @@
 		TInt* owningProcess =	(TInt*)Read(thread, iOffsetTable->iThread_OwningProcess);
 
 		TInt processName =		Read(owningProcess, iOffsetTable->iProcess_Name);
+		
+		TInt threadFlags = Read(thread, iOffsetTable->iThread_iFlags);
 
-		Kern::Printf("%02x %3x %3x %08x %04x %08x %04x %08x %08x %14s %s", 
+		Kern::Printf("%02x %3x %3x %08x %04x %08x %04x %08x %08x %14s %s %08x", 
 				id,
 				priority, 
 				type,
@@ -299,7 +301,8 @@
 				userContextType,
 				savedSP,
 				ExtractName(name, threadCharName),
-				ExtractName(processName, processCharName)
+				ExtractName(processName, processCharName),
+				threadFlags
 				);
 		}
 
--- a/kerneltest/e32test/debug/d_debugapi.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/debug/d_debugapi.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -131,7 +131,7 @@
 	TInt iThread_SavedSupervisorSP;
 	TInt iThread_Priority;
 	TInt iThread_ThreadType;
-	TInt iDebuggerOffset_Reserved12;
+	TInt iThread_iFlags;
 	// process info
 	TInt iProcess_Name;
 	TInt iProcess_Id;
--- a/kerneltest/e32test/debug/t_debugapi.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/debug/t_debugapi.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -22,7 +22,7 @@
 // (ARMv6 based target). It can be achieved by adding: #define STOP_MODE_DEBUGGING in .oby/iby file.
 // Supported and tested on H2 (ARMv5) and integrator_1136 (ARMv6) platforms.
 // It requires D_DEBUGAPI.DLL as well.
-// Using debug interfaca only, it completes (prints) the list of:
+// Using debug interface only, it completes (prints) the list of:
 // - processes;
 // - threads;
 // - chunks;
--- a/kerneltest/e32test/domainmgr/dm_tests.iby	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/dm_tests.iby	Mon Oct 04 12:03:52 2010 +0100
@@ -18,17 +18,26 @@
 #define __DM_TEST_IBY__
 
 
-file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain.exe				\sys\bin\t_domain.exe
-file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain_slave.exe			\sys\bin\t_domain_slave.exe
-file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy99.dll			\sys\bin\domainpolicy99.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain.exe			\sys\bin\t_domain.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain_monitor.exe	\sys\bin\t_domain_monitor.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain_manual.exe		\sys\bin\t_domain_manual.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_domain_slave.exe		\sys\bin\t_domain_slave.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy94.dll		\sys\bin\domainpolicy94.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy95.dll		\sys\bin\domainpolicy95.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy96.dll		\sys\bin\domainpolicy96.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy97.dll		\sys\bin\domainpolicy97.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy98.dll		\sys\bin\domainpolicy98.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\domainpolicy99.dll		\sys\bin\domainpolicy99.dll
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_dmslave_nocaps.exe	\sys\bin\t_dmslave_nocaps.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_dmslave_wdd.exe		\sys\bin\t_dmslave_wdd.exe
+file=\Epoc32\Release\##MAIN##\##BUILD##\t_dmslave_protsrv.exe	\sys\bin\t_dmslave_protsrv.exe
 
-
-data=\epoc32\rom\include\dmtest.auto.bat				\test\dm.auto.bat
+data=\epoc32\rom\include\dmtest.auto.bat	\test\dm.auto.bat
+data=\epoc32\rom\include\dmtest.all.bat		\test\dm.all.bat
 
 #if defined(DM_AUTO_ROM)
-data=\epoc32\rom\include\dm_autoexec.bat				\autoexec.bat
+data=\epoc32\rom\include\dm_autoexec.bat  \autoexec.bat
 #endif
 
 
-
 #endif // __DM_TEST_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/dmtest.all.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,19 @@
+@rem
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+t_domain
+t_domain_monitor
+t_domain_manual
--- a/kerneltest/e32test/domainmgr/dmtest.auto.bat	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/dmtest.auto.bat	Mon Oct 04 12:03:52 2010 +0100
@@ -15,3 +15,4 @@
 @rem
 
 t_domain
+t_domain_monitor
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy94.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,58 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "domainpolicytest.h"
+
+
+const TDmDomainSpec DomainHierarchy[] =
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		TDM_DOMAIN_SPEC_END
+	};
+
+const TDmHierarchyPolicy HierarchyPolicy	=
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+
+
+// For testing purposes: completely insane values:
+const SDmStateSpecV1 StateSpecification[] =
+	{
+    //    iState,  iTimeoutMs, iDeferralLimit, iFailurePolicy
+        { 171,     -16,        -9876,          1765 },
+        { 0xffff,  16000,      10000,          -28 },
+        { 0,       18,         ~0,             100 }
+	};
+
+const TUint StateSpecificationSize = sizeof(StateSpecification)/sizeof(SDmStateSpecV1);
+const TInt StateSpecificationVersion = KSDmStateSpecV1;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy94.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/domainpolicy94.mmp
+// domainpolicy94.dll Test Domain manager policy module
+//
+//
+
+TARGET		domainpolicy94.dll
+
+#include	"domainpolicydll.mmh"
+
+source		domainpolicy94.cpp
+
+deffile     	../../../userlibandfileserver/domainmgr/~/domainpolicy_v2.def
+
+macro		DOMAIN_POLICY_V2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy95.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,67 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "domainpolicytest.h"
+
+
+const TDmDomainSpec DomainHierarchy[] =
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		TDM_DOMAIN_SPEC_END
+	};
+
+const TDmHierarchyPolicy HierarchyPolicy	=
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+
+
+const SDmStateSpecV1 StateSpecification[] =
+	{
+	//    iState, 					iTimeoutMs, iDeferralLimit,	iFailurePolicy
+		{ EStartupCriticalStatic,	0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ EStartupCriticalDynamic,	0, 	 		0, 				ETransitionFailureStop },
+		{ EStartupNonCritical,		0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ ENormalRunning,			0,	 		0, 				ETransitionFailureContinue },
+		{ EBackupMode,				100, 		1, 				ETransitionFailureStop },
+		{ ERestoreMode,				1000, 		3, 				ETransitionFailureStop },
+		{ EShutdownCritical,		200, 		5, 				ETransitionFailureContinue },
+		{ EShutdownNonCritical,		200, 		5, 				ETransitionFailureContinue }
+	};
+
+const TUint StateSpecificationSize = sizeof(StateSpecification)/sizeof(SDmStateSpecV1);
+
+
+// The above code is a valid domain policy but the following value should, for
+// testing purposes, trigger an error in the Domain Manager (in
+// CDmSvrManager::BuildDomainTree()):
+const TInt StateSpecificationVersion = KDmErrBadDomainSpec;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy95.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/domainpolicy95.mmp
+// domainpolicy95.dll Test Domain manager policy module
+//
+//
+
+TARGET		domainpolicy95.dll
+
+#include	"domainpolicydll.mmh"
+
+source		domainpolicy95.cpp
+
+deffile     	../../../userlibandfileserver/domainmgr/~/domainpolicy_v2.def
+
+macro		DOMAIN_POLICY_V2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy96.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "domainpolicytest.h"
+
+
+const TDmDomainSpec DomainHierarchy[] = 
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1		
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		TDM_DOMAIN_SPEC_END
+	};
+
+const TDmHierarchyPolicy HierarchyPolicy	= 
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+	
+	
+
+const SDmStateSpecV1 StateSpecification[] = { { 0 } } ;
+const TUint StateSpecificationSize = 0;
+const TInt StateSpecificationVersion = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy96.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/domainpolicy96.mmp
+// domainpolicy96.dll Test Domain manager policy module
+//
+//
+
+TARGET		domainpolicy96.dll
+
+#include	"domainpolicydll.mmh"
+
+source		domainpolicy96.cpp
+
+deffile     	../../../userlibandfileserver/domainmgr/~/domainpolicy_v2.def
+
+macro		DOMAIN_POLICY_V2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy97.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,62 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "domainpolicytest.h"
+
+const TDmDomainSpec DomainHierarchy[] = 
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1		
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		TDM_DOMAIN_SPEC_END
+	};
+
+const TDmHierarchyPolicy HierarchyPolicy	= 
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+
+const SDmStateSpecV1 StateSpecification[] =
+	{
+	//    iState, 					iTimeoutMs, iDeferralLimit,	iFailurePolicy
+		{ EStartupCriticalStatic,	0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ EStartupCriticalDynamic,	0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ EStartupNonCritical,		0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ ENormalRunning,			0,	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 }, 
+		{ EBackupMode,				0, 			0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ ERestoreMode,				0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ EShutdownCritical,		0, 			0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ EShutdownNonCritical,		0, 			0, 				ETransitionFailureUsePolicyFromOrdinal3 }
+	};
+
+
+const TUint StateSpecificationSize = sizeof(StateSpecification)/sizeof(SDmStateSpecV1);
+const TInt StateSpecificationVersion = KSDmStateSpecV1;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy97.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/domainpolicy97.mmp
+// domainpolicy97.dll Test Domain manager policy module
+//
+//
+
+TARGET		domainpolicy97.dll
+
+#include	"domainpolicydll.mmh"
+
+source		domainpolicy97.cpp
+
+deffile     	../../../userlibandfileserver/domainmgr/~/domainpolicy_v2.def
+
+macro		DOMAIN_POLICY_V2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy98.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,64 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "domainpolicytest.h"
+
+const TInt KDomainTimeoutShort = 1500000; /* 1500ms */
+
+const TDmDomainSpec DomainHierarchy[] =
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeoutShort	},
+
+		// row 1
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeoutShort	},
+
+		// end of array marker
+		TDM_DOMAIN_SPEC_END
+	};
+
+const TDmHierarchyPolicy HierarchyPolicy	=
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+
+
+const SDmStateSpecV1 StateSpecification[] =
+	{
+	//    iState, 					iTimeoutMs, iDeferralLimit,	iFailurePolicy
+		{ EStartupCriticalStatic,	0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ EStartupCriticalDynamic,	0, 	 		0, 				ETransitionFailureStop },
+		{ EStartupNonCritical,		0, 	 		0, 				ETransitionFailureUsePolicyFromOrdinal3 },
+		{ ENormalRunning,			0,	 		0, 				ETransitionFailureContinue },
+		{ EBackupMode,				3000, 		1, 				ETransitionFailureStop },
+		{ ERestoreMode,				150, 		3, 				ETransitionFailureStop },
+		{ EShutdownCritical,		3000, 		5, 				ETransitionFailureStop },
+		{ EShutdownNonCritical,		3000, 		1, 				ETransitionFailureContinue }
+	};
+
+const TUint StateSpecificationSize = sizeof(StateSpecification)/sizeof(SDmStateSpecV1);
+const TInt StateSpecificationVersion = KSDmStateSpecV1;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy98.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/domainpolicy98.mmp
+// domainpolicy98.dll Test Domain manager policy module
+//
+//
+
+TARGET		domainpolicy98.dll
+
+#include	"domainpolicydll.mmh"
+
+source		domainpolicy98.cpp
+
+deffile     	../../../userlibandfileserver/domainmgr/~/domainpolicy_v2.def
+
+macro		DOMAIN_POLICY_V2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicy99.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "domainpolicytest.h"
+
+
+
+const TDmDomainSpec DomainHierarchy[] = 
+	{
+		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 1		
+		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// row 2
+		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		
+		// row 3
+		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
+
+		// end of array marker
+		TDM_DOMAIN_SPEC_END
+	};
+
+const TDmHierarchyPolicy HierarchyPolicy	= 
+	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
+	
+
--- a/kerneltest/e32test/domainmgr/domainpolicy99.mmp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/domainpolicy99.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -13,33 +13,16 @@
 // Description:
 // e32test/domainmgr/domainpolicy99.mmp
 // domainpolicy99.dll Test Domain manager policy module
-// 
+//
 //
 
-/**
- @file
-*/
+TARGET		domainpolicy99.dll
+
+#include	"domainpolicydll.mmh"
+
+source		domainpolicy99.cpp
+
+deffile	   	../../../userlibandfileserver/domainmgr/~/domainpolicy.def
 
 
-TARGET          domainpolicy99.dll
-CAPABILITY PowerMgmt ProtServ DiskAdmin
-TARGETTYPE      dll
 
-userinclude		.
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-sourcepath	.
-source		domainpolicytest.cpp
-
-library		euser.lib
-
-
-START WINS
-END
-
-START MARM
-END
-
-VENDORID 0x70000001
-
-SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/domainpolicydll.mmh	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/domainpolicydll.mmh
+//
+
+TARGETTYPE	dll
+
+userinclude	.
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+sourcepath	.
+source		domainpolicytest.cpp
+
+library		euser.lib
+
+CAPABILITY 	PowerMgmt ProtServ DiskAdmin
+
+VENDORID	0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/domainmgr/domainpolicytest.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/domainpolicytest.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -16,35 +16,6 @@
 #include <domainpolicy.h>
 #include "domainpolicytest.h"
 
-const TInt KDomainTimeout = 2000000; /* 2000ms */
-
-static const TDmDomainSpec DomainHierarchy[] = 
-	{
-		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),		EStartupCriticalStatic,	KDomainTimeout	},
-
-		// row 1		
-		{ KDmIdTestA,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestB,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestC,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-
-		// row 2
-		{ KDmIdTestAA,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestAB,	KDmIdTestA,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestBA,	KDmIdTestB,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestCA,	KDmIdTestC,	_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		
-		// row 3
-		{ KDmIdTestABA,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestABB,	KDmIdTestAB,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-		{ KDmIdTestCAA,	KDmIdTestCA,_INIT_SECURITY_POLICY_PASS,									EStartupCriticalStatic,	KDomainTimeout	},
-
-		// end of array marker
-		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0,	0	}
-	};
-static const TDmHierarchyPolicy HierarchyPolicy	= 
-	{ETraverseParentsFirst, ETraverseChildrenFirst, ETransitionFailureStop};
-	
-
 
 /**
 Gets access to the test hierarchy specification.
@@ -58,12 +29,10 @@
 */
 EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
 	{
-	return (TDmDomainSpec*) DomainHierarchy;
+	return DomainHierarchy;
 	}
 
 
-
-
 /**
 Releases access to the specified domain hierarchy specification.
 
@@ -82,12 +51,12 @@
 
 
 /**
-Retrieves the domain hierarchy policy 
+Retrieves the domain hierarchy policy
 
 @param	aPolicy a client-supplied policy which on exit
 		will contain a copy of the policy for the requested domain hierarchy id.
 
-  
+
 @return	KErrNone
 */
 EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
@@ -96,3 +65,24 @@
 	return KErrNone;
 	}
 
+
+#ifdef DOMAIN_POLICY_V2
+
+EXPORT_C TInt DmPolicy::GetStateSpec(TAny*& aPtr, TUint& aNumElements)
+	{
+	aNumElements = StateSpecificationSize;
+	if (StateSpecificationSize)
+		aPtr = (TAny*) StateSpecification;
+	else
+		aPtr = NULL;
+	return StateSpecificationVersion;
+	}
+
+
+EXPORT_C void DmPolicy::ReleaseStateSpec(TAny* /*aStateSpec*/)
+	{
+	}
+
+#endif
+
+
--- a/kerneltest/e32test/domainmgr/domainpolicytest.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/domainpolicytest.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -16,18 +16,39 @@
 #ifndef __DOMAIN_POLICY_TEST_H__
 #define __DOMAIN_POLICY_TEST_H__
 
-// The test domain hierarchy id 
+#include <domainpolicy.h>
 
+// Policy Domain Timeout
+const TInt KDomainTimeout = 2000000; /* 2000ms */
+
+// The original test domain hierarchy id
 static const TDmHierarchyId	KDmHierarchyIdTest = 99;
 
+// The test domain hierarchy Id for V2 policy with V2 features enabled
+static const TDmHierarchyId	KDmHierarchyIdTestV2 = 98;
+
+// The original test domain hierarchy id but as a V2 policy with V1 functionality
+static const TDmHierarchyId	KDmHierarchyIdTestV2_97 = 97;
+
+// The original test domain hierarchy id but as a V2 policy with V1 functionality, null state spec
+static const TDmHierarchyId	KDmHierarchyIdTestV2_96 = 96;
+
+//  The test domain hierarchy Id for V2 policy with V2 features enabled but botched
+static const TDmHierarchyId	KDmHierarchyIdTestV2_95 = 95;
+
+//  The test domain hierarchy Id for V2 policy with V2 features enabled but botched
+static const TDmHierarchyId	KDmHierarchyIdTestV2_94 = 94;
+
+
 /*
-Domains defined in this hiearchy
+Domains defined in this hierarchy.
 The hierarchy desribed here looks like this:
 		Root
 		A				B				C
 		AA	AB			BA				CA
 			ABA	ABB						CAA
-
+			
+This hierarchy is used in V1 and V2 policies. 
 */
 static const TDmDomainId	KDmIdTestA		= 0x02;
 static const TDmDomainId	KDmIdTestB		= 0x03;
@@ -41,33 +62,67 @@
 static const TDmDomainId	KDmIdTestABA	= 0x09;
 static const TDmDomainId	KDmIdTestABB	= 0x0A;
 static const TDmDomainId	KDmIdTestCAA	= 0x0B;
+
 static const TInt KTestDomains = 0x0B;	// number of domains including root
 
 
 /*
-System-wide start-up states
+Simulated system-wide states for test purposes.
 
-Some of these states may be ommitted depending on the start-up mode.
-E.g. The system-starter might choose to omit EStartupNonCritical in "safe" mode
+The typical state transitions expected in this model:
+	EStartupCriticalStatic 	-> EStartupCriticalDynamic
+	EStartupCriticalDynamic -> EStartupNonCritical
+	EStartupNonCritical 	-> ENormalRunning
+	ENormalRunning 			-> EBackupMode
+	EBackupMode				-> ENormalRunning
+	ENormalRunning			-> EShutdownCritical
+	EShutdownCritical 		-> EShutdownNonCritical
+
+However, that does not stop tests from transition from/to any state as required
+for test cases. Further states can be added through numbering e.g. EBackupMode1
+if required.
 */
-enum TStartupState
+enum TSystemState
 	{
-	/** In this state, all ROM based (static) components or resources that 
-	are critical to the operation of the phone are started */
+	/** Device starting up initialising ROM based components/resources */
 	EStartupCriticalStatic,
 
-	/** In this state, all non-ROM based (dynamic) components or resources that 
-	are critical to the operation of the phone are started */
+	/** Device continuing start up initisliaing non-ROM based components/resoruces */
 	EStartupCriticalDynamic,
 
-	/** In this state, all ROM based (static) or non-ROM based (dynamic) 
-	components or resources that are not critical to the operation of the phone 
-	are started */
+	/** Device continues start up initialising non-critical components/resoruces */
 	EStartupNonCritical,
+	
+	/** Device running normally */
+	ENormalRunning,
+		
+	/** Device about to start system wide backup operation */
+	EBackupMode,
 
-	/** An integer that is strictly greater thean any legal start-up state value */
-	EStartupLimit
+	/** Device about to start system wide restore operation */
+	ERestoreMode,
+
+	/** Device starting shutdown perform critical shutdown actions */
+	EShutdownCritical,
+
+	/** Device performing non-critical shutdown actions */
+	EShutdownNonCritical,
+
+
+	/** An integer that is strictly greater than any legal system state value */
+	ESystemStateLimit
 	};
 
+
+// Externs for test policy data
+
+extern const TDmDomainSpec DomainHierarchy[];
+extern const TDmHierarchyPolicy HierarchyPolicy;
+
+extern const SDmStateSpecV1 StateSpecification[];
+extern const TUint StateSpecificationSize;
+extern const TInt StateSpecificationVersion;
+
 #endif
 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_dmslave_nocaps.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,70 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_dmslave_nocaps.cpp
+//
+//
+
+#include <e32test.h>
+#include <domainmember.h>
+
+#include "domainpolicytest.h"
+
+
+RTest test(_L(" T_DMSLAVE_NOCAPS "));
+
+
+GLDEF_C TInt E32Main()
+	{
+	test.Title();
+	test.Start(_L("Call DeferAcknowledgement() without any capabilities"));
+
+	// Steps 1. & 2. are in the parent process
+
+	// 3. Connect to domain
+	RDmDomain domain;
+	TInt r = domain.Connect(KDmHierarchyIdTestV2, KDmIdTestA);
+	test(r == KErrNone);
+
+	// 4. Request transition notification
+	TRequestStatus status;
+	test.Printf(_L("Requesting transition notification"));
+	domain.RequestTransitionNotification(status);
+
+	// Tell parent we're done
+	RProcess().Rendezvous(KErrNone);
+
+	// Step 5. is in the parent process
+
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+
+	// 6. Try to defer acknowledgement (this is the sole purpose of this test)
+	const TInt expected_result =
+		(PlatSec::IsCapabilityEnforced(ECapabilityWriteDeviceData) &&
+		 PlatSec::IsCapabilityEnforced(ECapabilityProtServ)) ?
+		KErrPermissionDenied : KErrNone;
+
+	test.Printf(_L("Requesting acknowledgement deferral\n"));
+	domain.DeferAcknowledgement(status);
+	User::WaitForRequest(status);
+	test(status.Int() == expected_result);
+
+	// 7. Acknowledge
+	test.Printf(_L("Acknowledging last state\n"));
+	domain.AcknowledgeLastState();
+
+	test.End();
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_dmslave_nocaps.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_dmslave_nocaps.mmp
+// 
+//
+
+TARGET			t_dmslave_nocaps.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_dmslave_nocaps.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		../../../userlibandfileserver/domainmgr/inc
+
+CAPABILITY		None
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_dmslave_onecap.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,65 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_dmslave_onecap.cpp
+//
+//
+
+#include <e32test.h>
+#include <domainmember.h>
+
+#include "domainpolicytest.h"
+
+
+RTest test(_L(" T_DMSLAVE_ONECAP "));
+
+
+GLDEF_C TInt E32Main()
+	{
+	test.Title();
+	test.Start(_L("Call DeferAcknowledgement() with one capability"));
+
+	// Steps 1. & 2. are in the parent process
+
+	// 3. Connect to domain
+	RDmDomain domain;
+	TInt r = domain.Connect(KDmHierarchyIdTestV2, KDmIdTestA);
+	test(r == KErrNone);
+
+	// 4. Request transition notification
+	TRequestStatus status;
+	test.Printf(_L("Requesting transition notification"));
+	domain.RequestTransitionNotification(status);
+
+	// Tell parent we're done
+	RProcess().Rendezvous(KErrNone);
+
+	// Step 5. is in the parent process
+
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+
+	// 6. Try to defer acknowledgement (this is the sole purpose of this test)
+	test.Printf(_L("Requesting acknowledgement deferral\n"));
+	domain.DeferAcknowledgement(status);
+	User::WaitForRequest(status);
+	test(status.Int() == KErrNone);
+
+	// 7. Acknowledge
+	test.Printf(_L("Acknowledging last state\n"));
+	domain.AcknowledgeLastState();
+
+	test.End();
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_dmslave_protsrv.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_dmslave_protsrv.mmp
+// 
+//
+
+TARGET			t_dmslave_protsrv.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_dmslave_onecap.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		../../../userlibandfileserver/domainmgr/inc
+
+CAPABILITY		ProtServ
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_dmslave_wdd.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_dmslave_wdd.mmp
+// 
+//
+
+TARGET			t_dmslave_wdd.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_dmslave_onecap.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		../../../userlibandfileserver/domainmgr/inc
+
+CAPABILITY		WriteDeviceData
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/domainmgr/t_domain.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/t_domain.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -11,7 +11,7 @@
 // Contributors:
 //
 // Description:
-// e32test\power\t_domain.cpp
+// e32test/domainmgr/t_domain.cpp
 // Overview:
 // Domain manager tests
 // API Information:
@@ -51,321 +51,27 @@
 // 
 //
 
+#define __E32TEST_EXTENSION__
 #include <e32test.h>
-#include <domainmember.h>
-#include <domainmanager.h>
-#include <domainobserver.h>
-#include "domainpolicytest.h"
 #include <e32debug.h>
-#include <f32file.h>
-#include <e32ldr.h>
 #include <e32ldr_private.h>
+#include <domainobserver.h>
 
-LOCAL_D RTest test(_L(" T_DOMAIN "));
+#include "domainpolicytest.h"
+#include "t_domain.h"
+
+
+RTest test(_L(" T_DOMAIN "));
 _LIT(KThreadName, "t_domain_panic_thread");
 
+TDmHierarchyId GHierarchyIdUnderTest = 0;
+
 #ifdef _DEBUG
 #define __PRINT(x) {RDebug::Print x;}
 #else
 #define __PRINT(x) 
 #endif
 
-class CDmTestMember;
-
-// interface for test domain memebers.
-// Any test memeber should derive from this interface 
-class MDmDomainMember
-	{
-public:
-	virtual TDmHierarchyId HierarchyId() = 0;
-	virtual TDmDomainId	DomainId() = 0;
-	virtual TDmDomainState State() = 0;
-	virtual TInt Status() = 0;
-	virtual TUint32 Ordinal() = 0;
-	virtual TInt Notifications() = 0;
-	};
-
-class MDmTest
-	{
-public:
-	virtual void Perform() = 0;
-	virtual void Release() = 0;
-	virtual TInt TransitionNotification(MDmDomainMember& aDomainMember) = 0;
-	virtual void TransitionRequestComplete() = 0;
-	};
-
-// for the test hierarchy, we generate an ordinal for each domain
-// each byte of which describes the exact location of the domain in the hierarchy
-#define ORDINAL_FROM_DOMAINID0(id) (id)
-#define ORDINAL_FROM_DOMAINID1(parent, id) ((parent << 8) | (id))
-#define ORDINAL_FROM_DOMAINID2(grandparent, parent, id) ((grandparent << 16) | (parent << 8) | id)
-#define ORDINAL_FROM_DOMAINID3(greatgrandparent, grandparent, parent, id) ((greatgrandparent << 24) | (grandparent << 16) | (parent << 8) | id)
-#define PARENT_ORDINAL(id) (id >> 8)
-
-#define ORDINAL_LEVEL(ordinal)			\
-	((ordinal & 0xFF00) == 0) ? 1 :			\
-	((ordinal & 0xFF0000) == 0) ? 2 :		\
-	((ordinal & 0xFF000000) == 0) ? 3 : 4;
-
-
-// get the least significant domain id character (for debugging purposes)
-TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar)
-	{
-	TBool found = ETrue;
-	switch(aDomainId)
-		{
-		
-		case KDmIdTestA:	aChar = 'A'; break;
-		case KDmIdTestB:	aChar = 'B'; break;
-		case KDmIdTestC:	aChar = 'C'; break;
-		case KDmIdTestAA:	aChar = 'A'; break;
-		case KDmIdTestAB:	aChar = 'B'; break;
-		case KDmIdTestBA:	aChar = 'A'; break;
-		case KDmIdTestCA:	aChar = 'A'; break;
-		case KDmIdTestABA:	aChar = 'A'; break;
-		case KDmIdTestABB:	aChar = 'B'; break;
-		case KDmIdTestCAA:	aChar = 'A'; break;
-		// domain char not found 
-		case KDmIdNone:
-		case KDmIdRoot:		
-		default:			
-			found = EFalse;
-		}
-	return found;
-	}
-
-// prints the 4-character domain string into the passed descriptor (for debugging purposes)
-// e.g. "CAA" for KDmIdTestCAA
-void GetDomainDesc(TUint32 aOrdinal, TDes& aDes)
-	{
-	if (aOrdinal == KDmIdRoot)
-		{
-		aDes.Append(_L("root"));
-		return;
-		}
-
-	TUint32 val =  aOrdinal;
-
-	for (TInt n=0; n<4; n++)
-		{
-		TDmDomainId domainId = (TDmDomainId) (val >> 24);
-		TChar ch;
-		TBool found = GetDomainChar(domainId, ch);
-		if (found)
-			aDes.Append(ch);
-		val = val << 8;
-		}
-
-	}
-
-
-class CDmTestMember : public CActive, public MDmDomainMember
-	{
-public:	
-	// from CActive
-	void RunL();
-	// from MDmDomainMember
-	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
-	inline TDmDomainId	DomainId() {return iId;};
-	inline TDmDomainState State() {return iState;};
-	inline TInt Status() {return iStatus.Int();};
-	inline TUint32 Ordinal() {return iOrdinal;};
-	inline TInt Notifications() {return iNotifications;};
-
-	CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-	~CDmTestMember();
-	void Acknowledge();
-
-protected:
-	// from CActive
-	virtual void DoCancel();
-
-
-public:
-	TDmHierarchyId iHierarchy;
-	TDmDomainId	iId;
-	TDmDomainState iState;
-	TUint32		iOrdinal;
-	MDmTest*	iTest;	
-	TInt		iNotifications;
-	RDmDomain	iDomain;
-	};
-
-
-
-CDmTestMember::CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : CActive(CActive::EPriorityStandard), 
-	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
-	{
-	TInt r;
-
-	if (iHierarchy == KDmHierarchyIdPower)
-		 r = iDomain.Connect(iId);
-	else
-		 r = iDomain.Connect(iHierarchy, iId);
-
-	test(r == KErrNone);
-
-	CActiveScheduler::Add(this);
-
-	iDomain.RequestTransitionNotification(CActive::iStatus);
-	CActive::SetActive();
-	}
-
-CDmTestMember::~CDmTestMember()
-	{
-	CActive::Cancel();
-	iDomain.Close();
-	}
-
-void CDmTestMember::Acknowledge()
-	{
-	iDomain.AcknowledgeLastState();
-	}
-
-void CDmTestMember::RunL()
-	{
-
-	iNotifications++;
-
-	iState = iDomain.GetState();
-
-	TInt ackError = iTest->TransitionNotification(*this);
-	if (ackError == KErrNone)
-		iDomain.AcknowledgeLastState();
-	else if (ackError == KErrAbort)	// don't acknowledge
-		;
-	else
-		iDomain.AcknowledgeLastState(ackError);
-
-	
-	// request another notification (even if we didn't acknowledge the last one)
-	iDomain.RequestTransitionNotification(CActive::iStatus);
-	CActive::SetActive();
-	}
-
-void CDmTestMember::DoCancel()
-	{
-	iDomain.CancelTransitionNotification();
-	}
-
-
-// CDomainMemberAo
-class CDomainMemberAo : public CDmDomain, public MDmDomainMember
-	{
-public:	
-	static CDomainMemberAo* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-	~CDomainMemberAo();
-
-	// from CActive
-	void RunL();
-
-	// from MDmDomainMember
-	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
-	inline TDmDomainId	DomainId() {return iId;};
-	inline TDmDomainState State() {return iState;};
-	inline TInt Status() {return iStatus.Int();};
-	inline TUint32 Ordinal() {return iOrdinal;};
-	inline TInt Notifications() {return iNotifications;};
-
-private:
-	CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
-
-public:
-	TDmHierarchyId iHierarchy;
-	TDmDomainId	iId;
-	TDmDomainState iState;
-	TUint32		iOrdinal;
-	MDmTest*	iTest;	
-	TInt		iNotifications;
-	};
-
-CDomainMemberAo* CDomainMemberAo::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest)
-	{
-	CDomainMemberAo* self=new (ELeave) CDomainMemberAo(aHierarchy, aId, aOrdinal, aTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-
-	self->RequestTransitionNotification();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-CDomainMemberAo::CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest* aTest) : 
-	CDmDomain(aHierarchy, aId), 
-	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
-	{
-	}
-
-CDomainMemberAo::~CDomainMemberAo()
-	{
-	Cancel();
-	}
-
-void CDomainMemberAo::RunL()
-	{
-	iNotifications++;
-
-	iState = GetState();
-
-	TInt ackError = iTest->TransitionNotification(*this);
-	if (ackError == KErrNone)
-		AcknowledgeLastState(ackError);
-	else if (ackError == KErrAbort)	// don't acknowledge
-		;
-	else
-		AcknowledgeLastState(ackError); 
-	if (ackError != KErrAbort)	
-		AcknowledgeLastState(ackError);
-
-	
-	// request another notification (even if we didn't acknowledge the last one)
-	RequestTransitionNotification();
-	}
-
-
-// CDomainManagerAo
-class CDomainManagerAo : public CDmDomainManager
-	{
-public:	
-	~CDomainManagerAo();
-	static CDomainManagerAo* NewL(TDmHierarchyId aHierarchy, MDmTest& aTest);
-
-	// from CActive
-	void RunL();
-
-private:
-	CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest);
-
-private:
-	MDmTest& iTest;
-	};
-
-
-CDomainManagerAo* CDomainManagerAo::NewL(TDmHierarchyId aHierarchy, MDmTest& aTest)
-	{
-	CDomainManagerAo* self=new (ELeave) CDomainManagerAo(aHierarchy, aTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-CDomainManagerAo::CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest) : 
-	CDmDomainManager(aHierarchy), iTest(aTest)
-	{
-	}
-
-CDomainManagerAo::~CDomainManagerAo()
-	{
-	}
-
-void CDomainManagerAo::RunL()
-	{
-	iTest.TransitionRequestComplete();
-	}
-
 
 class CDmTest1 : public CActive, public MDmTest
 	{
@@ -889,7 +595,7 @@
 	//
 	CActiveScheduler::Add(this);
 
-	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
+	TInt r = RDmDomainManager::AddDomainHierarchy(GHierarchyIdUnderTest);
 
     RDebug::Printf("RDmDomainManager::AddDomainHierarchy returns %d", r );
 
@@ -912,35 +618,35 @@
 	TInt testMemberCount = 0;
 
 	// Add some test hierarchy members - these use the RDmDomain API
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this);
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row 1
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this);
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row2
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this);
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row 3
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this);
 	test(iTestMembers[testMemberCount++] != NULL);
-	iTestMembers[testMemberCount] = new CDmTestMember(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this);
+	iTestMembers[testMemberCount] = new CDmTestMember(GHierarchyIdUnderTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this);
 	test(iTestMembers[testMemberCount++] != NULL);
 
 	// add some power hierarchy members - these use the CDmDomain AO API
@@ -1001,12 +707,12 @@
 
 
 	// connect to the test hierarchy
-	r = iTestDomainManager.Connect(KDmHierarchyIdTest);
+	r = iTestDomainManager.Connect(GHierarchyIdUnderTest);
 	test(r == KErrNone);
 
 	// verify that we can't connect to the same hierarchy more than once
 	RDmDomainManager	domainManager;
-	r = domainManager.Connect(KDmHierarchyIdTest);
+	r = domainManager.Connect(GHierarchyIdUnderTest);
 	test(r == KErrInUse);
 
 
@@ -1045,7 +751,7 @@
 	//*************************************************
 	test.Next(_L("Test 5c- verify domains are in correct state"));
 	RDmDomain domainMember;
-	r = domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	r = domainMember.Connect(GHierarchyIdUnderTest, iTestDomainId);
 	test (r == KErrNone);
 	TDmDomainState state = domainMember.GetState();
 	domainMember.Close();
@@ -1055,7 +761,7 @@
 	// the root domain and the transition domain are in different states
 	if (iTestDomainId != KDmIdRoot && iTestState != EStartupCriticalStatic)
 		{
-		r = domainMember.Connect(KDmHierarchyIdTest, KDmIdRoot);
+		r = domainMember.Connect(GHierarchyIdUnderTest, KDmIdRoot);
 		test (r == KErrNone);
 		TDmDomainState state = domainMember.GetState();
 		domainMember.Close();
@@ -1097,6 +803,9 @@
 	//*************************************************
 	// Test 5e- request a positive transition, with zero acknowledgements
 	// issue a positive transition with no members acknowledging the transition
+	// Expect timeout from server
+	// Also covers Testcase 2.3.2 from Transition Monitoring test suite when
+	// policy used in 96 or 97.
 	//*************************************************
 	test.Next(_L("Test 5e- request a positive transition, with zero acknowledgements"));
 	iAckMode = KAckNever;
@@ -1267,7 +976,7 @@
 	test(status.Int() == KErrNone);
 	manager.Close();
 	
-	r = manager.Connect(KDmHierarchyIdTest);
+	r = manager.Connect(GHierarchyIdUnderTest);
 	test (r == KErrNone);
 	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
 	test(status.Int() == KRequestPending);
@@ -1299,7 +1008,7 @@
 			aDomainMember.HierarchyId(), aDomainMember.Ordinal(), aDomainMember.State(), aDomainMember.Status()));
 		test(aDomainMember.State() == iPowerState);
 		}
-	else if (aDomainMember.HierarchyId() == KDmHierarchyIdTest)
+	else if (aDomainMember.HierarchyId() == GHierarchyIdUnderTest)
 		{
 		TBuf16<4> buf;
 		GetDomainDesc(aDomainMember.Ordinal(), buf);
@@ -1319,7 +1028,7 @@
 
 	CDmTestMember** mp;
 
-	if (aDomainMember.HierarchyId() == KDmHierarchyIdTest && iAckMode == KAckAlways)
+	if (aDomainMember.HierarchyId() == GHierarchyIdUnderTest && iAckMode == KAckAlways)
 		{
 
 		if (iTraverseDirection == ETraverseParentsFirst)
@@ -1499,7 +1208,7 @@
 			{
 			RDmDomainManager manager;
 			TRequestStatus status;
-			TInt r = manager.Connect(KDmHierarchyIdTest);
+			TInt r = manager.Connect(GHierarchyIdUnderTest);
 			test(r == KErrNone);
 
 			User::SetJustInTime(EFalse);
@@ -1571,10 +1280,10 @@
 	CActiveScheduler::Add(this);
 
 	CDomainManagerAo* iTestDomainManager = NULL;
-	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(GHierarchyIdUnderTest, *this));
 	test (iTestDomainManager != NULL);
 
-	TInt r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
+	TInt r = CDomainManagerAo::AddDomainHierarchy(GHierarchyIdUnderTest);
 	test(r == KErrNone);
 
 	//*************************************************
@@ -1584,7 +1293,7 @@
 
 	// verify that we can't connect to the same hierarchy more than once
 	CDomainManagerAo* testDomainManager = NULL;
-	TRAP(r, testDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	TRAP(r, testDomainManager = CDomainManagerAo::NewL(GHierarchyIdUnderTest, *this));
 	test(r == KErrInUse);
 	test (testDomainManager == NULL);
 
@@ -1592,35 +1301,35 @@
 	TInt testMemberCount = 0;
 
 	// Add some test hierarchy members
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row 1
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row2
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row 3
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 
 
@@ -1651,7 +1360,7 @@
 	test.Next(_L("Test 6c cancel a member notification request"));
 	RDmDomain domainMember;
 	TRequestStatus status;
-	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	domainMember.Connect(GHierarchyIdUnderTest, iTestDomainId);
 	domainMember.RequestTransitionNotification(status);
 	domainMember.CancelTransitionNotification();
 	User::WaitForRequest(status);
@@ -1661,7 +1370,7 @@
 	// Test 6d cancel a member notification request without having first requested a notification
 	//*************************************************
 	test.Next(_L("Test 6d cancel a member notification request without having first requested a notification"));
-	domainMember.Connect(KDmHierarchyIdTest, iTestDomainId);
+	domainMember.Connect(GHierarchyIdUnderTest, iTestDomainId);
 	domainMember.CancelTransitionNotification();
 	domainMember.Close();
 
@@ -1683,7 +1392,7 @@
 	// Test 6g domain member connects to valid hierarchy but invalid domain
 	//*************************************************
 	test.Next(_L("Test 6g domain member connects to valid hierarchy but invalid domain"));
-	r = domainMember.Connect(KDmHierarchyIdTest, TDmDomainId(-1));
+	r = domainMember.Connect(GHierarchyIdUnderTest, TDmDomainId(-1));
 	test (r == KDmErrBadDomainId);
 
 	delete iTestDomainManager;
@@ -1726,7 +1435,7 @@
 		
 	iTestNotifications++;
 
-	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
+	test (aDomainMember.HierarchyId() == GHierarchyIdUnderTest);
 
 	TBuf16<4> buf;
 	GetDomainDesc(aDomainMember.Ordinal(), buf);
@@ -1849,14 +1558,14 @@
 	//
 	CActiveScheduler::Add(this);
 
-	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTest);
+	TInt r = RDmDomainManager::AddDomainHierarchy(GHierarchyIdUnderTest);
 	test(r == KErrNone);
 
 	CDomainManagerAo* iTestDomainManager = NULL;
-	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(KDmHierarchyIdTest, *this));
+	TRAP_IGNORE(iTestDomainManager = CDomainManagerAo::NewL(GHierarchyIdUnderTest, *this));
 	test (iTestDomainManager != NULL);
 
-	r = CDomainManagerAo::AddDomainHierarchy(KDmHierarchyIdTest);
+	r = CDomainManagerAo::AddDomainHierarchy(GHierarchyIdUnderTest);
 	test(r == KErrNone);
 
 	//*************************************************
@@ -1868,38 +1577,38 @@
 	TInt testMemberCount = 0;
 
 	// Add some test hierarchy members
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row 1
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row2
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 	
 	// row 3
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), this));
 	test(iTestMembers[testMemberCount++] != NULL);
-	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(KDmHierarchyIdTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
+	TRAP(r, iTestMembers[testMemberCount] = CDomainMemberAo::NewL(GHierarchyIdUnderTest, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), this));
 	test(iTestMembers[testMemberCount++] != NULL);
 
 	// create an observer
 	CHierarchyObserver* observer = NULL;
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, GHierarchyIdUnderTest));
 	test (r == KErrNone);
 	test(observer != NULL);
 	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
@@ -1938,7 +1647,7 @@
 	test.Next(_L("Test 7b - start & stop the observer"));
 
 	// create an observer, start it stop and then start it again
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, GHierarchyIdUnderTest));
 	test (r == KErrNone);
 	test(observer != NULL);
 	observer->StartObserver(iObservedDomainId, EDmNotifyAll);
@@ -2033,7 +1742,7 @@
 	
 	
 	test.Printf(_L("Test 7c.2 - Starting the observer with wrong domain Id\n"));
-	TRAP(r, observer = CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	TRAP(r, observer = CHierarchyObserver::NewL(*this, GHierarchyIdUnderTest));
 	test (r == KErrNone);
 	test(observer != NULL);
 
@@ -2043,7 +1752,7 @@
 	test(r==KDmErrBadDomainId);
 
 	test.Printf(_L("Test 7c.3 - Trying to create second observer on the same hierarchy\n"));
-	TRAP(r, CHierarchyObserver::NewL(*this, KDmHierarchyIdTest));
+	TRAP(r, CHierarchyObserver::NewL(*this, GHierarchyIdUnderTest));
 	test (r == KDmErrBadSequence);
 
 	
@@ -2082,7 +1791,7 @@
 	{
 	RDmDomainManager manager;
 	TRequestStatus status;
-	TInt r = manager.Connect(KDmHierarchyIdTest);
+	TInt r = manager.Connect(GHierarchyIdUnderTest);
 	test (r == KErrNone);
 	manager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
 	User::WaitForRequest(status);
@@ -2099,7 +1808,7 @@
 		
 	iTestNotifications++;
 
-	test (aDomainMember.HierarchyId() == KDmHierarchyIdTest);
+	test (aDomainMember.HierarchyId() == GHierarchyIdUnderTest);
 
 	TBuf16<4> buf;
 	GetDomainDesc(aDomainMember.Ordinal(), buf);
@@ -2189,6 +1898,192 @@
 	TestForCompletion();
 	}
 
+
+/**
+   Increase code coverage, in particular get CPowerUpHandler::DoCancel()
+   called.
+*/
+class CDmPowerCoverageTest : public CActive, public MDmTest
+	{
+public:
+	CDmPowerCoverageTest();
+	~CDmPowerCoverageTest()
+		{
+		Cancel();
+		iManager.Close();
+		delete iMember;
+		}
+	// from CActive
+	void RunL();
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember&);
+	void TransitionRequestComplete()
+		{}
+private:
+	// from CActive
+	virtual void DoCancel()
+		{
+		test(0);
+		}
+private:
+	CDmTestMember* iMember;
+	RDmDomainManager iManager;
+	};
+
+
+CDmPowerCoverageTest::CDmPowerCoverageTest()
+	: CActive(CActive::EPriorityStandard)
+	{}
+
+
+void CDmPowerCoverageTest::RunL()
+	{
+	RDebug::Printf("CDmPowerCoverageTest::RunL(): %d", iStatus.Int());
+	CActiveScheduler::Stop();
+	}
+
+
+void CDmPowerCoverageTest::Perform()
+	{
+	test.Next(_L("CDmPowerCoverageTest"));
+
+	iMember = new CDmTestMember(KDmHierarchyIdPower, KDmIdApps, 0, this);
+	test(iMember != NULL);
+
+	TInt r = iManager.Connect();
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+	iManager.RequestSystemTransition(EPwStandby, iStatus);
+	iManager.CancelTransition();
+	CActive::SetActive();
+
+	CActiveScheduler::Start();
+	}
+
+
+TInt CDmPowerCoverageTest::TransitionNotification(MDmDomainMember&)
+	{
+	RDebug::Printf("CDmPowerCoverageTest::TransitionNotification()");
+	// Don't acknowledge
+	return KErrAbort;
+	}
+
+
+void CDmPowerCoverageTest::Release()
+	{
+	delete this;
+	}
+
+
+/**
+Test disconnecting domain controller from server whilst
+transition in progress
+*/
+class CDmTestDisconnect : public CBase, public MDmTest
+	{
+public:
+	~CDmTestDisconnect();
+
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {test(EFalse);}
+
+protected:
+	CDmTestMember*		iMember;
+	RDmDomainManager	iManager;
+	};
+
+CDmTestDisconnect::~CDmTestDisconnect()
+	{
+	delete iMember;
+	iManager.Close();
+	}
+
+void CDmTestDisconnect::Perform()
+	{
+	TInt r = RDmDomainManager::AddDomainHierarchy(GHierarchyIdUnderTest);
+	test_KErrNone(r);
+	test.Next(_L("Test disconnecting controller during transition"));
+	iMember = new (ELeave) CDmTestMember(GHierarchyIdUnderTest, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), this);
+	r = iManager.Connect(GHierarchyIdUnderTest);
+	test_KErrNone(r);
+
+	test_Equal(0, RThread().RequestCount());
+	TRequestStatus status;
+	iManager.RequestDomainTransition(KDmIdRoot, EStartupCriticalStatic, ETraverseDefault, status);
+	CActiveScheduler::Start();
+
+	// No User::WaitForRequest is used, since it is expected that
+	// the outstanding request will not be completed
+	test_Equal(0, RThread().RequestCount());
+	}
+
+TInt CDmTestDisconnect::TransitionNotification(MDmDomainMember&)
+	{
+	iManager.Close();
+	CActiveScheduler::Stop();
+	return KErrNone;
+	}
+
+void CDmTestDisconnect::Release()
+	{
+	delete this;
+	}
+
+void RunTests(TInt aIter)
+	{
+	while (aIter--)
+		{
+		MDmTest* tests[] = 
+			{
+			new CDmTestDisconnect(),
+			new CDmTest1(KDmIdRoot, EPwStandby),
+			new CDmTest1(KDmIdRoot, EPwOff),
+			new CDmTest1(KDmIdRoot, EPwActive),
+			new CDmTest1(KDmIdApps, EPwStandby),
+			new CDmTest1(KDmIdApps, EPwOff),
+			new CDmTest1(KDmIdApps, EPwActive),
+			new CDmTest1(KDmIdUiApps, EPwStandby),
+			new CDmTest1(KDmIdUiApps, EPwOff),
+			new CDmTest1(KDmIdUiApps, EPwActive),
+			new CDmTest2(EPwStandby),
+			new CDmTest3(),
+	
+			// platform security tests
+			new CDmTest4(),
+	
+			// PREQ810 tests :
+			// note that we use a fictitious power state to prevent any 
+			new CDmTest5(KDmIdRoot, KDmIdRoot, EPwActive+10, EStartupCriticalDynamic),
+			new CDmTest5(KDmIdUiApps, KDmIdTestAB, EPwActive+10, EStartupCriticalDynamic),
+	
+		    // negative tests
+			new CDmTest6(),
+	
+	
+			// observer tests
+	 		new CDmTest7(KDmIdTestA),
+			new CDmTest7(KDmIdRoot),
+			
+			// increase code coverage
+			new CDmPowerCoverageTest(),
+			};
+	
+		for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
+			{
+			test(tests[i] != NULL);
+			tests[i]->Perform();
+			tests[i]->Release();
+			}
+		}
+	}
+
+
 GLDEF_C TInt E32Main()
 	{
 	CTrapCleanup* trapHandler=CTrapCleanup::New();
@@ -2207,9 +2102,8 @@
 	//
 	// Perform the number of iterations specifed by the command line argument.
 	//
-	// If no arguments - perform two iterations
+	// If no arguments - perform one iteration
 	//
-//  TInt iter = 2;
     TInt iter = 1;
 
 	TInt len = User::CommandLineLength();
@@ -2233,57 +2127,27 @@
 		}
 
 	test.Title();
-	test.Start(_L("Testing"));
-
 	test.Printf(_L("Go for %d iterations\n"), iter);
 
 	// Remember the number of open handles. Just for a sanity check ....
 	TInt start_thc, start_phc;
 	RThread().HandleCount(start_phc, start_thc);
 
-	while (iter--)
-		{
-		MDmTest* tests[] = 
-			{
-			new CDmTest1(KDmIdRoot, EPwStandby),
-			new CDmTest1(KDmIdRoot, EPwOff),
-			new CDmTest1(KDmIdRoot, EPwActive),
-			new CDmTest1(KDmIdApps, EPwStandby),
-			new CDmTest1(KDmIdApps, EPwOff),
-			new CDmTest1(KDmIdApps, EPwActive),
-			new CDmTest1(KDmIdUiApps, EPwStandby),
-			new CDmTest1(KDmIdUiApps, EPwOff),
-			new CDmTest1(KDmIdUiApps, EPwActive),
-			new CDmTest2(EPwStandby),
-			new CDmTest3(),
-	
-			// platform security tests
-			new CDmTest4(),
 
-			// PREQ810 tests :
-			// note that we use a fictitious power state to prevent any 
-			new CDmTest5(KDmIdRoot, KDmIdRoot, EPwActive+10, EStartupCriticalDynamic),
-			new CDmTest5(KDmIdUiApps, KDmIdTestAB, EPwActive+10, EStartupCriticalDynamic),
-
-        // negative tests
-			new CDmTest6(),
-
+	test.Start(_L("Test run with original test Hierarchy"));	
+	GHierarchyIdUnderTest = KDmHierarchyIdTest;
+	RunTests(iter);
+	test.End();
+	
+	
+	test.Start(_L("Test run with original test Hierarchy as V2 policy"));	
+	GHierarchyIdUnderTest = KDmHierarchyIdTestV2_97;
+	RunTests(iter);
+	test.End();
 
-			// observer tests
-     		new CDmTest7(KDmIdTestA),
-			new CDmTest7(KDmIdRoot),
-			
-			};
-
-		for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
-			{
-			test(tests[i] != NULL);
-			tests[i]->Perform();
-			tests[i]->Release();
-			}
-
-		}
-
+	test.Start(_L("Test run with original test Hierarchy as V2 policy, but NULL state specification"));	
+	GHierarchyIdUnderTest = KDmHierarchyIdTestV2_96;
+	RunTests(iter);
 	test.End();
 
 	// Sanity check for open handles and for pending requests ...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain.h	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,227 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Framework headers for Domain Manager tests.
+//
+
+#ifndef __T_DOMAIN_H__
+#define __T_DOMAIN_H__
+
+#include <domainmember.h>
+
+#include "domainmanager_private.h"
+
+// for the test hierarchy, we generate an ordinal for each domain
+// each byte of which describes the exact location of the domain in the hierarchy
+
+#define ORDINAL_FROM_DOMAINID0(id) (id)
+#define ORDINAL_FROM_DOMAINID1(parent, id) ((parent << 8) | (id))
+#define ORDINAL_FROM_DOMAINID2(grandparent, parent, id) ((grandparent << 16) | (parent << 8) | id)
+#define ORDINAL_FROM_DOMAINID3(greatgrandparent, grandparent, parent, id) ((greatgrandparent << 24) | (grandparent << 16) | (parent << 8) | id)
+#define PARENT_ORDINAL(id) (id >> 8)
+
+#define ORDINAL_LEVEL(ordinal)			\
+	((ordinal & 0xFF00) == 0) ? 1 :			\
+	((ordinal & 0xFF0000) == 0) ? 2 :		\
+	((ordinal & 0xFF000000) == 0) ? 3 : 4;
+
+//
+// Interface for test domain memebers
+//
+
+// MDmDomainMember
+class MDmDomainMember
+	{
+public:
+	virtual TDmHierarchyId HierarchyId() = 0;
+	virtual TDmDomainId	DomainId() = 0;
+	virtual TDmDomainState State() = 0;
+	virtual TInt Status() = 0;
+	virtual TUint32 Ordinal() = 0;
+	virtual TInt Notifications() = 0;
+	};
+
+
+// MDmTest
+class MDmTest
+	{
+public:
+	virtual void Perform() = 0;
+	virtual void Release() = 0;
+	virtual TInt TransitionNotification(MDmDomainMember& aDomainMember) = 0;
+	virtual void TransitionRequestComplete() = 0;
+	};
+
+
+TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar);
+void GetDomainDesc(TUint32 aOrdinal, TDes& aDes);
+
+
+// CDmTestMember
+class CDmTestMember : public CActive, public MDmDomainMember
+	{
+public:
+	// from CActive
+	void RunL();
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+
+	CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+	~CDmTestMember();
+	void Acknowledge();
+
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+public:
+	TDmHierarchyId iHierarchy;
+	TDmDomainId	iId;
+	TDmDomainState iState;
+	TUint32		iOrdinal;
+	MDmTest*	iTest;
+	TInt		iNotifications;
+	RDmDomain	iDomain;
+	};
+
+
+// CDomainMemberAo
+class CDomainMemberAo : public CDmDomain, public MDmDomainMember
+	{
+public:
+	static CDomainMemberAo* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+	~CDomainMemberAo();
+
+	// from CActive
+	void RunL();
+
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+
+private:
+	CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDmTest*);
+
+public:
+	TDmHierarchyId iHierarchy;
+	TDmDomainId	iId;
+	TDmDomainState iState;
+	TUint32		iOrdinal;
+	MDmTest*	iTest;
+	TInt		iNotifications;
+	};
+
+
+// CDomainManagerAo
+class CDomainManagerAo : public CDmDomainManager
+	{
+public:
+	~CDomainManagerAo();
+	static CDomainManagerAo* NewL(TDmHierarchyId aHierarchy, MDmTest& aTest);
+
+	// from CActive
+	void RunL();
+
+private:
+	CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest);
+
+private:
+	MDmTest& iTest;
+	};
+
+
+//
+// Deferral tests
+//
+
+/**
+A base class for simple deferral tests
+*/
+class CDmDeferralTest : public CActive, public MDmTest
+	{
+public:
+	// from CActive
+	CDmDeferralTest(TDmHierarchyId aId, TDmDomainState aState);
+	~CDmDeferralTest();
+
+	void RunL();
+	void DoCancel();
+
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+
+	virtual void DoPerform() =0;
+
+protected:
+	CDmTestMember* iMember;
+	RDmDomainManager iManager;
+	TDmHierarchyId iHierarchyId;
+	TDmDomainState iState;
+	};
+
+/**
+Interface allowing test classes to be informed when a CTestKeepAlive has finished
+deferrals
+*/
+class MDeferringMember
+	{
+public:
+	virtual void HandleEndOfDeferrals(TInt aError) =0;
+	};
+
+/**
+This class is a test version of CDmKeepAlive.
+
+It will perform up to the number of defferals instructed.
+*/
+class CTestKeepAlive : public CActive
+	{
+public:
+	CTestKeepAlive(RDmDomain& aDomain);
+	~CTestKeepAlive();
+
+	void BeginDeferrals(MDeferringMember* aMember, TInt aDeferralCount);
+
+protected:
+	/**
+	Request deadline deferral for the last transition
+	notification
+	*/
+	void DeferAcknowledgement();
+
+	/**
+	Re-call DeferNotification()
+	up to count.
+	*/
+	void RunL();
+
+	void DoCancel();
+
+	RDmDomain& iDomain;
+
+	TInt iCount;
+	MDeferringMember* iDeferringMember;
+	};
+#endif	// __T_DOMAIN_H__
--- a/kerneltest/e32test/domainmgr/t_domain.mmp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/t_domain.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -18,10 +18,12 @@
 TARGET			t_domain.exe        
 TARGETTYPE		EXE
 SOURCEPATH		.
-SOURCE			t_domain.cpp
+SOURCE			t_domain.cpp t_domain_cmn.cpp
 LIBRARY			euser.lib domaincli.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
+USERINCLUDE		../../../userlibandfileserver/domainmgr/inc
+
 CAPABILITY		WriteDeviceData PowerMgmt
 
 VENDORID 0x70000001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_cmn.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,349 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Framework code for Domain Manager tests.
+//
+
+#include <e32base.h>
+#define __E32TEST_EXTENSION__
+#include <e32test.h>
+
+#include "domainpolicytest.h"
+#include "t_domain.h"
+
+
+extern RTest test;
+
+// get the least significant domain id character (for debugging purposes)
+TBool GetDomainChar(TDmDomainId aDomainId, TChar& aChar)
+	{
+	TBool found = ETrue;
+	switch(aDomainId)
+		{
+		case KDmIdTestA:	aChar = 'A'; break;
+		case KDmIdTestB:	aChar = 'B'; break;
+		case KDmIdTestC:	aChar = 'C'; break;
+		case KDmIdTestAA:	aChar = 'A'; break;
+		case KDmIdTestAB:	aChar = 'B'; break;
+		case KDmIdTestBA:	aChar = 'A'; break;
+		case KDmIdTestCA:	aChar = 'A'; break;
+		case KDmIdTestABA:	aChar = 'A'; break;
+		case KDmIdTestABB:	aChar = 'B'; break;
+		case KDmIdTestCAA:	aChar = 'A'; break;
+		// domain char not found
+		case KDmIdNone:
+		case KDmIdRoot:
+		default:
+			found = EFalse;
+		}
+	return found;
+	}
+
+
+// prints the 4-character domain string into the passed descriptor (for debugging purposes)
+// e.g. "CAA" for KDmIdTestCAA
+void GetDomainDesc(TUint32 aOrdinal, TDes& aDes)
+	{
+	if (aOrdinal == KDmIdRoot)
+		{
+		aDes.Append(_L("root"));
+		return;
+		}
+
+	TUint32 val =  aOrdinal;
+
+	for (TInt n=0; n<4; n++)
+		{
+		TDmDomainId domainId = (TDmDomainId) (val >> 24);
+		TChar ch;
+		TBool found = GetDomainChar(domainId, ch);
+		if (found)
+			aDes.Append(ch);
+		val = val << 8;
+		}
+	}
+
+
+CDmTestMember::CDmTestMember(TDmHierarchyId aHierarchy, TDmDomainId aId,
+							 TUint32 aOrdinal, MDmTest* aTest)
+  : CActive(CActive::EPriorityStandard),
+	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	TInt r;
+
+	if (iHierarchy == KDmHierarchyIdPower)
+		 r = iDomain.Connect(iId);
+	else
+		 r = iDomain.Connect(iHierarchy, iId);
+
+	test(r == KErrNone);
+
+	CActiveScheduler::Add(this);
+
+	iDomain.RequestTransitionNotification(CActive::iStatus);
+	CActive::SetActive();
+	}
+
+CDmTestMember::~CDmTestMember()
+	{
+	CActive::Cancel();
+	iDomain.Close();
+	}
+
+void CDmTestMember::Acknowledge()
+	{
+	iDomain.AcknowledgeLastState();
+	}
+
+void CDmTestMember::RunL()
+	{
+	RDebug::Printf("CDmTestMember::RunL(): %d", iStatus.Int());
+	iNotifications++;
+
+	if (iHierarchy == KDmHierarchyIdPower)
+		{
+		iState = (TDmDomainState) iDomain.GetPowerState();
+		}
+	else
+		{
+		iState = iDomain.GetState();
+		}
+		
+	TInt ackError = iTest->TransitionNotification(*this);
+	if (ackError == KErrNone)
+		{
+		iDomain.AcknowledgeLastState();
+		}
+	else if (ackError == KErrAbort)
+		{
+		; // don't acknowledge
+		}
+	else
+		{
+		iDomain.AcknowledgeLastState(ackError);
+		}
+	// request another notification (even if we didn't acknowledge the last one)
+	iDomain.RequestTransitionNotification(CActive::iStatus);
+	CActive::SetActive();
+	}
+
+void CDmTestMember::DoCancel()
+	{
+	iDomain.CancelTransitionNotification();
+	}
+
+
+CDomainMemberAo* CDomainMemberAo::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId,
+									   TUint32 aOrdinal, MDmTest* aTest)
+	{
+	CDomainMemberAo* self=new (ELeave) CDomainMemberAo(aHierarchy, aId, aOrdinal, aTest);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	self->RequestTransitionNotification();
+
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainMemberAo::CDomainMemberAo(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal,
+								 MDmTest* aTest)
+	: CDmDomain(aHierarchy, aId),
+	  iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	}
+
+CDomainMemberAo::~CDomainMemberAo()
+	{
+	Cancel();
+	}
+
+void CDomainMemberAo::RunL()
+	{
+	RDebug::Printf("CDomainMemberAo::RunL(): %d", iStatus.Int());
+	iNotifications++;
+
+	iState = GetState();
+
+	TInt ackError = iTest->TransitionNotification(*this);
+	if (ackError == KErrNone)
+		AcknowledgeLastState(ackError);
+	else if (ackError == KErrAbort)	// don't acknowledge
+		;
+	else
+		AcknowledgeLastState(ackError);
+	if (ackError != KErrAbort)
+		AcknowledgeLastState(ackError);
+
+	// request another notification (even if we didn't acknowledge the last one)
+	RequestTransitionNotification();
+	}
+
+
+CDomainManagerAo* CDomainManagerAo::NewL(TDmHierarchyId aHierarchy, MDmTest& aTest)
+	{
+	CDomainManagerAo* self=new (ELeave) CDomainManagerAo(aHierarchy, aTest);
+	CleanupStack::PushL(self);
+
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainManagerAo::CDomainManagerAo(TDmHierarchyId aHierarchy, MDmTest& aTest) :
+	CDmDomainManager(aHierarchy), iTest(aTest)
+	{
+	}
+
+CDomainManagerAo::~CDomainManagerAo()
+	{
+	}
+
+void CDomainManagerAo::RunL()
+	{
+	RDebug::Printf("CDomainManagerAo::RunL(): %d", iStatus.Int());
+	iTest.TransitionRequestComplete();
+	}
+
+
+//
+// Deferral Test code
+//
+
+//
+// CDmDeferralTest
+//
+
+CDmDeferralTest::CDmDeferralTest(TDmHierarchyId aId, TDmDomainState aState)
+	: CActive(CActive::EPriorityStandard), iHierarchyId(aId), iState(aState)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CDmDeferralTest::~CDmDeferralTest()
+	{
+	iManager.Close();
+	delete iMember;
+	}
+
+/**
+Basic test setup : load and connect to appropriate hierarchy
+*/
+void CDmDeferralTest::Perform()
+	{
+	TInt r = RDmDomainManager::AddDomainHierarchy(iHierarchyId);
+	test_KErrNone(r);
+
+	r = iManager.Connect(iHierarchyId);
+	test_KErrNone(r);
+
+	DoPerform();
+
+	CActive::SetActive();
+	CActiveScheduler::Start();
+	}
+
+void CDmDeferralTest::Release()
+	{
+	delete this;
+	}
+
+/**
+aDomainMember has recieved a transition notification
+*/
+TInt CDmDeferralTest::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	test.Printf(_L("MDmDomainMember notified of transition, Domain ID=%d"),
+				aDomainMember.DomainId());
+	return KErrNone;
+	}
+
+/**
+A transition has completed
+*/
+void CDmDeferralTest::TransitionRequestComplete()
+	{}
+
+void CDmDeferralTest::RunL()
+	{
+	RDebug::Printf("CDmDeferralTest::RunL(): %d", iStatus.Int());
+	TransitionRequestComplete();
+	CActiveScheduler::Stop();
+	}
+
+void CDmDeferralTest::DoCancel()
+	{
+	test(0);
+	}
+
+//
+//
+// CTestKeepAlive
+//
+
+
+CTestKeepAlive::CTestKeepAlive(RDmDomain& aDomain)
+	: CActive(CActive::EPriorityHigh), iDomain(aDomain), iCount(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CTestKeepAlive::~CTestKeepAlive()
+	{
+	Cancel();
+	}
+
+/**
+Begin deferrals
+
+@param aMember The object to notify when deferrals cease
+@param aDeferralCount Number of times to defer
+*/
+void CTestKeepAlive::BeginDeferrals(MDeferringMember* aMember, TInt aDeferralCount)
+	{
+	iDeferringMember = aMember;
+	iCount = aDeferralCount;
+
+	if(iCount > 0)
+		DeferAcknowledgement();
+	}
+
+void CTestKeepAlive::DeferAcknowledgement()
+	{
+	test.Printf(_L("DeferAcknowledgement() iCount %d\n"), iCount);
+	iDomain.DeferAcknowledgement(iStatus);
+	SetActive();
+	}
+
+void CTestKeepAlive::RunL()
+	{
+	RDebug::Printf("CTestKeepAlive::RunL(): %d", iStatus.Int());
+	test(iCount>0);
+	--iCount;
+	TInt err = iStatus.Int();
+
+	if((iCount == 0) || (KErrNone != err))
+		{
+		iDeferringMember->HandleEndOfDeferrals(err);
+		iDeferringMember = NULL;
+		}
+	else
+		{
+		DeferAcknowledgement();
+		}
+	}
+
+void CTestKeepAlive::DoCancel()
+	{
+	iDomain.CancelDeferral();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_manual.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,125 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_domain_manual.cpp
+//
+// Overview:
+// Domain Manager Manual test cases
+//
+
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32ldr_private.h>
+
+#include "t_domain.h"
+
+
+RTest test(_L(" T_DOMAIN_MANUAL "));
+
+
+class CDmShutdownTest : public MDmTest
+	{
+public:
+	virtual ~CDmShutdownTest()
+		{
+		iManager.Close();
+		}
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember&)
+		{
+		test(0);
+		return KErrNone;
+		}
+	void TransitionRequestComplete()
+		{}
+private:
+	RDmDomainManager iManager;
+	};
+
+
+void CDmShutdownTest::Perform()
+	{
+	test.Next(_L("CDmShutdownTest"));
+
+	// 1. Set up test hierarchy/domain & join it
+	const TInt r = iManager.Connect();
+	test_KErrNone(r);
+
+	// 2. Call the Shutdown API
+	iManager.SystemShutdown();
+
+	test(0);	// Never reaches here!
+	}
+
+
+void CDmShutdownTest::Release()
+	{
+	delete this;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// --- Main() ---
+
+GLDEF_C TInt E32Main()
+	{
+	CTrapCleanup* trapHandler = CTrapCleanup::New();
+	test(trapHandler != NULL);
+
+	CActiveScheduler* scheduler = new CActiveScheduler();
+	test(scheduler != NULL);
+	CActiveScheduler::Install(scheduler);
+
+	// Turn off evil lazy dll unloading
+	RLoader l;
+	test(l.Connect() == KErrNone);
+	test(l.CancelLazyDllUnload()== KErrNone);
+	l.Close();
+
+	test.Title();
+
+	test.Start(_L("Test starting..."));
+
+	// Remember the number of open handles. Just for a sanity check
+	TInt start_thc, start_phc;
+	RThread().HandleCount(start_phc, start_thc);
+
+	MDmTest* tests[] =
+		{
+		// Always the last manual test as it shuts down the board/emulator
+		new CDmShutdownTest(),
+		};
+
+	for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
+		{
+		test(tests[i] != NULL);
+		tests[i]->Perform();
+		tests[i]->Release();
+		}
+
+	test.End();
+
+	// Sanity check for open handles and for pending requests
+	TInt end_thc, end_phc;
+	RThread().HandleCount(end_phc, end_thc);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
+	test(RThread().RequestCount() >= 0);
+
+	delete scheduler;
+	delete trapHandler;
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_manual.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_domain_manual.mmp
+// 
+//
+
+TARGET			t_domain_manual.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_domain_manual.cpp t_domain_cmn.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		../../../userlibandfileserver/domainmgr/inc
+
+CAPABILITY		PowerMgmt WriteDeviceData ProtServ
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_monitor.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,2436 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_domain_monitor.cpp
+// Overview:
+// Domain manager transition monitoring feature implementation tests
+//
+// API Information:
+// RDmDomain, RDmDomainManager CDmDomain, CDmDomainManager,CDmDomanKeepAlive
+//
+//  - Domain member deferral and acknowledgments tests
+//  - Domain manager policy interface tests
+//  - Domain member deferral requests Platsec capability checking tests
+//
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites:
+// Failures and causes:
+// Base Port information:
+//
+
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32ldr_private.h>
+
+#include <domainobserver.h>
+
+#include "domainpolicytest.h"
+
+#include "t_domain.h"
+
+
+RTest test(_L(" T_DOMAIN_MONITOR "));
+
+
+/**
+   Domain member deferral requests PlatSec capability checking tests.
+*/
+_LIT(KSecuritySlavePath1, "t_dmslave_nocaps.exe");
+_LIT(KSecuritySlavePath2, "t_dmslave_wdd.exe");
+_LIT(KSecuritySlavePath3, "t_dmslave_protsrv.exe");
+
+class CDmTestPlatSec : public CActive, public MDmTest
+	{
+public:
+	CDmTestPlatSec(TPtrC aFileName);
+	~CDmTestPlatSec()
+		{
+		Cancel();
+		iManager.Close();
+		}
+	// from CActive
+	void RunL();
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember&)
+		{
+		test(0);
+		return KErrNone;
+		}
+	void TransitionRequestComplete()
+		{}
+private:
+	// from CActive
+	virtual void DoCancel()
+		{
+		test(0);
+		}
+private:
+	RDmDomainManager iManager;
+	const TPtrC iFileName;
+	};
+
+
+CDmTestPlatSec::CDmTestPlatSec(TPtrC aFileName)
+	: CActive(CActive::EPriorityStandard), iFileName(aFileName)
+	{}
+
+
+void CDmTestPlatSec::Perform()
+	{
+	test.Next(_L("CDmTestPlatSec"));
+
+	// 1. Set up test hierarchy/domain & join it
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTestV2);
+	test_KErrNone(r);
+	r = iManager.Connect(KDmHierarchyIdTestV2);
+	test_KErrNone(r);
+
+	// 2. Create a child process
+	RProcess proc;
+	r = proc.Create(iFileName, KNullDesC);
+	test_KErrNone(r);
+
+	// Start process & wait until child has set up itself (3. & 4.)
+	TRequestStatus status;
+	proc.Rendezvous(status);
+	proc.Resume();
+	User::WaitForRequest(status);
+	test_KErrNone(status.Int());
+
+	// 5. Transition test domain to some other state (child: 6. & 7.)
+	CActiveScheduler::Add(this);
+	iManager.RequestDomainTransition(KDmIdTestA, EShutdownNonCritical, ETraverseDefault, iStatus);
+	CActive::SetActive();
+	CActiveScheduler::Start();
+
+	// Child processes do: TC 3.1, 3.2, 3.3
+
+	CLOSE_AND_WAIT(proc);
+	}
+
+
+void CDmTestPlatSec::RunL()
+	{
+	RDebug::Printf("CDmTestPlatSec::RunL(): %d", iStatus.Int());
+	CActiveScheduler::Stop();
+	}
+
+
+void CDmTestPlatSec::Release()
+	{
+	delete this;
+	}
+
+
+/**
+   Checks that upon transition acknowledgment, outstanding deferral is
+   completed with KErrCompletion.
+*/
+class CDmDeferralTestCompletion : public CDmDeferralTest, public MDeferringMember
+	{
+public:
+	CDmDeferralTestCompletion(TDmHierarchyId aId, TDmDomainState aState)
+		: CDmDeferralTest(aId, aState)
+		{}
+
+	~CDmDeferralTestCompletion()
+		{
+		delete iKeepAlive;
+		}
+
+	void DoPerform()
+		{
+		test.Next(_L("CDmDeferralTestCompletion\n"));
+
+		iMember = new CDmTestMember(iHierarchyId, KDmIdTestA, 0, this);
+		test_NotNull(iMember);
+
+		iKeepAlive = new CTestKeepAlive(iMember->iDomain);
+		test_NotNull(iKeepAlive);
+
+		iManager.RequestSystemTransition(iState, ETraverseChildrenFirst, CActive::iStatus);
+		}
+
+	void HandleEndOfDeferrals(TInt aError)
+		{
+		test.Printf(_L("End of deferrals\n"));
+
+		// This is the test (TC 1.1.1.2.1):
+
+		test_Equal(KErrCompletion, aError);
+		}
+
+	TInt TransitionNotification(MDmDomainMember& /*aDomainMember*/)
+		{
+		iKeepAlive->BeginDeferrals(this, 1);
+		return KErrNone;
+		}
+
+	void TransitionRequestComplete()
+		{
+		}
+private:
+	CTestKeepAlive* iKeepAlive;
+	};
+
+
+/**
+   Checks that after deferring a given number of times, the deferral
+   after fails with KErrNotSupported.
+*/
+class CDmDeferralTestKErrNotSupported : public CDmDeferralTest, public MDeferringMember
+	{
+public:
+	/**
+	@param aCount Number of deferrals to attempt
+	*/
+	CDmDeferralTestKErrNotSupported(TDmHierarchyId aId, TDmDomainState aState, TInt aCount)
+		: CDmDeferralTest(aId, aState), iCount(aCount)
+		{}
+
+	~CDmDeferralTestKErrNotSupported()
+		{
+		delete iKeepAlive;
+		}
+
+	// from CDmDeferralTest
+	void DoPerform()
+		{
+		test.Next(_L("CDmDeferralTestKErrNotSupported\n"));
+		test.Printf(_L("CDmDeferralTestKErrNotSupported: Hierachy %d, state %d, attempt %d deferrals\n"),
+			iHierarchyId, iState, iCount);
+
+		iMember = new CDmTestMember(iHierarchyId, KDmIdTestA, 0, this);
+		test_NotNull(iMember);
+
+		iKeepAlive = new CTestKeepAlive(iMember->iDomain);
+		test_NotNull(iKeepAlive);
+
+		iManager.RequestSystemTransition(iState, ETraverseChildrenFirst, CActive::iStatus);
+		}
+
+	// from MDeferringMember
+	void HandleEndOfDeferrals(TInt aError)
+		{
+		iMember->Acknowledge();
+
+		test.Printf(_L("CDmDeferralTestKErrNotSupported: End of deferrals %d\n"), aError);
+		// This is the test (TC 1.1.1.3.1, TC 1.1.1.3.2, TC 1.1.1.3.3):
+		test_Equal(KErrNotSupported, aError);
+		}
+
+	// from MDmTest
+	TInt TransitionNotification(MDmDomainMember& /*aDomainMember*/)
+		{
+		iKeepAlive->BeginDeferrals(this, iCount);
+		return KErrAbort; // Don't acknowledge yet
+		}
+
+	void TransitionRequestComplete()
+		{
+		RDebug::Printf("CDmDeferralTestKErrNotSupported::TransitionRequestComplete()");
+		test_KErrNone(iStatus.Int());
+		}
+private:
+	CTestKeepAlive* iKeepAlive;
+	const TInt iCount;
+	};
+
+/**
+   DeferAcknowledgement() with status KErrNone.
+
+   1: Client receives notification, defers once and then acknowledges after the
+   next notification
+   2: Client receives notification, defers twice and then acknowledges after
+   the next notification
+   3: Client receives notification, defers once and then fails to acknowledge
+*/
+class CDmDeferralTestKErrNone : public CDmDeferralTest, public MDeferringMember
+	{
+public:
+	CDmDeferralTestKErrNone(TDmHierarchyId aId, TDmDomainState aState,
+							TInt aDeferrals, TBool aAcknowledge);
+	~CDmDeferralTestKErrNone();
+	// from CDmDeferralTest
+	void DoPerform();
+	// from MDmTest
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+	// from MDeferringMember
+	void HandleEndOfDeferrals(TInt aError);
+
+private:
+	CTestKeepAlive* iKeepAlive;
+	const TInt iDeferrals;
+	const TBool iAcknowledge;
+	};
+
+
+CDmDeferralTestKErrNone::CDmDeferralTestKErrNone(TDmHierarchyId aId,
+												 TDmDomainState aState,
+												 TInt aDeferrals,
+												 TBool aAcknowledge)
+	: CDmDeferralTest(aId, aState),
+	  iDeferrals(aDeferrals),
+	  iAcknowledge(aAcknowledge)
+	{}
+
+
+CDmDeferralTestKErrNone::~CDmDeferralTestKErrNone()
+	{
+	delete iKeepAlive;
+	}
+
+
+void CDmDeferralTestKErrNone::DoPerform()
+	{
+	test.Next(_L("CDmDeferralTestKErrNone"));
+
+	iMember = new CDmTestMember(iHierarchyId, KDmIdTestCAA, 0, this);
+	test_NotNull(iMember);
+
+	iKeepAlive = new CTestKeepAlive(iMember->iDomain);
+	test_NotNull(iKeepAlive);
+
+	iManager.RequestSystemTransition(iState, ETraverseDefault, CActive::iStatus);
+	}
+
+
+void CDmDeferralTestKErrNone::HandleEndOfDeferrals(TInt aError)
+	{
+	test.Printf(_L("HandleEndOfDeferrals(): %d\n"), aError);
+
+	// This is the test (TC 1.1.1.1.1, TC 1.1.1.1.2 , TC 1.1.1.1.3):
+
+	test_Equal(KErrNone, aError);
+
+	if (iAcknowledge)
+		{
+		RDebug::Printf(" Calling AcknowledgeLastState()");
+		iMember->iDomain.AcknowledgeLastState();
+		}
+	}
+
+
+TInt CDmDeferralTestKErrNone::TransitionNotification(MDmDomainMember&)
+	{
+	iKeepAlive->BeginDeferrals(this, iDeferrals);
+	// don't acknowledge yet
+	return KErrAbort;
+	}
+
+
+void CDmDeferralTestKErrNone::TransitionRequestComplete()
+	{
+	}
+
+
+/**
+   Test mix of deferral and non-deferral clients (1.3)
+  
+   1: Three clients receive notification.
+   2: One makes three deferrals and then acknowledges after the next notification
+   3: The other two non-deferral clients acknowledge without making a deferral      
+*/
+class CDmDeferralMixed : public CDmDeferralTest, public MDeferringMember
+	{
+public:
+	CDmDeferralMixed(TDmHierarchyId aId, TDmDomainState aState, TInt aDeferrals, TBool aAcknowledge, TBool aDelayAck);
+	~CDmDeferralMixed();
+	// from CDmDeferralTest
+	void DoPerform();
+	// from MDmTest
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+	// from MDeferringMember
+	void HandleEndOfDeferrals(TInt aError);
+
+private:
+	CTestKeepAlive* iKeepAlive;	
+	CDmTestMember* iMixedDeferralTestMember[2];
+	const TInt iDeferrals;
+	const TBool iAcknowledge;
+	TBool iDoneDeferral;	
+	const TBool iDelayAck;
+	TBool iNonMemberAck[2];
+	MDmDomainMember* iFirstMemberToCompleteAddr;
+	};
+
+CDmDeferralMixed::CDmDeferralMixed(TDmHierarchyId aId, 
+								   TDmDomainState aState,
+								   TInt aDeferrals,
+								   TBool aAcknowledge,
+								   TBool aDelayAck)	
+    :CDmDeferralTest(aId, aState),
+ 	 iDeferrals(aDeferrals),
+	 iAcknowledge(aAcknowledge),
+	 iDelayAck(aDelayAck)
+	{
+	iDoneDeferral=EFalse; 	
+	iFirstMemberToCompleteAddr = NULL;
+	iNonMemberAck[0]=EFalse;
+	iNonMemberAck[1]=EFalse;
+	}
+
+CDmDeferralMixed::~CDmDeferralMixed()
+	{
+	delete iKeepAlive;	
+	delete iMixedDeferralTestMember[0];
+	delete iMixedDeferralTestMember[1];	   
+	}
+
+void CDmDeferralMixed::DoPerform()
+	{
+	test.Next(_L("CDmDeferralMixed"));	
+	
+	// Attach three test members to the same domain (KDmIdTestCAA). One of the test
+	// member is a deferring member while the other two are non deferring members.
+	iMember = new CDmTestMember(iHierarchyId, KDmIdTestCAA, 0, this);
+	test_NotNull(iMember);
+
+	iMixedDeferralTestMember[0] = new CDmTestMember(iHierarchyId, KDmIdTestCAA, 0, this);
+	test_NotNull(iMixedDeferralTestMember[0]);
+
+	iMixedDeferralTestMember[1] = new CDmTestMember(iHierarchyId, KDmIdTestCAA, 0, this); 
+	test_NotNull(iMixedDeferralTestMember[1]);
+
+	iManager.RequestSystemTransition(iState, ETraverseDefault, CActive::iStatus);
+	}
+
+void CDmDeferralMixed::HandleEndOfDeferrals(TInt aError)
+	{
+	test.Printf(_L("HandleEndOfDeferrals(): %d\n"), aError);
+	test_Equal(KErrNone, aError);
+	if (iAcknowledge)
+		{
+		RDebug::Printf(" Calling AcknowledgeLastState()");
+		//iFirstMemberToCompleteAddr is the first member to complete and is deferred 
+		static_cast<CDmTestMember*>(iFirstMemberToCompleteAddr)->iDomain.AcknowledgeLastState();		
+		iDoneDeferral = ETrue;
+		}
+	}
+
+TInt CDmDeferralMixed::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	RDebug::Printf("CDmDeferralMixed::TransitionNotification()");
+
+	// if first member to complete, take note of this member and defer.
+	if (iFirstMemberToCompleteAddr ==  NULL)
+		{
+		iFirstMemberToCompleteAddr =  &aDomainMember; // Get address of first member to complete		
+		iKeepAlive = new CTestKeepAlive(static_cast<CDmTestMember*>(iFirstMemberToCompleteAddr)->iDomain);
+		test_NotNull(iKeepAlive);		
+		}
+
+	if  ( (!iDoneDeferral) && (&aDomainMember == iFirstMemberToCompleteAddr) ) // Defer 
+		{
+		//TC 1.3.1 Define a client to defer 3 times and then acknowledge and include 2 non deferring clients 	
+		test.Printf(_L("CDmDeferralMixed Attempting %d deferrals\n"), iDeferrals);
+		iKeepAlive->BeginDeferrals(this, iDeferrals);		
+		return KErrAbort;// don't acknowledge yet
+		}
+	else if (iNonMemberAck[0]== EFalse) 
+		{//One of the two non deferring clients which acknowledges without any delay
+		iNonMemberAck[0]= ETrue;
+		test.Printf(_L("CDmDeferralMixed acknowledging iMixedDeferralTestMember - 1 \n"));	
+		return KErrNone;  // Non deferral memeber acknowledges on time
+		}
+	else if (iNonMemberAck[1]== EFalse ) 
+		{//One of the two non deferring clients which acknowledges with and without a delay based on the state of iDelayAck
+		iNonMemberAck[1]= ETrue;
+		if(!iDelayAck)
+			{
+			test.Printf(_L("CDmDeferralMixed acknowledging iMixedDeferralTestMember - 2 \n"));
+			return KErrNone; // Non deferral member acknowledges on time
+			}
+		else
+			{
+			test.Printf(_L("CDmDeferralMixed delaying acknowledgement for iMixedDeferralTestMember - 2  \n"));
+			//TC 1.3.2 - 1 fails to acknowledge in time
+			return KErrAbort; // Delay acknowlegdement
+			}			
+		}
+	test(EFalse);
+	//default
+	return KErrNone;
+	}					
+
+void CDmDeferralMixed::TransitionRequestComplete()
+	{
+	RDebug::Printf("CDmDeferralMixed::TransitionRequestComplete()");
+	}
+
+/////////////////////////////////////////////// CDmKeepAlive Test cases ///////////////////////////////////////////////
+
+//-------------------------------------------------
+// Domain member deferral and acknowledgments tests
+//-------------------------------------------------
+
+class MDomainMemberTests;
+class CDomainMemberKeepAlive;
+const TUint KMembersMax = 32;
+
+// Policy related service functions user by the CDmDomainKeepAlive tests
+SDmStateSpecV1 Get0DeferralState()
+	{
+	TUint i = 0;
+	for (i=0; i<StateSpecificationSize; i++)
+		{
+		if(StateSpecification[i].iDeferralLimit != 0)
+			continue;
+		return StateSpecification[i];
+		}
+
+	// We could not find any state that has a 0 deferral specified in the policy
+	test(0);
+	return StateSpecification[i]; // get rid of compiler warnings
+	}
+
+// Get the first minimal deferral state from the policy greater than 0
+SDmStateSpecV1 GetMinDeferralState() 
+	{
+	SDmStateSpecV1 maxState, minState;
+	maxState = StateSpecification[0];
+	minState = StateSpecification[0];
+
+	for (TUint i=0; i<StateSpecificationSize; i++)
+		{
+		if(StateSpecification[i].iDeferralLimit != 0)
+			{
+			if(StateSpecification[i].iDeferralLimit > maxState.iDeferralLimit)
+				maxState = StateSpecification[i];
+			if(StateSpecification[i].iDeferralLimit < minState.iDeferralLimit)
+				{
+				minState = StateSpecification[i];
+				}
+			else if(minState.iDeferralLimit == 0)
+				minState = StateSpecification[i];
+			}
+		continue;
+		}
+
+	test.Printf(_L("minState's TimeoutMs = %d , count = %d\n"), minState.iTimeoutMs, minState.iDeferralLimit );
+
+	// Test whether there exists atleast one minimal deferral state that is greater than 0 deferrals and less than max deferrals
+	test(minState.iDeferralLimit > 0 && minState.iDeferralLimit < maxState.iDeferralLimit);
+	return minState;
+	}
+
+// Get the max deferral state from the policy. This is a simple function that always gets the first max deferral from the list
+// The parameter aContinueOnError is used to get a state eith maximum deferral that has the policy error as
+// ETransitionFailureContinue or ETransitionFailureStop
+SDmStateSpecV1 GetMaxDeferralState(TBool aContinueOnError = EFalse) 
+	{
+	SDmStateSpecV1 aState;
+	aState = StateSpecification[0];
+
+	TUint i;
+	for (i=0; i<StateSpecificationSize; i++)
+		{
+		const SDmStateSpecV1& spec = StateSpecification[i];
+
+		if((spec.iDeferralLimit > aState.iDeferralLimit) &&
+			(spec.iFailurePolicy == aContinueOnError ? ETransitionFailureContinue : ETransitionFailureStop))
+			{
+			aState = StateSpecification[i];
+			}
+		}
+
+	// Check that a suitable state was found
+	test(aState.iFailurePolicy == aContinueOnError ? ETransitionFailureContinue : ETransitionFailureStop);
+
+	test.Printf(_L("Max deferrral state's TimeoutMs = %d , count = %d, failure policy %d\n"), aState.iTimeoutMs, aState.iDeferralLimit, aState.iFailurePolicy);
+	return aState;
+	}
+
+// CDmDomainKeepAliveTest test
+//-------------------------------------------------
+// Domain member deferral and acknowledgments tests
+//-------------------------------------------------
+class CDmDomainKeepAliveTest : public CActive, public MDmTest
+	{
+public: 
+	// from CActive
+	void RunL();
+ 
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete() {};
+
+	// for the individual tests to handle
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+
+	CDmDomainKeepAliveTest() : CActive(CActive::EPriorityStandard) {}
+	void SetExpectedValues(TInt aTestNotificationsExpected, TInt aTransitionsExpected);
+	void ValidateTestResults();
+	void RequestSystemTransition(TDmDomainState aTestState, TDmTraverseDirection aDirection);
+	void DoAsynMemberAck();
+	void CancelTransition();
+protected:
+	// from CActive
+	virtual void DoCancel();
+
+private:
+	void Init(MDomainMemberTests* aTest);
+	void UnInit();
+
+private:
+	CDomainMemberKeepAlive*	iTestMembers[KMembersMax]; 
+	RDmDomainManager		iTestDomainManager;
+	
+	MDomainMemberTests*			iCurrentTest;
+
+public:
+	static TUint		gTestMemberCount;
+	static TUint		gLeafMemberCount;
+	TInt				iTestNotifications;
+	TInt				iTestNotificationsExpected;
+
+	TInt				iTransitionsCompleted;
+	TInt				iTransitionsExpected;
+	};
+
+// CDomainMemberKeepAlive
+class CDomainMemberKeepAlive : public CDmDomainKeepAlive, public MDmDomainMember
+	{
+public:
+	static CDomainMemberKeepAlive* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDomainMemberTests*);
+	~CDomainMemberKeepAlive();
+
+	// from CDmDomainKeepAlive
+	TInt HandleDeferralError(TInt aError);
+	void HandleTransitionL();
+
+	// from MDmDomainMember
+	inline TDmHierarchyId HierarchyId() {return iHierarchy;};
+	inline TDmDomainId	DomainId() {return iId;};
+	inline TDmDomainState State() {return iState;};
+	inline TInt Status() {return iStatus.Int();};
+	inline TUint32 Ordinal() {return iOrdinal;};
+	inline TInt Notifications() {return iNotifications;};
+	static TInt TimerCallback(TAny* obj);
+	void DoAsynHandleTransition(const TTimeIntervalMicroSeconds32 aInterval);
+private:
+	CDomainMemberKeepAlive(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDomainMemberTests*);
+
+public:
+	// used only for test cases TC 1.1.2.2.2, TC 1.1.2.3.1 and TC 1.1.2.3.2 where DoAsynMemberAck is used
+	TBool				iShouldAck; 
+	
+private:
+	TDmHierarchyId		iHierarchy;
+	TDmDomainId			iId;
+	TDmDomainState		iState;
+	TUint32				iOrdinal;
+	MDomainMemberTests*	iTest;
+	TUint				iNotifications;
+
+	CPeriodic*			iTimer;
+	};
+
+class MDomainMemberTests
+	{
+public:
+	virtual void Perform() = 0;
+	virtual void Release() = 0;
+	virtual void HandleTransitionL(CDomainMemberKeepAlive* aDmMember) = 0;
+	virtual TInt HandleDeferralError(TInt aError) = 0;
+	virtual void DoAsynHandleTransition(CDomainMemberKeepAlive*) {};
+	virtual void DoAsynMemberAck(CDomainMemberKeepAlive*) {};
+public:
+	TDmDomainState		iTestState;
+	};
+
+CDomainMemberKeepAlive* CDomainMemberKeepAlive::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDomainMemberTests* aTest)
+	{
+	CDomainMemberKeepAlive* self=new (ELeave) CDomainMemberKeepAlive(aHierarchy, aId, aOrdinal, aTest);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	self->RequestTransitionNotification();
+
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDomainMemberKeepAlive::~CDomainMemberKeepAlive()
+	{
+	delete iTimer;
+	Cancel();
+	}
+
+CDomainMemberKeepAlive::CDomainMemberKeepAlive(TDmHierarchyId aHierarchy, TDmDomainId aId, TUint32 aOrdinal, MDomainMemberTests* aTest):
+	CDmDomainKeepAlive(aHierarchy, aId), iShouldAck(EFalse),
+	iHierarchy(aHierarchy), iId(aId), iOrdinal(aOrdinal), iTest(aTest)
+	{
+	}
+
+TInt CDomainMemberKeepAlive::HandleDeferralError(TInt aError)
+	{
+	TInt r = KErrNone;
+
+	TBuf16<4> buf;
+	GetDomainDesc(Ordinal(), buf);
+	test.Printf(_L("HandleDeferralError domain = %S, error = %d\n"), &buf, aError);
+
+	r = iTest->HandleDeferralError(aError);
+	return r;
+	}
+
+void CDomainMemberKeepAlive::HandleTransitionL()
+	{
+	iShouldAck = ETrue;
+	iNotifications++;
+	iTest->HandleTransitionL(this);
+	}
+
+TInt CDomainMemberKeepAlive::TimerCallback(TAny* obj)
+	{
+    CDomainMemberKeepAlive* member = static_cast<CDomainMemberKeepAlive*>(obj);
+
+	TBuf16<4> buf;
+	GetDomainDesc(member->Ordinal(), buf);
+
+	test.Printf(_L("Member asynchronous transition handler, domain = %S\n"), &buf);
+
+	member->iTest->DoAsynHandleTransition(member);
+	member->iTimer->Cancel();
+	return KErrNone;
+	}
+
+void CDomainMemberKeepAlive::DoAsynHandleTransition(const TTimeIntervalMicroSeconds32 aInterval)
+	{
+	iTimer = CPeriodic::NewL(CActive::EPriorityHigh);
+
+	TCallBack callback(TimerCallback, this);
+	iTimer->Start(aInterval, aInterval, callback);
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//                      TC 1.1.2.1.1 (with deferral count 0)                      //
+////////////////////////////////////////////////////////////////////////////////////
+class TestTransitionWithDeferral0 : public MDomainMemberTests // TC 1.1.2.1.1 (with deferral count 0)
+	{
+public:
+	TestTransitionWithDeferral0(CDmDomainKeepAliveTest& aTester) : iTester(aTester) {}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+
+private:
+	CDmDomainKeepAliveTest& iTester;
+	};
+
+void TestTransitionWithDeferral0::Perform()
+	{
+	test.Printf(_L("****************TestTransitionWithDeferral0****************\n"));
+	test.Next(_L("Test state transition that has 0 deferral"));
+	test.Printf(_L("Acknowleding immediately......\n"));
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = Get0DeferralState();
+
+	iTestState =  aStateSpec.iState;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L("....transition completed\n"));
+
+	iTester.ValidateTestResults();
+	}
+
+void TestTransitionWithDeferral0::Release()
+	{
+	delete this;
+	}
+
+void TestTransitionWithDeferral0::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	TInt ackError = iTester.TransitionNotification(*aDmMember);
+	aDmMember->GetState();
+
+	aDmMember->AcknowledgeLastState(ackError);
+	}
+
+TInt TestTransitionWithDeferral0::HandleDeferralError(TInt aError)
+	{
+	// Since this test case expects 0 deferral, the KErrNotSupported will happen which is expected
+	test(aError == KErrNotSupported);
+	return KErrNone;
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//         TC 1.1.2.1.1 (with max deferral count - ack after n deferrals          //
+////////////////////////////////////////////////////////////////////////////////////
+class TestAckWithinDeferral : public MDomainMemberTests
+	{
+public:
+	TestAckWithinDeferral(CDmDomainKeepAliveTest& aTester) : iTester(aTester) {}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+	void DoAsynHandleTransition(CDomainMemberKeepAlive* aDmMember);
+private:
+	CDmDomainKeepAliveTest& iTester;
+	TUint iTransitionTime;
+	};
+
+void TestAckWithinDeferral::Perform()
+	{
+	test.Printf(_L("****************TestAckWithinDeferral****************\n"));
+	test.Next(_L("Test state transition that has deferral > 0"));
+	test.Printf(_L("Acknowleding immediately......\n"));
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = GetMaxDeferralState();
+
+	iTestState =  aStateSpec.iState;
+	iTransitionTime = aStateSpec.iTimeoutMs * aStateSpec.iDeferralLimit / 2;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L(".......transition completed\n"));
+
+	iTester.ValidateTestResults();
+	}
+
+void TestAckWithinDeferral::Release()
+	{
+	delete this;
+	}
+
+void TestAckWithinDeferral::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	iTester.TransitionNotification(*aDmMember);
+
+	aDmMember->GetState();
+
+	const TTimeIntervalMicroSeconds32 KInterval = iTransitionTime * 1000; // policy defines in millisec - convert it to microsec
+
+	aDmMember->DoAsynHandleTransition(KInterval);
+	}
+
+TInt TestAckWithinDeferral::HandleDeferralError(TInt aError)
+	{
+	// Since this test case expects acknowledging within the deferral, the KErrCompletion will happen which is expected
+	test_Equal(KErrCompletion, aError);
+	return KErrNone;
+	}
+
+/* By now atleast 3 deferrals should have got finished */
+void TestAckWithinDeferral::DoAsynHandleTransition(CDomainMemberKeepAlive* aDmMember)
+	{
+	aDmMember->AcknowledgeLastState(KErrNone);
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//                 TC 1.1.2.2.1 (But still ongoing with other domain)             //
+////////////////////////////////////////////////////////////////////////////////////
+class TestAckAfterDomainDeferralExpiry : public MDomainMemberTests
+	{
+public:
+	TestAckAfterDomainDeferralExpiry(CDmDomainKeepAliveTest& aTester) : iTester(aTester) {}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+	void DoAsynHandleTransition(CDomainMemberKeepAlive* aDmMember);
+private:
+	CDmDomainKeepAliveTest& iTester;
+	TUint iTransitionTime;
+	};
+
+void TestAckAfterDomainDeferralExpiry::Perform()
+	{
+	test.Printf(_L("****************TestAckAfterDomainDeferralExpiry****************\n"));
+	test.Next(_L("Test client that does not acknowledge within the allowed number of deferrals "));
+	test.Printf(_L("but which then acknowledges while transition still ongoing (in other domain)\n"));
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = GetMaxDeferralState(ETrue);
+
+	iTestState =  aStateSpec.iState;
+	iTransitionTime = aStateSpec.iTimeoutMs * aStateSpec.iDeferralLimit * 2;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L(".......transition completed\n"));
+
+	iTester.ValidateTestResults();
+	}
+
+void TestAckAfterDomainDeferralExpiry::Release()
+	{
+	delete this;
+	}
+
+void TestAckAfterDomainDeferralExpiry::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	iTester.TransitionNotification(*aDmMember);
+
+	aDmMember->GetState();
+
+	const TTimeIntervalMicroSeconds32 KInterval = iTransitionTime * 1000; // policy defines in millisec - convert it to microsec
+
+	aDmMember->DoAsynHandleTransition(KInterval);
+	}
+
+TInt TestAckAfterDomainDeferralExpiry::HandleDeferralError(TInt aError)
+	{
+	// We expect the KErrNotSupported happens after expiring the deferral counts
+	test(aError == KErrNotSupported);
+	return KErrNone;
+	}
+
+/* By the time this function is called the server would have transitioned this member
+   under the domain and would have moved on to the next domain */
+void TestAckAfterDomainDeferralExpiry::DoAsynHandleTransition(CDomainMemberKeepAlive* aDmMember)
+	{
+	aDmMember->AcknowledgeLastState(KErrNone);
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//                                   TC 1.1.2.2.2                                 //
+////////////////////////////////////////////////////////////////////////////////////
+class TestAckAfterTransitionCompletes : public MDomainMemberTests
+	{
+public:
+	TestAckAfterTransitionCompletes(CDmDomainKeepAliveTest& aTester) : iTester(aTester) {}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+	void DoAsynMemberAck(CDomainMemberKeepAlive* aDmMember);
+private:
+	CDmDomainKeepAliveTest& iTester;
+	TInt iExpectedErrorCode;
+	};
+
+void TestAckAfterTransitionCompletes::Perform()
+	{
+	test.Printf(_L("****************TestAckAfterTransitionCompletes****************\n"));
+
+	test.Next(_L("Test client that does not acknowledge within the allowed number of deferrals "));
+	test.Printf(_L("but which then acknowledges while transition has completed\n"));
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = GetMaxDeferralState(ETrue);
+
+	iTestState =  aStateSpec.iState;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L(".......transition completed\n"));
+
+	iTester.ValidateTestResults();
+
+	iTester.DoAsynMemberAck();
+	}
+
+void TestAckAfterTransitionCompletes::Release()
+	{
+	delete this;
+	}
+
+void TestAckAfterTransitionCompletes::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	iTester.TransitionNotification(*aDmMember);
+	aDmMember->GetState();
+	}
+
+void TestAckAfterTransitionCompletes::DoAsynMemberAck(CDomainMemberKeepAlive* aDmMember)
+	{
+	aDmMember->AcknowledgeLastState(KErrNone);
+	}
+
+TInt TestAckAfterTransitionCompletes::HandleDeferralError(TInt aError)
+	{
+	test(aError == KErrNotSupported);
+	return KErrNone;
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//					TC 1.1.2.2.3	and    TC 1.1.2.2.4						      //
+////////////////////////////////////////////////////////////////////////////////////
+class TestAckPrevTransAfterNewTransStart : public MDomainMemberTests
+	{
+public:
+	TestAckPrevTransAfterNewTransStart(CDmDomainKeepAliveTest& aTester, TBool aAckPrevTran) :
+				iShouldAck(EFalse), iAckPrevTran(aAckPrevTran), iTester(aTester) {}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+
+private:
+	TBool iShouldAck;
+	TBool iAckPrevTran;
+	CDmDomainKeepAliveTest& iTester;
+	};
+
+void TestAckPrevTransAfterNewTransStart::Perform()
+	{
+	if(iAckPrevTran)
+		{
+		test.Printf(_L("**************** TestAckPrevTransAfterNewTransStart (Ack Previous Transition after new transition started) ****************\n"));
+		test.Next(_L("Test client that does not acknowledge within the allowed number of deferrals "));
+		test.Printf(_L("but which then acknowledges while next new transition has started\n"));
+		}
+	else
+		{
+		test.Printf(_L("**************** TestAckPrevTransAfterNewTransStart (Never Ack Previous Transition) ****************\n"));
+		test.Next(_L("Test client that does not acknowledge within the allowed number of deferrals "));
+		test.Printf(_L("but which never acknowledges and continues handling next transition\n"));
+		}
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = GetMaxDeferralState(ETrue);
+
+	iTestState =  aStateSpec.iState;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L("....transition completed\n"));
+
+	iTester.ValidateTestResults();
+
+	if(iAckPrevTran)
+		test.Printf(_L("Now request another transition for which the domain members should ack both transitions)\n"));
+	else
+		test.Printf(_L("Now request another transition for which the domain members should ack only the last transitions)\n"));
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount*2, 2);
+	aStateSpec = GetMinDeferralState();
+	iTestState =  aStateSpec.iState;
+
+	iShouldAck = ETrue;
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L("....transition completed\n"));
+
+	iTester.ValidateTestResults();
+	}
+
+void TestAckPrevTransAfterNewTransStart::Release()
+	{
+	delete this;
+	}
+
+void TestAckPrevTransAfterNewTransStart::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	TInt ackError = iTester.TransitionNotification(*aDmMember);
+	if(iShouldAck == EFalse)
+		{
+		aDmMember->GetState();
+		// request another notification (even if we didn't acknowledge the last one)
+		aDmMember->RequestTransitionNotification();
+		test.Printf(_L("....Return without acknowledging\n"));
+		return;
+		}
+
+	if(iAckPrevTran)
+		{
+		test.Printf(_L("....Acknowledge the first transition\n"));
+		/* First ack the previous notification */
+		aDmMember->AcknowledgeLastState(ackError);
+		}
+	else
+		{
+		test.Printf(_L("Skipping to acknowledge the first transition...\n"));
+		/* We are not going to ack the previous notification handled in the above if condition 
+	   Intentionally not acking and continuing to do a GetState to handle the next notification */
+		}
+
+	test.Printf(_L("Acknowledge the second transition\n"));
+	/* Now handle the current notification */
+	aDmMember->GetState();
+	aDmMember->AcknowledgeLastState(ackError);
+	}
+
+TInt TestAckPrevTransAfterNewTransStart::HandleDeferralError(TInt aError)
+	{
+	if(!iShouldAck)
+		test(aError == KErrNotSupported);
+	else
+		test_Equal(KErrCompletion, aError);
+
+	return KErrNone;
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//                      TC 1.1.2.3.1    and    TC 1.1.2.3.2                       //
+////////////////////////////////////////////////////////////////////////////////////
+class TestCancelTransitonWithMemberAck : public MDomainMemberTests
+	{
+public:
+	TestCancelTransitonWithMemberAck(CDmDomainKeepAliveTest& aTester, TInt aErrorCode) : 
+			iTester(aTester), iCancelCount(0), iErrorCode(aErrorCode) {}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+	void DoAsynMemberAck(CDomainMemberKeepAlive* aDmMember);
+	static TInt CancelTransitionTimerCallback(TAny* obj);
+	static TInt DelayTimerCallback(TAny* obj);
+	void StopScheduler();
+private:
+	CDmDomainKeepAliveTest& iTester;
+	TUint iTransitionTime;
+	TUint iCancelCount;
+	TInt  iErrorCode;
+	CPeriodic *iCancelTransitionTimer;
+	CPeriodic *iDelayTimer;
+	};
+
+TInt TestCancelTransitonWithMemberAck::CancelTransitionTimerCallback(TAny* obj)
+	{
+    TestCancelTransitonWithMemberAck* thisTest = static_cast<TestCancelTransitonWithMemberAck*>(obj);
+
+	thisTest->iTester.CancelTransition();
+	thisTest->iCancelTransitionTimer->Cancel();
+	return KErrNone;
+	}
+
+TInt TestCancelTransitonWithMemberAck::DelayTimerCallback(TAny* obj)
+	{
+    TestCancelTransitonWithMemberAck* thisTest = static_cast<TestCancelTransitonWithMemberAck*>(obj);
+
+	thisTest->iDelayTimer->Cancel();
+	thisTest->StopScheduler();
+	return KErrNone;
+	}
+
+void TestCancelTransitonWithMemberAck::StopScheduler()
+	{
+	CActiveScheduler::Stop();
+	}
+
+void TestCancelTransitonWithMemberAck::Perform()
+	{
+	test.Printf(_L("****************TestCancelTransitonWithMemberAck****************\n"));
+	test.Next(_L("Test state transition cancelation...."));
+	test.Printf(_L("that acknowledes KErrNone......\n"));
+
+	iTester.SetExpectedValues(iTester.gLeafMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = GetMaxDeferralState();
+
+	iTestState =  aStateSpec.iState;
+	iTransitionTime = aStateSpec.iTimeoutMs * aStateSpec.iDeferralLimit / 2;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	iCancelTransitionTimer = CPeriodic::NewL(CActive::EPriorityHigh);
+
+	TCallBack cancelCb(CancelTransitionTimerCallback, this);
+	iCancelTransitionTimer->Start(aStateSpec.iTimeoutMs, aStateSpec.iTimeoutMs, cancelCb);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L("....transition cancelled\n"));
+
+	iDelayTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+
+	TCallBack delayCb(DelayTimerCallback, this);
+	TUint delayTime = iTransitionTime * 3;
+	iDelayTimer->Start(delayTime, delayTime, delayCb);
+
+	CActiveScheduler::Start();
+	test.Printf(_L("........expected members got cancelation notified\n"));
+
+	iTester.DoAsynMemberAck();
+
+	iTester.ValidateTestResults();
+	}
+
+void TestCancelTransitonWithMemberAck::Release()
+	{
+	delete iDelayTimer;
+	delete iCancelTransitionTimer;
+	delete this;
+	}
+
+void TestCancelTransitonWithMemberAck::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	iTester.TransitionNotification(*aDmMember);
+
+	aDmMember->GetState();
+	}
+
+TInt TestCancelTransitonWithMemberAck::HandleDeferralError(TInt aError)
+	{
+	// KErrNotReady is possible if the cancellation
+	// ocurred in between member deferrrals
+	test(aError == KErrCancel || aError == KErrNotReady);
+	test(++iCancelCount <= iTester.gLeafMemberCount);
+	return KErrNone;
+	}
+
+void TestCancelTransitonWithMemberAck::DoAsynMemberAck(CDomainMemberKeepAlive* aDmMember)
+	{
+	aDmMember->AcknowledgeLastState(iErrorCode);
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//                                TC 1.1.2.3.3                                    //
+////////////////////////////////////////////////////////////////////////////////////
+class TestCancelTransitonNeverAck : public MDomainMemberTests // TC1.1.2.3.3
+	{
+public:
+	TestCancelTransitonNeverAck(CDmDomainKeepAliveTest& aTester) : iTester(aTester), iCancelCount(0), iShouldAck(EFalse){}
+	// from MDmKeepAliveTest
+	void Perform();
+	void Release();
+	void HandleTransitionL(CDomainMemberKeepAlive* aDmMember);
+	TInt HandleDeferralError(TInt aError);
+	static TInt CancelTransitionTimerCallback(TAny* obj);
+	static TInt DelayTimerCallback(TAny* obj);
+	void StopScheduler();
+private:
+	CDmDomainKeepAliveTest& iTester;
+	TUint iTransitionTime;
+	TUint iCancelCount;
+	TBool iShouldAck;
+	CPeriodic *iCancelTransitionTimer;
+	CPeriodic *iDelayTimer;
+	};
+
+TInt TestCancelTransitonNeverAck::CancelTransitionTimerCallback(TAny* obj)
+	{
+    TestCancelTransitonNeverAck* thisTest = static_cast<TestCancelTransitonNeverAck*>(obj);
+
+	thisTest->iTester.CancelTransition();
+	thisTest->iCancelTransitionTimer->Cancel();
+	return KErrNone;
+	}
+
+TInt TestCancelTransitonNeverAck::DelayTimerCallback(TAny* obj)
+	{
+    TestCancelTransitonNeverAck* thisTest = static_cast<TestCancelTransitonNeverAck*>(obj);
+
+	thisTest->iDelayTimer->Cancel();
+	thisTest->StopScheduler();
+	return KErrNone;
+	}
+
+void TestCancelTransitonNeverAck::StopScheduler()
+	{
+	CActiveScheduler::Stop();
+	}
+
+void TestCancelTransitonNeverAck::Perform()
+	{
+	test.Printf(_L("****************TestCancelTransitonNeverAck****************\n"));
+	test.Next(_L("Test state transition cancelation...."));
+	test.Printf(_L("that never acknowledes ......\n"));
+
+	iTester.SetExpectedValues(iTester.gLeafMemberCount, 1);
+
+	SDmStateSpecV1 aStateSpec = GetMaxDeferralState();
+
+	iTestState =  aStateSpec.iState;
+	iTransitionTime = aStateSpec.iTimeoutMs * aStateSpec.iDeferralLimit / 2;
+
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	iCancelTransitionTimer = CPeriodic::NewL(CActive::EPriorityHigh);
+
+	TCallBack cancelCb(CancelTransitionTimerCallback, this);
+	iCancelTransitionTimer->Start(iTransitionTime, iTransitionTime, cancelCb);
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L("....transition cancelled\n"));
+
+	iDelayTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+
+	TCallBack delayCb(DelayTimerCallback, this);
+	TUint delayTime = iTransitionTime * 3;
+	iDelayTimer->Start(delayTime, delayTime, delayCb);
+
+	CActiveScheduler::Start();
+	test.Printf(_L("........expected members got cancelation notified\n"));
+
+	iTester.ValidateTestResults();
+
+	test.Printf(_L("Now request another transition for which the domain members should ack only the last transitions)\n"));
+
+	iTester.SetExpectedValues(iTester.gTestMemberCount + iTester.gLeafMemberCount, 2);
+	aStateSpec = GetMinDeferralState();
+
+	iTestState =  aStateSpec.iState;
+
+	iShouldAck = ETrue;
+	// request a system transition
+	iTester.RequestSystemTransition(iTestState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	// wait for test transitions to complete
+	CActiveScheduler::Start();
+	test.Printf(_L(".......transition completed\n"));
+
+	iTester.ValidateTestResults();
+	}
+
+void TestCancelTransitonNeverAck::Release()
+	{
+	delete iDelayTimer;
+	delete iCancelTransitionTimer;
+	delete this;
+	}
+
+void TestCancelTransitonNeverAck::HandleTransitionL(CDomainMemberKeepAlive* aDmMember)
+	{
+	TInt ackError = iTester.TransitionNotification(*aDmMember);
+
+	if(iShouldAck == EFalse)
+		{
+		aDmMember->GetState();
+
+		// request another notification (even if we didn't acknowledge the last one)
+		aDmMember->RequestTransitionNotification();
+		test.Printf(_L("Return without acknowledging...\n"));
+		return;
+		}
+
+	test.Printf(_L("Skipping to acknowledge the first transition...\n"));
+	/* We are not going to ack the previous notification handled in the above if condition 
+	   Intentionally not acking and continuing to do a GetState to handle the next notification */
+
+	test.Printf(_L("Acknowledge the second transition...\n"));
+	/* Now handle the current notification */
+	aDmMember->GetState();
+	aDmMember->AcknowledgeLastState(ackError);
+	}
+
+TInt TestCancelTransitonNeverAck::HandleDeferralError(TInt aError)
+	{
+	if(!iShouldAck)
+		{
+		// KErrNotReady is possible if the cancellation
+		// ocurred in between member deferrrals
+		test(aError == KErrCancel || aError == KErrNotReady);
+		}
+	else
+		test_Equal(KErrCompletion, aError);
+
+	if(aError == KErrCancel || (aError == KErrNotReady && !iShouldAck))
+		test(++iCancelCount <= iTester.gLeafMemberCount);
+
+	return KErrNone;
+	}
+
+////////////////////////////////////////////////////////////////////////////////////
+//                           CDmDomainKeepAliveTest                               //
+////////////////////////////////////////////////////////////////////////////////////
+void CDmDomainKeepAliveTest::Init(MDomainMemberTests* aTest)
+	{
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTestV2);
+	test_KErrNone(r);
+
+	r = iTestDomainManager.Connect(KDmHierarchyIdTestV2);
+	test_KErrNone(r);
+
+	iTransitionsCompleted = 0;
+	iTestNotifications = 0;
+	gTestMemberCount = 0;
+	gLeafMemberCount = 0;
+
+	// Add some test hierarchy members
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), aTest));
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdRoot, ORDINAL_FROM_DOMAINID0(KDmIdRoot), aTest));
+	
+	// row 1
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestA, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestA), aTest));
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestB, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestB), aTest));
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestC, ORDINAL_FROM_DOMAINID1(KDmIdRoot, KDmIdTestC), aTest));
+	
+	// row2
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestAA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAA), aTest));
+	gLeafMemberCount++;
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestAB, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestA, KDmIdTestAB), aTest));
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestBA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestB, KDmIdTestBA), aTest));
+	gLeafMemberCount++;
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestCA, ORDINAL_FROM_DOMAINID2(KDmIdRoot, KDmIdTestC, KDmIdTestCA), aTest));
+	
+	// row 3
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestABA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABA), aTest));
+	gLeafMemberCount++;
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestABB, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestA, KDmIdTestAB, KDmIdTestABB), aTest));
+	gLeafMemberCount++;
+
+	test_TRAP(iTestMembers[gTestMemberCount++] = CDomainMemberKeepAlive::NewL(KDmHierarchyIdTestV2, KDmIdTestCAA, ORDINAL_FROM_DOMAINID3(KDmIdRoot, KDmIdTestC, KDmIdTestCA, KDmIdTestCAA), aTest));
+	gLeafMemberCount++;
+
+	}
+
+void CDmDomainKeepAliveTest::SetExpectedValues(TInt aTestNotificationsExpected, TInt aTransitionsExpected)
+	{
+	iTestNotificationsExpected = aTestNotificationsExpected;
+	iTransitionsExpected = aTransitionsExpected;
+	}
+
+void CDmDomainKeepAliveTest::ValidateTestResults()
+	{
+	test.Printf(_L("ValidateResults().....\n"));
+
+	test.Printf(_L("iTestNotifications = %d iTestNotificationsExpected = %d\n"), iTestNotifications ,
+				iTestNotificationsExpected);
+	test(iTestNotifications == iTestNotificationsExpected);
+	}
+
+void CDmDomainKeepAliveTest::UnInit()
+	{
+	iTestDomainManager.Close();
+
+	// cleanup
+	
+	for (TUint i = 0; i<gTestMemberCount; i++)
+		delete iTestMembers[i];
+	}
+
+void CDmDomainKeepAliveTest::RequestSystemTransition(TDmDomainState aTestState, TDmTraverseDirection aDirection) 
+	{
+	iTestDomainManager.RequestSystemTransition(aTestState, aDirection, CActive::iStatus);
+	CActive::SetActive();
+	}
+
+void CDmDomainKeepAliveTest::Perform()
+	{
+ 	__UHEAP_MARK;
+
+	CActiveScheduler::Add(this);
+
+	MDomainMemberTests* tests[] = 
+		{
+			new TestTransitionWithDeferral0(*this), // TC 1.1.2.1.1 (with deferral count 0)
+			new TestAckWithinDeferral(*this), // TC 1.1.2.1.1 (with max deferral count)
+			new TestAckAfterDomainDeferralExpiry(*this), // TC 1.1.2.2.1 (But still ongoing with other domain)
+			new TestAckAfterTransitionCompletes(*this), // TC 1.1.2.2.2
+			new TestAckPrevTransAfterNewTransStart(*this, ETrue), // TC 1.1.2.2.3
+			new TestAckPrevTransAfterNewTransStart(*this, EFalse), // TC 1.1.2.2.4
+			new TestCancelTransitonWithMemberAck(*this, KErrNone), // TC1.1.2.3.1
+			new TestCancelTransitonWithMemberAck(*this, KErrCompletion), // TC1.1.2.3.2
+			new TestCancelTransitonNeverAck(*this), // TC1.1.2.3.3
+		};
+
+	for (unsigned int i = 0; i < sizeof(tests)/sizeof(*tests); ++i)
+		{
+		test(tests[i] != NULL);
+		Init(tests[i]);
+		iCurrentTest = tests[i];
+		tests[i]->Perform();
+		tests[i]->Release();
+		UnInit();
+		}
+	__UHEAP_MARKEND;
+	}
+
+void CDmDomainKeepAliveTest::DoAsynMemberAck()
+	{
+	for (TUint i = 0; i<gTestMemberCount; i++)
+		{
+		if(iTestMembers[i]->iShouldAck)
+			{
+			TBuf16<4> buf;
+			GetDomainDesc(iTestMembers[i]->Ordinal(), buf);
+			test.Printf(_L("Request current test to ack %S.......\n"), &buf);
+			iCurrentTest->DoAsynMemberAck(iTestMembers[i]);
+			iTestMembers[i]->iShouldAck = EFalse;
+			}
+		}
+	}
+
+void CDmDomainKeepAliveTest::CancelTransition()
+	{
+	iTestDomainManager.CancelTransition();
+	}
+
+	// This handles a transition notification from a test domain member.
+TInt CDmDomainKeepAliveTest::TransitionNotification(MDmDomainMember& aDomainMember)
+	{
+	TInt status = aDomainMember.Status();
+
+	iTestNotifications++;
+
+	test (aDomainMember.HierarchyId() == KDmHierarchyIdTestV2);
+
+	TBuf16<4> buf;
+	GetDomainDesc(aDomainMember.Ordinal(), buf);
+
+	test.Printf(_L("TransitionNotification Hierarchy = %d, domain = %S, iOrdinal = 0x%08X, state = 0x%x, status = %d\n"), 
+		aDomainMember.HierarchyId(), &buf, aDomainMember.Ordinal(), aDomainMember.State(), status);
+
+	return KErrNone;
+	}
+
+void CDmDomainKeepAliveTest::RunL()
+	{
+	iTransitionsCompleted++;
+
+	TInt error = iStatus.Int();
+
+	test.Printf(_L("CDmDomainKeepAliveTest::RunL() error = %d, iTransitionsCompleted %d iTransitionsExpected %d\n"), 
+		error, iTransitionsCompleted, iTransitionsExpected);
+
+	if (iTransitionsCompleted == iTransitionsExpected)
+		CActiveScheduler::Stop();
+	}
+
+void CDmDomainKeepAliveTest::DoCancel()
+	{
+	test(0);
+	}
+
+void CDmDomainKeepAliveTest::Release()
+	{
+	delete this;
+	}
+
+
+TUint CDmDomainKeepAliveTest::gTestMemberCount = 0;
+TUint CDmDomainKeepAliveTest::gLeafMemberCount = 0;
+
+
+/**
+   DeferAcknowledgement() with status KErrServerBusy.
+
+   Client receives notification, defers once and then defers again before the
+   next notification.
+*/
+class ActiveMember : public CActive
+	{
+public:
+	ActiveMember(CDmTestMember* aMember)
+		: CActive(CActive::EPriorityHigh), iMember(aMember)
+		{
+		CActiveScheduler::Add(this);
+		}
+	~ActiveMember()
+		{
+		Cancel();
+		}
+	void Defer()
+		{
+		iMember->iDomain.DeferAcknowledgement(iStatus);
+		SetActive();
+		}
+	void DoCancel()
+		{
+		iMember->iDomain.CancelDeferral();
+		}
+protected:
+	CDmTestMember* const iMember;
+	};
+
+
+class TestServerBusy : public ActiveMember
+	{
+public:
+	TestServerBusy(CDmTestMember* aMember);
+	~TestServerBusy();
+	void PrimeTimer();
+private:
+	void RunL();
+private:
+	RTimer iTimer;
+	TBool iDeferred;
+	const TInt iInstance;
+	static TInt iInstances;
+	};
+
+TInt TestServerBusy::iInstances = 0;
+
+
+TestServerBusy::TestServerBusy(CDmTestMember* aMember)
+	: ActiveMember(aMember), iDeferred(EFalse), iInstance(++iInstances)
+	{
+	const TInt r = iTimer.CreateLocal();
+	test_KErrNone(r);
+	}
+
+
+TestServerBusy::~TestServerBusy()
+	{
+	Cancel();
+	iTimer.Close();
+	iInstances--;
+	}
+
+
+void TestServerBusy::PrimeTimer()
+	{
+	// let the timers fire at different times (first one in 1ms, second one in
+	// 50ms)
+	const TTimeIntervalMicroSeconds32 t = (iInstance == 1) ? 1000 : 50000;
+	iTimer.After(iStatus, t);
+	SetActive();
+	}
+
+
+void TestServerBusy::RunL()
+	{
+	RDebug::Printf("TestServerBusy(#%d)::RunL(): %d", iInstance, iStatus.Int());
+	if (!iDeferred)
+		{
+		iDeferred = ETrue;
+		Defer();
+		}
+	else if (iInstance == 2)
+		{
+		// This is the test (TC 1.1.1.7.1):
+		test_Equal(KErrServerBusy, iStatus.Int());
+		}
+	else if (iInstance == 1)
+		{
+		// Acknowledge at last
+		test_KErrNone(iStatus.Int());
+		iMember->Acknowledge();
+		}
+	else
+		test(0);
+	}
+
+
+class CDmDeferralTestKErrServerBusy : public CDmDeferralTest
+	{
+public:
+	CDmDeferralTestKErrServerBusy(TDmHierarchyId aId, TDmDomainState aState);
+	~CDmDeferralTestKErrServerBusy();
+	// from CDmDeferralTest
+	void DoPerform();
+	// from MDmTest
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+private:
+	TestServerBusy* iDeferral1;
+	TestServerBusy* iDeferral2;
+	};
+
+
+CDmDeferralTestKErrServerBusy::CDmDeferralTestKErrServerBusy(TDmHierarchyId aId,
+															 TDmDomainState aState)
+	: CDmDeferralTest(aId, aState)
+	{
+	}
+
+
+CDmDeferralTestKErrServerBusy::~CDmDeferralTestKErrServerBusy()
+	{
+	delete iDeferral1;
+	delete iDeferral2;
+	}
+
+
+void CDmDeferralTestKErrServerBusy::DoPerform()
+	{
+	test.Next(_L("CDmDeferralTestKErrServerBusy"));
+
+	iMember = new CDmTestMember(iHierarchyId, KDmIdTestCAA, 0, this);
+	test_NotNull(iMember);
+
+	iDeferral1 = new TestServerBusy(iMember);
+	test_NotNull(iDeferral1);
+	iDeferral2 = new TestServerBusy(iMember);
+	test_NotNull(iDeferral2);
+
+	iManager.RequestSystemTransition(iState, ETraverseDefault, CActive::iStatus);
+	}
+
+
+TInt CDmDeferralTestKErrServerBusy::TransitionNotification(MDmDomainMember&)
+	{
+	RDebug::Printf("CDmDeferralTestKErrServerBusy::TransitionNotification()");
+
+	iDeferral1->PrimeTimer();
+
+	iDeferral2->PrimeTimer();
+
+	// don't acknowledge yet
+	return KErrAbort;
+	}
+
+
+void CDmDeferralTestKErrServerBusy::TransitionRequestComplete()
+	{
+	RDebug::Printf("CDmDeferralTestKErrServerBusy::TransitionRequestComplete()");
+	}
+
+
+/**
+   DeferAcknowledgement() with status KErrCancel.
+
+   1. Client receives notification, defers once and then cancels before the next
+   notification.
+   2. Client receives notification, cancels deferral without one outstanding.
+*/
+class TestCancel : public ActiveMember
+	{
+public:
+	TestCancel(CDmTestMember* aMember)
+		: ActiveMember(aMember)
+		{
+		}
+	void RunL()
+		{
+		RDebug::Printf("TestCancel::RunL(): %d", iStatus.Int());
+
+		// This is the test (TC 1.1.1.4.1):
+		test_Equal(KErrCancel, iStatus.Int());
+
+		// Acknowledge at last
+		iMember->Acknowledge();
+		}
+	};
+
+
+class CDmDeferralTestKErrCancel : public CDmDeferralTest
+	{
+public:
+	CDmDeferralTestKErrCancel(TDmHierarchyId aId, TDmDomainState aState, TBool aDeferFirst);
+	~CDmDeferralTestKErrCancel();
+	// from CDmDeferralTest
+	void DoPerform();
+	// from MDmTest
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+private:
+	TestCancel* iCancel;
+	const TBool iDeferFirst;
+	};
+
+
+CDmDeferralTestKErrCancel::CDmDeferralTestKErrCancel(TDmHierarchyId aId,
+													 TDmDomainState aState,
+													 TBool aDeferFirst)
+	: CDmDeferralTest(aId, aState), iDeferFirst(aDeferFirst)
+	{
+	}
+
+
+CDmDeferralTestKErrCancel::~CDmDeferralTestKErrCancel()
+	{
+	delete iCancel;
+	}
+
+
+void CDmDeferralTestKErrCancel::DoPerform()
+	{
+	test.Next(_L("CDmDeferralTestKErrCancel"));
+
+	iMember = new CDmTestMember(iHierarchyId, KDmIdTestABA, 0, this);
+	test_NotNull(iMember);
+
+	iCancel = new TestCancel(iMember);
+	test_NotNull(iCancel);
+
+	iManager.RequestSystemTransition(iState, ETraverseDefault, CActive::iStatus);
+	}
+
+
+TInt CDmDeferralTestKErrCancel::TransitionNotification(MDmDomainMember&)
+	{
+	RDebug::Printf("CDmDeferralTestKErrCancel::TransitionNotification()");
+
+	if (iDeferFirst)
+		{
+		// Test case 1: First ask for a deferral...
+		iCancel->Defer();
+		}
+
+	// Test cases 1 & 2: Cancel deferral request.
+
+	// RDmDomainSession::CancelDeferral() checks if
+	// RSessionBase::SendReceive(EDmStateCancelDeferral) returned KErrNone;
+	// if not it will panic the client. (TC 1.1.1.4.2)
+
+	iMember->iDomain.CancelDeferral();
+
+	if (iDeferFirst)
+		{
+		// don't acknowledge yet (RunL() will)
+		return KErrAbort;
+		}
+	else
+		{
+		return KErrNone;
+		}
+	}
+
+
+void CDmDeferralTestKErrCancel::TransitionRequestComplete()
+	{
+	RDebug::Printf("CDmDeferralTestKErrCancel::TransitionRequestComplete()");
+	}
+
+
+/**
+   DeferAcknowledgement() with status KErrNotReady.
+
+   1. Client defers before a transition notification.
+   2. Client receives notification, defers once and then defers again after the
+   next notification.
+*/
+class TestNotReady : public ActiveMember
+	{
+public:
+	TestNotReady(CDmTestMember* aMember)
+		: ActiveMember(aMember)
+		{
+		}
+	void RunL()
+		{
+		RDebug::Printf("TestNotReady::RunL(): %d", iStatus.Int());
+
+		// This is the test (TC 1.1.1.5.1):
+		test_Equal(KErrNotReady, iStatus.Int());
+
+		CActiveScheduler::Stop();
+		}
+	};
+
+
+class CDmDeferralTestKErrNotReady : public CDmDeferralTest
+	{
+public:
+	CDmDeferralTestKErrNotReady(TDmHierarchyId aId, TDmDomainState aState);
+	~CDmDeferralTestKErrNotReady();
+	// from CDmDeferralTest
+	void DoPerform();
+	// from MDmTest
+	TInt TransitionNotification(MDmDomainMember& aDomainMember);
+	void TransitionRequestComplete();
+private:
+	TestNotReady* iNotReady;
+	};
+
+
+CDmDeferralTestKErrNotReady::CDmDeferralTestKErrNotReady(TDmHierarchyId aId,
+														 TDmDomainState aState)
+	: CDmDeferralTest(aId, aState)
+	{
+	}
+
+
+CDmDeferralTestKErrNotReady::~CDmDeferralTestKErrNotReady()
+	{
+	delete iNotReady;
+	}
+
+
+void CDmDeferralTestKErrNotReady::DoPerform()
+	{
+	test.Next(_L("CDmDeferralTestKErrNotReady"));
+
+	iMember = new CDmTestMember(iHierarchyId, KDmIdTestABA, 0, this);
+	test_NotNull(iMember);
+
+	iNotReady = new TestNotReady(iMember);
+	test_NotNull(iNotReady);
+
+	iNotReady->Defer();
+	CActiveScheduler::Start();
+
+	iManager.RequestSystemTransition(iState, ETraverseDefault, CActive::iStatus);
+	}
+
+
+TInt CDmDeferralTestKErrNotReady::TransitionNotification(MDmDomainMember&)
+	{
+	RDebug::Printf("CDmDeferralTestKErrNotReady::TransitionNotification()");
+
+	// don't acknowledge yet
+	return KErrAbort;
+	}
+
+
+void CDmDeferralTestKErrNotReady::TransitionRequestComplete()
+	{
+	RDebug::Printf("CDmDeferralTestKErrNotReady::TransitionRequestComplete()");
+
+	TRequestStatus status;
+	iMember->iDomain.DeferAcknowledgement(status);
+	User::WaitForRequest(status);
+
+	RDebug::Printf("Deferral status: %d", status.Int());
+
+	// This is the test (TC 1.1.1.5.2):
+	test_Equal(KErrNotReady, status.Int());
+
+	}
+
+
+/**
+   Policy interface tests - negative tests.
+
+   1. Ordinals return null or error.
+   2. Structure returned contains invalid values.
+*/
+class CDmPolicyInterfaceTest : public MDmTest
+	{
+public:
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember&)
+		{
+		return KErrNone;
+		}
+	void TransitionRequestComplete()
+		{}
+	};
+
+
+void CDmPolicyInterfaceTest::Perform()
+	{
+	test.Next(_L("CDmPolicyInterfaceTest"));
+
+	// In domainpolicy95.dll ordinal 4 (DmPolicy::GetStateSpec) returns an
+	// error. This will lead to the failure of the following call, which will
+	// also execute the destructors of classes CDmHierarchy and
+	// CHierarchySettings.
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTestV2_95);
+
+	// This is the test (TC 1.4.2.1):
+	test_Equal(KDmErrBadDomainSpec, r);
+
+	// domainpolicy94.dll contains garbage values in the SDmStateSpecV1 struct.
+	r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTestV2_94);
+
+	// This is the test (TC 1.4.2.2):
+	test_Equal(KDmErrBadDomainSpec, r);
+	}
+
+
+void CDmPolicyInterfaceTest::Release()
+	{
+	delete this;
+	}
+
+
+/////////////////////// Failure Policy Tests //////////////////////////////////
+// 2.4 [M] Domain Controller DC5 (different failure policies for different 
+//         system state transitions)
+//    * TC 2.4.1 Create V2 policy where some states are "stop" and some are 
+//      "continue" on failure, get member(s) to fail 
+//
+
+class CDmFailurePolicyTest : public CActive, public MDmTest
+	{
+public:
+	CDmFailurePolicyTest(TDmDomainState aState, TDmTransitionFailurePolicy aPolicy);
+	~CDmFailurePolicyTest();
+		
+	// from CActive
+	void RunL();
+	
+	// from MDmTest
+	void Perform();
+	void Release();
+	TInt TransitionNotification(MDmDomainMember&);
+	void TransitionRequestComplete()
+		{}
+		
+private:
+	// from CActive
+	virtual void DoCancel()
+		{ test(0); }
+		
+private:
+	RDmDomainManager iManager;
+	CDmTestMember*	 iMembers[2];
+	
+	TDmDomainState				iDmState;
+	TDmTransitionFailurePolicy	iFailPolicy;
+	};
+
+
+CDmFailurePolicyTest::CDmFailurePolicyTest(TDmDomainState aState, TDmTransitionFailurePolicy aPolicy)
+	: CActive(CActive::EPriorityStandard), iDmState(aState), iFailPolicy(aPolicy)
+	{
+	iMembers[0] = iMembers[1] = 0;
+	}
+	
+CDmFailurePolicyTest::~CDmFailurePolicyTest()
+	{
+	Cancel();
+	for (int i = 0; i < 2; i++)
+		delete iMembers[i], iMembers[i]= 0;
+	iManager.Close();
+	}
+
+void CDmFailurePolicyTest::Perform()
+	{
+	test.Next(_L("CDmFailurePolicyTest"));
+	
+	RDebug::Printf("CDmFailurePolicyTest::Perform: iFailPolicy(%d)", iFailPolicy);
+
+	// 1. Set up test hierarchy/domain & join it
+	TInt r = RDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTestV2);
+	test_KErrNone(r);
+	r = iManager.Connect(KDmHierarchyIdTestV2);
+	test_KErrNone(r);
+
+	// 2. Create the two members needed for this test. First does not ackn.
+	iMembers[0] = new CDmTestMember(KDmHierarchyIdTestV2, KDmIdTestB, (iFailPolicy<<8)+0, this);
+	test_NotNull(iMembers[0]);
+	iMembers[1] = new CDmTestMember(KDmHierarchyIdTestV2, KDmIdTestBA, (iFailPolicy<<8)+1, this);
+	test_NotNull(iMembers[1]);
+
+	// 3. Initiate state transition from iInitState to iDmState
+	CActiveScheduler::Add(this);
+	iManager.RequestDomainTransition(KDmIdTestB, iDmState, ETraverseParentsFirst, iStatus);
+	CActive::SetActive();
+	CActiveScheduler::Start();
+
+	// Close iManager when this object is destroyed in destructor
+	}
+
+TInt CDmFailurePolicyTest::TransitionNotification(MDmDomainMember& aMember)
+	{
+	RDebug::Printf("CDmFailurePolicyTest::TransitionNotification: aMember(%d)", aMember.Ordinal());
+	
+    if ((aMember.Ordinal() & 0xff ) == 0)		// Member in domain B
+	{
+		if (((aMember.Ordinal() & 0xff00) >> 8) == 0) // Stop policy
+		{
+			return KErrAbort; // Dont let this member in domain B ackn.
+		}
+		else // Continue policy
+		{
+			return KErrCommsParity; // Ackn with bizarre error
+		}	
+    }
+    
+	// Should only reach here for Members of sub-domain BA
+	return KErrNone;
+	}
+
+
+void CDmFailurePolicyTest::RunL()
+	{
+	RDebug::Printf("CDmFailurePolicyTest::RunL: istatus(%d)", iStatus.Int());
+	
+	// Handle Transition completion code here. Should be a time out.
+	
+	// Based on failure policy check to see if the second member was transitioned
+	// (continue) or whether it was not (stop). Since ETraverseParentsFirst is used
+	// in the transition iMember[0] in domain B should fail and the iMember [1]
+	// in domain BA may or may not then be transitioned....
+	
+	test_Equal(1, iMembers[0]->Notifications());
+	
+	if (iFailPolicy == ETransitionFailureContinue)
+		{
+		test_Equal(KErrCommsParity, iStatus.Int());		
+		test_Equal(1, iMembers[1]->Notifications()); // Proves it did continue with transition
+		}
+	else if (iFailPolicy == ETransitionFailureStop)
+		{
+		test_Equal(KErrTimedOut, iStatus.Int());
+		test_Equal(0, iMembers[1]->Notifications()); // Proves it did stop transition
+		}
+	else
+		{
+		test(0); // Panic default case
+		}	
+		
+	test.Printf(_L("Test passed - failure policy (%d)\n"), iFailPolicy);
+	
+	CActiveScheduler::Stop();
+	}
+
+
+void CDmFailurePolicyTest::Release()
+	{
+	RDebug::Printf("CDmFailurePolicyTest::Release");
+	delete this;
+	}
+
+/****************************** CDmDomainKeepAlive Functional coverage test ******************************/
+// CDmKeepAliveFuncCov
+class CDmKeepAliveFuncCov : public CDmDomainKeepAlive
+	{
+public:
+	enum TMemKeepAliveCovTests { ECovHandleError, ECovDoCancel };
+
+	static CDmKeepAliveFuncCov* NewL(TDmHierarchyId aHierarchy, TDmDomainId aId);
+	~CDmKeepAliveFuncCov();
+
+	// from CDmDomainKeepAlive
+	void HandleTransitionL();
+private:
+	CDmKeepAliveFuncCov(TDmHierarchyId aHierarchy, TDmDomainId aId);
+
+public:
+	TMemKeepAliveCovTests iDmMemCov;
+	};
+
+CDmKeepAliveFuncCov* CDmKeepAliveFuncCov::NewL(TDmHierarchyId aHierarchy, TDmDomainId aId)
+	{
+	CDmKeepAliveFuncCov* self=new (ELeave) CDmKeepAliveFuncCov(aHierarchy, aId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+
+	self->RequestTransitionNotification();
+
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDmKeepAliveFuncCov::~CDmKeepAliveFuncCov()
+	{
+	Cancel();
+	}
+
+CDmKeepAliveFuncCov::CDmKeepAliveFuncCov(TDmHierarchyId aHierarchy, TDmDomainId aId):
+	CDmDomainKeepAlive(aHierarchy, aId)
+	{
+	}
+
+void CDmKeepAliveFuncCov::HandleTransitionL()
+	{
+	switch(iDmMemCov)
+		{
+		case ECovHandleError:
+			// Simply ack. Since the request transition is for 0 deferral 
+			// KErrNotSupported will anyways happen
+			GetState();
+			AcknowledgeLastState(KErrNone);
+			RequestTransitionNotification();
+			break;
+		case ECovDoCancel:
+			// do nothing, let the keep alive deferrals be active and let the CDmKeepAliveFuncCovTest delete this object
+			CActiveScheduler::Stop();
+			break;
+		default:
+			User::Leave(KErrUnknown);
+			break;
+		}
+	}
+
+class CDmDomainManFuncCov : public CDmDomainManager
+	{
+public:
+	static CDmDomainManFuncCov* NewL(TDmHierarchyId aHierarchy);
+	~CDmDomainManFuncCov();
+
+	// from CDmDomainManager
+	void RunL();
+private:
+	CDmDomainManFuncCov(TDmHierarchyId aHierarchy);
+	};
+
+CDmDomainManFuncCov* CDmDomainManFuncCov::NewL(TDmHierarchyId aHierarchy)
+	{
+	CDmDomainManFuncCov* self=new (ELeave) CDmDomainManFuncCov(aHierarchy);
+	CleanupStack::PushL(self);
+
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+CDmDomainManFuncCov::~CDmDomainManFuncCov()
+	{
+	Cancel();
+	}
+
+CDmDomainManFuncCov::CDmDomainManFuncCov(TDmHierarchyId aHierarchy) :
+	CDmDomainManager(aHierarchy)
+	{
+	}
+
+void CDmDomainManFuncCov::RunL()
+	{
+	CActiveScheduler::Stop();
+	}
+
+class CDmKeepAliveFuncCovTest : public CActive, public MDmTest
+	{
+public:
+	CDmKeepAliveFuncCovTest() : CActive(CActive::EPriorityStandard) {};
+	void Perform();
+	void Release();
+
+	TInt TransitionNotification(MDmDomainMember&) { return KErrNone; };
+	void TransitionRequestComplete() {};
+
+		// from CActive
+	void RunL() {};
+	virtual void DoCancel()
+		{
+		test(0);
+		}
+
+public:
+	CDmDomainManFuncCov*		iTestDomainManager;
+	};
+
+void CDmKeepAliveFuncCovTest::Perform()
+	{
+ 	__UHEAP_MARK;
+
+	CActiveScheduler::Add(this);
+
+	test.Printf(_L("****************CFunctionalCoverageTest****************\n"));
+	test.Next(_L("Test to perform code coverage"));
+
+	TInt r = CDmDomainManager::AddDomainHierarchy(KDmHierarchyIdTestV2);
+	test(r == KErrNone);
+
+	TRAP_IGNORE(iTestDomainManager = CDmDomainManFuncCov::NewL(KDmHierarchyIdTestV2));
+	test (iTestDomainManager != NULL);
+
+	CDmKeepAliveFuncCov* member = NULL;
+	// Add some test hierarchy members
+	TRAP(r, member = CDmKeepAliveFuncCov::NewL(KDmHierarchyIdTestV2, KDmIdRoot));
+	test(member != NULL);
+
+	SDmStateSpecV1 aStateSpec = Get0DeferralState();
+
+	TDmDomainState		testState =  aStateSpec.iState;
+
+	// request a system transition
+	iTestDomainManager->RequestSystemTransition(testState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	member->iDmMemCov = CDmKeepAliveFuncCov::ECovHandleError;
+
+	test.Printf(_L("HandleDeferralError functional coverage...\n"));
+	// wait for test transition to complete
+	CActiveScheduler::Start();
+
+	test.Printf(_L("......system transition completed\n"));
+
+	aStateSpec = GetMaxDeferralState();
+	testState =  aStateSpec.iState;
+
+	// request a system transition
+	iTestDomainManager->RequestSystemTransition(testState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	member->iDmMemCov = CDmKeepAliveFuncCov::ECovDoCancel;
+	test.Printf(_L("DoCancel functional coverage...\n"));
+	// wait for the member to call CActiveScheduler::Stop
+	CActiveScheduler::Start();
+	delete member;
+
+	// wait for test transition to complete
+	CActiveScheduler::Start();
+	test.Printf(_L("......system transition completed\n"));
+
+	// Add some test hierarchy members
+	TRAP(r, member = CDmKeepAliveFuncCov::NewL(KDmHierarchyIdTestV2, KDmIdRoot));
+	test(member != NULL);
+
+	aStateSpec = GetMaxDeferralState();
+	testState =  aStateSpec.iState;
+
+	// request a system transition
+	iTestDomainManager->RequestSystemTransition(testState, ETraverseChildrenFirst);
+	test.Printf(_L("Requested system transition\n"));
+
+	member->iDmMemCov = CDmKeepAliveFuncCov::ECovDoCancel; // just so that the member will call CActiveScheduler::Stop
+
+	test.Printf(_L("DoCancel functional coverage...\n"));
+	// wait for the member to call CActiveScheduler::Stop
+	CActiveScheduler::Start();
+
+	delete iTestDomainManager;
+	delete member;
+
+	__UHEAP_MARKEND;
+	}
+
+void CDmKeepAliveFuncCovTest::Release()
+	{
+	delete this;
+	}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// --- Main() ---
+
+GLDEF_C TInt E32Main()
+	{
+	CTrapCleanup* trapHandler = CTrapCleanup::New();
+	test(trapHandler != NULL);
+
+	CActiveScheduler* scheduler = new CActiveScheduler();
+	test(scheduler != NULL);
+	CActiveScheduler::Install(scheduler);
+
+	// Turn off evil lazy dll unloading
+	RLoader l;
+	test(l.Connect() == KErrNone);
+	test(l.CancelLazyDllUnload()== KErrNone);
+	l.Close();
+
+	// Default number of iteration
+    TInt iter = 1;
+
+	TInt len = User::CommandLineLength();
+	if (len)
+		{
+		// Copy the command line in a buffer
+		HBufC* hb = HBufC::NewMax(len);
+		test(hb != NULL);
+		TPtr cmd((TUint16*) hb->Ptr(), len);
+		User::CommandLine(cmd);
+		// Extract the number of iterations
+		TLex l(cmd);
+		TInt i;
+		TInt r = l.Val(i);
+		if (r == KErrNone)
+			iter = i;
+		else
+			// strange command - silently ignore
+			{}
+		delete hb;
+		}
+
+	test.Title();
+
+	test.Start(_L("Test starting..."));
+
+	test.Printf(_L("Go for %d iterations\n"), iter);
+
+	// Remember the number of open handles. Just for a sanity check
+	TInt start_thc, start_phc;
+	RThread().HandleCount(start_phc, start_thc);
+
+	for (TInt i = 1; i <= iter; i++)
+		{
+		test.Printf(_L("\nThis iteration: %d\n"), i);
+
+		MDmTest* tests[] =
+			{
+			// DM Client PlatSec tests
+			new CDmTestPlatSec(TPtrC(KSecuritySlavePath1)),
+			new CDmTestPlatSec(TPtrC(KSecuritySlavePath2)),
+			new CDmTestPlatSec(TPtrC(KSecuritySlavePath3)),
+
+			// Domain Member R-Class API tests
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, EShutdownCritical, 1, ETrue), // TC 1.1.1.1.1
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, EShutdownCritical, 2, ETrue), // TC 1.1.1.1.2
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, EShutdownCritical, 1, EFalse), // TC 1.1.1.1.3
+			new CDmDeferralTestCompletion(KDmHierarchyIdTestV2, EBackupMode), // TC 1.1.1.2.1
+			new CDmDeferralTestKErrNotSupported(KDmHierarchyIdTestV2, EShutdownCritical, 6), // TC 1.1.1.3.1
+			new CDmDeferralTestKErrNotSupported(KDmHierarchyIdTestV2, ENormalRunning, 1), // TC 1.1.1.3.2
+			new CDmDeferralTestKErrNotSupported(KDmHierarchyIdTest, EBackupMode, 1), // TC 1.1.1.3.3
+			new CDmDeferralTestKErrCancel(KDmHierarchyIdTestV2, EBackupMode, ETrue), // TC 1.1.1.4.1
+			new CDmDeferralTestKErrCancel(KDmHierarchyIdTestV2, EBackupMode, EFalse), // TC 1.1.1.4.2
+			new CDmDeferralTestKErrNotReady(KDmHierarchyIdTestV2, EBackupMode), // TC 1.1.1.5.1
+			new CDmDeferralTestKErrServerBusy(KDmHierarchyIdTestV2, ERestoreMode), // TC 1.1.1.7.1
+
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, ERestoreMode, 0, ETrue), // TC 1.2.0
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, ERestoreMode, 1, ETrue), // TC 1.2.1
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, ERestoreMode, 2, ETrue), // TC 1.2.2
+			new CDmDeferralTestKErrNone(KDmHierarchyIdTestV2, ERestoreMode, 3, ETrue), // TC 1.2.3
+
+			new	CDmDeferralMixed(KDmHierarchyIdTestV2, EShutdownCritical, 3, ETrue,EFalse), // TC 1.3.1
+			new	CDmDeferralMixed(KDmHierarchyIdTestV2, EShutdownCritical, 3, ETrue,ETrue),  // TC 1.3.2
+
+			// Domain Member C-Class API tests
+			new CDmDomainKeepAliveTest(),
+
+			// Policy State Spec Failure Policy tests - transition timeouts
+			//   ETransitionFailureUsePolicyFromOrdinal3
+			new CDmFailurePolicyTest(EStartupCriticalStatic, HierarchyPolicy.iFailurePolicy),
+			new CDmFailurePolicyTest(EStartupCriticalDynamic, ETransitionFailureStop),
+			new CDmFailurePolicyTest(ENormalRunning, ETransitionFailureContinue),
+
+			// Policy Interface tests
+			new CDmPolicyInterfaceTest(),
+
+			// Functional coverage test
+			new CDmKeepAliveFuncCovTest(),
+			};
+
+		for (TUint j = 0; j < sizeof(tests)/sizeof(*tests); j++)
+			{
+			test(tests[j] != NULL);
+			tests[j]->Perform();
+			tests[j]->Release();
+			}
+		}
+
+	test.End();
+
+	// Sanity check for open handles and for pending requests
+	TInt end_thc, end_phc;
+	RThread().HandleCount(end_phc, end_thc);
+	test(start_thc == end_thc);
+	test(start_phc == end_phc);
+	test(RThread().RequestCount() >= 0);
+
+	delete scheduler;
+	delete trapHandler;
+
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/domainmgr/t_domain_monitor.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/domainmgr/t_domain_monitor.mmp
+// 
+//
+
+TARGET			t_domain_monitor.exe        
+TARGETTYPE		EXE
+SOURCEPATH		.
+SOURCE			t_domain_monitor.cpp t_domain_cmn.cpp domainpolicy98.cpp
+LIBRARY			euser.lib domaincli.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		../../../userlibandfileserver/domainmgr/inc
+
+CAPABILITY		PowerMgmt WriteDeviceData ProtServ
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/domainmgr/test.inf	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/domainmgr/test.inf	Mon Oct 04 12:03:52 2010 +0100
@@ -22,21 +22,32 @@
 BASEDEFAULT
 
 
-
 PRJ_TESTEXPORTS
 
 dm_tests.iby	/epoc32/rom/include/dm_tests.iby
 
+dmtest.all.bat	/epoc32/rom/include/dmtest.all.bat
 dmtest.auto.bat	/epoc32/rom/include/dmtest.auto.bat
 dm_autoexec.bat	/epoc32/rom/include/dm_autoexec.bat
 
 
-
 PRJ_TESTMMPFILES
 
 #ifndef SMP
 t_domain
+t_domain_monitor
+t_domain_manual		manual
+
 t_domain_slave		support
+t_dmslave_nocaps	support
+t_dmslave_wdd		support
+t_dmslave_protsrv	support
+
+domainpolicy94		support
+domainpolicy95		support
+domainpolicy96		support
+domainpolicy97		support
+domainpolicy98		support
 domainpolicy99		support
 #endif
 
--- a/kerneltest/e32test/eabi/domainpolicy99u.def	Tue Sep 28 15:28:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_ZN8DmPolicy14GetDomainSpecsEv @ 1 NONAME
-	_ZN8DmPolicy7ReleaseEPK13TDmDomainSpec @ 2 NONAME
-	_ZN8DmPolicy9GetPolicyER18TDmHierarchyPolicy @ 3 NONAME
-
--- a/kerneltest/e32test/group/bld.inf	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/group/bld.inf	Mon Oct 04 12:03:52 2010 +0100
@@ -120,6 +120,7 @@
 d_gobble					support
 d_nanowait					support
 d_medch						support
+d_mmctest					support
 d_shbuf_client				support
 d_shbuf_own					support
 d_asid						support
@@ -717,6 +718,7 @@
 t_pccdsr    support
 t_mmcdrv    manual
 t_med_writebm   manual
+t_mmcinfo
 
 #ifdef EPOC32
 t_crrdrv    support
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/d_mmctest.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/group/d_mmctest.mmp
+// 
+//
+
+#include "kernel/kern_ext.mmh"
+
+TARGET         d_mmctest.ldd
+TARGETTYPE     LDD
+SOURCEPATH	../pccd
+SOURCE         d_mmctest.cpp
+LIBRARY		epbusmmc.lib
+
+epocallowdlldata
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability	all
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_mmcinfo.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/group/t_mmcinfo.mmp
+// 
+//
+
+TARGET         t_mmcinfo.exe        
+TARGETTYPE     EXE
+SOURCEPATH	../pccd
+SOURCE         t_mmcinfo.cpp
+LIBRARY        euser.lib hal.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+start wins
+win32_headers
+end
+
+capability	   all
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pccd/d_mmctest.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,670 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This LDD provides a set of direct interface functions with the kernel 
+// MultiMediaCard Controller
+// 
+//
+
+#include <kernel/kernel.h>
+#include <drivers/mmc.h>
+#include "d_mmctest.h"
+
+const TInt KMajorVersionNumber=1;
+const TInt KMinorVersionNumber=0;
+const TInt KBuildVersionNumber=0;
+
+const TInt KStackNumber  = 0;
+
+const TInt KMaxMMCCardsPerStack = 4;
+
+// global Dfc Que
+TDynamicDfcQue* gDfcQ;
+
+class DLddFactoryMmcCntrlInterface : public DLogicalDevice
+	{
+public:
+	DLddFactoryMmcCntrlInterface();
+	virtual ~DLddFactoryMmcCntrlInterface();
+	virtual TInt Install();
+	virtual void GetCaps(TDes8 &aDes) const;
+	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
+	};
+
+class DLddMmcCntrlInterface : public DLogicalChannel
+	{
+public:
+	DLddMmcCntrlInterface();
+	~DLddMmcCntrlInterface();
+protected:
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual void HandleMsg(class TMessageBase *);
+private:
+	void DoCancel(TInt aReqNo);
+	TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
+	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
+	TInt PrintCardInfo();	
+private:
+    void Reset();
+    static void SessionEndCallBack(TAny *aPtr);
+    static void SessionEndDfc(TAny *aPtr);
+	static void EventCallBack(TAny* aPtr, TInt aReason, TAny* a1, TAny* a2);
+
+private:
+    enum TPanic {EReadDes,EWriteDes,EWriteTInt,EUnknownMmcSes};
+    enum TMmcSessionCmd {EMmcSesNone,EMmcSesReadBlk,EMmcSesWriteBlk, EMmcSesReadExtCSD};
+    TInt iStackNum;
+	DMMCSocket* iSocketP;
+    DMMCStack* iStack;
+    TMMCard* iCard;
+    DMMCSession* iSession;
+    TMmcSessionCmd iMmcSessionCmd;
+    TAny* iClientDesPtr;
+	TUint32 iBlkOffet;
+	TRequestStatus* iReadWriteStatusP;
+    TMMCCallBack iSessionEndCallBack;
+	TDfc iSessionEndDfc;
+	TPBusCallBack iBusEventCallback;
+	TRequestStatus* iPowerUpStatusP;
+//	TUint8 iBuf[KDrvBufSizeInBytes];	// iBuf now uses the MMC DMA buffer, until DT issue with H4 is resolved
+	TUint8* iBuf;
+	DThread* iClient;
+	TExtendedCSD iExtendedCSD;
+    };
+
+DECLARE_STANDARD_LDD()
+	{
+	return new DLddFactoryMmcCntrlInterface;
+	}
+
+DLddFactoryMmcCntrlInterface::DLddFactoryMmcCntrlInterface()
+//
+// Constructor
+//
+	{
+
+    iParseMask=KDeviceAllowUnit;  // Pass stack number as unit
+	iUnitsMask=0xffffffff;
+	iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
+	}
+
+TInt DLddFactoryMmcCntrlInterface::Create(DLogicalChannelBase*& aChannel)
+//
+// Create a new DLddFactoryMmcCntrlInterface on this logical device
+//
+	{
+	aChannel=new DLddMmcCntrlInterface;
+	return aChannel ? KErrNone : KErrNoMemory;
+	}
+
+const TInt KDMmcThreadPriority = 27;
+_LIT(KDMmcThread,"DMmcTestThread");
+
+TInt DLddFactoryMmcCntrlInterface::Install()
+//
+// Install the device driver.
+//
+	{
+	// Allocate a kernel thread to run the DFC 
+	TInt r = Kern::DynamicDfcQCreate(gDfcQ, KDMmcThreadPriority, KDMmcThread);
+
+	if (r != KErrNone)
+		return r; 	
+
+    TPtrC name=_L("MmcTest");
+	return(SetName(&name));
+	}
+
+void DLddFactoryMmcCntrlInterface::GetCaps(TDes8 &aDes) const
+//
+// Return the Pc Card Contoller Interface ldd's capabilities.
+//
+	{
+
+    TCapsMmcIfV01 b;
+	b.version=TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
+    Kern::InfoCopy(aDes,(TUint8*)&b,sizeof(b));
+	}
+
+/**
+  Destructor
+*/
+DLddFactoryMmcCntrlInterface::~DLddFactoryMmcCntrlInterface()
+	{
+	if (gDfcQ)
+		gDfcQ->Destroy();
+	}
+
+#pragma warning( disable : 4355 )	// this used in initializer list
+DLddMmcCntrlInterface::DLddMmcCntrlInterface()
+//
+// Constructor
+//
+	: iSessionEndCallBack(DLddMmcCntrlInterface::SessionEndCallBack,this),
+	  iSessionEndDfc(DLddMmcCntrlInterface::SessionEndDfc, this, 1),
+	  iBusEventCallback(DLddMmcCntrlInterface::EventCallBack, this)
+	{
+
+//	iMmcController=NULL;
+//  iStackNum=0;
+//  iStack=NULL;
+//  iCard=NULL;
+//  iSession=NULL;
+//  iMmcSessionCmd=EMmcSesNone;
+//  iClientDesPtr=NULL;
+//	iBlkOffet=0;
+
+	iClient=&Kern::CurrentThread();
+	((DObject*)iClient)->Open();	// can't fail since thread is running
+    }
+#pragma warning( default : 4355 )
+
+DLddMmcCntrlInterface::~DLddMmcCntrlInterface()
+//
+// Destructor
+//
+	{
+
+    Reset();
+	iBusEventCallback.Remove();
+	delete iSession;
+	Kern::SafeClose((DObject*&)iClient,NULL);
+    }
+
+TInt DLddMmcCntrlInterface::DoCreate(TInt aUnit, const TDesC8* /*aInfo*/, const TVersion& aVer)
+//
+// Create channel.
+//
+	{    
+	if (!Kern::QueryVersionSupported(TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber),aVer))
+		return(KErrNotSupported);
+
+	//
+	// Obtain the appropriate card from the socket/stack
+	//
+	iSocketP = static_cast<DMMCSocket*>(DPBusSocket::SocketFromId(aUnit));
+	if(iSocketP == NULL)
+		return(KErrNoMemory);
+
+	iStack = static_cast<DMMCStack*>(iSocketP->Stack(KStackNumber));
+	if(iStack == NULL)
+		return(KErrNoMemory);
+
+    // Create an MMC session object
+	iSession = iStack->AllocSession(iSessionEndCallBack);
+    if (iSession==NULL)
+		return(KErrNoMemory);
+		
+    iSession->SetStack(iStack);
+   
+	TUint8* buf;
+	TInt bufLen;
+	TInt minorBufLen;
+	iStack->BufferInfo(buf, bufLen, minorBufLen);
+	iBuf = buf;
+
+	SetDfcQ(gDfcQ);
+	iMsgQ.Receive();
+	
+	iSessionEndDfc.SetDfcQ(gDfcQ);
+
+	iBusEventCallback.SetSocket(aUnit);
+	iBusEventCallback.Add();
+
+    return(KErrNone);
+	}
+
+void DLddMmcCntrlInterface::DoCancel(TInt /*aReqNo*/)
+//
+// Cancel an outstanding request.
+//
+	{
+	}
+
+void DLddMmcCntrlInterface::HandleMsg(TMessageBase* aMsg)
+    {
+    TThreadMessage& m=*(TThreadMessage*)aMsg;
+    TInt id=m.iValue;
+    
+	if (id==(TInt)ECloseMsg)
+		{
+		m.Complete(KErrNone, EFalse);
+		return;
+		}
+    else if (id==KMaxTInt)
+		{
+		// DoCancel
+		m.Complete(KErrNone,ETrue);
+		return;
+		}
+
+    if (id<0)
+		{
+		// DoRequest
+		TRequestStatus* pS=(TRequestStatus*)m.Ptr0();
+		TInt r=DoRequest(~id, pS, m.Ptr1(), m.Ptr2());
+		if (r!=KErrNone)
+	    	Kern::RequestComplete(iClient, pS, r);
+		m.Complete(KErrNone,ETrue);
+		}
+    else
+		{
+		// DoControl
+		TInt r=DoControl(id,m.Ptr0(),m.Ptr1());
+		if(r != KErrCompletion)
+			{
+			m.Complete(r,ETrue);
+			}
+		}
+	}
+
+TInt DLddMmcCntrlInterface::PrintCardInfo()
+    {
+    if(iCard == NULL)
+        {
+        return(KErrNotReady);
+        }
+    const TCSD& csd = iCard->CSD();
+    Kern::Printf("CSD");    
+    Kern::Printf("CSDStructure():                 %u",csd.CSDStructure());
+    Kern::Printf("SpecVers():                     %u",csd.SpecVers());
+    switch (csd.MediaType())
+        {
+        case EMultiMediaROM   : Kern::Printf("Read Only Media"); break;
+        case EMultiMediaFlash : Kern::Printf("Writable Media"); break;
+        case EMultiMediaIO    : Kern::Printf("IO Media Device"); break;
+        case EMultiMediaOther : Kern::Printf("UNKNOWN Media type"); break;
+        default : Kern::Printf("Media NOT SUPPORTED");
+        }    
+    Kern::Printf("----------------------------------");
+    Kern::Printf("Reserved120():                  %u",csd.Reserved120());
+    Kern::Printf("TAAC():                         %u", csd.TAAC());
+    Kern::Printf("NSAC():                         %u", csd.NSAC());
+    Kern::Printf("TranSpeed():                    %u", csd.TranSpeed());
+    Kern::Printf("CCC():                          %u",csd.CCC());
+    Kern::Printf("ReadBlLen():                    %u", csd.ReadBlLen());
+    Kern::Printf("ReadBlPartial():                %u", (TUint)csd.ReadBlPartial());
+    Kern::Printf("WriteBlkMisalign():             %u", (TUint) csd.WriteBlkMisalign());
+    Kern::Printf("ReadBlkMisalign():              %u", (TUint) csd.ReadBlkMisalign());
+    Kern::Printf("DSRImp():                       %u", (TUint) csd.DSRImp());
+    Kern::Printf("Reserved74():                   %u", csd.Reserved74());
+    Kern::Printf("CSize():                        %u", csd.CSize());
+    Kern::Printf("VDDRCurrMin():                  %u", csd.VDDRCurrMin());
+    Kern::Printf("VDDRCurrMax():                  %u", csd.VDDRCurrMax());
+    Kern::Printf("VDDWCurrMin():                  %u", csd.VDDWCurrMin());
+    Kern::Printf("VDDWCurrMax():                  %u", csd.VDDWCurrMax());
+    Kern::Printf("CSizeMult():                    %u", csd.CSizeMult());
+    Kern::Printf("EraseGrpSize():                 %u", csd.EraseGrpSize());
+    Kern::Printf("EraseGrpMult():                 %u", csd.EraseGrpMult());
+    Kern::Printf("WPGrpSize():                    %u", csd.WPGrpSize());
+    Kern::Printf("WPGrpEnable():                  %u", csd.WPGrpEnable());            
+    Kern::Printf("DefaultECC():                   %u", csd.DefaultECC());
+    Kern::Printf("R2WFactor():                    %u", csd.R2WFactor());
+    Kern::Printf("WriteBlLen():                   %u", csd.WriteBlLen());
+    Kern::Printf("WriteBlPartial():               %u", (TUint) csd.WriteBlPartial());
+    Kern::Printf("Reserved16():                   %u", csd.Reserved16());
+    Kern::Printf("FileFormatGrp():                %u", (TUint) csd.FileFormatGrp());
+    Kern::Printf("Copy():                         %u", (TUint) csd.Copy());
+    Kern::Printf("PermWriteProtect():             %u", (TUint) csd.PermWriteProtect());
+    Kern::Printf("TmpWriteProtect():              %u", (TUint) csd.TmpWriteProtect());
+    Kern::Printf("FileFormat():                   %u", csd.FileFormat());
+    Kern::Printf("ECC():                          %u", csd.ECC());
+    Kern::Printf("CRC():                          %u", csd.CRC());
+    Kern::Printf("DeviceSize():                   %u", csd.DeviceSize());   
+    Kern::Printf("ReadBlockLength():              %u", csd.ReadBlockLength());
+    Kern::Printf("WriteBlockLength():             %u", csd.WriteBlockLength());
+    Kern::Printf("EraseSectorSize():              %u", csd.EraseSectorSize());
+    Kern::Printf("EraseGroupSize():               %u", csd.EraseGroupSize());
+    Kern::Printf("MinReadCurrentInMilliamps():    %u", csd.MinReadCurrentInMilliamps());
+    Kern::Printf("MinWriteCurrentInMilliamps():   %u", csd.MinWriteCurrentInMilliamps());
+    Kern::Printf("MaxReadCurrentInMilliamps():    %u", csd.MaxReadCurrentInMilliamps());
+    Kern::Printf("MaxWriteCurrentInMilliamps():   %u", csd.MaxWriteCurrentInMilliamps());
+    Kern::Printf("MaxTranSpeedInKilohertz():      %u", csd.MaxTranSpeedInKilohertz());
+    
+    const TExtendedCSD& extcsd = iCard->iExtendedCSD;
+    Kern::Printf("\nExtended CSD");
+    Kern::Printf("CSDStructureVer:                %u", extcsd.CSDStructureVer());
+    Kern::Printf("ExtendedCSDRev:                 %u", extcsd.ExtendedCSDRev());
+    Kern::Printf("----------------------------------");
+    Kern::Printf("SupportedCmdSet:                %u", extcsd.SupportedCmdSet());
+    Kern::Printf("SectorCount:                    %u", extcsd.SectorCount());
+    Kern::Printf("MinPerfWrite8Bit52Mhz:          %u", extcsd.MinPerfWrite8Bit52Mhz());
+    Kern::Printf("MinPerfRead8Bit52Mhz:           %u", extcsd.MinPerfRead8Bit52Mhz());
+    Kern::Printf("MinPerfRead8Bit26Mhz_4Bit52Mhz: %u", extcsd.MinPerfRead8Bit26Mhz_4Bit52Mhz());
+    Kern::Printf("MinPerfWrite4Bit26Mhz:          %u", extcsd.MinPerfWrite4Bit26Mhz());
+    Kern::Printf("MinPerfRead4Bit26Mhz:           %u", extcsd.MinPerfRead4Bit26Mhz());
+    Kern::Printf("PowerClass26Mhz360V:            0x%02X", extcsd.PowerClass26Mhz360V());
+    Kern::Printf("PowerClass52Mhz360V:            0x%02X", extcsd.PowerClass52Mhz360V());
+    Kern::Printf("PowerClass26Mhz195V:            0x%02X", extcsd.PowerClass26Mhz195V());
+    Kern::Printf("PowerClass52Mhz195V:            0x%02X", extcsd.PowerClass52Mhz195V());
+    Kern::Printf("CardType:                       %u", extcsd.CardType());
+    Kern::Printf("CmdSet:                         %u", extcsd.CmdSet());
+    Kern::Printf("CmdSetRev:                      %u", extcsd.CmdSetRev());
+    Kern::Printf("PowerClass:                     %u", extcsd.PowerClass());
+    Kern::Printf("HighSpeedTiming:                %u", extcsd.HighSpeedTiming());
+    Kern::Printf("BusWidthMode:                   %u", extcsd.BusWidthMode());
+    Kern::Printf("HighCapacityEraseGroupSize:     %u", extcsd.HighCapacityEraseGroupSize());
+    Kern::Printf("AccessSize:                     %u", extcsd.AccessSize());
+    Kern::Printf("BootInfo:                       %u", extcsd.BootInfo() );
+    Kern::Printf("BootSizeMultiple:               %u", extcsd.BootSizeMultiple() );
+    Kern::Printf("EraseTimeoutMultiple:           %u", extcsd.EraseTimeoutMultiple() );
+    Kern::Printf("ReliableWriteSector:            %u", extcsd.ReliableWriteSector() );
+    Kern::Printf("HighCapWriteProtGroupSize:      %u", extcsd.HighCapacityWriteProtectGroupSize() );
+    Kern::Printf("SleepCurrentVcc:                %u", extcsd.SleepCurrentVcc() );
+    Kern::Printf("SleepCurrentVccQ:               %u", extcsd.SleepCurrentVccQ());
+    Kern::Printf("SleepAwakeTimeout:              %u", extcsd.SleepAwakeTimeout());
+    Kern::Printf("BootConfig:                     %u", extcsd.BootConfig());
+    Kern::Printf("BootBusWidth:                   %u", extcsd.BootBusWidth());
+    Kern::Printf("EraseGroupDef:                  %u", extcsd.EraseGroupDef());
+    
+    return KErrNone;
+    }
+
+TInt DLddMmcCntrlInterface::DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* a1, TAny* a2)
+//
+// Most Async requests
+//
+	{
+
+    if (iMmcSessionCmd!=EMmcSesNone)
+		{
+		return(KErrInUse);
+		}
+
+    switch (aFunction)
+		{
+        case RMmcCntrlIf::EReqPwrUp:
+			{
+			if(!iSocketP->CardIsPresent())
+				{
+				Kern::RequestComplete(iClient, aStatus, KErrNotReady);
+				}
+			else if(iSocketP->State() == EPBusOn)
+				{
+				Kern::RequestComplete(iClient, aStatus, KErrNone);
+				}
+			else
+				{
+				iPowerUpStatusP = aStatus;
+				iSocketP->PowerUp();
+				}
+			break;
+			}
+        case RMmcCntrlIf::EReqReadSect:
+            {
+			if(iCard == NULL)
+				{
+				return(KErrNotReady);
+				}
+
+			//TCSD csd=iCard->CSD();
+			iReadWriteStatusP = aStatus;
+			TUint32 srcAddr=((TUint32)a1)<<KSectorSizeShift;
+			TUint readBlLen = 1 << iCard->MaxReadBlLen();
+			TUint readBlMask=(readBlLen-1);
+			iBlkOffet=srcAddr-(srcAddr&(~readBlMask));
+			iClientDesPtr=a2;
+			iMmcSessionCmd=EMmcSesReadBlk;
+			srcAddr&=(~readBlMask);
+			TMMCArgument da(srcAddr);
+			iSession->SetupCIMReadBlock(da,readBlLen,&iBuf[0]);
+			iSession->Engage();
+			break;
+            }
+        case RMmcCntrlIf::EReqWriteSect:
+            {
+			if(iCard == NULL)
+				{
+				return(KErrNotReady);
+				}
+
+			iReadWriteStatusP = aStatus;
+			TUint32 destAddr=((TUint32)a1)<<KSectorSizeShift;
+			TUint writeBlLen=1 << iCard->MaxWriteBlLen();
+			TUint writeBlMask=(writeBlLen-1);
+			iBlkOffet=destAddr-(destAddr&(~writeBlMask));
+			TPtr8* srcDes = (TPtr8*)a2;		
+			TPtr8 ptr(&iBuf[iBlkOffet],KSectorSizeInBytes,KSectorSizeInBytes);
+			TInt r = Kern::ThreadDesRead(iClient, srcDes, ptr, 0, KChunkShiftBy0);
+			if(r != KErrNone)
+				{
+				return(r);
+				}
+				
+			iMmcSessionCmd=EMmcSesWriteBlk;
+			destAddr&=(~writeBlMask);
+			iSession->SetupCIMWriteBlock(TMMCArgument(destAddr),writeBlLen,&iBuf[0]);
+			iSession->Engage();
+			break;
+			}
+
+        case RMmcCntrlIf::EReqReadExtCSD:
+            {
+			if(iCard == NULL)
+				{
+				return(KErrNotReady);
+				}
+
+			iClientDesPtr = a1;
+			iReadWriteStatusP = aStatus;
+			iMmcSessionCmd = EMmcSesReadExtCSD;
+
+			iSession->SetupDTCommand(
+				ECmdSendExtendedCSD, 
+				TMMCArgument(0),
+				KMMCExtendedCSDLength,
+				(TUint8*) &iExtendedCSD);
+
+			iSession->Engage();
+			break;
+            }
+            
+        case RMmcCntrlIf::EReqMMCInfoPrint:
+            {
+            // Print CSD & Extended CSD values
+            TInt r = PrintCardInfo();            
+            Kern::RequestComplete(iClient, aStatus, r);
+            break;
+            }
+
+        }
+	return(KErrNone);
+	}
+
+TInt DLddMmcCntrlInterface::DoControl(TInt aFunction,TAny* a1,TAny* /*a2*/)
+//
+// Mostly requests (but some kernel server async ones)
+//
+	{
+
+	TInt r=KErrNotSupported;
+	switch (aFunction)
+		{
+        case RMmcCntrlIf::ESvReset:
+            {
+            Reset();
+			r=KErrNone;
+			break;
+            }
+        case RMmcCntrlIf::ESvPwrDown:
+			{
+//		    iStack->PowerDown(); ???
+//          iMmcController->SetPowerEvent(0,EPEventPwrDownNormal,0);
+			r=KErrNone;
+			break;
+			}
+        case RMmcCntrlIf::EExecStackInfo:
+            {
+            // Determine the number of cards present
+            TUint cardsPresentMask=0x00000000;
+	        TMMCard* card;
+            for (TInt i=0;i<KMaxMMCCardsPerStack;i++)
+                {
+                card=iStack->CardP(i);
+                if (card!=NULL && card->IsPresent())
+                    cardsPresentMask|=(0x1<<i);
+                }
+			r = Kern::ThreadRawWrite(iClient,a1,&cardsPresentMask,sizeof(TUint));
+			break;
+            }
+        case RMmcCntrlIf::ESvRegisterEvent:
+            {
+			return(KErrNotSupported);
+            }
+        case RMmcCntrlIf::EExecSelectCard:
+            {
+            iCard=iStack->CardP((TUint)a1);
+            iSession->SetCard(iCard);
+			r=KErrNone;
+			break;
+            }
+        case RMmcCntrlIf::EExecCardInfo:
+            {
+            if (iCard)
+                {
+				TMmcCardInfo ci;
+	            ci.iIsReady=iCard->IsPresent();
+	            ci.iIsLocked=iCard->IsLocked();
+				TCID* cid=(TCID*)&(iCard->CID());
+				TInt i;
+				for (i=0;i<16;i++)
+					ci.iCID[i]=cid->At(i);
+				const TCSD& csd = iCard->CSD();
+				for (i=0;i<16;i++)
+					ci.iCSD[i]=csd.At(i);
+	            ci.iRCA=TUint16(iCard->RCA());
+	            ci.iMediaType=(TMmcMediaType)iCard->MediaType();
+                ci.iCardSizeInBytes=iCard->DeviceSize64();
+	            ci.iReadBlLen=csd.ReadBlockLength();
+	            ci.iWriteBlLen=csd.WriteBlockLength();
+	            ci.iReadBlPartial=csd.ReadBlPartial();
+	            ci.iWriteBlPartial=csd.WriteBlPartial();
+	            ci.iReadBlkMisalign=csd.ReadBlkMisalign();
+	            ci.iWriteBlkMisalign=csd.WriteBlkMisalign();
+                ci.iReadCurrentInMilliAmps=csd.MaxReadCurrentInMilliamps();
+                ci.iWriteCurrentInMilliAmps=csd.MaxWriteCurrentInMilliamps();
+	            ci.iSpecVers=csd.SpecVers();
+	            ci.iTAAC=csd.TAAC();
+	            ci.iNSAC=csd.NSAC();
+	            ci.iTransferSpeed=csd.TranSpeed();
+	            ci.iCommandRegister=csd.CCC();
+	            ci.iHighCapacity = iCard->IsHighCapacity();
+				r = Kern::ThreadRawWrite(iClient, a1/*TAny *aDest*/, &ci/*const TAny *aSrc*/, sizeof(TMmcCardInfo));
+                }
+            else
+                r=KErrGeneral;
+			break;
+            }
+		}
+	return(r);
+	}
+
+void DLddMmcCntrlInterface::Reset()
+//
+// Release any resources 
+//
+	{
+	iSessionEndDfc.Cancel();
+    }
+
+void DLddMmcCntrlInterface::SessionEndCallBack(TAny *aPtr)
+//
+// Session end callback
+//
+	{
+	DLddMmcCntrlInterface &mci=*(DLddMmcCntrlInterface*)aPtr;
+
+	// Signal request complete using DFC 
+	if (!mci.iSessionEndDfc.Queued())
+		mci.iSessionEndDfc.Enque();
+	}
+
+void DLddMmcCntrlInterface::SessionEndDfc(TAny *aPtr)
+//
+// Session end dfc
+//
+	{
+	DLddMmcCntrlInterface &mci=*(DLddMmcCntrlInterface*)aPtr;
+    TInt err=mci.iSession->EpocErrorCode();
+    switch (mci.iMmcSessionCmd)
+		{
+        case EMmcSesReadBlk:
+            {
+			TPtr8 ptr(&mci.iBuf[mci.iBlkOffet],KSectorSizeInBytes,KSectorSizeInBytes);
+			TPtrC8* srcDes = (TPtrC8*)mci.iClientDesPtr;
+			TInt r = Kern::ThreadDesWrite(mci.iClient,srcDes,ptr,0,mci.iClient);
+
+	    	Kern::RequestComplete(mci.iClient, mci.iReadWriteStatusP, (r == KErrNone) ? err : r);
+            break;
+            }
+        case EMmcSesWriteBlk:
+			{
+			Kern::Printf("EMmcSesWriteBlk Complete");
+	    	Kern::RequestComplete(mci.iClient, mci.iReadWriteStatusP, err);
+            break;
+			}
+		case EMmcSesReadExtCSD:
+			{
+			TPtr8 ptr((TUint8*) &mci.iExtendedCSD, KMMCExtendedCSDLength, KMMCExtendedCSDLength);
+			TPtrC8* dstDes = (TPtrC8*)mci.iClientDesPtr;
+			TInt r = Kern::ThreadDesWrite(mci.iClient, dstDes, ptr, 0,mci.iClient);
+
+	    	Kern::RequestComplete(mci.iClient, mci.iReadWriteStatusP, (r == KErrNone) ? err : r);
+			break;
+			}
+        default:
+        	break;
+		}
+	mci.iMmcSessionCmd=EMmcSesNone;
+	}
+
+void DLddMmcCntrlInterface::EventCallBack(TAny* aPtr, TInt aReason, TAny* a1, TAny* a2)
+	{
+	DLddMmcCntrlInterface &mci=*(DLddMmcCntrlInterface*)aPtr;
+
+	if(mci.iPowerUpStatusP)
+		{
+		TInt retCode = KErrCompletion;
+
+		switch(aReason)
+			{
+			case TPBusCallBack::EPBusStateChange:
+				{
+				TPBusState newState = (TPBusState)(TInt)a1;
+				TInt errorCode = (TInt)a2;
+
+				switch(newState)
+					{
+					case EPBusCardAbsent:	retCode = KErrNotFound;		break;			
+					case EPBusOff:			retCode = errorCode;		break;
+					case EPBusPsuFault:		retCode = KErrBadPower;		break;
+					case EPBusOn:			retCode = KErrNone;			break;
+					case EPBusPowerUpPending:
+					case EPBusPoweringUp:
+					default:	
+						break;
+					}
+
+				break;
+				}
+			}
+
+		if(retCode != KErrCompletion)
+			{
+   			Kern::RequestComplete(mci.iClient, mci.iPowerUpStatusP, retCode);
+			mci.iPowerUpStatusP = NULL;
+			}
+		}
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pccd/d_mmctest.h	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,131 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This header provides the interface to MMCIF.LDD, which provides a set of
+// direct interface functions with the kernel MultiMediaCard Controller
+// 
+//
+
+#if !defined(__D_MMCTEST_H__)
+#include <e32cmn.h>
+#ifndef __KERNEL_MODE__
+#include <e32std.h>
+#endif
+
+//
+enum TMmcMediaType {EMmcROM,EMmcFlash,EMmcIO,EMmcOther,EMmcNotSupported};
+//
+const TInt KMaxCardsPerStack=2;
+const TInt KSectorSizeInBytes=512;
+const TInt KSectorSizeShift=9;
+const TInt KDrvBufSizeInSectors=8;
+
+/**
+@internalComponent
+*/
+class TMmcCardInfo
+	{
+public:
+	inline TMmcCardInfo()
+		  {memset(this,0x00,sizeof(TMmcCardInfo)); iMediaType=EMmcNotSupported;}
+public:
+	TBool iIsReady;
+	TBool iIsLocked;
+	TUint8 iCID[16];
+	TUint8 iCSD[16];
+	TUint16 iRCA;
+	TMmcMediaType iMediaType;
+    TInt64 iCardSizeInBytes;
+	TUint iReadBlLen;
+	TUint iWriteBlLen;
+	TBool iReadBlPartial;
+	TBool iWriteBlPartial;
+	TBool iReadBlkMisalign;
+	TBool iWriteBlkMisalign;
+    TInt iReadCurrentInMilliAmps;
+    TInt iWriteCurrentInMilliAmps;
+	TUint iSpecVers;
+	TUint iTAAC;
+	TUint iNSAC;
+	TUint iTransferSpeed;
+	TUint iCommandRegister;
+	TBool iHighCapacity;
+	};
+
+/**
+@internalComponent
+*/
+class TCapsMmcIfV01
+	{
+public:
+	TVersion version;
+	};
+
+/**
+@internalComponent
+*/
+class RMmcCntrlIf : public RBusLogicalChannel
+	{
+public:
+	enum {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=1};
+	enum TRequest
+		{
+		EReqReadSect,
+		EReqWriteSect,
+		EReqPwrUp,
+		EReqReadExtCSD,
+		EReqMMCInfoPrint
+		};
+	enum TControl
+        {
+		ESvReset,
+		ESvPwrDown,
+		ESvRegisterEvent,
+		EExecSelectCard,
+		EExecStackInfo,
+        EExecCardInfo
+		};
+public:
+	inline void Cancel();
+	inline TInt Open(TInt aStack,const TVersion& aVer)
+		{return(DoCreate(_L("MmcTest"),aVer,(TInt)aStack,NULL,NULL));}
+	inline TVersion VersionRequired() const
+		{return(TVersion(EMajorVersionNumber,EMinorVersionNumber,EBuildVersionNumber));}
+	inline void Reset()
+		{DoControl(ESvReset);}
+	inline void PwrDownStack()
+		{DoControl(ESvPwrDown);}
+	inline TInt StackInfo(TUint& aCardsPresentMask)
+		{return(DoControl(EExecStackInfo,&aCardsPresentMask));}
+	inline TInt SelectCard(TInt aCard)
+		{return(DoControl(EExecSelectCard,(TAny*)aCard));}
+	inline TInt CardInfo(TMmcCardInfo& anInfo)
+		{return(DoControl(EExecCardInfo,&anInfo));}
+
+//	inline TInt RegisterEvent(TUint anEventMask,TRequestStatus *aReqStat)
+//		{return(DoControl(ESvRegisterEvent,(TAny*)anEventMask,(TAny*)aReqStat));}
+
+	inline void PwrUpAndInitStack(TRequestStatus& aStatus)
+		{DoRequest(EReqPwrUp,aStatus);}
+	inline void ReadSector(TRequestStatus &aStatus,TInt aSectNum,TDes8 &aDes)
+		{DoRequest(EReqReadSect,aStatus,(TAny*)aSectNum,(TAny*)&aDes);}
+	inline void WriteSector(TRequestStatus &aStatus,TInt aSectNum,const TDesC8 &aDes)
+		{DoRequest(EReqWriteSect,aStatus,(TAny*)aSectNum,(TAny*)&aDes);}
+	inline void ReadExtCSD(TRequestStatus& aStatus, TDes8& aExtCSD)
+		{DoRequest(EReqReadExtCSD, aStatus, (TAny*) &aExtCSD, NULL);}
+	inline void PrintCardRegisters(TRequestStatus& aStatus)
+        {DoRequest(EReqMMCInfoPrint,aStatus);}
+	
+	};
+//
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pccd/t_mmcinfo.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,99 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test\pccd\t_mmcinfo.cpp
+// Display MMC Card register contents
+// 
+//
+
+#define __E32TEST_EXTENSION__
+#include <e32test.h>
+#include "d_mmctest.h"
+
+LOCAL_D	RTest test(_L("MMC INFO TEST"));
+
+RMmcCntrlIf iDriver;
+TInt iStack;
+TInt iCard;
+
+GLDEF_C TInt E32Main()
+/**
+ * Test Entry Point for T_MMCINFO.
+ * 
+ * This test uses the associated driver (D_mmctest) 
+ * to gain access to the mmc stack configuration data
+ */
+    {	
+	test.Title();
+
+	test.Start(_L("Load D_MMCTEST Driver"));
+	TInt r;	
+	r=User::LoadLogicalDevice(_L("D_MMCTEST"));
+	if(r==KErrNotFound)
+		{
+		test.Printf(_L("Test Driver not present on this platform \n"));
+		test.End();
+		return(0);
+		}
+	test(r==KErrNone || r==KErrAlreadyExists);
+
+	test.Next(_L("Connect to the test Driver"));
+	// Connect to the driver
+	iDriver.Close();
+    r=iDriver.Open(iStack,iDriver.VersionRequired());
+    if(r==KErrNotFound)
+        {
+        test.Printf(_L("Test not supported on this platform\n"));
+        test.End();
+        return(0);
+        }
+    test_KErrNone(r);
+    
+    // Power the stack down & up to make sure the CardInfo is up to date
+    test.Next(_L("Powering Stack"));
+    iDriver.Reset();
+    iDriver.PwrDownStack();
+    TRequestStatus status = KRequestPending;
+    iDriver.PwrUpAndInitStack(status);
+    User::WaitForRequest(status);    
+    r = status.Int();    
+    if (r==KErrNotReady)
+        {
+        test.Printf(_L("Card not found on this platform \n"));
+        test.End();
+        return(0);
+        }        
+    test_KErrNone(r);
+
+    test.Next(_L("Retrieve Stack Info"));
+    TUint cardsPresentMask;
+    r=iDriver.StackInfo(cardsPresentMask);
+    test_KErrNone(r);
+    
+    test.Next(_L("Select Card - 0"));
+    iDriver.SelectCard(iCard);
+    TMmcCardInfo ci;
+    r=iDriver.CardInfo(ci);
+    test_KErrNone(r);
+            
+    test.Next(_L("Print Card CSD & extended CSD registers"));
+    status = KRequestPending;
+    iDriver.PrintCardRegisters(status);    
+    User::WaitForRequest(status);
+    r = status.Int();
+    test_KErrNone(r);
+
+	test.End();
+	return(0);
+	}
+  
--- a/kerneltest/e32test/resmanus/t_resmanus.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/e32test/resmanus/t_resmanus.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -1317,62 +1317,66 @@
 //! 
 //!						2) Call API to get the new state of the resource and check it exhibits
 //!						the expected value.
+//!
+//!						3) Call API to modify the state of the resource by setting its level to zero.
+//!
+//!						4) Call API to get the state of the resource and check it exhibits the expected zero value.
 //! 
-//!						3) Call API to return the resource state to its original value.
+//!						5) Call API to return the resource state to its original value.
 //! 
-//!						4) Call API to get the state of a long latency resource then call API
+//!						6) Call API to get the state of a long latency resource then call API
 //!						with operation-type qualifier cancel the request.
 //! 
-//!						5) Call API to modify the state of the long latency resource then call API
+//!						7) Call API to modify the state of the long latency resource then call API
 //!						with operation-type qualifier to cancel the request.
 //! 
-//!						6) Call API to get the state of a long latency resource and wait for it 
+//!						8) Call API to get the state of a long latency resource and wait for it 
 //!						to complete. Then call API with operation-type qualifier to cancel the request.
 //! 
-//!						7) Call API to modify the state of the long latency resource and wait for
+//!						9) Call API to modify the state of the long latency resource and wait for
 //!						it to complete. Then call API with operation-type qualifier to cancel the request.
 //! 
-//!						8) Call API to get the state of a long latency resource then call API
+//!						10) Call API to get the state of a long latency resource then call API
 //!						without operation-type qualifier to cancel the request.
 //! 
-//!						9) Call API to modify the state of the long latency resource then call API
+//!						11) Call API to modify the state of the long latency resource then call API
 //!						without operation-type qualifier to cancel the request.
 //! 
-//!						10) Call API to get the state of a long latency resource and wait for it 
+//!						12) Call API to get the state of a long latency resource and wait for it 
 //!						to complete. Then call API without operation-type qualifier to cancel the request.
 //! 
-//!						11) Call API to modify the state of the long latency resource and wait for
+//!						13) Call API to modify the state of the long latency resource and wait for
 //!						it to complete. Then call API without operation-type qualifier to cancel the request.
 //! 
-//!						12) Call API to get the state of a long latency resource 'n' times. Then call API with 
+//!						14) Call API to get the state of a long latency resource 'n' times. Then call API with 
 //!						resource qualifier to cancel the requests.
 //! 
-//!						13) Call API to modify the state of a long latency resource 'm' times. Then call API with 
+//!						15) Call API to modify the state of a long latency resource 'm' times. Then call API with 
 //!						resource qualifier to cancel the requests.
 //! 
-//!						14) Call API to get the state of a long latency resource 'n' times and wait for them to complete.
+//!						16) Call API to get the state of a long latency resource 'n' times and wait for them to complete.
 //!						Then call API with resource qualifier to cancel the requests.
 //! 
-//!						15) Call API to modify the state of a long latency resource 'm' times and wait for them to complete.
+//!						17) Call API to modify the state of a long latency resource 'm' times and wait for them to complete.
 //!						Then call API with resource qualifier to cancel the requests.
 //! 
-//!						16) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+//!						18) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 //!						a long latency resource 'm' times. Call the API to cancel the get operations with resource qualifier.
 //!						Wait for the operations to complete. Check the state of the associated TRequestStatus objects.
 //! 
-//!						17) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+//!						19) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 //!						a long latency resource 'm' times. Call the API to cancel the modify operations with resource qualifier.
 //!						Wait for the get operations to complete. Check the state of the associated TRequestStatus objects.
 //! 
-//!						18) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+//!						20) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 //!						a long latency resource 'm' times. Wait for the get operations to complete. Call the API to cancel the get
 //!						operations with resource qualifier. Check the state of the associated TRequestStatus objects.
 //! 
-//!						19) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+//!						21) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 //!						a long latency resource 'm' times. Wait for the modify operations to complete. Call the API to cancel the modify
 //!						operations with resource qualifier. Check the state of the associated TRequestStatus objects.
 //! 
-//!						20) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+//!						22) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 //!						a long latency resource 'm' times.
 //!						Then call API with operation-type qualifier to cancel the even-numbered get request(s).
 //!						Then call API without operation-type qualifier to cancel the even-numbered modify request(s).
@@ -1387,57 +1391,62 @@
 //! 
 //!						3) The associated TRequestStatus object should indicate KErrNone, exits otherwise.
 //! 
-//!						4) The associated TRequestStatus object should indicate KErrCancel if the cancel 
+//!						4) The associated TRequestStatus object should indicate KErrNone, exits otherwise.
+//!						Exit if the value read back is not as expected.
+//! 
+//!						5) The associated TRequestStatus object should indicate KErrNone, exits otherwise.
+//! 
+//!						6) The associated TRequestStatus object should indicate KErrCancel if the cancel 
 //!						request was accepted, exits otherwise.
 //!						The associated TRequestStatus object should indicate KErrNone if the cancel request
 //!						was not accepted, exits otherwise.
 //! 
-//!						5) The associated TRequestStatus object should indicate KErrCancel if the cancel 
+//!						7) The associated TRequestStatus object should indicate KErrCancel if the cancel 
 //!						request was accepted, exits otherwise.
 //!						The associated TRequestStatus object should indicate KErrNone if the cancel request
 //!						was not accepted, exits otherwise.
 //! 
-//!						6) The TRequestStatus object associated with the get operation should indicate 
+//!						8) The TRequestStatus object associated with the get operation should indicate 
 //!						KErrNone - exits otherwise. The TRequestStatus object associated with the cancel
 //!						operation should indicate KErrNone - exits otherwise.
 //! 
-//!						7) The TRequestStatus object associated with the get operation should indicate
+//!						9) The TRequestStatus object associated with the get operation should indicate
 //!						KErrNone - exits otherwise. The TRequestStatus object associated with the cancel
 //!						operation should indicate KErrNone - exits otherwise.
 //! 
-//!						8) The associated TRequestStatus object should indicate KErrCancel, exits otherwise.
+//!						10) The associated TRequestStatus object should indicate KErrCancel, exits otherwise.
 //! 
-//!						9) The associated TRequestStatus object should indicate KErrCancel, exits otherwise.
+//!						11) The associated TRequestStatus object should indicate KErrCancel, exits otherwise.
 //! 
-//!						10) The TRequestStatus object associated with the get operation should indicate 
+//!						12) The TRequestStatus object associated with the get operation should indicate 
 //!						KErrNone - exits otherwise. The TRequestStatus object associated with the cancel
 //!						operation should indicate KErrNone - exits otherwise.
 //! 
-//!						11) The TRequestStatus object associated with the get operation should indicate
+//!						13) The TRequestStatus object associated with the get operation should indicate
 //!						KErrNone - exits otherwise. The TRequestStatus object associated with the cancel
 //!						operation should indicate KErrNone - exits otherwise.
 //!
-//!						12) The TRequestStatus objects should all exibit KErrCancel - exits otherwise.
+//!						14) The TRequestStatus objects should all exibit KErrCancel - exits otherwise.
 //! 
-//!						13) The TRequestStatus objects should all exibit KErrCancel - exits otherwise.
+//!						15) The TRequestStatus objects should all exibit KErrCancel - exits otherwise.
 //! 
-//!						14) The TRequestStatus objects associated with the get operations should all exibit KErrNone - exits otherwise.
+//!						16) The TRequestStatus objects associated with the get operations should all exibit KErrNone - exits otherwise.
 //!						The TRequestStatus objects associated with the cancel operations should all exibit KErrNone - exits otherwise
 //! 
-//!						15) The TRequestStatus objects associated with the modify operations should all exibit KErrNone - exits otherwise.
+//!						17) The TRequestStatus objects associated with the modify operations should all exibit KErrNone - exits otherwise.
 //!						The TRequestStatus objects associated with the cancel operations should all exibit KErrNone - exits otherwise
 //! 
-//!						16) The TRequestStatus objects associated with the get operations should all exibit KErrCancel - exits otherwise.
+//!						18) The TRequestStatus objects associated with the get operations should all exibit KErrCancel - exits otherwise.
 //!						The TRequestStatus objects associated with the modify operations should all exibit KErrNone - exits otherwise
 //! 
-//!						17) The TRequestStatus objects associated with the get operations should all exibit KErrNone - exits otherwise.
+//!						19) The TRequestStatus objects associated with the get operations should all exibit KErrNone - exits otherwise.
 //!						The TRequestStatus objects associated with the modify operations should all exibit KErrCancel - exits otherwise
 //! 
-//!						18) The TRequestStatus objects associated with the get and modify operations should all exibit KErrNone - exits otherwise.
+//!						20) The TRequestStatus objects associated with the get and modify operations should all exibit KErrNone - exits otherwise.
 //! 
-//!						19) The TRequestStatus objects associated with the get and modify operations should all exibit KErrNone - exits otherwise.
+//!						21) The TRequestStatus objects associated with the get and modify operations should all exibit KErrNone - exits otherwise.
 //!
-//!						20) The TRequestStatus objects associated with the even-numbered request should exhibit KErrCancel.
+//!						22) The TRequestStatus objects associated with the even-numbered request should exhibit KErrCancel.
 //!						The TRequestStatus objects associated with the odd-numbered request should exhibit KErrNone.
 //!
 //! @SYMTestPriority        High
@@ -1500,7 +1509,29 @@
 	gTest.Printf(_L("TestGetSetResourceStateOps: level read back =0x%x, levelOwnerId=%d\n"),readValue,levelOwnerId);
 	gTest(newLevel==(TUint)readValue);
 
-	// 3) Call API to return the resource state to its original value.
+	// 3) Call API to modify the state of the resource by setting its level to zero
+	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
+	gChannel.ChangeResourceState(status,gLongLatencyResource,0);
+	User::WaitForRequest(status);
+	if(status != KErrNone)
+		{
+		gTest.Printf(_L("ChangeResourceState to level 0 returned %d\n"),r);
+		return r;
+		}
+
+	// 4) Call API to get the state of the resource and check it exhibits the expected zero value.
+	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
+	gChannel.GetResourceState(status,gLongLatencyResource,cached,&readValue,&levelOwnerId);
+	User::WaitForRequest(status);
+	if(status != KErrNone)
+		{
+		gTest.Printf(_L("TestGetSetResourceStateOps, get state status = %d\n"),r);
+		return r;
+		}
+	gTest.Printf(_L("TestGetSetResourceStateOps: level read back =0x%x, levelOwnerId=%d\n"),readValue,levelOwnerId);
+	gTest(readValue==0);
+
+	// 5) Call API to return the resource state to its original value.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	gTest.Printf(_L("TestGetSetResourceStateOps: write original level 0x%x\n"), startingLevel);
 	gChannel.ChangeResourceState(status,gLongLatencyResource,startingLevel);
@@ -1519,7 +1550,7 @@
 		}
 	gTest.Printf(_L("TestGetSetResourceStateOps: check original level read back =0x%x, levelOwnerId=%d\n"),readValue,levelOwnerId);
 
-	// 4) Call API to get the state of a long latency resource then call API with operation-type qualifier cancel the request.
+	// 6) Call API to get the state of a long latency resource then call API with operation-type qualifier cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	gChannel.GetResourceState(status,gLongLatencyResource,cached,&readValue,&levelOwnerId);
 	r=gChannel.CancelGetResourceState(status);
@@ -1554,7 +1585,7 @@
 
 		}
 
-	// 5) Call API to modify the state of the long latency resource then call API with operation-type qualifier to cancel the request.
+	// 7) Call API to modify the state of the long latency resource then call API with operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	newLevel = (TUint)(readValue + gAsyncResStateDelta);
 	gChannel.ChangeResourceState(status,gLongLatencyResource,newLevel);
@@ -1590,7 +1621,7 @@
 		}
 
 
-	// 6) Call API to get the state of a long latency resource and wait for it to complete.
+	// 8) Call API to get the state of a long latency resource and wait for it to complete.
 	//    Then call API with operation-type qualifier to cancel the request.	
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	gChannel.GetResourceState(status,gLongLatencyResource,cached,&readValue,&levelOwnerId);
@@ -1611,7 +1642,7 @@
 		return r;
 		}
 
-	// 7) Call API to modify the state of the long latency resource and wait for it to complete. 
+	// 9) Call API to modify the state of the long latency resource and wait for it to complete. 
 	//    Then call API with operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	gChannel.ChangeResourceState(status,gLongLatencyResource,(readValue + gAsyncResStateDelta));
@@ -1632,7 +1663,7 @@
 		return r;
 		}
 
-	// 8) Call API to get the state of a long latency resource then call API without operation-type qualifier to cancel the request.
+	// 10) Call API to get the state of a long latency resource then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	
 	// NOTE: Cancel operation can only remove request which is still inside the resource controller
@@ -1653,7 +1684,7 @@
 		return r;
 		}
 
-	// 9) Call API to modify the state of the long latency resource then call API without operation-type qualifier to cancel the request.
+	// 11) Call API to modify the state of the long latency resource then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	
 	// NOTE: Cancel operation can only remove request which is still inside the resource controller
@@ -1675,7 +1706,7 @@
 		return r;
 		}
 
-	// 10) Call API to get the state of a long latency resource and wait for it to complete.
+	// 12) Call API to get the state of a long latency resource and wait for it to complete.
 	//     Then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	gChannel.GetResourceState(status,gLongLatencyResource,cached,&readValue,&levelOwnerId);
@@ -1692,7 +1723,7 @@
 		return r;
 		}
 
-	// 11) Call API to modify the state of the long latency resource and wait for it to complete. 
+	// 13) Call API to modify the state of the long latency resource and wait for it to complete. 
 	//     Then call API without operation-type qualifier to cancel the request.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	gChannel.ChangeResourceState(status,gLongLatencyResource,(readValue + gAsyncResStateDelta));
@@ -1716,7 +1747,7 @@
 	TRequestStatus setReqStatus[KLoopVarM];
 	TInt i=0;
 
-	// 12) Call API to get the state of a long latency resource 'n' times. 
+	// 14) Call API to get the state of a long latency resource 'n' times. 
 	//     Then call API with resource qualifier to cancel the requests.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	for(i=0;i<KLoopVarN;i++)
@@ -1739,7 +1770,7 @@
 			}
 		}
 
-	// 13) Call API to modify the state of a long latency resource 'm' times. 
+	// 15) Call API to modify the state of a long latency resource 'm' times. 
 	//     Then call API with resource qualifier to cancel the requests.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	for(i=0;i<KLoopVarM;i++)
@@ -1762,7 +1793,7 @@
 			}
 		}
 
-	// 14) Call API to get the state of a long latency resource 'n' times and wait for them to complete.
+	// 16) Call API to get the state of a long latency resource 'n' times and wait for them to complete.
 	//     Then call API with resource qualifier to cancel the requests.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	for(i=0;i<KLoopVarN;i++)
@@ -1788,7 +1819,7 @@
 			}
 		}
 
-	// 15) Call API to modify the state of a long latency resource 'm' times and wait for them to complete.
+	// 17) Call API to modify the state of a long latency resource 'm' times and wait for them to complete.
 	//     Then call API with resource qualifier to cancel the requests.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
 	for(i=0;i<KLoopVarM;i++)
@@ -1814,7 +1845,7 @@
 			}
 		}
 
-	// 16) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+	// 18) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 	//     a long latency resource 'm' times. 
 	//     Call the API to cancel the get operations with resource qualifier.
 	//     Wait for the operations to complete. Check the state of the associated TRequestStatus objects.
@@ -1852,7 +1883,7 @@
 			}
 		}
 
-	// 17) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+	// 19) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 	//     a long latency resource 'm' times. 
 	//     Call the API to cancel the modify operations with resource qualifier.
 	//     Wait for the get operations to complete. Check the state of the associated TRequestStatus objects.
@@ -1885,7 +1916,7 @@
 			}
 		}
 
-	// 18) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+	// 20) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 	//     a long latency resource 'm' times. Wait for the get operations to complete. 
 	//     Call the API to cancel the get operations with resource qualifier. Check the state of the associated TRequestStatus objects.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
@@ -1927,7 +1958,7 @@
 			}
 		}
 
-	// 19) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
+	// 21) Call API to get the state of a long latency resource 'n' times, call API to modify the state of
 	//     a long latency resource 'm' times. Wait for the modify operations to complete. Call the API to cancel the modify
 	//     operations with resource qualifier. Check the state of the associated TRequestStatus objects.
 	gTest.Printf(_L("TestGetSetResourceStateOps, starting test %d\n"),testNo++);
@@ -1967,7 +1998,7 @@
 			}
 		}
 
-	// 20) Call API to get the state of a long latency resource 'n' times, call API to modify the state of a long latency resource 'm' times.
+	// 22) Call API to get the state of a long latency resource 'n' times, call API to modify the state of a long latency resource 'm' times.
 	//     Then call API without operation-type qualifier to cancel the even-numbered modify request(s).
 	//     Then call API with operation-type qualifier to cancel the even-numbered get request(s).
 	//     Check the state of the associated TRequestStatus objects.
--- a/kerneltest/f32test/loader/security/t_ldrcheck.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/f32test/loader/security/t_ldrcheck.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -46,7 +46,7 @@
 	test.Next(_L("Copy Modules from ROM to disk"));
 
 	TInt r;
-	TTime modtime;
+	TTime modtime(0);  // don't update modification time
 
 	r=TheFs.MkDirAll(KSystemLibs);
 	test(r==KErrNone || r==KErrAlreadyExists);
@@ -610,6 +610,9 @@
 
     CleanupStack::PopAndDestroy(1); //-- corrFile
 
+	test.Printf(_L("File size %d, changed byte %d from %d to %d\n"),
+				size, size - 5, ~dat[0], dat[0]);
+	
     return KErrNone;
 }
 
@@ -1200,6 +1203,12 @@
 	CTrapCleanup* cleanup;
 	cleanup=CTrapCleanup::New();
 	__UHEAP_MARK;
+	
+	// Turn off evil lazy dll unloading
+	RLoader l;
+	test(l.Connect()==KErrNone);
+	test(l.CancelLazyDllUnload()==KErrNone);
+	l.Close();
 
 	TBuf<20> sessPath;
 	TInt r=0;	
--- a/kerneltest/f32test/server/t_fsys.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/kerneltest/f32test/server/t_fsys.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -240,8 +240,6 @@
     test_KErrNone(nRes);
     test(fsName1 == fsName);
 
-    pHelper1->Close(); //-- just for testing
-
     delete pHelper1;
     delete pHelper2;
 }
--- a/userlibandfileserver/domainmgr/bmarm/domaincliu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/bmarm/domaincliu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -42,4 +42,12 @@
 	"_._9CDmDomain" @ 41 NONAME R3UNUSED ; CDmDomain::~CDmDomain(void)
 	__16CDmDomainManagerUc @ 42 NONAME R3UNUSED ; CDmDomainManager::CDmDomainManager(unsigned char)
 	AcknowledgeLastState__9CDmDomaini @ 43 NONAME R3UNUSED ; CDmDomain::AcknowledgeLastState(int)
-
+	CancelDeferral__9RDmDomain @ 44  NONAME R3UNUSED ; RDmDomain::CancelDeferral(void)
+	ConstructL__18CDmDomainKeepAlive @ 45  NONAME R3UNUSED ; CDmDomainKeepAlive::ConstructL(void)
+	DeferAcknowledgement__9RDmDomainR14TRequestStatus @ 46  NONAME R3UNUSED ; RDmDomain::DeferAcknowledgement(TRequestStatus &)
+	"_._18CDmDomainKeepAlive" @ 47  NONAME R3UNUSED ; CDmDomainKeepAlive::~CDmDomainKeepAlive(void)
+	__18CDmDomainKeepAliveUcUs @ 48  NONAME R3UNUSED ; CDmDomainKeepAlive::CDmDomainKeepAlive(unsigned char, unsigned short)
+	AcknowledgeLastState__18CDmDomainKeepAlivei @ 49  NONAME R3UNUSED ; CDmDomainKeepAlive::AcknowledgeLastState(int)
+	RunL__18CDmDomainKeepAlive @ 50  NONAME R3UNUSED ; CDmDomainKeepAlive::RunL(void)
+	HandleDeferralError__18CDmDomainKeepAlivei @ 51  NONAME R3UNUSED ; CDmDomainKeepAlive::HandleDeferralError(int)
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/bmarm/domainpolicy_v2u.def	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,6 @@
+EXPORTS
+	GetDomainSpecs__8DmPolicy @ 1 NONAME R3UNUSED ; DmPolicy::GetDomainSpecs(void)
+	Release__8DmPolicyPC13TDmDomainSpec @ 2 NONAME R3UNUSED ; DmPolicy::Release(TDmDomainSpec const *)
+	GetPolicy__8DmPolicyR18TDmHierarchyPolicy @ 3 NONAME R3UNUSED ; DmPolicy::GetPolicy(TDmHierarchyPolicy &)
+	GetStateSpec__8DmPolicyRPvRUi @ 4  NONAME R3UNUSED ; DmPolicy::GetStateSpec(void *&, unsigned int &)
+	ReleaseStateSpec__8DmPolicyPv @ 5  NONAME R3UNUSED ; DmPolicy::ReleaseStateSpec(void *)
--- a/userlibandfileserver/domainmgr/bwins/domaincliu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/bwins/domaincliu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -42,4 +42,12 @@
 	?RequestTransitionNotification@CDmDomain@@QAEXXZ @ 41 NONAME ; public: void __thiscall CDmDomain::RequestTransitionNotification(void)
 	?StartObserver@CHierarchyObserver@@QAEHGW4TDmNotifyType@@@Z @ 42 NONAME ; public: int __thiscall CHierarchyObserver::StartObserver(unsigned short,enum TDmNotifyType)
 	?StopObserver@CHierarchyObserver@@QAEHXZ @ 43 NONAME ; public: int __thiscall CHierarchyObserver::StopObserver(void)
+	?CancelDeferral@RDmDomain@@QAEXXZ @ 44 NONAME ; void RDmDomain::CancelDeferral(void)
+	?AcknowledgeLastState@CDmDomainKeepAlive@@QAEXH@Z @ 45 NONAME ; void CDmDomainKeepAlive::AcknowledgeLastState(int)
+	?DeferAcknowledgement@RDmDomain@@QAEXAAVTRequestStatus@@@Z @ 46 NONAME ; void RDmDomain::DeferAcknowledgement(class TRequestStatus &)
+	?ConstructL@CDmDomainKeepAlive@@IAEXXZ @ 47 NONAME ; void CDmDomainKeepAlive::ConstructL(void)
+	??0CDmDomainKeepAlive@@QAE@EG@Z @ 48 NONAME ; CDmDomainKeepAlive::CDmDomainKeepAlive(unsigned char, unsigned short)
+	??1CDmDomainKeepAlive@@UAE@XZ @ 49 NONAME ; CDmDomainKeepAlive::~CDmDomainKeepAlive(void)
+	?RunL@CDmDomainKeepAlive@@MAEXXZ @ 50 NONAME ; protected: virtual void __thiscall CDmDomainKeepAlive::RunL(void)
+	?HandleDeferralError@CDmDomainKeepAlive@@UAEHH@Z @ 51 NONAME ; public: virtual int __thiscall CDmDomainKeepAlive::HandleDeferralError(int)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/bwins/domainpolicy_v2u.def	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,6 @@
+EXPORTS
+	?GetDomainSpecs@DmPolicy@@SAPBUTDmDomainSpec@@XZ @ 1 NONAME ; public: static struct TDmDomainSpec const * __cdecl DmPolicy::GetDomainSpecs(void)
+	?Release@DmPolicy@@SAXPBUTDmDomainSpec@@@Z @ 2 NONAME ; public: static void __cdecl DmPolicy::Release(struct TDmDomainSpec const *)
+	?GetPolicy@DmPolicy@@SAHAAVTDmHierarchyPolicy@@@Z @ 3 NONAME ; public: static int __cdecl DmPolicy::GetPolicy(class TDmHierarchyPolicy &)
+	?GetStateSpec@DmPolicy@@SAHAAPAXAAI@Z @ 4  NONAME ; int DmPolicy::GetStateSpec(void * &, unsigned int &)
+	?ReleaseStateSpec@DmPolicy@@SAXPAX@Z @ 5  NONAME ; void DmPolicy::ReleaseStateSpec(void *)
--- a/userlibandfileserver/domainmgr/bx86/domaincliu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/bx86/domaincliu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -42,4 +42,12 @@
 	?RequestTransitionNotification@CDmDomain@@QAEXXZ @ 41 NONAME ; public: void __thiscall CDmDomain::RequestTransitionNotification(void)
 	?StartObserver@CHierarchyObserver@@QAEHGW4TDmNotifyType@@@Z @ 42 NONAME ; public: int __thiscall CHierarchyObserver::StartObserver(unsigned short,enum TDmNotifyType)
 	?StopObserver@CHierarchyObserver@@QAEHXZ @ 43 NONAME ; public: int __thiscall CHierarchyObserver::StopObserver(void)
-
+	??0CDmDomainKeepAlive@@QAE@EG@Z @ 44  NONAME ; public: __thiscall CDmDomainKeepAlive::CDmDomainKeepAlive(unsigned char,unsigned short)
+	??1CDmDomainKeepAlive@@UAE@XZ @ 45  NONAME ; public: virtual __thiscall CDmDomainKeepAlive::~CDmDomainKeepAlive(void)
+	?AcknowledgeLastState@CDmDomainKeepAlive@@QAEXH@Z @ 46  NONAME ; public: void __thiscall CDmDomainKeepAlive::AcknowledgeLastState(int)
+	?CancelDeferral@RDmDomain@@QAEXXZ @ 47  NONAME ; public: void __thiscall RDmDomain::CancelDeferral(void)
+	?ConstructL@CDmDomainKeepAlive@@IAEXXZ @ 48  NONAME ; protected: void __thiscall CDmDomainKeepAlive::ConstructL(void)
+	?DeferAcknowledgement@RDmDomain@@QAEXAAVTRequestStatus@@@Z @ 49  NONAME ; public: void __thiscall RDmDomain::DeferAcknowledgement(class TRequestStatus &)
+	?RunL@CDmDomainKeepAlive@@MAEXXZ @ 50  NONAME ; protected: virtual void __thiscall CDmDomainKeepAlive::RunL(void)
+	?HandleDeferralError@CDmDomainKeepAlive@@UAEHH@Z @ 51  NONAME ; public: virtual int __thiscall CDmDomainKeepAlive::HandleDeferralError(int)
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/bx86/domainpolicy_v2u.def	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,7 @@
+EXPORTS
+	?GetDomainSpecs@DmPolicy@@SAPBUTDmDomainSpec@@XZ @ 1 NONAME ; public: static struct TDmDomainSpec const * __cdecl DmPolicy::GetDomainSpecs(void)
+	?Release@DmPolicy@@SAXPBUTDmDomainSpec@@@Z @ 2 NONAME ; public: static void __cdecl DmPolicy::Release(struct TDmDomainSpec const *)
+	?GetPolicy@DmPolicy@@SAHAAVTDmHierarchyPolicy@@@Z @ 3 NONAME ; public: static int __cdecl DmPolicy::GetPolicy(class TDmHierarchyPolicy &)
+	?GetStateSpec@DmPolicy@@SAHAAPAXAAI@Z @ 4  NONAME ; public: static int __cdecl DmPolicy::GetStateSpec(void * &,unsigned int &)
+	?ReleaseStateSpec@DmPolicy@@SAXPAX@Z @ 5  NONAME ; public: static void __cdecl DmPolicy::ReleaseStateSpec(void *)
+	
--- a/userlibandfileserver/domainmgr/eabi/domaincliu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/eabi/domaincliu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -54,4 +54,18 @@
 	_ZTV16CDmDomainManager @ 53 NONAME ; #<VT>#
 	_ZTV18CHierarchyObserver @ 54 NONAME ; #<VT>#
 	_ZTV9CDmDomain @ 55 NONAME ; #<VT>#
-
+	_ZN18CDmDomainKeepAlive10ConstructLEv @ 56 NONAME
+	_ZN18CDmDomainKeepAlive20AcknowledgeLastStateEi @ 57 NONAME
+	_ZN18CDmDomainKeepAliveC2Eht @ 58 NONAME
+	_ZN18CDmDomainKeepAliveD0Ev @ 59 NONAME
+	_ZN18CDmDomainKeepAliveD1Ev @ 60 NONAME
+	_ZN18CDmDomainKeepAliveD2Ev @ 61 NONAME
+	_ZN9RDmDomain14CancelDeferralEv @ 62 NONAME
+	_ZN9RDmDomain20DeferAcknowledgementER14TRequestStatus @ 63 NONAME
+	_ZTI12CDmKeepAlive @ 64 NONAME
+	_ZTI18CDmDomainKeepAlive @ 65 NONAME
+	_ZTV12CDmKeepAlive @ 66 NONAME
+	_ZTV18CDmDomainKeepAlive @ 67 NONAME
+	_ZN18CDmDomainKeepAlive4RunLEv @ 68 NONAME
+	_ZN18CDmDomainKeepAlive19HandleDeferralErrorEi @ 69 NONAME
+		
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/eabi/domainpolicy_v2u.def	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN8DmPolicy14GetDomainSpecsEv @ 1 NONAME
+	_ZN8DmPolicy7ReleaseEPK13TDmDomainSpec @ 2 NONAME
+	_ZN8DmPolicy9GetPolicyER18TDmHierarchyPolicy @ 3 NONAME
+	_ZN8DmPolicy12GetStateSpecERPvRj @ 4 NONAME	
+	_ZN8DmPolicy16ReleaseStateSpecEPv @ 5 NONAME
+
+ 
--- a/userlibandfileserver/domainmgr/group/bld.inf	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/group/bld.inf	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -23,14 +23,14 @@
 
 PRJ_PLATFORMS
 
-BASEUSERDEFAULT
+BASEUSERDEFAULT -ARM4T -ARMV4
 
 PRJ_EXPORTS
 
-../inc/domaindefs.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domaindefs.h)
-../inc/domainmanager.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domainmanager.h)
-../inc/domainmember.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domainmember.h)
-../inc/domainpolicy.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domainpolicy.h)
+../inc/domaindefs.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domaindefs.h)
+../inc/domainmanager.h 			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domainmanager.h)
+../inc/domainmember.h 			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domainmember.h)
+../inc/domainpolicy.h 			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(domainpolicy.h)
 
 ../bmarm/domainpolicyu.def	/epoc32/include/def/bmarm/domainpolicyu.def
 ../bwins/domainpolicyu.def	/epoc32/include/def/bwins/domainpolicyu.def
--- a/userlibandfileserver/domainmgr/group/domaincli.mmp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/group/domaincli.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -24,7 +24,6 @@
 TARGET          domaincli.dll
 TARGETTYPE      dll
 
-userinclude		../src
 userinclude		../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
--- a/userlibandfileserver/domainmgr/group/domainsrv.mmp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/group/domainsrv.mmp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -25,15 +25,16 @@
 CAPABILITY PowerMgmt ProtServ DiskAdmin
 TARGETTYPE      exe
 
-userinclude		../src
 userinclude		../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 sourcepath	../src
-source		domainsrv.cpp
+source		domainsrv.cpp domaincfg.cpp
 
 library		euser.lib efsrv.lib
 
+//Enables Domain server tracing
+//macro __DS_DEBUG 
 
 
 VENDORID 0x70000001
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/inc/domaincfg.h	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,116 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Provides classes for holding domain policy data.
+//
+//
+
+#ifndef __DOMAIN_CFG_H__
+#define __DOMAIN_CFG_H__
+
+#include <e32base.h>
+
+#include <domainpolicy.h>
+
+
+/**
+The server's representation of per-transition config settings
+
+It is intended to act as a buffer between the server and any
+future SDmStateSpecV* structs.
+
+*/
+struct TTransitionConfig : public SDmStateSpecV1
+	{
+	TTransitionConfig(const SDmStateSpecV1& aSpec);
+	// This version of the constructor is used as a key when looking up a
+	// specific actual config.
+	TTransitionConfig(TDmDomainState);
+	TInt CheckValues() const;
+	};
+
+/**
+Repository for a hierachy's settings
+*/
+class CHierarchySettings : public CBase
+	{
+public:
+	CHierarchySettings();
+	~CHierarchySettings();
+
+	void StoreConfigL(const TTransitionConfig& aConfig);
+
+	// Called by CDmHierarchy
+	void SetCurrentTargetTransition(TDmDomainState);
+
+	// Called by various objects to retrieve settings
+	TBool GetDomainTimeout(TTimeIntervalMicroSeconds32&) const;
+	TBool GetDeferralBudget(TInt&) const;
+	TBool GetFailurePolicy(TDmTransitionFailurePolicy&) const;
+
+private:
+	const TTransitionConfig* LookupConfig(TDmDomainState) const;
+
+	TDmDomainState iCurrentState;
+
+	RArray<const TTransitionConfig> iConfigs;
+	};
+
+/**
+This class wraps up the fetching of a data type for which
+an overridden value may be available from CHierarchySettings
+
+Template parameters:
+T - Type of the value which may be over-ridden.
+F - Pointer to member function of CHierarchySettings.
+	This will be used to query and fetch an over-ride value.
+*/
+template< typename T, TBool (CHierarchySettings::*F)(T&) const>
+class TOverrideableSetting
+	{
+public:
+	/**
+	@param aDefault Default value
+	@param aSettings The object from which overrides are fetched
+	*/
+	TOverrideableSetting(T aDefault, const CHierarchySettings* aSettings = NULL)
+		: iSettings(aSettings), iDefault(aDefault)
+		{}
+
+	void SetSettings(const CHierarchySettings* aSettings)
+		{
+		iSettings = aSettings;
+		}
+
+	/**
+	Used to access the wrapped value. It will supply an
+	over-ridden value if available, otherwise, the internal
+	default vaule.
+	*/
+	T operator ()() const
+		{
+		T value;
+		const TBool overridden = (iSettings->*F)(value);
+
+		if(!overridden)
+			{
+			value = iDefault;
+			}
+		return value;
+		}
+
+private:
+	const CHierarchySettings* iSettings;
+	const T iDefault;
+	};
+#endif
--- a/userlibandfileserver/domainmgr/inc/domaindefs.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/inc/domaindefs.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -11,6 +11,7 @@
 // Contributors:
 //
 // Description:
+// Contains the common definitions for the Domain Manager interface for clients.
 //
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
@@ -23,6 +24,7 @@
 #include <e32cmn.h>
 #include <e32power.h>
 
+
 /**
 @internalTechnology
 */
@@ -159,7 +161,8 @@
 /**
 @internalTechnology
 
-The power domain hierarchy Id.
+The power domain hierarchy Id. This hierarchy is used in development 
+platforms.
 */
 static const TDmHierarchyId	KDmHierarchyIdPower		= 1;
 
@@ -169,7 +172,8 @@
 /**
 @internalAll
 
-The start-up domain hierarchy Id.
+The system state start-up and shutdown domain hierarchy Id. This hierarchy is
+used in production devices.
 */
 static const TDmHierarchyId	KDmHierarchyIdStartup	= 2;
 
@@ -248,6 +252,35 @@
 
 
 
+/**
+The possible ways in which the domain manager can behave when a transition 
+fails. 
+
+@see TDmHierarchyPolicy
+@see TDmStateSpecV1
+@see DmPolicyGetPolicy
+*/
+enum TDmTransitionFailurePolicy
+	{
+	// Failure policies
+	
+	/**	The domain manager stops at the first transition failure */
+	ETransitionFailureStop,
+
+	/** The domain manager continues at any transition failure */
+	ETransitionFailureContinue,
+
+
+	// Special failure policies
+
+	/** Used in SDmStateSpecV1 when the default failure policy for the 
+	hierarchy should be used. The default failure policy is
+	returned by the DmPolicyGetPolicy() function, ordinal 3 in
+	the policy library. */
+	ETransitionFailureUsePolicyFromOrdinal3 = 256
+	};
+
+
 
 /**
 @publishedPartner
@@ -385,5 +418,8 @@
 */
 static const TInt KErrBadHierarchyId	= -263;
 
+
+
+
 #endif
 
--- a/userlibandfileserver/domainmgr/inc/domainmanager.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/inc/domainmanager.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -11,7 +11,9 @@
 // Contributors:
 //
 // Description:
-//
+// Contains the Domain Manager interface for clients acting in the role of
+// "Domain Controller".
+// 
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
 //          outside the Kernel and Hardware Services package.
@@ -24,26 +26,38 @@
 
 #include <domaindefs.h>
 
+
 /**
-@internalComponent
+Internal macro used by EStart source. It provides the filename of the Domain 
+Manager server.
+Not to be used outside the KernelHwSrv package.
 */
 #define KDmManagerFileNameLit	_L("domainSrv.exe")
 
+
+
 /**
-@internalComponent
+Internal session class used inside the Domain Manager client library. 
+Not to be used outside the KernelHwSrv package.
 */
 class RDmManagerSession : public RSessionBase
 	{
 public:
+	// Power hierarchy connect	
 	TInt Connect();
+	 	
+	// Specified hierarchy connect
 	TInt Connect(TDmHierarchyId aHierarchyId);
 	TInt ConnectObserver(TDmHierarchyId aHierarchyId);
+	
+	// Controller related functions
 	void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
 	void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
 	void CancelTransition();
 	TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
 	TInt GetTransitionFailureCount();
 	TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
+	
 	// Observer related functions
 	TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType);
 	void GetNotification(TRequestStatus& aStatus);
@@ -55,85 +69,54 @@
 
 
 /**
-@publishedPartner
-@released
+Published platform interface of the Domain Manager for clients performing
+the "Domain Controller" role implementing domain policy on the platform.
+
+Controllers can use this class to request domain state transitions either
+system-wide across the whole domain hierarchy or only within a specific domain 
+subtree. 
 
-The policy's interface to the domain manager.
+The Domain Manager may utilize the Transition Monitoring feature for some state
+transitions (as defined in the policy) which allows trusted clients to request
+more time to complete their work for the transition e.g. power down transitions.
+
+It also provides utility methods allowing policy controllers to load additional
+hierarchies (from a domain policy library) and to monitor the Domain Manager's
+start-up.
+
+See the RDmDomain class for the interface used by Domain Member clients. 
+ 
+Also see domaindefs.h for Domain Manager specific error codes used with this
+API.
 */
 class RDmDomainManager
 	{
 public:
 	IMPORT_C static TInt WaitForInitialization();
+		
 public:
+	// Power Hierarchy
 	IMPORT_C TInt Connect();
-	IMPORT_C void Close();
-
 	IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus);
 	IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus);
-	IMPORT_C void CancelTransition();
+	IMPORT_C void SystemShutdown();
 
-	IMPORT_C void SystemShutdown();
-	/**
-	@internalAll
-	*/
+	// Controller Specified Hierarchy
+	IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
 	IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId);
-	/**
-	@internalAll
-	*/
 	IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
-	/**
-	@internalAll
-	*/
 	IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus);
-	/**
-	@internalAll
-	*/
-	IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
-	/**
-	@internalAll
-	*/
+	
+	// Common session/hierarchy 
 	IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
-	/**
-	@internalAll
-	*/
 	IMPORT_C TInt GetTransitionFailureCount();
+	IMPORT_C void CancelTransition();
+	IMPORT_C void Close();
+	
 private:
 	RDmManagerSession	iSession;
 	};
 
 
 
-
-/**
-@internalComponent
-
-An abstract class to allow a domain controller to interface to the domain manager.
-
-To make use of this class an application must derive from it and implement a RunL() 
-method to handle notifications.
-After the derived class has been instantiated, it must call ConstructL().
-*/
-class CDmDomainManager : public CActive
-	{
-public:
-	IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId);
-	IMPORT_C ~CDmDomainManager();
-
-	IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection);
-	IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection);
-	IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
-	IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
-	IMPORT_C TInt GetTransitionFailureCount();
-	virtual void RunL() = 0;
-protected:
-	// from CActive
-	IMPORT_C void DoCancel();
-	IMPORT_C void ConstructL();
-
-private:
-	RDmDomainManager iManager;
-	TDmHierarchyId iHierarchyId;
-	TInt iReserved[4];	
-	};
-
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/inc/domainmanager_private.h	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Contains private Domain Manager interface internal to the Kernel Hardware
+// Services package.
+// 
+// WARNING: This file contains some APIs which are internal and are subject
+//          to change without notice. Such APIs should therefore not be used
+//          outside the Kernel and Hardware Services package.
+//
+
+#ifndef __DOMAIN_MANAGER_PRIVATE_H__
+#define __DOMAIN_MANAGER_PRIVATE_H__
+
+#include <e32base.h>
+#include <domaindefs.h>
+#include <domainmanager.h>
+
+
+/**
+Internal class, no clients may use this class.
+Not to be used outside the KernelHwSrv package.
+*/
+class CDmDomainManager : public CActive
+	{
+public:
+	IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId);
+	IMPORT_C ~CDmDomainManager();
+
+	IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection);
+	IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection);
+	IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId);
+	IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures);
+	IMPORT_C TInt GetTransitionFailureCount();
+	virtual void RunL() = 0;
+
+protected:
+	// from CActive
+	IMPORT_C void DoCancel();
+	IMPORT_C void ConstructL();
+
+private:
+	RDmDomainManager iManager;
+	TDmHierarchyId iHierarchyId;
+	TInt iReserved[4];	
+	};
+
+
+#endif
--- a/userlibandfileserver/domainmgr/inc/domainmember.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/inc/domainmember.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -20,27 +20,24 @@
 #ifndef __DOMAIN_MEMBER_H__
 #define __DOMAIN_MEMBER_H__
 
-#include <e32std.h>
+#include <e32base.h>
 #include <e32property.h>
 #include <domaindefs.h>
 
-/**
-@internalComponent
-*/
+
 class RDmDomainSession : public RSessionBase
 	{
 public:
 	TInt Connect(TDmHierarchyId aHierarchyId, TDmDomainId, TUint* aKey);
-	void Acknowledge(TInt aValue, TInt aError);
+	TInt Acknowledge(TInt aValue, TInt aError);
 	void RequestTransitionNotification();
 	void CancelTransitionNotification();
+	void DeferAcknowledgement(TRequestStatus& aStatus);
+	void CancelDeferral();
 	};
 
 
 /**
-@publishedPartner
-@released
-
 The application's interface to the domain manager.
 */
 class RDmDomain
@@ -55,35 +52,28 @@
 	IMPORT_C TPowerState GetPowerState();
 	IMPORT_C void AcknowledgeLastState();
 
-	/**
-	@internalAll
-	*/
 	IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
-	/**
-	@internalAll
-	*/
 	IMPORT_C void AcknowledgeLastState(TInt aError);
-	/**
-	@internalAll
-	*/
 	IMPORT_C TDmDomainState GetState();
 
+	IMPORT_C void DeferAcknowledgement(TRequestStatus& aStatus);
+	IMPORT_C void CancelDeferral();
+
 private:
+	friend class CDmDomainKeepAlive;
+	TInt AcknowledgeLastStatePriv(TInt aError);
+
 	RDmDomainSession	iSession;
 	RProperty			iStateProperty;
-	TInt				iLastStatePropertyValue;	
+	TInt				iLastStatePropertyValue;
 	};
 
 
-
 /**
-@publishedPartner
-@released
-
 An abstract class for interfacing to a domain managed by the domain manager.
 
-To make use of this class an application must derive from it and implement a RunL()
-method to handle notifications.
+To make use of this class an application must derive from it and implement a
+RunL() method to handle notifications.
 */
 class CDmDomain : public CActive
 	{
@@ -92,26 +82,85 @@
 	IMPORT_C ~CDmDomain();
 
 	IMPORT_C void RequestTransitionNotification();
-	/**
-	@internalTechnology
-	*/
 	IMPORT_C void AcknowledgeLastState(TInt aError);
-	/**
-	@internalTechnology
-	*/
 	IMPORT_C TDmDomainState GetState();
 	virtual void RunL() = 0;
+
 protected:
 	// from CActive
 	IMPORT_C void DoCancel();
 	IMPORT_C void ConstructL();
 
+	RDmDomain iDomain;
+
 private:
-	RDmDomain iDomain;
 	TDmHierarchyId iHierarchyId;
 	TDmDomainId iDomainId;
-	TInt iReserved[4];	
+	TInt iReserved[4];
 	};
 
 
+class CDmKeepAlive;
+
+/**
+This derived class extends the parent class by automatically deferring
+transitions as long as possible after the original notification is received.
+
+To make use of this class, derive and implement the HandleTransitionL()
+function. HandleTransitionL() will be called when the transition notification
+comes in. Thereafter, the active object will continually defer the transition.
+
+This object is intended to simplify the handling of notifications and
+deferrals. The member must ensure that other active objects do not block or
+have long-running RunL()s; this is to ensure that the Active Scheduler will
+remain responsive to the expiry of deadline deferrals.
+
+The capabilities needed are the same as those needed for
+RDmDomain::DeferAcknowledgement() (which this active object uses).
+
+@capability WriteDeviceData
+@capability ProtServ
+@see RDmDomain::DeferAcknowledgement()
+*/
+class CDmDomainKeepAlive : public CDmDomain
+	{
+public:
+	IMPORT_C CDmDomainKeepAlive(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId);
+	IMPORT_C ~CDmDomainKeepAlive();
+
+	IMPORT_C void AcknowledgeLastState(TInt aError);
+
+	/**
+	The derived class active object will call this function to indicate the
+	completion of the asynchronous call RequestTransitionNotification().
+
+	The implementation of this function should be used first to call
+	RequestTransitionNotification() again if required, and then to initiate the
+	response to the transition. It should be kept as quick as possible, any
+	slow operations (e.g. File Server calls) should be initiated asynchronously
+	and handled using other active objects.
+
+	Once the Domain Member's transition operations are complete, it should call
+	AcknowledgeLastState() on this active object, to indicate it is ready to be
+	transitioned.
+
+	HandleTransitionL() should not call AcknowledgeLastState() unless it can
+	trivially determine that no action at all is required for the given
+	transition.
+	*/
+	virtual void HandleTransitionL() =0;
+
+	IMPORT_C virtual TInt HandleDeferralError(TInt aError);
+
+protected:
+	IMPORT_C void ConstructL();
+
+	IMPORT_C void RunL();
+
+private:
+	CDmKeepAlive* iKeepAlive;
+
+	TUint32 iReservedSpace[2];
+	};
+
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/inc/domainmember_private.h	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,71 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: Contains private Domain Member interface internal to the Kernel
+// & Hardware Services package.
+//
+// WARNING: This file contains some APIs which are internal and are subject
+//          to change without notice. Such APIs should therefore not be used
+//          outside the Kernel & Hardware Services package.
+//
+
+#ifndef __DOMAIN_MEMBER_PRIVATE_H__
+#define __DOMAIN_MEMBER_PRIVATE_H__
+
+#include <e32base.h>
+
+class RDmDomain;
+class CDmDomainKeepAlive;
+
+/**
+This active object will, once activated, repeatedly attempt to defer
+a transition deadline from the Domain Manager.
+
+It will stop once an attempt to defer fails eg. because deferral
+was cancelled or the transition was acknowledged.
+*/
+class CDmKeepAlive : public CActive
+	{
+public:
+	CDmKeepAlive(RDmDomain& aDomain, CDmDomainKeepAlive& aOwnerActiveObject);
+	~CDmKeepAlive();
+
+	/**
+	Request deadline deferral for the last transition
+	notification
+	*/
+	void DeferNotification();
+
+	void NotifyOfAcknowledgment();
+
+protected:
+	/**
+	Re-call DeferNotification(), unless the previous
+	call completed with an error.
+	*/
+	void RunL();
+
+	/**
+	Handle errors thrown from RunL() - call HandleDeferralError()
+	hook to permit client to handle it.
+	*/
+	TInt RunError(TInt aError);
+	void DoCancel();
+
+private:
+	RDmDomain& iDomain;
+	CDmDomainKeepAlive& iOwnerActiveObject;
+
+	TBool iCeaseDeferral;
+	};
+
+#endif
--- a/userlibandfileserver/domainmgr/inc/domainpolicy.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/inc/domainpolicy.h	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -11,6 +11,15 @@
 // Contributors:
 //
 // Description:
+// Contains the Domain Manager interface for clients providing policy 
+// information. Typically this is the same client that acts in the 
+// "Domain Controller" role.
+//
+// There are two versions of the policy API - the original V1 and the new V2.
+// V2 builds upon V1 and specifies the states which clients are allowed to defer 
+// their transition timeout if they have not finished, up to a max number of 
+// times. This is part of the Domain Manager Transition Monitoring feature.
+//
 //
 // WARNING: This file contains some APIs which are internal and are subject
 //          to change without notice. Such APIs should therefore not be used
@@ -25,153 +34,232 @@
 #include <domaindefs.h>
 
 
-
-
 /**
-@publishedPartner
-@released
-
 Defines the characteristics of a domain.
 */
 struct TDmDomainSpec
 	{
-	/**
-	The domain identifier.
-	*/
+	/**	The 16-bit domain identifier */
 	TDmDomainId					iId;
 	
-	/**
-	The domain identifier of the domain's parent.
-	*/
+	/**	The domain identifier of the domain's parent */
 	TDmDomainId					iParentId;
 
-	/**
-	The security capability required to join this domain
-	*/
+	/**	The security capability required to join this domain */
 	TStaticSecurityPolicy		iJoinPolicy;
 	
-	/**
-	The initial state of the domain after construction.
-	*/
+	/**	The initial state of the domain after construction */
 	TDmDomainState				iInitState;
 	
-	/**
-	The total time allowed for members of the domain to acknowledge
-	a transition.
-	*/
+	/**	The total time allowed for the domain to complete a state transition.
+	Members of the domain must acknowledge a transition within this time.
+	Measured in microseconds. */
 	TUint32						iTimeBudgetUs;
 	};
 
+#define TDM_DOMAIN_SPEC_END  {KDmIdNone, KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0, 0}
 
 
 
 /**
-@internalAll
+Defines the overall traversal and failure policy for a particular 
+domain hierarchy and is returned by DmPolicy::GetPolicy().
+Note the failure policy can be overridden for individual 
+states in V2 policies. 
 
-The possible ways in which the domain manager can behave
-when a transition fails.
-
-This is defined for each domain hierarchy.
-
-@see TDmHierarchyPolicy
+@see TDmTransitionFailurePolicy
 */
-enum TDmTransitionFailurePolicy
+class TDmHierarchyPolicy
 	{
-	/**
-	The domain manager stops at the first transition failure.
-	*/
-	ETransitionFailureStop,
-
-	/**
-	The domain manager continues at any transition failure.
-	*/
-	ETransitionFailureContinue
+public:
+	/** Direction of traversal if target state is after current state */
+	TDmTraverseDirection iPositiveTransitions;
+	
+	/**	Direction of traversal if target state is before current state */
+	TDmTraverseDirection iNegativeTransitions;
+	
+	/** Policy which outlines the action upon transition failure */
+	TDmTransitionFailurePolicy iFailurePolicy;
 	};
 
 
 
 /**
-@internalTechnology
+Defines the characteristics of a state and is used by entry points introduced
+in version 2 of the policy API. The structure itself is also versioned with V1 
+in use with version 2 policy libraries. 
+
+Policy providers provide an object of this type for each state they want to:
+- enable the Transition Monitoring feature or/and
+- override the default failure policy
 
-Defines the policy for a particular domain hierarchy.
+Enabling transition monitoring will allow trusted clients to receive more time
+to complete their work before final acknowledgment. Enable transition 
+monitoring to ensure a fair completion of the transition e.g. shutdown system.
+Where transition monitoring is enabled the Domain level timer is not used
+and iTimeBudgetUs provided in TDmDomainSpec is ignored.
+
+The global failure policy is returned by DmPolicy::GetPolicy() and in V1 
+policies this applies to all state transitions. iFailurePolicy in this 
+structure allows different failure policies for different state transitions. 
+
+@see DmPolicy::GetStateSpec()
 */
-class TDmHierarchyPolicy
+struct SDmStateSpecV1
 	{
-public:
-	/**
-	direction of traverse if target state is after current state
-	*/
-	TDmTraverseDirection iPositiveTransitions;
-	/**
-	direction of traverse if target state is before current state
-	*/
-	TDmTraverseDirection iNegativeTransitions;
-	/**
-	policy which outlines the action upon transition failure
-	*/
-	TDmTransitionFailurePolicy iFailurePolicy;
+	/**	The destination state of the transition */
+	TDmDomainState		iState;
+	
+	/** Transition Monitoring: member transition timeout granularity, in 
+	milliseconds, e.g. 200ms. Set to 0 to not use transition monitoring for 
+	this state. */
+	TInt16				iTimeoutMs;	
+		
+	/** Transition Monitoring: maximum number of times a domain member may be 
+	granted an additional timeout period. Set to 0 when transition 
+	monitoring not used for this state. */	
+	TInt16				iDeferralLimit;	
+	
+	/** Specifies the failure policy for transitions to the target state, see
+	TDmTransitionFailurePolicy. Overrides the global value returned by 
+	the policy function DmPolicyGetPolicy(). 
+	Set to ETransitionFailureUsePolicyFromOrdinal3 if override not required. */	
+	TInt16			    iFailurePolicy;
 	};
+	
+const TInt KSDmStateSpecV1 = 1;
+
 
 
 /**
-@internalAll
+Defines the function type for a static function that is implemented by
+a device's domain policy DLL at ordinal 1.
+The domain manager uses this function to access the domain
+hierarchy specification. The pointer returned must point to an array of
+TDmDomainSpec objects where the last object in the array is defined
+using the END macro, as shown below.
+@code
+	. . .
+	TDM_DOMAIN_SPEC_END
+	};
+@endcode
 
-Defines the function type for a static function that is implemented by
-a device's domain policy DLL.
+The implementation should return NULL if it is unable to supply the requested
+information due to an error. This will abort policy loading and hierarchy 
+creation. 
+The implementation must never panic or leave in any way.
 
-The domain manager uses this function to access the hierarchy's policy.
+@see DmPolicy
 */
 typedef const TDmDomainSpec* (*DmPolicyGetDomainSpecs)();
 
 
 /**
-@internalAll
+Defines the function type for a static function that is implemented by
+a device's domain policy DLL at ordinal 2. The domain manager uses this 
+function to release the domain hierarchy specification returned by ordinal 1.
+The implementation must never panic or leave in any way.
 
-Defines the function type for a static function that is implemented by
-a device's domain policy DLL.
-
-The domain manager uses this function to release the domain
-hierarchy specification.
+@see DmPolicy
 */
 typedef void (*DmPolicyRelease) (const TDmDomainSpec* aDomainSpec);
 
 
 /**
-@internalAll
+Defines the function type for a static function that is implemented by
+a device's domain policy DLL at ordinal 3. The domain manager uses this 
+function to access the hierarchy's policy.
+The implementation may return a system-wide error code if it encounters an
+error. This will abort policy loading and hierarchy creation. 
+The implementation must never panic or leave in any way.
 
-Defines the function type for a static function that is implemented by
-a device's domain policy DLL.
-
-The domain manager uses this function to access the domain
-hierarchy specification.
+@see DmPolicy
 */
 typedef TInt (*DmPolicyGetPolicy) (TDmHierarchyPolicy& aPolicy);
 
+
 /**
-@publishedPartner
-@released
+Defines the function type for a static function that is implemented by
+a device's domain policy DLL at ordinal 4. The domain manager uses this
+function to obtain the state specification to configure the client transition
+monitoring feature. 
+This method is new in V2 of the domain policy and should not be present in 
+V1 policy library.
+The implementation must never panic or leave in any way.
+
+The implementation returns either an error or the version of the state 
+specification structure used in the array pointed to by aPtr on exit. 
+When the return value is >=1, aNumElements must be >0.
+Where a state specification is not required (i.e. client transition monitoring 
+is not required) the implementation returns 0. When an error occurs a negative
+system-wide error code is returned. In both these cases the output parameters are
+ignored.
+
+@see SDmStateSpecV1
+@see DmPolicy
+*/
+typedef TInt (*DmPolicyGetStateSpec) (TAny*& aPtr, TUint& aNumElements);
 
-A set of static functions implemented by a device's domain policy DLL that
-the domain manager uses to access, and release, the domain
-hierarchy specification.
+/**
+Defines the function type for a static function that is implemented by
+a device's domain policy DLL at ordinal 5. The domain manager uses this 
+function to release the state specification returned by ordinal 4. The 
+implementation may be empty and simply return if no release action needs 
+to be taken.
+
+This method is new in V2 of the domain policy and should not be present in 
+V1 policy library.
+The implementation must never panic or leave in any way.
+
+@see DmPolicy
+*/
+typedef void (*DmPolicyReleaseStateSpec) (TAny* aStateSpec);
+
+
+
+/**
+A set of static functions implemented in a domain hierarchy policy DLL that
+the domain manager uses to access and release the domain hierarchy and 
+domain state specifications.
+
+@see DmPolicyOrdinals
 */
 class DmPolicy
 	{
 public:
+	// Original policy version methods
 	IMPORT_C static const TDmDomainSpec* GetDomainSpecs();
 	IMPORT_C static void Release(const TDmDomainSpec* aDomainSpec);
 	IMPORT_C static TInt GetPolicy(TDmHierarchyPolicy& aPolicy);
+	
+	// Version 2 methods
+	IMPORT_C static TInt GetStateSpec(TAny*& aPtr, TUint& aNumElements);
+	IMPORT_C static void ReleaseStateSpec(TAny* aStateSpec);
 	};
 
 
+
 /**
-@internalTechnology
+Describes the purpose (and thus each function prototype) of each ordinal in the
+policy DLL. There are two versions of this DLL in use:
+- V1 DLLs implement ordinals 1..3
+- V2 DLLs implement ordinals 1..5 
+
+@see DmPolicy 
 */
 enum DmPolicyOrdinals
 	{
+	// Policy DLL version 1 ordinals 
 	EDmPolicyGetDomainSpecs = 1,
 	EDmPolicyRelease,
-	EDmPolicyGetPolicy
+	EDmPolicyGetPolicy,
+	
+	// Policy DLL version 2 ordinals for the "Transition Monitoring" feature.
+	// These entry points are not needed in V1 policy libraries.
+	EDmPolicyGetStateSpec,
+	EDmPolicyReleaseStateSpec			
 	};
 
+
+
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/inc/domainsrv.h	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,76 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Provides domain manager and member server message definitions and 
+// DmStateXXX inlines. 
+// 
+//
+
+#ifndef __DOMAIN_SRV_H__
+#define __DOMAIN_SRV_H__
+
+#include <e32def.h>
+
+#include <domaindefs.h>
+
+_LIT(KDmDomainServerNameLit,"!DmDomainServer");
+#define KDmDomainServerVersion	TVersion(1, 0, 0)
+_LIT(KDmManagerServerNameLit,"!DmManagerServer");
+#define KDmManagerServerVersion	TVersion(1, 0, 0)
+
+#ifdef __DS_DEBUG
+#include <e32debug.h>
+#define __DS_TRACE(s) RDebug::Print s
+#else
+#define __DS_TRACE(s)
+#endif
+
+enum TMemberRequests
+	{
+	EDmDomainJoin,
+	EDmStateAcknowledge,
+	EDmStateRequestTransitionNotification,
+	EDmStateCancelTransitionNotification,
+	EDmStateDeferAcknowledgement,
+	EDmStateCancelDeferral
+	};
+
+enum TControllerRequests
+	{
+	EDmRequestSystemTransition,
+	EDmRequestDomainTransition,
+	EDmCancelTransition,
+	EDmHierarchyJoin,
+	EDmHierarchyAdd,
+	EDmGetTransitionFailureCount,
+	EDmGetTransitionFailures,
+	EDmObserverJoin,
+	EDmObserverStart,
+	EDmObserverStop,
+	EDmObserverNotify,
+	EDmObserverEventCount,
+	EDmObserverGetEvent,
+	EDmObserverCancel,
+	EDmObserveredCount
+	};
+
+inline TInt DmStatePropertyKey(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId)
+	{ return (TInt) ((aHierarchyId << 8) | ((aDomainId << 8) & 0xff0000) | (aDomainId & 0xff) ); }
+
+inline TInt DmStatePropertyValue(TUint aId, TUint32 aState)
+	{ return (TInt) ((aId << 24) | (aState & 0xffffff)); }
+
+inline TDmDomainState DmStateFromPropertyValue(TInt aValue)
+	{ return (TDmDomainState) (aValue & 0xffffff); }
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/domainmgr/src/domaincfg.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -0,0 +1,174 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Code for managing the Domain manager's configuration settings
+//
+//
+
+#include "domaincfg.h"
+#include "domainsrv.h"
+
+TTransitionConfig::TTransitionConfig(TDmDomainState aState)
+	{
+	iState = aState;
+	iTimeoutMs = -1;
+	iDeferralLimit = -1;
+	iFailurePolicy = -1;
+	}
+
+TTransitionConfig::TTransitionConfig(const SDmStateSpecV1& aSpec)
+	{
+	iState = aSpec.iState;
+	iTimeoutMs  = aSpec.iTimeoutMs;
+	iDeferralLimit = aSpec.iDeferralLimit;
+	iFailurePolicy = aSpec.iFailurePolicy;
+	}
+
+TInt TTransitionConfig::CheckValues() const
+	{
+	// Do some basic value sanity checking
+	if ((iTimeoutMs < 0) ||
+		(iDeferralLimit < 0) ||
+		(iFailurePolicy < 0))
+		{
+		__DS_TRACE((_L("DM: Error: Negative value in struct TTransitionConfig")));
+		return KDmErrBadDomainSpec;
+		}
+	return KErrNone;
+	}
+
+
+CHierarchySettings::CHierarchySettings()
+	{
+	__DS_TRACE((_L("DM: CHierarchySettings::CHierarchySettings @0x%08x"), this));
+
+	iConfigs.SetKeyOffset(_FOFF(TTransitionConfig, iState));
+	}
+
+CHierarchySettings::~CHierarchySettings()
+	{
+	__DS_TRACE((_L("DM: CHierarchySettings::~CHierarchySettings @0x%08x"), this));
+
+	iConfigs.Close();
+	}
+
+
+void CHierarchySettings::StoreConfigL(const TTransitionConfig& aConfig)
+	{
+	__DS_TRACE((_L("DM: CHierarchySettings::StoreConfigL(): @0x%08x: T %d ms, Def %d, Fail %d, State 0x%x (%d)"),
+		this, aConfig.iTimeoutMs, aConfig.iDeferralLimit, aConfig.iFailurePolicy, aConfig.iState, aConfig.iState));
+	iConfigs.InsertInUnsignedKeyOrderL(aConfig);
+	}
+
+void CHierarchySettings::SetCurrentTargetTransition(TDmDomainState aState)
+	{
+	__DS_TRACE((_L("DM: CHierarchySettings::SetCurrentTargetTransition @0x%08x: 0x%x (%d)"),
+		this, aState, aState));
+
+	iCurrentState = aState;
+	}
+
+TBool CHierarchySettings::GetDomainTimeout(TTimeIntervalMicroSeconds32& aTimeout) const
+	{
+	const TTransitionConfig* cfg = LookupConfig(iCurrentState);
+
+	TBool valueOverriden = EFalse;
+	TInt16 unsetValue = 0;
+	if(cfg && cfg->iTimeoutMs != unsetValue)
+		{
+		valueOverriden = ETrue;
+		}
+
+	if(valueOverriden)
+		{
+		// convert ms to microseconds
+		aTimeout = 1000 * cfg->iTimeoutMs;
+		}
+	else
+		{
+		aTimeout = 1000 * unsetValue;
+		}
+
+	__DS_TRACE((_L("DM: CHierarchySettings::GetDomainTimeout @0x%08x: state 0x%x (%d), override = %d, aTimeout = %d us"),
+		this, iCurrentState, iCurrentState, valueOverriden, aTimeout.Int()));
+
+	return valueOverriden;
+	}
+
+TBool CHierarchySettings::GetDeferralBudget(TInt& aDeferralCount) const
+	{
+	const TTransitionConfig* cfg = LookupConfig(iCurrentState);
+
+	TBool valueOverriden = EFalse;
+	TInt16 unsetValue = 0;
+	if(cfg && cfg->iDeferralLimit != unsetValue)
+		{
+		valueOverriden = ETrue;
+		}
+
+	if(valueOverriden)
+		{
+		aDeferralCount = cfg->iDeferralLimit;
+		}
+	else
+		{
+		aDeferralCount = unsetValue;
+		}
+
+	__DS_TRACE((_L("DM: CHierarchySettings::GetDeferralBudget @0x%08x: state 0x%x (%d), override = %d, aDeferralCount = %d"),
+		this, iCurrentState, iCurrentState, valueOverriden, aDeferralCount));
+
+	return valueOverriden;
+	}
+
+TBool CHierarchySettings::GetFailurePolicy(TDmTransitionFailurePolicy& aFailurePolicy) const
+	{
+	const TTransitionConfig* cfg = LookupConfig(iCurrentState);
+
+	TBool valueOverriden = EFalse;
+	TDmTransitionFailurePolicy unsetValue = ETransitionFailureUsePolicyFromOrdinal3;
+	if(cfg && (TDmTransitionFailurePolicy)cfg->iFailurePolicy != unsetValue)
+		{
+		valueOverriden = ETrue;
+		}
+
+	if(valueOverriden)
+		{
+		aFailurePolicy = (TDmTransitionFailurePolicy)cfg->iFailurePolicy;
+		}
+	else
+		{
+		aFailurePolicy = unsetValue;
+		}
+
+	__DS_TRACE((_L("DM: CHierarchySettings::GetFailurePolicy @0x%08x: state 0x%x (%d), override = %d, aFailurePolicy = %d"),
+		this, iCurrentState, iCurrentState, valueOverriden, aFailurePolicy));
+
+	return valueOverriden;
+	}
+
+const TTransitionConfig* CHierarchySettings::LookupConfig(TDmDomainState aState) const
+	{
+	const TTransitionConfig key(aState);
+	TInt index = -1;
+
+	TRAPD(r, iConfigs.FindInUnsignedKeyOrderL(key, index));
+
+	if(r == KErrNotFound)
+		return NULL;
+
+	return &(iConfigs[index]);
+	}
+
+
+
--- a/userlibandfileserver/domainmgr/src/domaincli.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/src/domaincli.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -22,8 +22,10 @@
 
 #include <domainmember.h>
 #include <domainmanager.h>
+#include "domainmanager_private.h"
 #include "domainobserver.h"
 #include "domainsrv.h"
+#include "domainmember_private.h"
 
 #define __DM_PANIC(aError) User::Panic(_L("domainCli.cpp"), (-(aError)) | (__LINE__ << 16))
 #define __DM_ASSERT(aCond) __ASSERT_DEBUG(aCond,User::Panic(_L("domainCli.cpp; assertion failed"), __LINE__))
@@ -47,14 +49,12 @@
 	return KErrNone;
 	}
 
-void RDmDomainSession::Acknowledge(TInt aValue, TInt aError)
+TInt RDmDomainSession::Acknowledge(TInt aValue, TInt aError)
 	{
 	__DM_ASSERT(Handle() != KNullHandle);
 
 	TIpcArgs a(aValue, aError);
-	TInt r = RSessionBase::SendReceive(EDmStateAcknowledge, a);
-	if (r != KErrNone)
-		__DM_PANIC(r);
+	return RSessionBase::SendReceive(EDmStateAcknowledge, a);
 	}
 
 void RDmDomainSession::RequestTransitionNotification()
@@ -76,6 +76,23 @@
 	}
 
 
+void RDmDomainSession::DeferAcknowledgement(TRequestStatus& aStatus)
+	{
+	__DM_ASSERT(Handle() != KNullHandle);
+	RSessionBase::SendReceive(EDmStateDeferAcknowledgement, aStatus);
+	}
+
+
+void RDmDomainSession::CancelDeferral()
+	{
+	if (Handle() != KNullHandle)
+		{
+		TInt r = RSessionBase::SendReceive(EDmStateCancelDeferral);
+		if (r != KErrNone)
+			__DM_PANIC(r);
+		}
+	}
+
 
 /**
 Connects to the domain identified by the specified domain Id.
@@ -90,7 +107,7 @@
 @param aDomainId The identifier of the domain to be connected to.
 
 @return KErrNone, if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+        or Domain Manager specific error codes.
 
 @capability WriteDeviceData If aDomainId==KDmIdRoot
 */
@@ -126,7 +143,7 @@
 @param aDomainId    The identifier of the domain to be connected to.
 
 @return KErrNone, if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+        or Domain Manager specific error codes.
 
 @capability WriteDeviceData If aDomainId==KDmIdRoot
 */
@@ -194,15 +211,14 @@
 
 
 
-
 /**
 Gets the domain's power state.
-	
+
 An application normally calls this function after a notification request
 has completed. It then performs any application-dependent action demanded by
 the power state, and then acknowledges the state transition.
 
-Note that the domain manager requires any domain power state change to be
+Note that the Domain Manager requires any domain power state change to be
 acknowledged by all applications connected to the domain.
 
 @return The connected domain's power state.
@@ -224,40 +240,119 @@
 
 /**
 Acknowledges the state change.
-	
+
 An application must acknowledge that it has performed all actions required
 by the last known state of the domain.
 */
 EXPORT_C void RDmDomain::AcknowledgeLastState()
 	{
-	iSession.Acknowledge(iLastStatePropertyValue, KErrNone);
+	TInt r = iSession.Acknowledge(iLastStatePropertyValue, KErrNone);
+
+	if (r != KErrNone && r != KErrNotFound)
+		__DM_PANIC(r);
 	}
 
-
 /**
 Acknowledges the state change with the specified error
 	
 An application must acknowledge that it has performed all actions required
 by the last known state of the domain.
 
-@param aError KDmErrNotJoin if domain is not part of the hierarhcy or a 
+@param aError KDmErrNotJoin if domain is not part of the hierarchy or a
 	system wide error value associated with the state change.
 */
 EXPORT_C void RDmDomain::AcknowledgeLastState(TInt aError)
 	{
-	iSession.Acknowledge(iLastStatePropertyValue, aError);
+	TInt r = iSession.Acknowledge(iLastStatePropertyValue, aError);
+
+	if (r != KErrNone && r != KErrNotFound)
+		__DM_PANIC(r);
+	}
+
+/**
+Acknowledges the state change with the specified error
+
+@param aError KDmErrNotJoin if domain is not part of the hierarchy or a
+	system wide error value associated with the state change.
+
+@return KErrNone If the acknowledgment was valid, KErrNotFound if it was spurious
+*/
+TInt RDmDomain::AcknowledgeLastStatePriv(TInt aError)
+	{
+	return iSession.Acknowledge(iLastStatePropertyValue, aError);
 	}
 
+/**
+Having received a state transition notification, instead of acknowledging,
+request more time. To be sure of deferring in time a client should call this immediately
+after receiving notification. This asynchronous call will complete once the original deadline
+is reached (ie. one period earlier than the final deadline), at which point the member must either
+defer again or acknowledge the transition. In the meantime, the member should perform
+its transition actions, whilst remaining responsive to new completion events.
+
+For example, if after receiving a transition notification, the client calls DeferAcknowledgement
+once, but fails to acknowledge or renew its deferral, it would be timed out after two time periods.
+
+Once the member has completed all necessary actions it should call AcknowledgeLastState
+to indicate a successful transition (it need not wait for the completion of DeferAcknowledgement).
+
+@note Deferrals are not always possible,
+whether the member will actually be given more time depends on if
+   - The current transition allows deferrals at all.
+   - The member still has deferrals left - there may be a maximum number
+     allowed.
+   - The deferral request was received in time.
+
+@param aStatus Status of request
+   - KErrNone Request has completed i.e. The member must either defer again or acknowledge.
+   - KErrCompletion The deferral was obsoleted by a subsequent call to AcknowledgeLastState.
+   - KErrNotSupported The current transition may not be deferred, or maximum deferral count reached.
+   - KErrCancel The deferral was cancelled.
+   - KErrNotReady Deferral attempted before a transition notification was received
+     or after the deadline for the previous one.
+   - KErrPermissionDenied The member lacked the necessary capabilities.
+   - KErrServerBusy A deferral was already outstanding.
+
+This function is provided for members to inform the Domain Manager that they
+are still active and are responding to a transition notification.
+For example, a server may have to persist data using
+the file server before shut down. Since this task should be allowed to complete
+before shutdown continues, the member should defer the transition, and then persist
+the data, using asynchronous calls.
+
+At least one of the below capabilities is required in order to defer a
+domain transition. Without them, the client will get KErrPermissionDenied.
+
+@capability WriteDeviceData
+@capability ProtServ
+
+@pre The member has been notified of a transition which it has not yet acknowledged
+*/
+EXPORT_C void RDmDomain::DeferAcknowledgement(TRequestStatus& aStatus)
+	{
+	iSession.DeferAcknowledgement(aStatus);
+	}
+
+
+/**
+Will cancel a call of DeferAcknowledgement(), if one was pending.
+
+If none was pending, it does nothing.
+*/
+EXPORT_C void RDmDomain::CancelDeferral()
+	{
+	iSession.CancelDeferral();
+	}
 
 
 /**
 Gets the domain's state.
-	
+
 An application normally calls this function after a notification request
 has completed. It then performs any application-dependent action demanded by
 the state, and then acknowledges the state transition.
 
-Note, that the domain manager requires any domain state change to be
+Note, that the Domain Manager requires any domain state change to be
 acknowledged by all applications connected to the domain.
 
 @return The connected domain's state.
@@ -498,9 +593,18 @@
 	return(RSessionBase::SendReceive(EDmObserveredCount));
 	}
 
+
+
+//-- RDmDomainManager ---------------------------------------------------------
+
+
+
 /**
-@internalAll
-@released
+Caller blocked until the Domain Manager server has started up and is ready 
+for requests.
+
+@return	KErrNone once the Domain Manager server is ready, otherwise one of the 
+		other system wide or the Domain Manager specific error codes.
 */
 EXPORT_C TInt RDmDomainManager::WaitForInitialization()
 	{
@@ -522,7 +626,7 @@
 		if (r == KErrNone)
 			{
 			if (value) break; // initialized
-			// property exists but the server is not intialized yet
+			// property exists but the server is not initialised yet
 			}
 		else
 			{
@@ -547,20 +651,21 @@
 	}
 
 
-
-
 /**
 Opens a controlling connection to the standard power domain hierarchy
-in the domain manager.
+in the Domain Manager.
 
-The domain manger allows only one open connection at any one time to the 
+The Domain Manager allows only one open connection at any one time to the 
 power domain hierarchy.
-Connection is usually made by the power policy entity.
 
-@return KErrNone, if successful; otherwise one of the other system-wide
-        or the domain manager specific error codes.
-        
-@see KDmErrAlreadyJoin   
+@return KErrNone if successful, otherwise one of the other system-wide
+        or the Domain Manager specific error codes.
+@return KErrInUse when the power hierarchy already has a controller connected.
+@return KErrBadHierarchyId when the server has failed to load the power hierarchy. 
+@return KErrPermissionDenied when the client has insufficient capabilities
+
+@capability PowerMgmt Required to create a connection to the Domain Manager.
+@see KDmHierarchyIdPower
 */
 EXPORT_C TInt RDmDomainManager::Connect()
 	{
@@ -568,34 +673,29 @@
 	}
 
 
-
+/**
+Opens a controlling connection to a specific domain hierarchy previously 
+loaded into the Domain Manager by the controller. The Domain Manager allows only 
+one open connection at any one time to a particular hierarchy.
 
-/**
-Opens a controlling connection to a specific domain hieararchy owned 
-by the domain manager.
+@param	aHierarchyId The Id of the domain hierarchy to connect to.
 
-The domain manger allows only one open connection at any one time to a 
-particular hierarchy.
-
-@param	aHierarchyId	The Id of the domain hierarchy to connect to.
-
-@return KErrNone, if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
-        
-@see KDmErrAlreadyJoin
-@see KErrBadHierarchyId       
+@return KErrNone if successful, otherwise one of the other system-wide
+        or the Domain Manager specific error codes.
+@return KErrInUse when the power hierarchy already has a controller connected.
+@return KErrBadHierarchyId when the server has failed to load the power hierarchy.
+@return KErrPermissionDenied when the client has insufficient capabilities
+   
+@capability PowerMgmt Required to create a connection to the Domain Manager.
 */
 EXPORT_C TInt RDmDomainManager::Connect(TDmHierarchyId aHierarchyId)
-
 	{
 	return iSession.Connect(aHierarchyId);
 	}
 
 
-
-
 /**
-Closes this connection to the domain manager.
+Closes this connection to the Domain Manager.
 	
 If there is no existing connection, then it returns silently.
 */
@@ -605,21 +705,23 @@
 	}
 
 
-
-
 /**
-Requests a system-wide power state transition.
+Requests a system-wide power state transition and is used with the
+KDmHierarchyIdPower hierarchy. The domain hierarchy is traversed in the 
+default direction. 
 
-The domain hierarchy is traversed in the default direction
-		
-@param aState   The target power state.
-@param aStatus  The request status object for this asynchronous request.
+A transition to the power state EPwActive is an error and result in 
+async completion with KErrArgument.
+	
+@param aState   The target power state, not EPwActive or >=EPwLimit.
+@param aStatus	The request status object for this asynchronous request.
 
 @see RDmDomainManager::CancelTransition()
+@see KDmHierarchyIdPower
 */
 EXPORT_C void RDmDomainManager::RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus)
 	{
-	if (aState == EPwActive)
+	if ((aState == EPwActive) || (aState >= EPwLimit))
 		{
 		TRequestStatus* status = &aStatus;
 		User::RequestComplete(status, KErrArgument);
@@ -629,13 +731,13 @@
 	}
 
 
-
+/**
+Requests a system-wide power off (EPwOff) state transition to shutdown the 
+platform. Applicable to the KDmHierarchyIdPower hierarchy.
 
-/**
-Requests a system-wide power shutdown.
+This call does not return; the system can only return by physical button restart.
 
-This is a request to change the system's power state to EPwOff.
-This call does not return; the system can only return by rebooting.
+@see KDmHierarchyIdPower
 */
 EXPORT_C void RDmDomainManager::SystemShutdown()
 	{
@@ -646,18 +748,19 @@
 	}
 
 
-
-
 /**
-Requests a domain state transition.
-
-The domain hierarchy is traversed in the default direction.
+Requests a domain power state transition and is used with the
+KDmHierarchyIdPower hierarchy. The domain hierarchy is traversed in the 
+default direction.
 
 @param aDomainId The Id of the domain for which the state transition
                  is being requested.
-@param aState    The target state.
-@param aStatus   The request status object for this asynchronous request.
-
+@param aState    The target power state.
+@param aStatus   The request status object to receive the asynchronous result.
+				 KErrNone if successful, otherwise one of the other system-wide
+        		 or the Domain Manager specific error codes.
+        		 
+@see KDmHierarchyIdPower
 @see RDmDomainManager::CancelTransition()
 */
 EXPORT_C void RDmDomainManager::RequestDomainTransition(
@@ -669,13 +772,11 @@
 	}
 
 
-
-
 /**
-Cancels a state transition, whether initiated by a call
+Cancels an outstanding state transition, whether initiated by a call
 to RequestSystemTransition() or RequestDomainTransition().
 
-An outstanding state transition request completes with KErrCancel.
+The outstanding state transition request completes with KErrCancel.
 */
 EXPORT_C void RDmDomainManager::CancelTransition()
 	{
@@ -683,22 +784,21 @@
 	}
 
 
-
-
 /**
-Requests a system-wide state transition.
+Requests a state transition across the whole domain hierarchy that 
+this connection is controlling. The domain hierarchy is traversed in the 
+specified direction.
+		
+@param aState	The target state, hierarchy specific state value.
+@param aDirection The direction in which to traverse the hierarchy
+@param aStatus  The request status object to receive the asynchronous result.
+				KErrNone if successful, otherwise one of the other system-wide
+        		or the Domain Manager specific error codes.
 
-The domain hierarchy is traversed in the specified direction.
-		
-@param aState   The target state.
-@param aDirection The direction in which to traverse the hierarchy
-@param aStatus  The request status object for this asynchronous request.
+@panic domainCli.cpp; assertion failed line - if the numerical value of 
+		aDirection is greater than the value of ETraverseMax. 
 
 @see RDmDomainManager::CancelTransition()
-
-@panic domainCli.cpp; assertion failed VARNUM if the numerical value of aDirection
-       is greater than the value of ETraverseMax. NOTE: VARNUM is the line number
-       in the source code and may change if the implementation changes.
 */
 EXPORT_C void RDmDomainManager::RequestSystemTransition(
 	TDmDomainState aState, 
@@ -711,23 +811,23 @@
 
 
 
-
 /**
-Requests a domain state transition.
-
-The domain hierarchy is traversed in the specified direction
+Requests a domain state transition for the hierarchy that this connection is 
+controlling. The domain hierarchy is traversed in the specified direction.
 
 @param aDomainId The Id of the domain for which the state transition
                  is being requested.
 @param aState    The target state.
 @param aDirection The direction in which to traverse the hierarchy.
-@param aStatus   The request status object for this asynchronous request.
-
-@see RDmDomainManager::CancelTransition()
+@param aStatus   The request status object to receive the asynchronous result.
+				 KErrNone if successful, otherwise one of the other system-wide
+        		 or the Domain Manager specific error codes.
 
 @panic domainCli.cpp; assertion failed VARNUM if the numerical value of aDirection
        is greater than the value of ETraverseMax. NOTE: VARNUM is the line number
        in the source code and may change if the implementation changes.
+       
+@see RDmDomainManager::CancelTransition()
 */
 EXPORT_C void RDmDomainManager::RequestDomainTransition(
 	TDmDomainId aDomainId, 
@@ -741,14 +841,19 @@
 
 
 
-
 /**
-Adds a domain hierarchy to the domain manager.
+Instructs the Domain Manager to load the domain hierarchy library for
+aHierarchyId. The library takes the name "domainpolicyNN.dll" where NN is 
+the hierarchy number as supplied.
 
 @param aHierarchyId The Id of the domain hierarchy to be added.
 
-@return	KErrNone if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+@return KErrNone if successful, otherwise one of the other system-wide
+        or the Domain Manager specific error codes.
+@return KErrBadHierarchyId If the library is not found or contains invalid data
+@return KErrPermissionDenied when the client has insufficient capabilities
+
+@capability PowerMgmt Required to create a connection to the Domain Manager.
 */
 EXPORT_C TInt RDmDomainManager::AddDomainHierarchy(TDmHierarchyId aHierarchyId)
 	{
@@ -762,17 +867,15 @@
 	}
 
 
-
 /**
 Requests a list of transition failures since the last transition request.
 
-@param aTransitionFailures A client-supplied array of TTransitionFailure objects which 
-		on exit will contain the failures that have occurred since the last transition 
-		request. 
-@pre	The session must be connected.
+@param aTransitionFailures A client supplied array of TTransitionFailure objects
+		which on exit will contain the failures that have occurred since the 
+		last transition	request. 
 
-@return KErrNone, if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+@return KErrNone if successful, otherwise one of the other system-wide
+        or the Domain Manager specific error codes.
 */
 EXPORT_C TInt RDmDomainManager::GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures)
 	{
@@ -780,12 +883,11 @@
 	}
 
 
-
 /**
 Gets the number of transition failures since the last transition request.
 
-@return	The number of failures, if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+@return KErrNone if successful, otherwise one of the other system-wide
+        or the Domain Manager specific error codes.
 */
 EXPORT_C TInt RDmDomainManager::GetTransitionFailureCount()
 	{
@@ -794,7 +896,9 @@
 
 
 
-// CDmDomain
+//-- CDmDomain ----------------------------------------------------------------
+
+
 
 /**
 Constructor.
@@ -822,7 +926,7 @@
 /**
 Destructor.
 
-Closes the session to the domain manager.
+Closes the session to the Domain Manager.
 */
 EXPORT_C CDmDomain::~CDmDomain()
 	{
@@ -852,6 +956,14 @@
 Requests notification when the domain's state changes.
 
 RunL() will be called when this happens.
+
+@note
+If the client is ready to acknowledge the last transition, but
+would like to register for notification of the next one, it
+should call this function and then call AcknowledgeLastState,
+immediately afterwards.
+This eliminates the possibility of a transition occurring
+between acknowledging and registering for notification.
 */
 EXPORT_C void CDmDomain::RequestTransitionNotification()
 	{
@@ -882,7 +994,7 @@
 An application must acknowledge that it has performed all actions required
 by the last known state of the domain.
 
-@param aError	The error to return to the domain manager. The client should
+@param aError	The error to return to the Domain Manager. The client should
 				set this to KErrNone if it successfully transitioned to the 
 				new state or to one of the system-wide error codes.
 */
@@ -908,6 +1020,199 @@
 	return iDomain.GetState();
 	}
 
+//-- CDmDomainKeepAlive ----------------------------------------------------------------
+
+
+/**
+Constructor.
+
+Adds this active object to the active scheduler.
+
+@param aHierarchyId The Id of the domain hierarchy to connect to.
+@param aDomainId	The Id of the domain to connect to.
+
+@see CActive
+*/
+EXPORT_C CDmDomainKeepAlive::CDmDomainKeepAlive(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId)
+	: CDmDomain(aHierarchyId, aDomainId), iKeepAlive(NULL)
+	{
+	}
+
+/**
+Destructor.
+
+Cleanup the internal CDmKeepAlive active object.
+*/
+EXPORT_C CDmDomainKeepAlive::~CDmDomainKeepAlive()
+	{
+	delete iKeepAlive;
+	}
+
+/**
+Complete construction of this object. Classes derived from this one
+should call this as part of their ConstructL or NewL functions.
+*/
+EXPORT_C void CDmDomainKeepAlive::ConstructL()
+	{
+	CDmDomain::ConstructL();
+	iKeepAlive = new (ELeave) CDmKeepAlive(iDomain, *this);
+	}
+
+/**
+Acknowledges the last state change.
+
+An application must acknowledge that it has performed all actions required
+by the last known state of the domain.
+
+Once this is done the AO will no longer attempt to defer deadlines.
+
+@param aError	The error to return to the Domain Manager. The client should
+				set this to KErrNone if it successfully transitioned to the 
+				new state or to one of the system-wide error codes.
+*/
+EXPORT_C void CDmDomainKeepAlive::AcknowledgeLastState(TInt aError)
+	{
+	TInt r = iDomain.AcknowledgeLastStatePriv(aError);
+	if (r != KErrNone && r != KErrNotFound)
+		__DM_PANIC(r);
+
+	if (r == KErrNone)
+		{
+		// KErrNone indicates that an acknowledgment was accepted
+		// (as opposed to being spurious or late)
+
+		iKeepAlive->NotifyOfAcknowledgment();
+		}
+	}
+
+/**
+Handle completion of request notifications, begins deferrals.
+
+@note Clients should not need to override this, they
+will be notified of events via calls to HandleTransitionL.
+*/
+EXPORT_C void CDmDomainKeepAlive::RunL()
+	{
+	iKeepAlive->DeferNotification();
+	HandleTransitionL();
+	}
+
+/**
+This object will internally, use RDmDomain::DeferAcknowledgement.
+
+The default implementation of this function will simply ignore errors
+from RDmDomain::DeferAcknowledgement that
+it presumes the client can not or need not handle.
+
+ie.
+KErrCompletion - Client has now acknowledged notification - not an error.
+KErrCancel - Server cancelled request - client can do nothing.
+KErrNotSupported - Deferral not possible - client can do nothing.
+KErrNotReady - Deferral too late or too early - client can do nothing.
+
+All other error codes will be returned unhandled to the active scheduler,
+leading to a panic.
+
+If the client does want to handle or inspect these errors e.g. for diagnostic
+purposes, they can override this method. KErrNone should be returned
+for errors that should not be passed to the active scheduler.
+
+@param aError Error code to handle
+*/
+EXPORT_C TInt CDmDomainKeepAlive::HandleDeferralError(TInt aError)
+	{
+	switch (aError)
+		{
+		case KErrCompletion:
+		case KErrCancel:
+		case KErrNotSupported:
+		case KErrNotReady:
+			{
+			// All the above error codes may occur but signal only
+			// that Deferrals should not continue for the current
+			// transition.
+			return KErrNone;
+			}
+		case KErrPermissionDenied:
+		case KErrServerBusy:
+		default:
+			{
+			return aError;
+			}
+		}
+	}
+
+//-- CDmKeepAlive ----------------------------------------------------------------
+
+CDmKeepAlive::CDmKeepAlive(RDmDomain& aDomain, CDmDomainKeepAlive& aOwnerActiveObject)
+	: CActive(CActive::EPriorityHigh), iDomain(aDomain), iOwnerActiveObject(aOwnerActiveObject), iCeaseDeferral(EFalse)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CDmKeepAlive::~CDmKeepAlive()
+	{
+	Cancel();
+	}
+
+void CDmKeepAlive::DeferNotification()
+	{
+	__DM_ASSERT(!IsActive());
+	iStatus = KRequestPending;
+	iDomain.DeferAcknowledgement(iStatus);
+	SetActive();
+	}
+
+/**
+Informs the object that the state transition has
+been _successfully_ acknowledged
+*/
+void CDmKeepAlive::NotifyOfAcknowledgment()
+	{
+	if (IsActive())
+		{
+		iCeaseDeferral = ETrue;
+		}
+	}
+
+void CDmKeepAlive::RunL()
+	{
+	const TInt error = iStatus.Int();
+
+	TBool ceaseDeferral = iCeaseDeferral;
+	iCeaseDeferral = EFalse;
+
+	User::LeaveIfError(error);
+
+	// If a valid acknowledgment
+	// has occured since the last deferral
+	// then avoid deferring again since
+	// this would only lead to KErrNotReady
+	if(!ceaseDeferral)
+		{
+		DeferNotification();
+		}
+	else
+		{
+		// At this point we know error == KErrNone
+		// However, we return the error code KErrCompletion, as this
+		// is what would have happened, had the acknowledgment come in
+		// a little earlier,
+		// whilst the deferral was still outstanding on the server.
+		User::Leave(KErrCompletion);
+		}
+	}
+
+TInt CDmKeepAlive::RunError(TInt aError)
+	{
+	return iOwnerActiveObject.HandleDeferralError(aError);
+	}
+
+void CDmKeepAlive::DoCancel()
+	{
+	iDomain.CancelDeferral();
+	}
+
 // CDmDomainManager
 
 /**
@@ -930,7 +1235,7 @@
 /**
 Destructor.
 
-Closes the session to the domain manager.
+Closes the session to the Domain Manager.
 */
 EXPORT_C CDmDomainManager::~CDmDomainManager()
 	{
@@ -998,12 +1303,12 @@
 
 
 /**
-Adds a domain hierarchy to the domain manager.
+Adds a domain hierarchy to the Domain Manager.
 
 @param aHierarchyId The Id of the domain hierarchy to add
 
 @return	KErrNone if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+        or Domain Manager specific error codes.
 */
 EXPORT_C TInt CDmDomainManager::AddDomainHierarchy(TDmHierarchyId aHierarchyId)
 	{
@@ -1040,7 +1345,7 @@
 @pre	The session must be connected.
 
 @return KErrNone, if successful; otherwise one of the other system-wide
-        or domain manager specific error codes.
+        or Domain Manager specific error codes.
 */
 EXPORT_C TInt CDmDomainManager::GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures)
 	{
@@ -1054,7 +1359,7 @@
 Gets the number of transition failures since the last transition request.
 
 @return	The number of failures if successful, otherwise one of the other system-wide
-        or domain manager specific error codes.
+        or Domain Manager specific error codes.
 */
 EXPORT_C TInt CDmDomainManager::GetTransitionFailureCount()
 	{
@@ -1081,7 +1386,7 @@
 
 Note that only one observer per domain hierarchy is allowed.
 
-@param	aHierarchyObserver	The implementation of the interface to the domain manager.
+@param	aHierarchyObserver	The implementation of the interface to the Domain Manager.
 @param	aHierarchyId		The Id of the domain hierarchy.
 
 @return The newly created CHierarchyObserver object.
--- a/userlibandfileserver/domainmgr/src/domainpolicy.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/src/domainpolicy.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -15,7 +15,7 @@
 // 
 //
 
-#include "domainpolicy.h"
+#include <domainpolicy.h>
 
 const TInt KDomainTimeout = 1000000; /* 1000ms */
 
@@ -26,7 +26,7 @@
 		{ KDmIdApps,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,								EPwActive,	KDomainTimeout	},
 		{ KDmIdUiApps,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,								EPwActive,	KDomainTimeout	},
 		// end of array marker
-		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,								0,			0	}	
+		TDM_DOMAIN_SPEC_END	
 	};
 
 static const TDmHierarchyPolicy HierarchyPolicyPower	= 
--- a/userlibandfileserver/domainmgr/src/domainsrv.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/domainmgr/src/domainsrv.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -11,8 +11,8 @@
 // Contributors:
 //
 // Description:
-// domain\src\domainsrv.cpp
-// 
+// domainmgr/src/domainsrv.cpp
+//
 //
 
 #include <e32debug.h>
@@ -23,20 +23,18 @@
 
 #include <domainpolicy.h>
 #include "domainsrv.h"
+#include "domaincfg.h"
 
 #define __DS_PANIC(aError) User::Panic(_L("domainSrv.cpp"), (-(aError)) | (__LINE__ << 16))
+#define __DS_PANIC_IFERR(aError) ((aError == KErrNone) || (User::Panic(_L("domainSrv.cpp"), (-(aError)) | (__LINE__ << 16)), 1))
+#define __DS_PANIC_IFNUL(aPtr) ((aPtr != NULL) || (User::Panic(_L("domainSrv.cpp"), (-(KErrNoMemory)) | (__LINE__ << 16)), 1))
 #define __DS_ASSERT(aCond) ((aCond) || (User::Panic(_L("domainSrv.cpp; assertion failed"), __LINE__), 1))
-
-//#define __DS_DEBUG
-
-#ifdef __DS_DEBUG
-#define __DS_TRACE(s) RDebug::Print s
-#else
-#define __DS_TRACE(s)
-#endif
+#define __DS_ASSERT_STARTUP(aCond) ((aCond) || (User::Panic(_L("Domain Server start-up error, server exiting"), __LINE__), 1))
 
 static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-static _LIT_SECURITY_POLICY_C1(KPowerMgmtPolicy,ECapabilityPowerMgmt);
+static _LIT_SECURITY_POLICY_C1(KPowerMgmtPolicy, ECapabilityPowerMgmt);
+static _LIT_SECURITY_POLICY_C1(KWddPolicy, ECapabilityWriteDeviceData);
+static _LIT_SECURITY_POLICY_C1(KProtServPolicy, ECapabilityProtServ);
 
 // forward refs
 class CSvrDomain;
@@ -50,12 +48,22 @@
 class CDmManagerSession;
 
 
+#if defined(_DEBUG) || defined(__DS_DEBUG)
+void GetClientNameFromMessageL(const RMessagePtr2& aMessage, TDes& aBuffer)
+	{
+	RThread clientThread;
+	aMessage.ClientL(clientThread);
+	aBuffer = clientThread.FullName();
+	clientThread.Close();
+	}
+#endif
 
 // CSvrDomain
 class CSvrDomain : public CTimer
 	{
 public: 
 	static CSvrDomain* New(CDmHierarchy& aHierarchy, const TDmDomainSpec&);
+	~CSvrDomain();
 
 	// from CTimer
 	void RunL();
@@ -81,6 +89,9 @@
 	void ChildrenTransitionDone();
 	void CompleteDomainTransition();
 
+	void SetMemberDeferralBudgets();
+	TBool ExpireMemberDeferrals();
+
 private:
 	CDmHierarchy&		iHierarchy;
 	CSvrDomain*			iParent;
@@ -90,7 +101,13 @@
 	CDmDomainSession*	iSessions;
 	TUint16				iChildrenCount;
 	TUint16				iTransCount;
-	TTimeIntervalMicroSeconds32	iTransTimeBudget;
+
+	TOverrideableSetting<TTimeIntervalMicroSeconds32, &CHierarchySettings::GetDomainTimeout>
+		iTransTimeBudget;
+
+
+	TOverrideableSetting<TInt, &CHierarchySettings::GetDeferralBudget>
+		iTransitionDeferralBudget;
 
 public:
 	const TSecurityPolicy	iJoinPolicy;
@@ -103,6 +120,8 @@
 class CDmHierarchy : public CBase
 	{
 public:
+	~CDmHierarchy();
+
 	static CDmHierarchy* New(TDmHierarchyId aHierarchyId, TDmHierarchyPolicy& aPolicy);
 
 	CSvrDomain* LookupDomain(TDmDomainId aDomainId);
@@ -116,17 +135,32 @@
 	virtual TInt RequestSystemTransition(TDmDomainState aTargetState, TDmTraverseDirection aTraverseDirection, const RMessage2* aMessage);
 	virtual void CompleteTransition(TInt aError);
 	virtual void NotifyCompletion(TInt aReason);
-	
+
+	CHierarchySettings& HierachySettings()
+		{
+		return *iSettings;
+		}
+
 protected:
 	CDmHierarchy(TDmHierarchyId aHierarchyId, TDmHierarchyPolicy& aPolicy);
 	void SetState(TDmDomainState aTargetState, TDmTraverseDirection aTraverseDirection = ETraverseDefault);
 
 private:
-	RMessagePtr2	iTransMessagePtr;
-	RMessagePtr2	iObsvrMessagePtr;
 	CSvrDomain*		iObservedDomain;
-	TBool			iOutstandingNotification;
+
+	CHierarchySettings* iSettings;
+
+	/** Direction of traversal if target state is after current state */
+	TDmTraverseDirection iPositiveTransitions;
+
+	/**	Direction of traversal if target state is before current state */
+	TDmTraverseDirection iNegativeTransitions;
+
 public:
+	/** Policy which outlines the action upon transition failure */
+	TOverrideableSetting<TDmTransitionFailurePolicy, &CHierarchySettings::GetFailurePolicy>
+		iFailurePolicy;
+
 	TDmHierarchyId	iHierarchyId;
 	CSvrDomain*		iRootDomain;
 	CSvrDomain*		iTransDomain;
@@ -135,9 +169,10 @@
 	TDmTraverseDirection	iTraverseDirection;
 	TUint8			iTransId;
 	CDmManagerSession* iControllerSession;	// only one controller per hierarchy
-	TDmHierarchyPolicy iPolicy;
+
+
 	RArray<TTransitionFailure> iTransitionFailures;
-	
+
 	// observer stuff
 	TBool			iObserverStarted;
 	TDmNotifyType	iNotifyType;
@@ -206,7 +241,7 @@
 public:
 	static CDmSvrManager* New();
 
-	TInt BuildDomainTree(TDmHierarchyId aHierarchyId, CDmHierarchy*& aHierarchy);
+	TInt BuildDomainTree(TDmHierarchyId aHierarchyId);
 	CDmHierarchy* LookupHierarchy(TDmHierarchyId aHierarchyId);
 	TInt LookupDomain(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId, CSvrDomain*& aDomain);
 
@@ -214,6 +249,8 @@
 	CDmSvrManager();
 	void Construct();
 
+	TInt LoadStateSpecs(RLibrary& aLib, CDmHierarchy* aHierarchy);
+
 private:
 	RPointerArray<CDmHierarchy> iDomainHierarchies;
 	};
@@ -223,10 +260,11 @@
 	{
 public: 
 	// from CServer2
-	CSession2* NewSessionL(const TVersion& aVer) const;
 	CSession2* NewSessionL(const TVersion& aVer, const RMessage2& aMessage) const;
 
-	CDmDomainServer(CDmSvrManager* aManager) : CServer2(CActive::EPriorityStandard), iManager(aManager)
+	// Note, tracing of client thread names relies upon
+	// EUnsharableSessions being used
+	CDmDomainServer(CDmSvrManager* aManager) : CServer2(CActive::EPriorityStandard, EUnsharableSessions), iManager(aManager)
 		{}
 
 public:
@@ -238,28 +276,45 @@
 	{
 public: 
 	// from CBase
+	CDmDomainSession();
 	~CDmDomainSession();
 
 	// from CSession2
 	void ServiceL(const RMessage2& aMessage);
 
+	// Called by CSvrDomain
+	void SetDeferralBudget(TInt);
+	TBool DeferralActive() const;
+	void ExpireDeferral();
+	void CancelDeferral();
+
 private:
+	// Handle client calls
+	void DeferAcknowledgment(const RMessage2&);
+	void CompleteDeferral(TInt);
+	void ObsoleteDeferral();
+
 	CSvrDomain*			iDomain;
+	TInt				iDeferralsRemaining;
+	RMessagePtr2		iDeferralMsg;
+
 
 public:
 	CDmDomainSession*	iNext;
-	TUint8				iPending;
+	TUint8				iAcknPending; ///< Indicates if an acknowledgment is pending
 	TBool				iNotificationEnabled;
+
 	};
 
 class CDmManagerServer : public CServer2
 	{
 public: 
 	// from CServer2
-	CSession2* NewSessionL(const TVersion& aVer) const;
 	CSession2* NewSessionL(const TVersion& aVer, const RMessage2&) const;
 
-	CDmManagerServer(CDmSvrManager* aManager) : CServer2(CActive::EPriorityStandard), iManager(aManager)
+	// Note, tracing of client thread names relies upon
+	// EUnsharableSessions being used
+	CDmManagerServer(CDmSvrManager* aManager) : CServer2(CActive::EPriorityStandard, EUnsharableSessions), iManager(aManager)
 		{}
 	CDmSvrManager*	iManager;
 	};
@@ -268,12 +323,15 @@
 	{
 public: 
 	// from CBase
+	CDmManagerSession();
 	~CDmManagerSession();
 	
 	// from CSession2
 	void ServiceL(const RMessage2& aMessage);
 
-	CDmManagerSession();
+	RMessagePtr2	iTransMessagePtr;
+	RMessagePtr2	iObsvrMessagePtr;
+
 private:
 	CDmHierarchy* iHierarchy;	// not owned
 	};
@@ -323,22 +381,46 @@
 CSvrDomain::CSvrDomain(CDmHierarchy& aHierarchy, const TDmDomainSpec* spec)
 	:	CTimer(CActive::EPriorityStandard), 
 		iHierarchy(aHierarchy),
-		iTransTimeBudget(spec->iTimeBudgetUs),
+		iParent(NULL),
+		iPeer(NULL),
+		iChild(NULL),
+		iChildrenCount(0),
+		iTransTimeBudget(TTimeIntervalMicroSeconds32(spec->iTimeBudgetUs), &iHierarchy.HierachySettings()),
+		iTransitionDeferralBudget(0, &iHierarchy.HierachySettings()),
 		iJoinPolicy(spec->iJoinPolicy),
 		iId(spec->iId)
-	{}
+	{
+	__DS_TRACE((_L("DM: CSvrDomain() @0x%08x, id 0x%x, hierachy id %d"), this, iId, iHierarchy.iHierarchyId));
+	}
 
 CSvrDomain* CSvrDomain::New(CDmHierarchy& aHierarchy, const TDmDomainSpec& aSpec)
 	{
-
 	CSvrDomain* self = new CSvrDomain(aHierarchy, &aSpec);
+	__DS_PANIC_IFNUL(self);
 
-	if (!self)
-		__DS_PANIC(KErrNoMemory);
 	self->Construct(&aSpec);
 	return self;
 	}
 
+CSvrDomain::~CSvrDomain()
+	{
+	__DS_TRACE((_L("DM: ~CSvrDomain() @0x%08x"), this));
+
+	// delete children
+	CSvrDomain* child = iChild;
+	while(child)
+		{
+		CSvrDomain* nextChild = child->iPeer;
+		delete child;
+		child = nextChild;
+		iChildrenCount--;
+		}
+	__DS_ASSERT(iChildrenCount==0);
+
+	TInt r = iProperty.Delete(DmStatePropertyKey(iHierarchy.iHierarchyId, iId));
+	__DS_PANIC_IFERR(r);
+	}
+
 void CSvrDomain::Construct(const TDmDomainSpec* spec)
 	{
 	TInt r = iProperty.Define(
@@ -347,23 +429,20 @@
 		RProperty::EInt,
 		KAllowAllPolicy,KPowerMgmtPolicy);
 
-	if (r != KErrNone)
-		__DS_PANIC(r);
+	__DS_PANIC_IFERR(r);
 	
 	r = iProperty.Attach(KUidDmPropertyCategory, DmStatePropertyKey(
 		iHierarchy.iHierarchyId, 
 		iId));
 
-	if (r != KErrNone)
-		__DS_PANIC(r);
+	__DS_PANIC_IFERR(r);
 
 	r = iProperty.Set(DmStatePropertyValue(0, spec->iInitState));
-	if (r != KErrNone)
-		__DS_PANIC(r);
+	__DS_PANIC_IFERR(r);
 
 	TRAP(r, CTimer::ConstructL());
-	if (r != KErrNone)
-		__DS_PANIC(r);
+	__DS_PANIC_IFERR(r);
+
 	CActiveScheduler::Add(this);
 	}
 
@@ -416,14 +495,16 @@
 
 void CSvrDomain::RequestMembersTransition()
 	{
-	__DS_TRACE((_L("CSvrDomain::RequestMembersTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+	__DS_TRACE((_L("DM: CSvrDomain::RequestMembersTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
 	__DS_ASSERT(iTransCount == 0);
-	
+
+	SetMemberDeferralBudgets();
+
 	for(CDmDomainSession* s = iSessions; s; s = s->iNext)
 		if (s->iNotificationEnabled)
 			{
 			++iTransCount;
-			s->iPending = ETrue;
+			s->iAcknPending = ETrue;
 			// notifications will be disabled until the client makes another 
 			// call to RDmDomain::RequestTransitionNotification()
 			s->iNotificationEnabled = EFalse;
@@ -440,7 +521,7 @@
 			}
 		}
 	if (iTransCount > 0)
-		CTimer::After(iTransTimeBudget);
+		CTimer::After(iTransTimeBudget());
 	iProperty.Set(iHierarchy.iTransPropValue);
 	if (iTransCount == 0)
 		MembersTransitionDone();
@@ -449,7 +530,7 @@
 
 void CSvrDomain::RequestChildrenTransition()
 	{
-	__DS_TRACE((_L("CSvrDomain::RequestChildrenTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+	__DS_TRACE((_L("DM: CSvrDomain::RequestChildrenTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
 	__DS_ASSERT(iTransCount == 0);
 	iTransCount = iChildrenCount;
 	if (iTransCount)
@@ -468,7 +549,7 @@
 
 void CSvrDomain::RequestDomainTransition()
 	{
-	__DS_TRACE((_L("CSvrDomain::RequestDomainTransition() hierarchy=%d, domain=0x%x state=0x%x prop=0x%x"), 
+	__DS_TRACE((_L("DM: CSvrDomain::RequestDomainTransition() hierarchy=%d, domain=0x%x state=0x%x prop=0x%x"), 
 						iHierarchy.iHierarchyId, iId, iHierarchy.iTransState, iHierarchy.iTransPropValue));
 	__DS_ASSERT(iTransCount == 0);
 	if (iHierarchy.iTraverseDirection == ETraverseChildrenFirst)
@@ -479,7 +560,7 @@
 		
 void CSvrDomain::MembersTransitionDone()
 	{
-	__DS_TRACE((_L("CSvrDomain::MembersTransitionDone() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+	__DS_TRACE((_L("DM: CSvrDomain::MembersTransitionDone() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
 	__DS_ASSERT(iTransCount == 0);
 	if (iHierarchy.iTraverseDirection == ETraverseChildrenFirst)
 		CompleteDomainTransition();
@@ -489,7 +570,7 @@
 
 void CSvrDomain::ChildrenTransitionDone()
 	{
-	__DS_TRACE((_L("CSvrDomain::ChildrenTransitionDone() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+	__DS_TRACE((_L("DM: CSvrDomain::ChildrenTransitionDone() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
 	__DS_ASSERT(iTransCount == 0);
 	if (iHierarchy.iTraverseDirection == ETraverseChildrenFirst)
 		RequestMembersTransition();
@@ -499,7 +580,7 @@
 
 void CSvrDomain::CompleteMemberTransition(TInt aError)
 	{
-	__DS_TRACE((_L("CSvrDomain::CompleteMemberTransition() hierarchy=%d, domain=0x%x, aError = %d"), iHierarchy.iHierarchyId, iId, aError));
+	__DS_TRACE((_L("DM: CSvrDomain::CompleteMemberTransition() hierarchy=%d, domain=0x%x, aError = %d"), iHierarchy.iHierarchyId, iId, aError));
 	__DS_ASSERT(iTransCount);
 
 	if (aError)
@@ -519,7 +600,7 @@
 				}
 			}
 		// examine the failure policy to work out what to do
-		if (iHierarchy.iPolicy.iFailurePolicy == ETransitionFailureStop)
+		if (iHierarchy.iFailurePolicy() == ETransitionFailureStop)
 			{
 			iHierarchy.CompleteTransition(aError);
 			return;
@@ -545,16 +626,26 @@
 
 void CSvrDomain::RunL()
 	{ // Timer expired 
-	__DS_TRACE((_L("CSvrDomain::RunL() Members transition timeout hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+
+	if (ExpireMemberDeferrals())
+		{
+		__DS_TRACE((_L("DM: CSvrDomain::RunL() Deferring transition timeout hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+		CTimer::After(iTransTimeBudget());
+		return;
+		}
+
+	__DS_TRACE((_L("DM: CSvrDomain::RunL() Members transition timeout hierarchy=%d, domain=0x%x, iTransCount=%d"), iHierarchy.iHierarchyId, iId, iTransCount));
 
 	// Add a transition failure to the array
 	TTransitionFailure failure(iId,KErrTimedOut);
 	iHierarchy.iTransitionFailures.Append(failure);
 
 
-	// examine the failure policy to work out what to do
-	if (iHierarchy.iPolicy.iFailurePolicy == ETransitionFailureStop)
+	// Examine the failure policy to work out what to do
+	if (iHierarchy.iFailurePolicy() == ETransitionFailureStop)
 		{
+		// CompleteTransition will in turn call CancelTransition,
+		// which will reset iTransCount and the iAcknPending flags
 		iHierarchy.CompleteTransition(KErrTimedOut);
 		return;
 		}
@@ -564,7 +655,11 @@
 		CDmDomainSession* session = iSessions;
 		while (session)
 			{
-			session->iPending = EFalse;
+			if (session->iAcknPending)
+				{
+				__DS_TRACE((_L("DM: Member transition timeout domain=0x%x: CDmDomainSession Object 0x%08x"), iId, session));
+				session->iAcknPending = EFalse;
+				}
 			session = session->iNext;
 			}
 		iTransCount = 0;
@@ -575,7 +670,7 @@
 
 void CSvrDomain::CompleteDomainTransition()
 	{
-	__DS_TRACE((_L("CSvrDomain::CompleteDomainTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+	__DS_TRACE((_L("DM: CSvrDomain::CompleteDomainTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
 	__DS_ASSERT(iTransCount == 0);
 	if (iHierarchy.iTransDomain == this)
 		{
@@ -594,7 +689,7 @@
 
 void CSvrDomain::CancelTransition()
 	{
-	__DS_TRACE((_L("CSvrDomain::CancelTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
+	__DS_TRACE((_L("DM: CSvrDomain::CancelTransition() hierarchy=%d, domain=0x%x"), iHierarchy.iHierarchyId, iId));
 	CTimer::Cancel();
 	CSvrDomain* child = iChild;
 	while (child)
@@ -605,7 +700,14 @@
 	CDmDomainSession* session = iSessions;
 	while (session)
 		{
-		session->iPending = EFalse;
+		// At this point the server says that the current transition may no
+		// longer be acknowledged. Therefore, cancel the deferral
+		if (session->DeferralActive())
+			{
+			session->CancelDeferral();
+			}
+
+		session->iAcknPending = EFalse;
 		session = session->iNext;
 		}
 	iTransCount = 0;
@@ -641,6 +743,46 @@
 	return DmStateFromPropertyValue(value);
 	}
 
+/**
+Called before members are notified of a transition.
+*/
+void CSvrDomain::SetMemberDeferralBudgets()
+	{
+	const TInt deferralBudget = iTransitionDeferralBudget();
+	CDmDomainSession* session = iSessions;
+	while (session)
+		{
+		__DS_ASSERT(!session->DeferralActive());
+		__DS_ASSERT(!session->iAcknPending);
+		session->SetDeferralBudget(deferralBudget);
+		session = session->iNext;
+		}
+	}
+
+/**
+Called upon completion of the domain's timeout
+
+@return True if at least one member had an active deferral
+*/
+TBool CSvrDomain::ExpireMemberDeferrals()
+	{
+	TBool deferDomain = EFalse;
+	CDmDomainSession* session = iSessions;
+	while (session)
+		{
+		if (session->DeferralActive())
+			{
+			__DS_ASSERT(session->iAcknPending);
+
+			deferDomain = ETrue;
+			session->ExpireDeferral();
+			}
+		session = session->iNext;
+		}
+
+	return deferDomain;
+	}
+
 //*********************************************************
 // CDmHierarchy
 //*********************************************************
@@ -654,20 +796,39 @@
 	else 
 		self = new CDmHierarchy(aHierarchyId, aPolicy);
 
-	if (!self)
-		__DS_PANIC(KErrNoMemory);
+	__DS_PANIC_IFNUL(self);
+
+	self->iSettings = new CHierarchySettings();
+	__DS_TRACE((_L("DM: CDmHierarchy::New() @0x%08x, CHierarchySettings @0x%08x"), self, self->iSettings));
+
+	__DS_PANIC_IFNUL(self->iSettings);
+
+	self->iFailurePolicy.SetSettings(self->iSettings);
 
 	return self;
 	}
 
 CDmHierarchy::CDmHierarchy(TDmHierarchyId aHierarchyId, TDmHierarchyPolicy& aPolicy) :
-	iOutstandingNotification(EFalse),
-	iHierarchyId(aHierarchyId),
-	iPolicy(aPolicy)
+	iPositiveTransitions(aPolicy.iPositiveTransitions),
+	iNegativeTransitions(aPolicy.iNegativeTransitions),
+	iFailurePolicy(aPolicy.iFailurePolicy, iSettings),
+	iHierarchyId(aHierarchyId)
 	{
+	__DS_TRACE((_L("DM: CDmHierarchy::CDmHierarchy() @0x%08x, hierarchy=%d"), this, iHierarchyId));
+
 	iTransitionFailures.Reset();
 	}
 
+CDmHierarchy::~CDmHierarchy()
+	{
+	__DS_TRACE((_L("DM: CDmHierarchy::~CDmHierarchy() @0x%08x"), this));
+
+	delete iRootDomain;
+	delete iSettings;
+	iTransitionFailures.Close();
+	iTransitions.Close();
+	}
+
 CSvrDomain* CDmHierarchy::LookupDomain(TDmDomainId aDomainId)
 	{
 	return iRootDomain ? iRootDomain->Lookup(aDomainId) : NULL;
@@ -679,7 +840,13 @@
 	iTransitionFailures.Reset();
 
 	if (aMessage)
-		iTransMessagePtr = *aMessage;
+		{
+		__DS_PANIC_IFNUL(iControllerSession);
+		iControllerSession->iTransMessagePtr = *aMessage;
+		}
+
+	iSettings->SetCurrentTargetTransition(iTransState);
+
 	iTransPropValue = DmStatePropertyValue(++iTransId, iTransState);
 
 	iTransDomain->RequestDomainTransition();
@@ -704,22 +871,21 @@
 	{
 	if (aMessage)
 		{
-		iObsvrMessagePtr = *aMessage;
-		iOutstandingNotification=ETrue;
-		}		
+		__DS_PANIC_IFNUL(iObserverSession);
+		iObserverSession->iObsvrMessagePtr = *aMessage;
+		}
 	}
 
 TBool CDmHierarchy::OutstandingNotification()
 	{
-	return iOutstandingNotification;
+	return iObserverSession && !(iObserverSession->iObsvrMessagePtr.IsNull());
 	}
 
 void CDmHierarchy::CompleteNotification(TInt aError)
 	{
-	if(iOutstandingNotification)
+	if (OutstandingNotification())
 		{
-		iObsvrMessagePtr.Complete(aError);
-		iOutstandingNotification=EFalse;
+		iObserverSession->iObsvrMessagePtr.Complete(aError);
 		}
 	}
 
@@ -730,11 +896,17 @@
 	iTransitions.Reset();
 	iObserverStarted=EFalse;
 	}
+
 void CDmHierarchy::NotifyCompletion(TInt aReason)
 	{
 	iTransDomain = NULL;
 	iTransPropValue = 0;
-	iTransMessagePtr.Complete(aReason);
+
+	if(iControllerSession)
+		{
+		__DS_ASSERT(!(iControllerSession->iTransMessagePtr.IsNull()));
+		iControllerSession->iTransMessagePtr.Complete(aReason);
+		}
 	}
 
 TInt CDmHierarchy::RequestSystemTransition(TDmDomainState aTargetState, TDmTraverseDirection aTraverseDirection, const RMessage2* aMessage)
@@ -752,7 +924,7 @@
 	TDmTraverseDirection aTraverseDirection, 
 	const RMessage2* aMessage)
 	{
-	__DS_TRACE((_L("CDmHierarchy::RequestTransition() hierarchy=%d domain=0x%x state=0x%x"), iHierarchyId, aDomainId, aTargetState)); 
+	__DS_TRACE((_L("DM: CDmHierarchy::RequestTransition() hierarchy=%d domain=0x%x state=0x%x"), iHierarchyId, aDomainId, aTargetState)); 
 	iTransDomain = LookupDomain(aDomainId);
 	if (!iTransDomain)
 		return KDmErrBadDomainId;
@@ -766,7 +938,7 @@
 	if (!iTransDomain)
 		return;
 
-	__DS_TRACE((_L("CDmHierarchy::CompleteTransition() hierarchy=%d, domain=0x%x, aError=%d"), iHierarchyId, iTransDomain->iId, aError));
+	__DS_TRACE((_L("DM: CDmHierarchy::CompleteTransition() hierarchy=%d, domain=0x%x, aError=%d"), iHierarchyId, iTransDomain->iId, aError));
 
 	if (iTransDomain)
 		{
@@ -785,9 +957,9 @@
 		TDmDomainState oldState = iTransDomain->State();
 
 		if (aTargetState >= oldState)
-			iTraverseDirection = iPolicy.iPositiveTransitions;
+			iTraverseDirection = iPositiveTransitions;
 		else
-			iTraverseDirection = iPolicy.iNegativeTransitions;
+			iTraverseDirection = iNegativeTransitions;
 		}
 	else
 		iTraverseDirection = aTraverseDirection;
@@ -804,8 +976,8 @@
 CPowerUpHandler* CPowerUpHandler::New(CDmHierarchyPower& aHierarchyPower)
 	{
 	CPowerUpHandler* self = new CPowerUpHandler(aHierarchyPower);
-	if (!self)
-		__DS_PANIC(KErrNoMemory);
+	__DS_PANIC_IFNUL(self);
+
 	self->Construct();
 	return self;
 	}
@@ -858,8 +1030,7 @@
 
 	self = new CDmHierarchyPower(aHierarchyId, aPolicy);
 
-	if (!self)
-		__DS_PANIC(KErrNoMemory);
+	__DS_PANIC_IFNUL(self);
 
 	self->Construct();
 
@@ -875,8 +1046,7 @@
 void CDmHierarchyPower::Construct()
 	{
 	iPowerUpHandler = CPowerUpHandler::New(*this);
-	if (!iPowerUpHandler)
-		__DS_PANIC(KErrNoMemory);
+	__DS_PANIC_IFNUL(iPowerUpHandler);
 	}
 
 void CDmHierarchyPower::NotifyCompletion(TInt aReason)
@@ -887,7 +1057,7 @@
 
 TInt CDmHierarchyPower::RequestSystemTransition(TDmDomainState aTargetState, TDmTraverseDirection aTraverseDirection, const RMessage2* aMessage)
 	{
-	__DS_TRACE((_L("CDmSvrManager::RequestSystemTransition() state = 0x%x"), aTargetState));
+	__DS_TRACE((_L("DM: CDmHierarchyPower::RequestSystemTransition() state = 0x%x"), aTargetState));
 	
 	TInt r = Power::EnableWakeupEvents((TPowerState) aTargetState);
 	if (r != KErrNone)
@@ -905,19 +1075,20 @@
 	if (!iTransDomain)
 		return;
 
-	__DS_TRACE((_L("CDmHierarchyPower::CompleteTransition() domain=0x%x"), iTransDomain->iId));
+	__DS_TRACE((_L("DM: CDmHierarchyPower::CompleteTransition() domain=0x%x error=%d"),
+				iTransDomain->iId, aError));
 
 	if (iTransDomain && aError == KErrCancel)
 		iPowerUpHandler->Cancel();
 
-	if (iTransStatus & EPoweringDown)
+	if ((iTransStatus & EPoweringDown) && (aError != KErrCancel))
 		{
 		RFs fs;
 		TInt r=fs.Connect();
 		__DS_ASSERT(r==KErrNone);	
-		__DS_TRACE((_L("CDmSvrManager::CompleteTransition() Calling FinaliseDrives")));
+		__DS_TRACE((_L("DM: CDmSvrManager::CompleteTransition() Calling FinaliseDrives")));
 		r=fs.FinaliseDrives();
-		__DS_TRACE((_L("CDmSvrManager::CompleteTransition()  Finalise returned %d"),r)); 
+		__DS_TRACE((_L("DM: CDmSvrManager::CompleteTransition()  Finalise returned %d"),r)); 
 		fs.Close();
 
 		Power::PowerDown();
@@ -933,7 +1104,7 @@
 
 void CDmHierarchyPower::PowerUp()
 	{
-	__DS_TRACE((_L("CDmHierarchyPower::RunL() Wakeup Event")));
+	__DS_TRACE((_L("DM: CDmHierarchyPower::RunL() Wakeup Event")));
 	__DS_ASSERT(iTransDomain);
 
 	Power::DisableWakeupEvents();
@@ -952,8 +1123,8 @@
 CDmSvrManager* CDmSvrManager::New()
 	{
 	CDmSvrManager* self = new CDmSvrManager();
-	if (!self)
-		__DS_PANIC(KErrNoMemory);
+	__DS_PANIC_IFNUL(self);
+
 	self->Construct();
 	return self;
 	}
@@ -964,44 +1135,30 @@
 
 void CDmSvrManager::Construct()
 	{
-	// load the power hierarchy-  Other hieratchies need to be loaded 
+	// Load the power hierarchy - other hierarchies need to be loaded
 	// explicitly using RDmDomainManager::AddDomainHierarchy()
-	CDmHierarchy* hierarchy;
-	TInt r = BuildDomainTree(KDmHierarchyIdPower, hierarchy);
-	if (r != KErrNone)
-		__DS_PANIC(r);
-
+	TInt r = BuildDomainTree(KDmHierarchyIdPower);
+	__DS_PANIC_IFERR(r);
 
 	RProperty prop;
 	r = prop.Define(KUidDmPropertyCategory, KDmPropertyKeyInit, RProperty::EInt,
-							KAllowAllPolicy,KPowerMgmtPolicy);
-	if (r != KErrNone)
-		__DS_PANIC(r);
+					KAllowAllPolicy,KPowerMgmtPolicy);
+	__DS_PANIC_IFERR(r);
 
 	prop.Set(KUidDmPropertyCategory, KDmPropertyKeyInit, ETrue);
 	}
 
-TInt CDmSvrManager::BuildDomainTree(TDmHierarchyId aHierarchyId, CDmHierarchy*& aHierarchy)
+TInt CDmSvrManager::BuildDomainTree(TDmHierarchyId aHierarchyId)
 	{
+	// We have already checked that the hierarchy doesn't already exist.
 
-	aHierarchy = NULL;
-
-	// assume we have already checked that the hierarchy doesn't already exist
-
-	// Get the name of the policy Dll
+	// Get the name of the policy DLL.
 	// This will be "domainPolicy.dll" for the power hierarchy
 	// and "domainPolicy<n>.dll" for other hierarchies where <n> is the hierarchy ID.
-	//
-	// If the hierarchy ID is less than KMaxCriticalPolicyDll, load only from ROM
 
 	TFullName dllName;
-
-	// is this policy "critical" i.e non-replaceable ?
-	_LIT(KSysBin,"z:\\sys\\bin\\");	
-	// const TInt KMaxCriticalPolicyDll = 1000;
-	// if (aHierarchyId < KMaxCriticalPolicyDll) // <-- cannot be false while aHierarchyId is a TUint8 (typedef'd to TDmHierarchyId)
+	_LIT(KSysBin,"z:\\sys\\bin\\");
 	dllName.Append(KSysBin);
-
 	dllName.Append(_L("domainPolicy"));
 	if (aHierarchyId != KDmHierarchyIdPower)
 		dllName.AppendNum(aHierarchyId);
@@ -1058,8 +1215,7 @@
 		}
 
 	CDmHierarchy* hierarchy = CDmHierarchy::New(aHierarchyId, hierarchyPolicy);
-	if (hierarchy == NULL)
-		__DS_PANIC(KErrNoMemory);
+	__DS_PANIC_IFNUL(hierarchy);
 
 	while (r == KErrNone && spec->iId != KDmIdNone)
 		{
@@ -1073,11 +1229,13 @@
 
 		domain = CSvrDomain::New(*hierarchy, *spec);
 		__DS_ASSERT(domain);
-	
+
 		if (spec->iParentId == KDmIdNone)
 			{
 			if (hierarchy->iRootDomain)
 				{
+				delete domain;
+				domain = NULL;
 				r = KDmErrBadDomainSpec;
 				break;
 				}
@@ -1088,6 +1246,8 @@
 			CSvrDomain* parent = hierarchy->LookupDomain(spec->iParentId);
 			if (!parent)
 				{
+				delete domain;
+				domain = NULL;
 				r = KDmErrBadDomainSpec;
 				break;
 				}
@@ -1096,15 +1256,28 @@
 		++spec;
 		}
 
+
+
 	if (spec)
 		(*release)(spec);
 
+	// Load state specs
+	if (r == KErrNone)
+		{
+		TInt err = LoadStateSpecs(lib, hierarchy);
+
+		// KErrNotFound indicates that policy does not contain state
+		// specs i.e. it is Version 1
+		if ( (err !=KErrNone) && (err !=KErrNotFound))
+			{
+			r = err;
+			}
+		}
 
 	if (r == KErrNone)
 		{
 		__DS_ASSERT(hierarchy->iRootDomain);
 		iDomainHierarchies.Append(hierarchy);
-		aHierarchy = hierarchy;
 		}
 	else
 		{
@@ -1117,6 +1290,76 @@
 	return r;
 	}
 
+TInt CDmSvrManager::LoadStateSpecs(RLibrary& aLib, CDmHierarchy* aHierarchy)
+	{
+	__DS_TRACE((_L("DM: CDmSvrManager::LoadStateSpecs() on CDmHierarchy @0x%08x"), aHierarchy));
+	TLibraryFunction ordinal4 = aLib.Lookup(EDmPolicyGetStateSpec);
+	DmPolicyGetStateSpec getStateSpec = reinterpret_cast<DmPolicyGetStateSpec>(ordinal4);
+	if (getStateSpec == NULL)
+		return KErrNotFound;
+
+	TLibraryFunction ordinal5 = aLib.Lookup(EDmPolicyReleaseStateSpec);
+	DmPolicyReleaseStateSpec releaseStateSpec = reinterpret_cast<DmPolicyReleaseStateSpec>(ordinal5);
+	if (releaseStateSpec == NULL)
+		return KErrNotFound;
+
+	TAny* spec = NULL;
+	TUint count = 0;
+	TInt version = (*getStateSpec)(spec, count);
+	TInt r = KErrNone;
+
+	switch (version)
+		{
+		case 0:
+			{
+			r = KErrNotFound;
+			break;
+			}
+		case 1:
+			{
+			if (count < 1)
+				{
+				r = KDmErrBadDomainSpec;
+				break;
+				}
+
+			SDmStateSpecV1* specV1 = reinterpret_cast<SDmStateSpecV1*>(spec);
+			for(TUint i = 0; i<count; ++i)
+				{
+				const TTransitionConfig transitionCfg(specV1[i]);
+				r = transitionCfg.CheckValues();
+				if (r != KErrNone)
+					{
+					break;
+					}
+				TRAP(r, aHierarchy->HierachySettings().StoreConfigL(transitionCfg));
+				if (r != KErrNone)
+					{
+					break;
+					}
+				}
+			break;
+			}
+		default:
+			{
+			if (version > 1)
+				{
+				r = KDmErrBadDomainSpec;
+				}
+			else
+				{
+				r = version;
+				}
+			break;
+			}
+		}
+
+	if(spec)
+		(*releaseStateSpec)(spec);
+
+	return r;
+	}
+
 CDmHierarchy* CDmSvrManager::LookupHierarchy(TDmHierarchyId aHierarchyId)
 
 	{
@@ -1150,69 +1393,75 @@
 	
 	return KErrNone;
 	}
-	
+
+
 CSession2* CDmManagerServer::NewSessionL(const TVersion&, const RMessage2& aMessage) const
 	{
-
     // If the client does not have ECapabilityPowerMgmt capability, then it has no
     // right to make this request. Blow it up.
     if (!KPowerMgmtPolicy.CheckPolicy(aMessage))
 		{
-
         User::Leave(KErrPermissionDenied);
-
 		}
 
-	return new CDmManagerSession();
-	}
+	CDmManagerSession* session = new CDmManagerSession();
+#if defined(_DEBUG) || defined(__DS_DEBUG)
+	CleanupStack::PushL(session);
+	TFullName clientName;
+	GetClientNameFromMessageL(aMessage, clientName);
 
-CSession2* CDmManagerServer::NewSessionL(const TVersion&) const
-	{
-	__DS_PANIC(KErrGeneral);
-	return 0;
+	// Sessions on this server may not be shared by clients
+	__DS_TRACE((_L("DM: New CDmManagerSession @0x%08x, client %S"), session, &clientName));
+	CleanupStack::Pop();
+#else
+	(void)aMessage;
+#endif
+	return session;
 	}
 
 CDmManagerSession::CDmManagerSession()
-	{}
+	{
+	__DS_TRACE((_L("DM: CDmManagerSession() @0x%08x"), this));
+	}
 
 CDmManagerSession::~CDmManagerSession()
 	{
-	if (iHierarchy && iHierarchy->iControllerSession == this)
-		iHierarchy->iControllerSession = NULL;
-	if (iHierarchy && iHierarchy->iObserverSession == this)
-		iHierarchy->iObserverSession = NULL;
-	}
+	__DS_TRACE((_L("DM: ~CDmManagerSession() @0x%08x"), this));
 
-class MyMessage : public RMessage2
-	{
-public:
-	TInt* ArgRef(TInt i)
-		{ return &iArgs[i]; }
-	};
+	if (iHierarchy)
+		{
+		if (iHierarchy->iControllerSession == this)
+			{
+			iHierarchy->iControllerSession = NULL;
+			}
+		if (iHierarchy->iObserverSession == this)
+			{
+			iHierarchy->iObserverSession = NULL;
+			}
+		}
+
+	if(!iTransMessagePtr.IsNull())
+		iTransMessagePtr.Complete(KErrCancel);
+
+	if(!iObsvrMessagePtr.IsNull())
+		iObsvrMessagePtr.Complete(KErrCancel);
+	}
 
 void CDmManagerSession::ServiceL(const RMessage2& aMessage)
 	{
 	TInt r;
 	CDmSvrManager* manager = ((CDmManagerServer*) Server()) -> iManager;
 
-	// Check client has ECapabilityPowerMgmt capability
-/*	
-    if (!KPowerMgmtPolicy.CheckPolicy(aMessage))
-		{
-		aMessage.Complete(KErrPermissionDenied);
-		return;
-		}
-*/
 	switch (aMessage.Function())
 		{
 		case EDmHierarchyAdd:
 			{
 			r = KErrNone;
 			TDmHierarchyId hierarchyId = (TDmHierarchyId) aMessage.Int0();
+			__DS_TRACE((_L("DM: CDmManagerSession::ServiceL @0x%08x EDmHierarchyAdd, HierarchyId %d"), this, hierarchyId));
 
-			CDmHierarchy* hierarchy = manager->LookupHierarchy(hierarchyId);
-			if (hierarchy == NULL)
-				r = manager->BuildDomainTree(hierarchyId, hierarchy);
+			if (manager->LookupHierarchy(hierarchyId) == NULL)
+				r = manager->BuildDomainTree(hierarchyId);
 			aMessage.Complete(r);
 			}
 			break;
@@ -1221,6 +1470,7 @@
 			{
 			r = KErrNone;
 			TDmHierarchyId hierarchyId = (TDmHierarchyId) aMessage.Int0();
+			__DS_TRACE((_L("DM: CDmManagerSession::ServiceL @0x%08x EDmHierarchyJoin, HierarchyId %d"), this, hierarchyId));
 
 			iHierarchy = manager->LookupHierarchy(hierarchyId);
 			if (iHierarchy == NULL)
@@ -1240,6 +1490,13 @@
 			break;
 
 		case EDmRequestSystemTransition:
+			{
+			const TDmDomainState targetState = aMessage.Int0();
+			const TDmTraverseDirection direction = (TDmTraverseDirection)aMessage.Int1();
+
+			__DS_TRACE((_L("DM: CDmManagerSession::ServiceL @0x%08x EDmRequestSystemTransition, TargetState %d, Direction %d"),
+				this, targetState, direction));
+
 			if (iHierarchy==NULL)
 				{
 				aMessage.Complete(KErrBadHierarchyId);
@@ -1252,15 +1509,24 @@
 				}
 
 			r = iHierarchy->RequestSystemTransition(
-				(TDmDomainState) aMessage.Int0(),
-				(TDmTraverseDirection) aMessage.Int1(),
+				targetState,
+				direction,
 				&aMessage);
 
 			if (r != KErrNone)
 				aMessage.Complete(r);
 			break;
+			}
 
 		case EDmRequestDomainTransition:
+			{
+			const TDmDomainId domain = (TDmDomainId)aMessage.Int0();
+			const TDmDomainState targetState = aMessage.Int1();
+			const TDmTraverseDirection direction = (TDmTraverseDirection)aMessage.Int2();
+
+			__DS_TRACE((_L("DM: CDmManagerSession::ServiceL @0x%08x EDmRequestDomainTransition, Domain 0x%x, TargetState %d, Direction %d"),
+				this, domain, targetState, direction));
+
 			if (iHierarchy==NULL)
 				{
 				aMessage.Complete(KErrBadHierarchyId);
@@ -1271,15 +1537,17 @@
 				aMessage.Complete(KDmErrBadSequence);
 				break;
 				}
+
 			r = iHierarchy->RequestDomainTransition(
-				(TDmDomainId) aMessage.Int0(), 
-				(TDmDomainState) aMessage.Int1(), 
-				(TDmTraverseDirection) aMessage.Int2(),
+				domain,
+				targetState,
+				direction,
 				&aMessage);
 
 			if (r != KErrNone)
 				aMessage.Complete(r);
 			break;
+			}
 
 		case EDmGetTransitionFailureCount:
 			{
@@ -1327,6 +1595,9 @@
 			break;
 
 		case EDmCancelTransition:
+			{
+			__DS_TRACE((_L("DM: CDmManagerSession::ServiceL @0x%08x EDmCancelTransition"), this));
+
 			if (iHierarchy == NULL)
 				{
 				aMessage.Complete(KErrBadHierarchyId);
@@ -1340,6 +1611,7 @@
 				}
 			aMessage.Complete(KErrNone);
 			break;
+			}
 		case EDmObserverCancel:
 			if (iHierarchy == NULL)
 				{
@@ -1498,24 +1770,38 @@
 		}
 	}
 
-CSession2* CDmDomainServer::NewSessionL(const TVersion&, const RMessage2&) const
+CSession2* CDmDomainServer::NewSessionL(const TVersion&, const RMessage2& aMessage) const
 	{
+	CDmDomainSession* session =  new (ELeave) CDmDomainSession;
+#ifdef __DS_DEBUG
+	CleanupStack::PushL(session);
+	TFullName clientName;
+	GetClientNameFromMessageL(aMessage, clientName);
 
-	return new CDmDomainSession();
+	// Sessions on this server may not be shared by clients
+	__DS_TRACE((_L("DM: New CDmDomainSession @0x%08x, client %S"), session, &clientName));
+	CleanupStack::Pop();
+#else
+	(void)aMessage;
+#endif
+	return session;
 	}
 
-CSession2* CDmDomainServer::NewSessionL(const TVersion&) const
+CDmDomainSession::CDmDomainSession()
+	: iDeferralsRemaining(0)
 	{
-	__DS_PANIC(KErrGeneral);
-	return 0;
+	__DS_TRACE((_L("DM: CDmDomainSession() @0x%08x"), this));
 	}
 
 CDmDomainSession::~CDmDomainSession()
 	{
-	if (iPending)
+	__DS_TRACE((_L("DM: ~CDmDomainSession() @0x%08x"), this));
+	if (iAcknPending)
 		iDomain->CompleteMemberTransition(KErrNone);
 	if (iDomain)
 		iDomain->Detach(this);
+	if (DeferralActive())
+		CancelDeferral();
 	}
 
 void CDmDomainSession::ServiceL(const RMessage2& aMessage)
@@ -1530,6 +1816,8 @@
 		TDmHierarchyId hierarchyId = (TDmHierarchyId) aMessage.Int0();
 		TDmDomainId domainId = (TDmDomainId) aMessage.Int1();
 
+		__DS_TRACE((_L("DM: CDmDomainSession::ServiceL @0x%08x EDmDomainJoin, HierarchyId %d, DomainId 0x%x"), this, hierarchyId, domainId));
+
 		r = manager->LookupDomain(hierarchyId, domainId, iDomain);
 
 		if (r != KErrNone)
@@ -1548,10 +1836,12 @@
 		}
 
 	case EDmStateRequestTransitionNotification:
+		__DS_TRACE((_L("DM: CDmDomainSession::ServiceL @0x%08x EDmStateRequestTransitionNotification"), this));
 		iNotificationEnabled = ETrue;
 		break;
 
 	case EDmStateCancelTransitionNotification:
+		__DS_TRACE((_L("DM: CDmDomainSession::ServiceL @0x%08x EDmStateCancelTransitionNotification"), this));
 		iNotificationEnabled = EFalse;
 		break;
 
@@ -1559,59 +1849,165 @@
 		{
 		TInt propValue = aMessage.Int0();
 		TInt error = aMessage.Int1();
+
+		__DS_TRACE((_L("DM: CDmDomainSession::ServiceL @0x%08x EDmStateAcknowledge, error %d"), this, error));
+
 		if (!iDomain)
 			{
 			r = KDmErrNotJoin;
 			break;
 			}
-		if (iPending && iDomain->CheckPropValue(propValue))
+		if (iAcknPending && iDomain->CheckPropValue(propValue))
 			{
-			iPending = EFalse;
+			if (DeferralActive())
+				ObsoleteDeferral();
+
+			iAcknPending = EFalse;
 			iDomain->CompleteMemberTransition(error);
 			}
+		else
+			{
+			// This error code indicates that there was no pending transition
+			// corresponding to the cookie supplied in propValue.
+			r = KErrNotFound;
+			}
+
+		break;
 		}
+
+	case EDmStateDeferAcknowledgement:
+		{
+		__DS_TRACE((_L("DM: CDmDomainSession::ServiceL @0x%08x EDmStateDeferAcknowledgement"), this));
+
+		// PlatSec check
+		if (!KWddPolicy.CheckPolicy(aMessage,
+									__PLATSEC_DIAGNOSTIC_STRING("KWriteDeviceDataPolicy")) &&
+			!KProtServPolicy.CheckPolicy(aMessage,
+										 __PLATSEC_DIAGNOSTIC_STRING("KProtServPolicy")))
+			{
+			// Try harder...
+			r = KErrPermissionDenied;
+			break;
+			}
+		DeferAcknowledgment(aMessage);
+		return;												// return, not break
+		}
+
+	case EDmStateCancelDeferral:
+		{
+		__DS_TRACE((_L("DM: CDmDomainSession::ServiceL @0x%08x EDmStateCancelDeferral"), this));
+		CancelDeferral();
 		break;
+		}
 	default:
 		r = KDmErrBadRequest;
 		break;
 		}
+
 	aMessage.Complete(r);
 	}
 
-	
+void CDmDomainSession::SetDeferralBudget(TInt aDeferralCount)
+	{
+	__DS_ASSERT(!DeferralActive());
+	iDeferralsRemaining = aDeferralCount;
+	}
+
+TBool CDmDomainSession::DeferralActive() const
+	{
+	return (!iDeferralMsg.IsNull());
+	}
+
+void CDmDomainSession::ExpireDeferral()
+	{
+	__DS_ASSERT(DeferralActive());
+	__DS_ASSERT(iDeferralsRemaining >= 0);
+
+	CompleteDeferral(KErrNone);
+	}
+
+void CDmDomainSession::DeferAcknowledgment(const RMessage2& aMessage)
+	{
+	__DS_ASSERT(aMessage.Function() == EDmStateDeferAcknowledgement);
+	__DS_ASSERT(!DeferralActive());
+
+	TInt r = KErrNone;
+
+	if (!iAcknPending)
+		{
+		r = KErrNotReady;
+		}
+	else if (iDeferralsRemaining == 0)
+		{
+		r = KErrNotSupported;
+		}
+
+	if(KErrNone != r)
+		{
+		aMessage.Complete(r);
+		return;
+		}
+
+	--iDeferralsRemaining;
+	iDeferralMsg = aMessage;
+	}
+
+void CDmDomainSession::CancelDeferral()
+	{
+	if (DeferralActive())
+		{
+		CompleteDeferral(KErrCancel);
+		}
+	}
+
+void CDmDomainSession::ObsoleteDeferral()
+	{
+	__DS_ASSERT(DeferralActive());
+
+	CompleteDeferral(KErrCompletion);
+	}
+
+void CDmDomainSession::CompleteDeferral(TInt aError)
+	{
+	__DS_TRACE((_L("DM: CDmDomainSession::CompleteDeferral() @0x%08x, aError %d"), this, aError));
+	__DS_ASSERT(DeferralActive());
+
+	iDeferralMsg.Complete(aError);
+	}
+
+
 TInt E32Main()
 	{
+	// Make DM a system critical server
+	User::SetProcessCritical(User::ESystemCritical);
+	User::SetCritical(User::ESystemCritical);
+
 	CTrapCleanup* cleanupStack = CTrapCleanup::New();
-	if(!cleanupStack)
-		__DS_PANIC(KErrNoMemory);
+	__DS_ASSERT_STARTUP(cleanupStack);
 
 	CActiveScheduler* sched = new CActiveScheduler();
-	if (!sched)
-		__DS_PANIC(KErrNoMemory);
+	__DS_ASSERT_STARTUP(sched);
 
 	CActiveScheduler::Install(sched);
 
 	CDmSvrManager* mngr = CDmSvrManager::New();
-	__DS_ASSERT(mngr);
+	__DS_ASSERT_STARTUP(mngr);
 
 	CDmManagerServer* msrv = new CDmManagerServer(mngr);
-	if (!msrv)
-		__DS_PANIC(KErrNoMemory);
+	__DS_ASSERT_STARTUP(msrv);
 
 	TInt r=msrv->Start(KDmManagerServerNameLit);
-	if (r != KErrNone)
-		__DS_PANIC(r);
+	__DS_ASSERT_STARTUP(r == KErrNone);
 
 	CDmDomainServer* dsrv = new CDmDomainServer(mngr);
-	if (!dsrv)
-		__DS_PANIC(KErrNoMemory);
+	__DS_ASSERT_STARTUP(dsrv);
 
 	r=dsrv->Start(KDmDomainServerNameLit);
-	if (r != KErrNone)
-		__DS_PANIC(r);
+	__DS_ASSERT_STARTUP(r == KErrNone);
 
 	CActiveScheduler::Start();
 
+	// Server should never shutdown, hence panic to highlight such an event
 	__DS_PANIC(0);
 
 	return KErrNone;
--- a/userlibandfileserver/domainmgr/src/domainsrv.h	Tue Sep 28 15:28:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// domain\src\domainsrv.h
-// 
-//
-
-#ifndef __DOMAIN_SRV_H__
-#define __DOMAIN_SRV_H__
-
-#include <e32def.h>
-
-#include <domaindefs.h>
-
-_LIT(KDmDomainServerNameLit,"!DmDomainServer");
-#define KDmDomainServerVersion	TVersion(1, 0, 0)
-_LIT(KDmManagerServerNameLit,"!DmManagerServer");
-#define KDmManagerServerVersion	TVersion(1, 0, 0)
-
-enum 
-	{
-	EDmDomainJoin,
-	EDmStateAcknowledge,
-	EDmStateRequestTransitionNotification,
-	EDmStateCancelTransitionNotification
-	};
-
-enum 
-	{
-	EDmRequestSystemTransition,
-	EDmRequestDomainTransition,
-	EDmCancelTransition,
-	EDmHierarchyJoin,
-	EDmHierarchyAdd,
-	EDmGetTransitionFailureCount,
-	EDmGetTransitionFailures,
-	EDmObserverJoin,
-	EDmObserverStart,
-	EDmObserverStop,
-	EDmObserverNotify,
-	EDmObserverEventCount,
-	EDmObserverGetEvent,
-	EDmObserverCancel,
-	EDmObserveredCount
-	};
-
-inline TInt DmStatePropertyKey(TDmHierarchyId aHierarchyId, TDmDomainId aDomainId)
-	{ return (TInt) ((aHierarchyId << 8) | ((aDomainId << 8) & 0xff0000) | (aDomainId & 0xff) ); }
-
-inline TInt DmStatePropertyValue(TUint aId, TUint32 aState)
-	{ return (TInt) ((aId << 24) | (aState & 0xffffff)); }
-
-inline TDmDomainState DmStateFromPropertyValue(TInt aValue)
-	{ return (TDmDomainState) (aValue & 0xffffff); }
-
-#endif
--- a/userlibandfileserver/fileserver/bmarm/efsrvu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/bmarm/efsrvu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -13,7 +13,7 @@
 	CharToDrive__3RFsG5TCharRi @ 12 NONAME ; RFs::CharToDrive(TChar, int &)
 	CheckDisk__C3RFsRC7TDesC16 @ 13 NONAME ; RFs::CheckDisk(TDesC16 const &) const
 	ClearPassword__3RFsiRCt5TBuf81i16 @ 14 NONAME ; RFs::ClearPassword(int, TBuf8<16> const &)
-	Duplicate__5RFileRC5RFile10TOwnerType @ 15 NONAME R3UNUSED ; RFile::Duplicate(RFile const &, TOwnerType)	
+	Duplicate__5RFileRC5RFile10TOwnerType @ 15 NONAME R3UNUSED ; RFile::Duplicate(RFile const &, TOwnerType)    
 	Close__8RRawDisk @ 16 NONAME ; RRawDisk::Close(void)
 	Compress__4CDir @ 17 NONAME ; CDir::Compress(void)
 	Connect__3RFsi @ 18 NONAME ; RFs::Connect(int)
@@ -369,10 +369,10 @@
 	RequestNotifications__9CFsNotifyR14TRequestStatus @ 368 NONAME R3UNUSED ; CFsNotify::RequestNotifications(TRequestStatus &)
 	"_._9CFsNotify" @ 369 NONAME R3UNUSED ; CFsNotify::~CFsNotify(void)
 	SupportedFileSystemName__C3RFsR6TDes16ii @ 370 NONAME ; RFs::SupportedFileSystemName(TDes16 &, int, int) const
-	Close__14CFsMountHelper @ 371 NONAME R3UNUSED ; CFsMountHelper::Close(void)
-	DismountFileSystem__C14CFsMountHelper @ 372 NONAME R3UNUSED ; CFsMountHelper::DismountFileSystem(void) const
-	DismountFileSystem__C14CFsMountHelperR14TRequestStatusQ214CFsMountHelper15TFsDismountMode @ 373 NONAME R3UNUSED ; CFsMountHelper::DismountFileSystem(TRequestStatus &, CFsMountHelper::TFsDismountMode) const
-	GetMountProperties__14CFsMountHelper @ 374 NONAME R3UNUSED ; CFsMountHelper::GetMountProperties(void)
-	MountFileSystem__C14CFsMountHelper @ 375 NONAME R3UNUSED ; CFsMountHelper::MountFileSystem(void) const
-	New__14CFsMountHelperR3RFsi @ 376 NONAME R3UNUSED ; CFsMountHelper::New(RFs &, int)
+	DismountFileSystem__C14CFsMountHelper @ 371 NONAME R3UNUSED ; CFsMountHelper::DismountFileSystem(void) const
+	DismountFileSystem__C14CFsMountHelperR14TRequestStatusQ214CFsMountHelper15TFsDismountMode @ 372 NONAME R3UNUSED ; CFsMountHelper::DismountFileSystem(TRequestStatus &, CFsMountHelper::TFsDismountMode) const
+	GetMountProperties__14CFsMountHelper @ 373 NONAME R3UNUSED ; CFsMountHelper::GetMountProperties(void)
+	MountFileSystem__C14CFsMountHelper @ 374 NONAME R3UNUSED ; CFsMountHelper::MountFileSystem(void) const
+	New__14CFsMountHelperR3RFsi @ 375 NONAME R3UNUSED ; CFsMountHelper::New(RFs &, int)
+	"_._14CFsMountHelper" @ 376 NONAME R3UNUSED ; CFsMountHelper::~CFsMountHelper(void)
 
--- a/userlibandfileserver/fileserver/bwins/efsrvu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/bwins/efsrvu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -369,7 +369,7 @@
 	?RemoveNotifications@CFsNotify@@QAEHXZ @ 368 NONAME ; public: int __thiscall CFsNotify::RemoveNotifications(void)
 	?RequestNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 369 NONAME ; public: int __thiscall CFsNotify::RequestNotifications(class TRequestStatus &)
 	?SupportedFileSystemName@RFs@@QBEHAAVTDes16@@HH@Z @ 370 NONAME ; public: int __thiscall RFs::SupportedFileSystemName(class TDes16 &,int,int)const 
-	?Close@CFsMountHelper@@QAEXXZ @ 371 NONAME ; public: void __thiscall CFsMountHelper::Close(void)
+	??1CFsMountHelper@@UAE@XZ @ 371 NONAME ; public: virtual __thiscall CFsMountHelper::~CFsMountHelper(void)
 	?DismountFileSystem@CFsMountHelper@@QBEHXZ @ 372 NONAME ; public: int __thiscall CFsMountHelper::DismountFileSystem(void)const 
 	?DismountFileSystem@CFsMountHelper@@QBEXAAVTRequestStatus@@W4TFsDismountMode@1@@Z @ 373 NONAME ; public: void __thiscall CFsMountHelper::DismountFileSystem(class TRequestStatus &,enum CFsMountHelper::TFsDismountMode)const 
 	?GetMountProperties@CFsMountHelper@@QAEHXZ @ 374 NONAME ; public: int __thiscall CFsMountHelper::GetMountProperties(void)
--- a/userlibandfileserver/fileserver/bx86/efsrvu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/bx86/efsrvu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -1,375 +1,375 @@
 EXPORTS
-	??0CDir@@IAE@XZ @ 1 NONAME ; protected: __thiscall CDir::CDir(void)
-	??0CFileBase@@IAE@AAVRFs@@@Z @ 2 NONAME ; protected: __thiscall CFileBase::CFileBase(class RFs &)
-	??0TDriveUnit@@QAE@ABVTDesC16@@@Z @ 3 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(class TDesC16 const &)
-	??0TDriveUnit@@QAE@H@Z @ 4 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(int)
-	??0TEntryArray@@QAE@XZ @ 5 NONAME ; public: __thiscall TEntryArray::TEntryArray(void)
-	??0TFileText@@QAE@XZ @ 6 NONAME ; public: __thiscall TFileText::TFileText(void)
-	??0TFindFile@@QAE@AAVRFs@@@Z @ 7 NONAME ; public: __thiscall TFindFile::TFindFile(class RFs &)
-	??0TOpenFileScan@@QAE@AAVRFs@@@Z @ 8 NONAME ; public: __thiscall TOpenFileScan::TOpenFileScan(class RFs &)
-	??0TParseBase@@QAE@XZ @ 9 NONAME ; public: __thiscall TParseBase::TParseBase(void)
-	??0TParsePtr@@QAE@AAVTDes16@@@Z @ 10 NONAME ; public: __thiscall TParsePtr::TParsePtr(class TDes16 &)
-	??0TParsePtrC@@QAE@ABVTDesC16@@@Z @ 11 NONAME ; public: __thiscall TParsePtrC::TParsePtrC(class TDesC16 const &)
-	??0TVolumeInfo@@QAE@XZ @ 12 NONAME ; public: __thiscall TVolumeInfo::TVolumeInfo(void)
-	??1CDir@@UAE@XZ @ 13 NONAME ; public: virtual __thiscall CDir::~CDir(void)
-	??1CDirScan@@UAE@XZ @ 14 NONAME ; public: virtual __thiscall CDirScan::~CDirScan(void)
-	??1CFileBase@@MAE@XZ @ 15 NONAME ; protected: virtual __thiscall CFileBase::~CFileBase(void)
-	??4TDriveUnit@@QAEAAV0@ABVTDesC16@@@Z @ 16 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(class TDesC16 const &)
-	??4TDriveUnit@@QAEAAV0@H@Z @ 17 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(int)
-	??ACDir@@QBEABVTEntry@@H@Z @ 18 NONAME ; public: class TEntry const & __thiscall CDir::operator[](int)const 
-	??ATEntryArray@@QBEABVTEntry@@H@Z @ 19 NONAME ; public: class TEntry const & __thiscall TEntryArray::operator[](int)const 
-	?AbbreviatedPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 20 NONAME ; public: class TPtrC16  __thiscall CDirScan::AbbreviatedPath(void)
-	?AbbreviatedPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 21 NONAME ; public: class TPtrC16  __thiscall CFileBase::AbbreviatedPath(void)
-	?AddDir@TParseBase@@QAEHABVTDesC16@@@Z @ 22 NONAME ; public: int __thiscall TParseBase::AddDir(class TDesC16 const &)
-	?AddFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 23 NONAME ; public: int __thiscall RFs::AddFileSystem(class TDesC16 const &)const 
-	?AddL@CDir@@IAEXABVTEntry@@@Z @ 24 NONAME ; protected: void __thiscall CDir::AddL(class TEntry const &)
-	?Att@RFile@@QBEHAAI@Z @ 25 NONAME ; public: int __thiscall RFile::Att(unsigned int &)const 
-	?Att@RFs@@QBEHABVTDesC16@@AAI@Z @ 26 NONAME ; public: int __thiscall RFs::Att(class TDesC16 const &,unsigned int &)const 
-	?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@I@Z @ 27 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int)
-	?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@IAAVTRequestStatus@@@Z @ 28 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int,class TRequestStatus &)
-	?BytesTransferredByCopyStep@CFileMan@@QAEHXZ @ 29 NONAME ; public: int __thiscall CFileMan::BytesTransferredByCopyStep(void)
-	?ChangeMode@RFile@@QAEHW4TFileMode@@@Z @ 30 NONAME ; public: int __thiscall RFile::ChangeMode(enum TFileMode)
-	?CharToDrive@RFs@@SAHVTChar@@AAH@Z @ 31 NONAME ; public: static int __cdecl RFs::CharToDrive(class TChar,int &)
-	?CheckDisk@RFs@@QBEHABVTDesC16@@@Z @ 32 NONAME ; public: int __thiscall RFs::CheckDisk(class TDesC16 const &)const 
-	?ClearPassword@RFs@@QAEHHABV?$TBuf8@$0BA@@@@Z @ 33 NONAME ; public: int __thiscall RFs::ClearPassword(int,class TBuf8<16> const &)
-	?Duplicate@RFile@@QAEHABV1@W4TOwnerType@@@Z @ 34 NONAME ; public: int __thiscall RFile::Duplicate(class RFile const &,enum TOwnerType)
-	?Close@RRawDisk@@QAEXXZ @ 35 NONAME ; public: void __thiscall RRawDisk::Close(void)
-	?Compress@CDir@@IAEXXZ @ 36 NONAME ; protected: void __thiscall CDir::Compress(void)
-	?Connect@RFs@@QAEHH@Z @ 37 NONAME ; public: int __thiscall RFs::Connect(int)
-	?ConstructL@CFileBase@@IAEXXZ @ 38 NONAME ; protected: void __thiscall CFileBase::ConstructL(void)
-	?ControlIo@RFs@@QAEHHHPAX0@Z @ 39 NONAME ; public: int __thiscall RFs::ControlIo(int,int,void *,void *)
-	?Copy@CFileMan@@QAEHABVTDesC16@@0I@Z @ 40 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int)
-	?Copy@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 41 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-	?Count@CDir@@QBEHXZ @ 42 NONAME ; public: int __thiscall CDir::Count(void)const 
-	?Count@TEntryArray@@QBEHXZ @ 43 NONAME ; public: int __thiscall TEntryArray::Count(void)const 
-	?Create@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 44 NONAME ; public: int __thiscall RFile::Create(class RFs &,class TDesC16 const &,unsigned int)
-	?CurrentAction@CFileMan@@QAE?AW4TAction@1@XZ @ 45 NONAME ; public: enum CFileMan::TAction  __thiscall CFileMan::CurrentAction(void)
-	?CurrentEntry@CFileBase@@QAEABVTEntry@@XZ @ 46 NONAME ; public: class TEntry const & __thiscall CFileBase::CurrentEntry(void)
-	?DefaultPath@RFs@@QBEHAAVTDes16@@@Z @ 47 NONAME ; public: int __thiscall RFs::DefaultPath(class TDes16 &)const 
-	?Delete@CFileMan@@QAEHABVTDesC16@@I@Z @ 48 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int)
-	?Delete@CFileMan@@QAEHABVTDesC16@@IAAVTRequestStatus@@@Z @ 49 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int,class TRequestStatus &)
-	?Delete@RFs@@QAEHABVTDesC16@@@Z @ 50 NONAME ; public: int __thiscall RFs::Delete(class TDesC16 const &)
-	?DismountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 51 NONAME ; public: int __thiscall RFs::DismountFileSystem(class TDesC16 const &,int)const 
-	?Drive@RFs@@QBEHAAVTDriveInfo@@H@Z @ 52 NONAME ; public: int __thiscall RFs::Drive(class TDriveInfo &,int)const 
-	?Drive@TParseBase@@QBE?AVTPtrC16@@XZ @ 53 NONAME ; public: class TPtrC16  __thiscall TParseBase::Drive(void)const 
-	?DriveAndPath@TParseBase@@QBE?AVTPtrC16@@XZ @ 54 NONAME ; public: class TPtrC16  __thiscall TParseBase::DriveAndPath(void)const 
-	?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@@Z @ 55 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &)const 
-	?DrivePresent@TParseBase@@QBEHXZ @ 56 NONAME ; public: int __thiscall TParseBase::DrivePresent(void)const 
-	?DriveToChar@RFs@@SAHHAAVTChar@@@Z @ 57 NONAME ; public: static int __cdecl RFs::DriveToChar(int,class TChar &)
-	?Entry@RFs@@QBEHABVTDesC16@@AAVTEntry@@@Z @ 58 NONAME ; public: int __thiscall RFs::Entry(class TDesC16 const &,class TEntry &)const 
-	?Ext@TParseBase@@QBE?AVTPtrC16@@XZ @ 59 NONAME ; public: class TPtrC16  __thiscall TParseBase::Ext(void)const 
-	?ExtPresent@TParseBase@@QBEHXZ @ 60 NONAME ; public: int __thiscall TParseBase::ExtPresent(void)const 
-	?ExtractL@CDir@@IAEXHAAPAV1@@Z @ 61 NONAME ; protected: void __thiscall CDir::ExtractL(int,class CDir * &)
-	?FileSystemName@RFs@@QBEHAAVTDes16@@H@Z @ 62 NONAME ; public: int __thiscall RFs::FileSystemName(class TDes16 &,int)const 
-	?Find@TFindFile@@QAEHXZ @ 63 NONAME ; public: int __thiscall TFindFile::Find(void)
-	?FindByDir@TFindFile@@QAEHABVTDesC16@@0@Z @ 64 NONAME ; public: int __thiscall TFindFile::FindByDir(class TDesC16 const &,class TDesC16 const &)
-	?FindByPath@TFindFile@@QAEHABVTDesC16@@PBV2@@Z @ 65 NONAME ; public: int __thiscall TFindFile::FindByPath(class TDesC16 const &,class TDesC16 const *)
-	?FindWild@TFindFile@@QAEHAAPAVCDir@@@Z @ 66 NONAME ; public: int __thiscall TFindFile::FindWild(class CDir * &)
-	?FindWildByDir@TFindFile@@QAEHABVTDesC16@@0AAPAVCDir@@@Z @ 67 NONAME ; public: int __thiscall TFindFile::FindWildByDir(class TDesC16 const &,class TDesC16 const &,class CDir * &)
-	?FindWildByPath@TFindFile@@QAEHABVTDesC16@@PBV2@AAPAVCDir@@@Z @ 68 NONAME ; public: int __thiscall TFindFile::FindWildByPath(class TDesC16 const &,class TDesC16 const *,class CDir * &)
-	?Flush@RFile@@QAEHXZ @ 69 NONAME ; public: int __thiscall RFile::Flush(void)
-	?FullName@TParseBase@@QBEABVTDesC16@@XZ @ 70 NONAME ; public: class TDesC16 const & __thiscall TParseBase::FullName(void)const 
-	?FullPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 71 NONAME ; public: class TPtrC16  __thiscall CDirScan::FullPath(void)
-	?FullPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 72 NONAME ; public: class TPtrC16  __thiscall CFileBase::FullPath(void)
-	?GetCurrentSource@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 73 NONAME ; public: void __thiscall CFileMan::GetCurrentSource(class TBuf<256> &)
-	?GetCurrentTarget@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 74 NONAME ; public: void __thiscall CFileMan::GetCurrentTarget(class TBuf<256> &)
-	?GetDir@RFs@@QBEHABVTDesC16@@ABVTUidType@@IAAPAVCDir@@@Z @ 75 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,class TUidType const &,unsigned int,class CDir * &)const 
-	?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@1@Z @ 76 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &,class CDir * &)const 
-	?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@@Z @ 77 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &)const 
-	?GetDriveName@RFs@@QBEHHAAVTDes16@@@Z @ 78 NONAME ; public: int __thiscall RFs::GetDriveName(int,class TDes16 &)const 
-	?GetLastError@CFileBase@@QAEHXZ @ 79 NONAME ; public: int __thiscall CFileBase::GetLastError(void)
-	?GetLongName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 80 NONAME ; public: int __thiscall RFs::GetLongName(class TDesC16 const &,class TDes16 &)const 
-	?GetMoreInfoAboutError@CFileBase@@QAE?AW4TFileManError@@XZ @ 81 NONAME ; public: enum TFileManError  __thiscall CFileBase::GetMoreInfoAboutError(void)
-	?GetNotifyUser@RFs@@QAEHXZ @ 82 NONAME ; public: int __thiscall RFs::GetNotifyUser(void)
-	?GetShortName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 83 NONAME ; public: int __thiscall RFs::GetShortName(class TDesC16 const &,class TDes16 &)const 
-	?IsArchive@TEntry@@QBEHXZ @ 84 NONAME ; public: int __thiscall TEntry::IsArchive(void)const 
-	?IsDir@TEntry@@QBEHXZ @ 85 NONAME ; public: int __thiscall TEntry::IsDir(void)const 
-	?IsExtWild@TParseBase@@QBEHXZ @ 86 NONAME ; public: int __thiscall TParseBase::IsExtWild(void)const 
-	?IsFileInRom@RFs@@QBEPAEABVTDesC16@@@Z @ 87 NONAME ; public: unsigned char * __thiscall RFs::IsFileInRom(class TDesC16 const &)const 
-	?IsFileOpen@RFs@@QBEHABVTDesC16@@AAH@Z @ 88 NONAME ; public: int __thiscall RFs::IsFileOpen(class TDesC16 const &,int &)const 
-	?IsHidden@TEntry@@QBEHXZ @ 89 NONAME ; public: int __thiscall TEntry::IsHidden(void)const 
-	?IsKMatchAny@TParseBase@@QBEHXZ @ 90 NONAME ; public: int __thiscall TParseBase::IsKMatchAny(void)const 
-	?IsKMatchOne@TParseBase@@QBEHXZ @ 91 NONAME ; public: int __thiscall TParseBase::IsKMatchOne(void)const 
-	?IsNameWild@TParseBase@@QBEHXZ @ 92 NONAME ; public: int __thiscall TParseBase::IsNameWild(void)const 
-	?IsReadOnly@TEntry@@QBEHXZ @ 93 NONAME ; public: int __thiscall TEntry::IsReadOnly(void)const 
-	?IsRomAddress@RFs@@SAHPAX@Z @ 94 NONAME ; public: static int __cdecl RFs::IsRomAddress(void *)
-	?IsRoot@TParseBase@@QBEHXZ @ 95 NONAME ; public: int __thiscall TParseBase::IsRoot(void)const 
-	?IsSystem@TEntry@@QBEHXZ @ 96 NONAME ; public: int __thiscall TEntry::IsSystem(void)const 
-	?IsValidDrive@RFs@@SAHH@Z @ 97 NONAME ; public: static int __cdecl RFs::IsValidDrive(int)
-	?IsValidName@RFs@@QBEHABVTDesC16@@@Z @ 98 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &)const 
-	?IsValidName@RFs@@QBEHABVTDesC16@@AAG@Z @ 99 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,unsigned short &)const 
-	?IsWild@TParseBase@@QBEHXZ @ 100 NONAME ; public: int __thiscall TParseBase::IsWild(void)const 
-	?LoaderHeapFunction@RFs@@QAEHHPAX0@Z @ 101 NONAME ; public: int __thiscall RFs::LoaderHeapFunction(int,void *,void *)
-	?Lock@RFile@@QBEHHH@Z @ 102 NONAME ; public: int __thiscall RFile::Lock(int,int)const 
-	?LockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@0H@Z @ 103 NONAME ; public: int __thiscall RFs::LockDrive(int,class TBuf8<16> const &,class TBuf8<16> const &,int)
-	?MkDir@RFs@@QAEHABVTDesC16@@@Z @ 104 NONAME ; public: int __thiscall RFs::MkDir(class TDesC16 const &)
-	?MkDirAll@RFs@@QAEHABVTDesC16@@@Z @ 105 NONAME ; public: int __thiscall RFs::MkDirAll(class TDesC16 const &)
-	?Modified@RFile@@QBEHAAVTTime@@@Z @ 106 NONAME ; public: int __thiscall RFile::Modified(class TTime &)const 
-	?Modified@RFs@@QBEHABVTDesC16@@AAVTTime@@@Z @ 107 NONAME ; public: int __thiscall RFs::Modified(class TDesC16 const &,class TTime &)const 
-	?MountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 108 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int)const 
-	?Move@CFileMan@@QAEHABVTDesC16@@0I@Z @ 109 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int)
-	?Move@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 110 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-	?Name@TDriveUnit@@QBE?AV?$TBuf@$01@@XZ @ 111 NONAME ; public: class TBuf<2>  __thiscall TDriveUnit::Name(void)const 
-	?Name@TParseBase@@QBE?AVTPtrC16@@XZ @ 112 NONAME ; public: class TPtrC16  __thiscall TParseBase::Name(void)const 
-	?NameAndExt@TParseBase@@QBE?AVTPtrC16@@XZ @ 113 NONAME ; public: class TPtrC16  __thiscall TParseBase::NameAndExt(void)const 
-	?NameBuf@TParse@@MAEAAVTDes16@@XZ @ 114 NONAME ; protected: virtual class TDes16 & __thiscall TParse::NameBuf(void)
-	?NameBuf@TParsePtr@@MAEAAVTDes16@@XZ @ 115 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtr::NameBuf(void)
-	?NameBuf@TParsePtrC@@MAEAAVTDes16@@XZ @ 116 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtrC::NameBuf(void)
-	?NameBufC@TParse@@MBEABVTDesC16@@XZ @ 117 NONAME ; protected: virtual class TDesC16 const & __thiscall TParse::NameBufC(void)const 
-	?NameBufC@TParsePtr@@MBEABVTDesC16@@XZ @ 118 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtr::NameBufC(void)const 
-	?NameBufC@TParsePtrC@@MBEABVTDesC16@@XZ @ 119 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtrC::NameBufC(void)const 
-	?NameOrExtPresent@TParseBase@@QBEHXZ @ 120 NONAME ; public: int __thiscall TParseBase::NameOrExtPresent(void)const 
-	?NamePresent@TParseBase@@QBEHXZ @ 121 NONAME ; public: int __thiscall TParseBase::NamePresent(void)const 
-	?NewL@CDir@@KAPAV1@XZ @ 122 NONAME ; protected: static class CDir * __cdecl CDir::NewL(void)
-	?NewL@CDirScan@@SAPAV1@AAVRFs@@@Z @ 123 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewL(class RFs &)
-	?NewL@CFileMan@@SAPAV1@AAVRFs@@@Z @ 124 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &)
-	?NewL@CFileMan@@SAPAV1@AAVRFs@@PAVMFileManObserver@@@Z @ 125 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &,class MFileManObserver *)
-	?NewLC@CDirScan@@SAPAV1@AAVRFs@@@Z @ 126 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewLC(class RFs &)
-	?Next@RFormat@@QAEHAAH@Z @ 127 NONAME ; public: int __thiscall RFormat::Next(int &)
-	?Next@RFormat@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 128 NONAME ; public: void __thiscall RFormat::Next(class TPckgBuf<int> &,class TRequestStatus &)
-	?NextL@CDirScan@@QAEXAAPAVCDir@@@Z @ 129 NONAME ; public: void __thiscall CDirScan::NextL(class CDir * &)
-	?NextL@TOpenFileScan@@QAEXAAPAVCDir@@@Z @ 130 NONAME ; public: void __thiscall TOpenFileScan::NextL(class CDir * &)
-	?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@@Z @ 131 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &)
-	?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@ABVTDesC16@@@Z @ 132 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &,class TDesC16 const &)
-	?NotifyChangeCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 133 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(class TRequestStatus &)
-	?NotifyChangeCancel@RFs@@QAEXXZ @ 134 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(void)
-	?NotifyFileManEnded@MFileManObserver@@UAE?AW4TControl@1@XZ @ 135 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManEnded(void)
-	?NotifyFileManOperation@MFileManObserver@@UAE?AW4TControl@1@XZ @ 136 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManOperation(void)
-	?NotifyFileManStarted@MFileManObserver@@UAE?AW4TControl@1@XZ @ 137 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManStarted(void)
-	?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@ABVTUidType@@@Z @ 138 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,class TUidType const &)
-	?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 139 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,unsigned int)
-	?Open@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 140 NONAME ; public: int __thiscall RFile::Open(class RFs &,class TDesC16 const &,unsigned int)
-	?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAH@Z @ 141 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &)
-	?Open@RRawDisk@@QAEHAAVRFs@@H@Z @ 142 NONAME ; public: int __thiscall RRawDisk::Open(class RFs &,int)
-	?Parse@RFs@@QBEHABVTDesC16@@0AAVTParse@@@Z @ 143 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TDesC16 const &,class TParse &)const 
-	?Parse@RFs@@QBEHABVTDesC16@@AAVTParse@@@Z @ 144 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TParse &)const 
-	?Path@TParseBase@@QBE?AVTPtrC16@@XZ @ 145 NONAME ; public: class TPtrC16  __thiscall TParseBase::Path(void)const 
-	?PathPresent@TParseBase@@QBEHXZ @ 146 NONAME ; public: int __thiscall TParseBase::PathPresent(void)const 
-	?PopDir@TParseBase@@QAEHXZ @ 147 NONAME ; public: int __thiscall TParseBase::PopDir(void)
-	?Read@RDir@@QBEHAAVTEntry@@@Z @ 148 NONAME ; public: int __thiscall RDir::Read(class TEntry &)const 
-	?Read@RDir@@QBEHAAVTEntryArray@@@Z @ 149 NONAME ; public: int __thiscall RDir::Read(class TEntryArray &)const 
-	?Read@RDir@@QBEXAAV?$TPckg@VTEntry@@@@AAVTRequestStatus@@@Z @ 150 NONAME ; public: void __thiscall RDir::Read(class TPckg<class TEntry> &,class TRequestStatus &)const 
-	?Read@RDir@@QBEXAAVTEntryArray@@AAVTRequestStatus@@@Z @ 151 NONAME ; public: void __thiscall RDir::Read(class TEntryArray &,class TRequestStatus &)const 
-	?Read@RFile@@QBEHAAVTDes8@@@Z @ 152 NONAME ; public: int __thiscall RFile::Read(class TDes8 &)const 
-	?Read@RFile@@QBEHAAVTDes8@@H@Z @ 153 NONAME ; public: int __thiscall RFile::Read(class TDes8 &,int)const 
-	?Read@RFile@@QBEHHAAVTDes8@@@Z @ 154 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &)const 
-	?Read@RFile@@QBEHHAAVTDes8@@H@Z @ 155 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &,int)const 
-	?Read@RFile@@QBEXAAVTDes8@@AAVTRequestStatus@@@Z @ 156 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,class TRequestStatus &)const 
-	?Read@RFile@@QBEXAAVTDes8@@HAAVTRequestStatus@@@Z @ 157 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,int,class TRequestStatus &)const 
-	?Read@RFile@@QBEXHAAVTDes8@@AAVTRequestStatus@@@Z @ 158 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,class TRequestStatus &)const 
-	?Read@RFile@@QBEXHAAVTDes8@@HAAVTRequestStatus@@@Z @ 159 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,int,class TRequestStatus &)const 
-	?Read@_RRawDisk@@QAEHHAAVTDes8@@@Z @ 160 NONAME ; public: int __thiscall _RRawDisk::Read(int,class TDes8 &)
-	?Read@TFileText@@QAEHAAVTDes16@@@Z @ 161 NONAME ; public: int __thiscall TFileText::Read(class TDes16 &)
-	?ReadFileSection_RESERVED@RFs@@ABEHABVTDesC16@@HAAVTDes8@@H@Z @ 162 NONAME ; public: int __thiscall RFs::ReadFileSection_RESERVED(class TDesC16 const &,int,class TDes8 &,int)const 
-	?RealName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 163 NONAME ; public: int __thiscall RFs::RealName(class TDesC16 const &,class TDes16 &)const 
-	?RemoveFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 164 NONAME ; public: int __thiscall RFs::RemoveFileSystem(class TDesC16 const &)const 
-	?Rename@CFileMan@@QAEHABVTDesC16@@0I@Z @ 165 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int)
-	?Rename@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 166 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-	?Rename@RFile@@QAEHABVTDesC16@@@Z @ 167 NONAME ; public: int __thiscall RFile::Rename(class TDesC16 const &)
-	?Rename@RFs@@QAEHABVTDesC16@@0@Z @ 168 NONAME ; public: int __thiscall RFs::Rename(class TDesC16 const &,class TDesC16 const &)
-	?Replace@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 169 NONAME ; public: int __thiscall RFile::Replace(class RFs &,class TDesC16 const &,unsigned int)
-	?Replace@RFs@@QAEHABVTDesC16@@0@Z @ 170 NONAME ; public: int __thiscall RFs::Replace(class TDesC16 const &,class TDesC16 const &)
-	?ResourceCount@RFs@@QBEHXZ @ 171 NONAME ; public: int __thiscall RFs::ResourceCount(void)const 
-	?ResourceCountMarkEnd@RFs@@QBEXXZ @ 172 NONAME ; public: void __thiscall RFs::ResourceCountMarkEnd(void)const 
-	?ResourceCountMarkStart@RFs@@QBEXXZ @ 173 NONAME ; public: void __thiscall RFs::ResourceCountMarkStart(void)const 
-	?RmDir@CFileMan@@QAEHABVTDesC16@@@Z @ 174 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &)
-	?RmDir@CFileMan@@QAEHABVTDesC16@@AAVTRequestStatus@@@Z @ 175 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &,class TRequestStatus &)
-	?RmDir@RFs@@QAEHABVTDesC16@@@Z @ 176 NONAME ; public: int __thiscall RFs::RmDir(class TDesC16 const &)
-	?RunInSeparateThreadL@CFileBase@@IAEXP6AHPAX@Z@Z @ 177 NONAME ; protected: void __thiscall CFileBase::RunInSeparateThreadL(int (__cdecl*)(void *))
-	?RunL@CFileBase@@IAEXXZ @ 178 NONAME ; protected: void __thiscall CFileBase::RunL(void)
-	?ScanDrive@RFs@@QBEHABVTDesC16@@@Z @ 179 NONAME ; public: int __thiscall RFs::ScanDrive(class TDesC16 const &)const 
-	?Seek@RFile@@QBEHW4TSeek@@AAH@Z @ 180 NONAME ; public: int __thiscall RFile::Seek(enum TSeek,int &)const 
-	?Seek@TFileText@@QAEHW4TSeek@@@Z @ 181 NONAME ; public: int __thiscall TFileText::Seek(enum TSeek)
-	?SessionPath@RFs@@QBEHAAVTDes16@@@Z @ 182 NONAME ; public: int __thiscall RFs::SessionPath(class TDes16 &)const 
-	?Set@RFile@@QAEHABVTTime@@II@Z @ 183 NONAME ; public: int __thiscall RFile::Set(class TTime const &,unsigned int,unsigned int)
-	?Set@TFileText@@QAEXAAVRFile@@@Z @ 184 NONAME ; public: void __thiscall TFileText::Set(class RFile &)
-	?Set@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 185 NONAME ; public: int __thiscall TParse::Set(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
-	?SetAllocFailure@RFs@@QAEHH@Z @ 186 NONAME ; public: int __thiscall RFs::SetAllocFailure(int)
-	?SetAtt@RFile@@QAEHII@Z @ 187 NONAME ; public: int __thiscall RFile::SetAtt(unsigned int,unsigned int)
-	?SetAtt@RFs@@QAEHABVTDesC16@@II@Z @ 188 NONAME ; public: int __thiscall RFs::SetAtt(class TDesC16 const &,unsigned int,unsigned int)
-	?SetDebugRegister@RFs@@QAEHH@Z @ 189 NONAME ; public: int __thiscall RFs::SetDebugRegister(int)
-	?SetDefaultPath@RFs@@QAEHABVTDesC16@@@Z @ 190 NONAME ; public: int __thiscall RFs::SetDefaultPath(class TDesC16 const &)
-	?SetDriveName@RFs@@QAEHHABVTDesC16@@@Z @ 191 NONAME ; public: int __thiscall RFs::SetDriveName(int,class TDesC16 const &)
-	?SetEntry@RFs@@QAEHABVTDesC16@@ABVTTime@@II@Z @ 192 NONAME ; public: int __thiscall RFs::SetEntry(class TDesC16 const &,class TTime const &,unsigned int,unsigned int)
-	?SetErrorCondition@RFs@@QAEHHH@Z @ 193 NONAME ; public: int __thiscall RFs::SetErrorCondition(int,int)
-	?SetModified@RFile@@QAEHABVTTime@@@Z @ 194 NONAME ; public: int __thiscall RFile::SetModified(class TTime const &)
-	?SetModified@RFs@@QAEHABVTDesC16@@ABVTTime@@@Z @ 195 NONAME ; public: int __thiscall RFs::SetModified(class TDesC16 const &,class TTime const &)
-	?SetNoWild@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 196 NONAME ; public: int __thiscall TParse::SetNoWild(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
-	?SetNotifyUser@RFs@@QAEXH@Z @ 197 NONAME ; public: void __thiscall RFs::SetNotifyUser(int)
-	?SetObserver@CFileBase@@QAEXPAVMFileManObserver@@@Z @ 198 NONAME ; public: void __thiscall CFileBase::SetObserver(class MFileManObserver *)
-	?SetScanDataL@CDirScan@@QAEXABVTDesC16@@IIW4TScanDirection@1@@Z @ 199 NONAME ; public: void __thiscall CDirScan::SetScanDataL(class TDesC16 const &,unsigned int,unsigned int,enum CDirScan::TScanDirection)
-	?SetSessionPath@RFs@@QAEHABVTDesC16@@@Z @ 200 NONAME ; public: int __thiscall RFs::SetSessionPath(class TDesC16 const &)
-	?SetSize@RFile@@QAEHH@Z @ 201 NONAME ; public: int __thiscall RFile::SetSize(int)
-	?SetSubst@RFs@@QAEHABVTDesC16@@H@Z @ 202 NONAME ; public: int __thiscall RFs::SetSubst(class TDesC16 const &,int)
-	?SetVolumeLabel@RFs@@QAEHABVTDesC16@@H@Z @ 203 NONAME ; public: int __thiscall RFs::SetVolumeLabel(class TDesC16 const &,int)
-	?Size@RFile@@QBEHAAH@Z @ 204 NONAME ; public: int __thiscall RFile::Size(int &)const 
-	?Sort@CDir@@QAEHI@Z @ 205 NONAME ; public: int __thiscall CDir::Sort(unsigned int)
-	?Subst@RFs@@QBEHAAVTDes16@@H@Z @ 206 NONAME ; public: int __thiscall RFs::Subst(class TDes16 &,int)const 
-	?Temp@RFile@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 207 NONAME ; public: int __thiscall RFile::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
-	?ThreadId@TOpenFileScan@@QBE?AVTThreadId@@XZ @ 208 NONAME ; public: class TThreadId  __thiscall TOpenFileScan::ThreadId(void)const 
-	?UnLock@RFile@@QBEHHH@Z @ 209 NONAME ; public: int __thiscall RFile::UnLock(int,int)const 
-	?UnlockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@H@Z @ 210 NONAME ; public: int __thiscall RFs::UnlockDrive(int,class TBuf8<16> const &,int)
-	?Version@RFs@@QBE?AVTVersion@@XZ @ 211 NONAME ; public: class TVersion  __thiscall RFs::Version(void)const 
-	?Volume@RFs@@QBEHAAVTVolumeInfo@@H@Z @ 212 NONAME ; public: int __thiscall RFs::Volume(class TVolumeInfo &,int)const 
-	?Write@RFile@@QAEHABVTDesC8@@@Z @ 213 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &)
-	?Write@RFile@@QAEHABVTDesC8@@H@Z @ 214 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &,int)
-	?Write@RFile@@QAEHHABVTDesC8@@@Z @ 215 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &)
-	?Write@RFile@@QAEHHABVTDesC8@@H@Z @ 216 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &,int)
-	?Write@RFile@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 217 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,class TRequestStatus &)
-	?Write@RFile@@QAEXABVTDesC8@@HAAVTRequestStatus@@@Z @ 218 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,int,class TRequestStatus &)
-	?Write@RFile@@QAEXHABVTDesC8@@AAVTRequestStatus@@@Z @ 219 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,class TRequestStatus &)
-	?Write@RFile@@QAEXHABVTDesC8@@HAAVTRequestStatus@@@Z @ 220 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,int,class TRequestStatus &)
-	?Write@_RRawDisk@@QAEHHAAVTDesC8@@@Z @ 221 NONAME ; public: int __thiscall _RRawDisk::Write(int,class TDesC8 &)
-	?Write@TFileText@@QAEHABVTDesC16@@@Z @ 222 NONAME ; public: int __thiscall TFileText::Write(class TDesC16 const &)
-	?DebugNotify@RFs@@QAEXHIAAVTRequestStatus@@@Z @ 223 NONAME ; public: void __thiscall RFs::DebugNotify(int,unsigned int,class TRequestStatus &)
-	?NotifyDiskSpace@RFs@@QAEX_JHAAVTRequestStatus@@@Z @ 224 NONAME ; public: void __thiscall RFs::NotifyDiskSpace(__int64,int,class TRequestStatus &)
-	?NotifyDiskSpaceCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 225 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(class TRequestStatus &)
-	?NotifyDiskSpaceCancel@RFs@@QAEXXZ @ 226 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(void)
-	??0TEntry@@QAE@ABV0@@Z @ 227 NONAME ; public: __thiscall TEntry::TEntry(class TEntry const &)
-	??0TEntry@@QAE@XZ @ 228 NONAME ; public: __thiscall TEntry::TEntry(void)
-	??4TEntry@@QAEAAV0@ABV0@@Z @ 229 NONAME ; public: class TEntry & __thiscall TEntry::operator=(class TEntry const &)
-	??0TParse@@QAE@XZ @ 230 NONAME ; public: __thiscall TParse::TParse(void)
-	?Drive@RFile@@QBEHAAHAAVTDriveInfo@@@Z @ 231 NONAME ; public: int __thiscall RFile::Drive(int &,class TDriveInfo &)const 
-	?RemountDrive@RFs@@QAEHHPBVTDesC8@@I@Z @ 232 NONAME ; public: int __thiscall RFs::RemountDrive(int,class TDesC8 const *,unsigned int)
-	?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@HAAH@Z @ 233 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,int,int &)const 
-	?CreatePrivatePath@RFs@@QAEHH@Z @ 234 NONAME ; public: int __thiscall RFs::CreatePrivatePath(int)
-	?PrivatePath@RFs@@QAEHAAVTDes16@@@Z @ 235 NONAME ; public: int __thiscall RFs::PrivatePath(class TDes16 &)
-	?SetSessionToPrivate@RFs@@QAEHH@Z @ 236 NONAME ; public: int __thiscall RFs::SetSessionToPrivate(int)
-	?FileNamesIdentical@@YAHABVTDesC16@@0@Z @ 237 NONAME ; int __cdecl FileNamesIdentical(class TDesC16 const &,class TDesC16 const &)
-	?AddExtension@RFs@@QAEHABVTDesC16@@@Z @ 238 NONAME ; public: int __thiscall RFs::AddExtension(class TDesC16 const &)
-	?DismountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 239 NONAME ; public: int __thiscall RFs::DismountExtension(class TDesC16 const &,int)
-	?ExtensionName@RFs@@QAEHAAVTDes16@@HH@Z @ 240 NONAME ; public: int __thiscall RFs::ExtensionName(class TDes16 &,int,int)
-	?MountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 241 NONAME ; public: int __thiscall RFs::MountExtension(class TDesC16 const &,int)
-	?MountFileSystem@RFs@@QAEHABVTDesC16@@0H@Z @ 242 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int)
-	?RemoveExtension@RFs@@QAEHABVTDesC16@@@Z @ 243 NONAME ; public: int __thiscall RFs::RemoveExtension(class TDesC16 const &)
-	?StartupInitComplete@RFs@@QAEXAAVTRequestStatus@@@Z @ 244 NONAME ; public: void __thiscall RFs::StartupInitComplete(class TRequestStatus &)
-	?SetLocalDriveMapping@RFs@@QAEHABVTDesC8@@@Z @ 245 NONAME ; public: int __thiscall RFs::SetLocalDriveMapping(class TDesC8 const &)
-	?ControlIo@RFs@@QAEHHH@Z @ 246 NONAME ; public: int __thiscall RFs::ControlIo(int,int)
-	?ControlIo@RFs@@QAEHHHAAVTDes8@@@Z @ 247 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&)   ?Adopt@RFile@@QAEHAAVRFs@@AAH@Z @ 246 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int &)
-	?ControlIo@RFs@@QAEHHHAAVTDes8@@0@Z @ 248 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&,class TDes8&)
-	?Adopt@RFile@@QAEHAAVRFs@@H@Z @ 249 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int)
-	?MountFileSystem@RFs@@QAEHABVTDesC16@@0HH@Z @ 250 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int,int)
-	?MountFileSystem@RFs@@QBEHABVTDesC16@@HH@Z @ 251 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int,int)const 
-	?Read@RRawDisk@@QAEH_JAAVTDes8@@@Z @ 252 NONAME ; public: int __thiscall RRawDisk::Read(__int64,class TDes8 &)
-	?Write@RRawDisk@@QAEH_JAAVTDesC8@@@Z @ 253 NONAME ; public: int __thiscall RRawDisk::Write(__int64,class TDesC8 &)
-	?FinaliseDrives@RFs@@QAEHXZ @ 254 NONAME ; public: int __thiscall RFs::FinaliseDrives(void)
-	?SwapFileSystem@RFs@@QBEHABVTDesC16@@0H@Z @ 255 NONAME ; public: int __thiscall RFs::SwapFileSystem(class TDesC16 const &,class TDesC16 const &,int)const 
-	?ErasePassword@RFs@@QAEHH@Z @ 256 NONAME ; public: int __thiscall RFs::ErasePassword(int)
-	?GetReserveAccess@RFs@@QAEHH@Z @ 257 NONAME ; public: int __thiscall RFs::GetReserveAccess(int)
-	?ReleaseReserveAccess@RFs@@QAEHH@Z @ 258 NONAME ; public: int __thiscall RFs::ReleaseReserveAccess(int)
-	?ReserveDriveSpace@RFs@@QAEHHH@Z @ 259 NONAME ; public: int __thiscall RFs::ReserveDriveSpace(int,int)
-	?AdoptFromClient@RFile@@QAEHABVRMessage2@@HH@Z @ 260 NONAME ; public: int __thiscall RFile::AdoptFromClient(class RMessage2 const &,int,int)
-	?AdoptFromCreator@RFile@@QAEHHH@Z @ 261 NONAME ; public: int __thiscall RFile::AdoptFromCreator(int,int)
-	?AdoptFromServer@RFile@@QAEHHH@Z @ 262 NONAME ; public: int __thiscall RFile::AdoptFromServer(int,int)
-	?TransferToClient@RFile@@QBEHABVRMessage2@@H@Z @ 263 NONAME ; public: int __thiscall RFile::TransferToClient(class RMessage2 const &,int)const 
-	?TransferToProcess@RFile@@QBEHAAVRProcess@@HH@Z @ 264 NONAME ; public: int __thiscall RFile::TransferToProcess(class RProcess &,int,int)const 
-	?TransferToServer@RFile@@QBEHAAVTIpcArgs@@HH@Z @ 265 NONAME ; public: int __thiscall RFile::TransferToServer(class TIpcArgs &,int,int)const 
-	?Name@RFile@@QBEHAAVTDes16@@@Z @ 266 NONAME ; public: int __thiscall RFile::Name(class TDes16 &)const 
-	?Close@RDir@@QAEXXZ @ 267 NONAME ; public: void __thiscall RDir::Close(void)
-	?Close@RFile@@QAEXXZ @ 268 NONAME ; public: void __thiscall RFile::Close(void)
-	?Close@RFormat@@QAEXXZ @ 269 NONAME ; public: void __thiscall RFormat::Close(void)
-	?GetMediaSerialNumber@RFs@@QAEHAAV?$TBuf8@$0EA@@@H@Z @ 270 NONAME ; public: int __thiscall RFs::GetMediaSerialNumber(class TBuf8<64> &,int)
-	?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@I@Z @ 271 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int)
-	?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@IAAVTRequestStatus@@@Z @ 272 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-	?FullName@RFile@@QBEHAAVTDes16@@@Z @ 273 NONAME ; public: int __thiscall RFile::FullName(class TDes16 &)const 
-	?AddPlugin@RFs@@QBEHABVTDesC16@@@Z @ 274 NONAME ; public: int __thiscall RFs::AddPlugin(class TDesC16 const &)const 
-	?Close@RPlugin@@QAEXXZ @ 275 NONAME ; public: void __thiscall RPlugin::Close(void)
-	?DismountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 276 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &)const 
-	?DismountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 277 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int)const 
-	?DismountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 278 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int,int)const 
-	?DoCancel@RPlugin@@IBEXI@Z @ 279 NONAME ; protected: void __thiscall RPlugin::DoCancel(unsigned int)const 
-	?DoControl@RPlugin@@IBEHH@Z @ 280 NONAME ; protected: int __thiscall RPlugin::DoControl(int)const 
-	?DoControl@RPlugin@@IBEHHAAVTDes8@@0@Z @ 281 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &,class TDes8 &)const 
-	?DoControl@RPlugin@@IBEHHAAVTDes8@@@Z @ 282 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &)const 
-	?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@@Z @ 283 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &)const 
-	?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@1@Z @ 284 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &,class TDes8 &)const 
-	?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@@Z @ 285 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &)const 
-	?MountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 286 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &)const 
-	?MountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 287 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int)const 
-	?MountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 288 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int,int)const 
-	?Open@RPlugin@@QAEHAAVRFs@@H@Z @ 289 NONAME ; public: int __thiscall RPlugin::Open(class RFs &,int)
-	?PluginName@RFs@@QAEHAAVTDes16@@HH@Z @ 290 NONAME ; public: int __thiscall RFs::PluginName(class TDes16 &,int,int)
-	?RemovePlugin@RFs@@QBEHABVTDesC16@@@Z @ 291 NONAME ; public: int __thiscall RFs::RemovePlugin(class TDesC16 const &)const 
-	?AllowDismount@RFs@@QBEHH@Z @ 292 NONAME ; public: int __thiscall RFs::AllowDismount(int)const 
-	?NotifyDismount@RFs@@QBEXHAAVTRequestStatus@@W4TNotifyDismountMode@@@Z @ 293 NONAME ; public: void __thiscall RFs::NotifyDismount(int,class TRequestStatus &,enum TNotifyDismountMode)const 
-	?NotifyDismountCancel@RFs@@QBEXAAVTRequestStatus@@@Z @ 294 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(class TRequestStatus &)const 
-	?NotifyDismountCancel@RFs@@QBEXXZ @ 295 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(void)const 
-	?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAHABVTDesC8@@@Z @ 296 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &,class TDesC8 const &)
-	?SetStartupConfiguration@RFs@@QBEHHPAX0@Z @ 297 NONAME ; public: int __thiscall RFs::SetStartupConfiguration(int,void *,void *)const 
-	?ReadCancel@RFile@@QBEXAAVTRequestStatus@@@Z @ 298 NONAME ; public: void __thiscall RFile::ReadCancel(class TRequestStatus &)const 
-	?ReadCancel@RFile@@QBEXXZ @ 299 NONAME ; public: void __thiscall RFile::ReadCancel(void)const 
-	?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@0HAAH@Z @ 300 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,class TDesC16 const &,int,int &)const 
-	?SetNotifyChange@RFs@@QAEHH@Z @ 301 NONAME ; public: int __thiscall RFs::SetNotifyChange(int)
-	?AddCompositeMount@RFs@@QBEHABVTDesC16@@HHH@Z @ 302 NONAME ; int RFs::AddCompositeMount(class TDesC16 const &, int, int, int) const
-	?Flush@RFile@@QAEXAAVTRequestStatus@@@Z @ 303 NONAME ; public: void __thiscall RFile::Flush(class TRequestStatus &)
-	?GetSystemDrive@RFs@@SA?AW4TDriveNumber@@XZ @ 304 NONAME ; public: static enum TDriveNumber  __cdecl RFs::GetSystemDrive(void)
-	??0TBlockMapEntry@@QAE@XZ @ 305 NONAME ; public: __thiscall TBlockMapEntry::TBlockMapEntry(void)
-	?BlockMap@RFile@@QBEHAAUSBlockMapInfo@@AA_J_JH@Z @ 306 NONAME ; public: int __thiscall RFile::BlockMap(struct SBlockMapInfo &,__int64 &,__int64,int)const 
-	?SetNumberOfBlocks@TBlockMapEntry@@QAEXI@Z @ 307 NONAME ; public: void __thiscall TBlockMapEntry::SetNumberOfBlocks(unsigned int)
-	?SetStartBlock@TBlockMapEntry@@QAEXI@Z @ 308 NONAME ; public: void __thiscall TBlockMapEntry::SetStartBlock(unsigned int)
-	?Clamp@RFileClamp@@QAEHAAVRFile@@@Z @ 309 NONAME ; public: int __thiscall RFileClamp::Clamp(class RFile &)
-	?Close@RFileClamp@@QAEHAAVRFs@@@Z @ 310 NONAME ; public: int __thiscall RFileClamp::Close(class RFs &)
-	?FileSystemSubType@RFs@@QBEHHAAVTDes16@@@Z @ 311 NONAME ; public: int __thiscall RFs::FileSystemSubType(int,class TDes16 &)const 
-	?InitialisePropertiesFile@RFs@@QBEHABVTPtrC8@@@Z @ 312 NONAME ; public: int __thiscall RFs::InitialisePropertiesFile(class TPtrC8 const &)const 
-	?QueryVolumeInfoExt@RFs@@QBEHHW4TQueryVolumeInfoExtCmd@@AAVTDes8@@@Z @ 313 NONAME ; public: int __thiscall RFs::QueryVolumeInfoExt(int,enum TQueryVolumeInfoExtCmd,class TDes8 &)const 
-	?VolumeIOParam@RFs@@QBEHHAAVTVolumeIOParamInfo@@@Z @ 314 NONAME ; public: int __thiscall RFs::VolumeIOParam(int,class TVolumeIOParamInfo &)const 
-	?GetSystemDriveChar@RFs@@SA?AVTChar@@XZ @ 315 NONAME ; public: static class TChar  __cdecl RFs::GetSystemDriveChar(void)
-	?SetSystemDrive@RFs@@QAEHW4TDriveNumber@@@Z @ 316 NONAME ; public: int __thiscall RFs::SetSystemDrive(enum TDriveNumber)
-	?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@I@Z @ 317 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &,unsigned int)const 
-	?SetFindMask@TFindFile@@QAEHI@Z @ 318 NONAME ; public: int __thiscall TFindFile::SetFindMask(unsigned int)
-	?FinaliseDrive@RFs@@QBEHHW4TFinaliseDrvMode@1@@Z @ 319 NONAME ; public: int __thiscall RFs::FinaliseDrive(int,enum RFs::TFinaliseDrvMode)const 
-	?Volume@RFs@@QBEXAAVTVolumeInfo@@HAAVTRequestStatus@@@Z @ 320 NONAME ; public: void __thiscall RFs::Volume(class TVolumeInfo &,int,class TRequestStatus &)const 
-	?AddProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 321 NONAME ; public: int __thiscall RFs::AddProxyDrive(class TDesC16 const &)
-	?Caps@RRawDisk@@QAEHAAVTDes8@@@Z @ 322 NONAME ABSENT ; public: int __thiscall RRawDisk::Caps(class TDes8 &)
-	?DismountProxyDrive@RFs@@QAEHI@Z @ 323 NONAME ; public: int __thiscall RFs::DismountProxyDrive(unsigned int)
-	?DoMountProxyDrive@RFs@@AAEHABVTIpcArgs@@@Z @ 324 NONAME ; private: int __thiscall RFs::DoMountProxyDrive(class TIpcArgs const &)
-	?RemoveProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 325 NONAME ; public: int __thiscall RFs::RemoveProxyDrive(class TDesC16 const &)
-	?ReadFileSection@RFs@@QBEHABVTDesC16@@_JAAVTDes8@@H@Z @ 326 NONAME ; public: int __thiscall RFs::ReadFileSection(class TDesC16 const &,__int64,class TDes8 &,int)const 
-	?AdoptFromClient@RFile64@@QAEHABVRMessage2@@HH@Z @ 327 NONAME ; public: int __thiscall RFile64::AdoptFromClient(class RMessage2 const &,int,int)
-	?AdoptFromCreator@RFile64@@QAEHHH@Z @ 328 NONAME ; public: int __thiscall RFile64::AdoptFromCreator(int,int)
-	?AdoptFromServer@RFile64@@QAEHHH@Z @ 329 NONAME ; public: int __thiscall RFile64::AdoptFromServer(int,int)
-	?Create@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 330 NONAME ; public: int __thiscall RFile64::Create(class RFs &,class TDesC16 const &,unsigned int)
-	?FileSize@TEntry@@QBE_JXZ @ 331 NONAME ; public: __int64 __thiscall TEntry::FileSize(void)const 
-	?Lock@RFile64@@QBEH_J0@Z @ 332 NONAME ; public: int __thiscall RFile64::Lock(__int64,__int64)const 
-	?Open@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 333 NONAME ; public: int __thiscall RFile64::Open(class RFs &,class TDesC16 const &,unsigned int)
-	?Read@RFile64@@QBEHIAAVTDes8@@@Z @ 334 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &)const 
-	?Read@RFile64@@QBEHIAAVTDes8@@H@Z @ 335 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &,int)const 
-	?Read@RFile64@@QBEH_JAAVTDes8@@@Z @ 336 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &)const 
-	?Read@RFile64@@QBEH_JAAVTDes8@@H@Z @ 337 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &,int)const 
-	?Read@RFile64@@QBEXIAAVTDes8@@AAVTRequestStatus@@@Z @ 338 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,class TRequestStatus &)const 
-	?Read@RFile64@@QBEXIAAVTDes8@@HAAVTRequestStatus@@@Z @ 339 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,int,class TRequestStatus &)const 
-	?Read@RFile64@@QBEX_JAAVTDes8@@AAVTRequestStatus@@@Z @ 340 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,class TRequestStatus &)const 
-	?Read@RFile64@@QBEX_JAAVTDes8@@HAAVTRequestStatus@@@Z @ 341 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,int,class TRequestStatus &)const 
-	?Replace@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 342 NONAME ; public: int __thiscall RFile64::Replace(class RFs &,class TDesC16 const &,unsigned int)
-	?Seek@RFile64@@QBEHW4TSeek@@AA_J@Z @ 343 NONAME ; public: int __thiscall RFile64::Seek(enum TSeek,__int64 &)const 
-	?SetSize@RFile64@@QAEH_J@Z @ 344 NONAME ; public: int __thiscall RFile64::SetSize(__int64)
-	?Size@RFile64@@QBEHAA_J@Z @ 345 NONAME ; public: int __thiscall RFile64::Size(__int64 &)const 
-	?Temp@RFile64@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 346 NONAME ; public: int __thiscall RFile64::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
-	?UnLock@RFile64@@QBEH_J0@Z @ 347 NONAME ; public: int __thiscall RFile64::UnLock(__int64,__int64)const 
-	?Write@RFile64@@QAEHIABVTDesC8@@@Z @ 348 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &)
-	?Write@RFile64@@QAEHIABVTDesC8@@H@Z @ 349 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int)
-	?Write@RFile64@@QAEH_JABVTDesC8@@@Z @ 350 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &)
-	?Write@RFile64@@QAEH_JABVTDesC8@@H@Z @ 351 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &,int)
-	?Write@RFile64@@QAEXIABVTDesC8@@AAVTRequestStatus@@@Z @ 352 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,class TRequestStatus &)
-	?Write@RFile64@@QAEXIABVTDesC8@@HAAVTRequestStatus@@@Z @ 353 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int,class TRequestStatus &)
-	?Write@RFile64@@QAEX_JABVTDesC8@@AAVTRequestStatus@@@Z @ 354 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,class TRequestStatus &)
-	?Write@RFile64@@QAEX_JABVTDesC8@@HAAVTRequestStatus@@@Z @ 355 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,int,class TRequestStatus &)
-	?IsValidName@RFs@@QAEHABVTDesC16@@AAVTNameValidParam@1@@Z @ 356 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,class RFs::TNameValidParam &)
-	?Close@RFs@@QAEXXZ @ 357 NONAME ; public: void __thiscall RFs::Close(void)
-	??1CFsNotify@@UAE@XZ @ 358 NONAME ; public: virtual __thiscall CFsNotify::~CFsNotify(void)
-	?AddNotification@CFsNotify@@QAEHIABVTDesC16@@0@Z @ 359 NONAME ; public: int __thiscall CFsNotify::AddNotification(unsigned int,class TDesC16 const &,class TDesC16 const &)
-	?Attributes@TFsNotification@@QBEHAAI0@Z @ 360 NONAME ; public: int __thiscall TFsNotification::Attributes(unsigned int &,unsigned int &)const 
-	?CancelNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 361 NONAME ; public: int __thiscall CFsNotify::CancelNotifications(class TRequestStatus &)
-	?FileSize@TFsNotification@@QBEHAA_J@Z @ 362 NONAME ; public: int __thiscall TFsNotification::FileSize(__int64 &)const 
-	?NewL@CFsNotify@@SAPAV1@AAVRFs@@H@Z @ 363 NONAME ; public: static class CFsNotify * __cdecl CFsNotify::NewL(class RFs &,int)
-	?NewName@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 364 NONAME ; public: int __thiscall TFsNotification::NewName(class TPtrC16 &)const 
-	?NextNotification@CFsNotify@@QAEPBVTFsNotification@@XZ @ 365 NONAME ; public: class TFsNotification const * __thiscall CFsNotify::NextNotification(void)
-	?NotificationType@TFsNotification@@QBE?AW4TFsNotificationType@1@XZ @ 366 NONAME ; public: enum TFsNotification::TFsNotificationType __thiscall TFsNotification::NotificationType(void)const 
-	?Path@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 367 NONAME ; public: int __thiscall TFsNotification::Path(class TPtrC16 &)const 
-	?RemoveNotifications@CFsNotify@@QAEHXZ @ 368 NONAME ; public: int __thiscall CFsNotify::RemoveNotifications(void)
-	?RequestNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 369 NONAME ; public: int __thiscall CFsNotify::RequestNotifications(class TRequestStatus &)
-	?SupportedFileSystemName@RFs@@QBEHAAVTDes16@@HH@Z @ 370 NONAME ; public: int __thiscall RFs::SupportedFileSystemName(class TDes16 &,int,int)const 
-	?Close@CFsMountHelper@@QAEXXZ @ 371 NONAME ; public: void __thiscall CFsMountHelper::Close(void)
+    ??0CDir@@IAE@XZ @ 1 NONAME ; protected: __thiscall CDir::CDir(void)
+    ??0CFileBase@@IAE@AAVRFs@@@Z @ 2 NONAME ; protected: __thiscall CFileBase::CFileBase(class RFs &)
+    ??0TDriveUnit@@QAE@ABVTDesC16@@@Z @ 3 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(class TDesC16 const &)
+    ??0TDriveUnit@@QAE@H@Z @ 4 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(int)
+    ??0TEntryArray@@QAE@XZ @ 5 NONAME ; public: __thiscall TEntryArray::TEntryArray(void)
+    ??0TFileText@@QAE@XZ @ 6 NONAME ; public: __thiscall TFileText::TFileText(void)
+    ??0TFindFile@@QAE@AAVRFs@@@Z @ 7 NONAME ; public: __thiscall TFindFile::TFindFile(class RFs &)
+    ??0TOpenFileScan@@QAE@AAVRFs@@@Z @ 8 NONAME ; public: __thiscall TOpenFileScan::TOpenFileScan(class RFs &)
+    ??0TParseBase@@QAE@XZ @ 9 NONAME ; public: __thiscall TParseBase::TParseBase(void)
+    ??0TParsePtr@@QAE@AAVTDes16@@@Z @ 10 NONAME ; public: __thiscall TParsePtr::TParsePtr(class TDes16 &)
+    ??0TParsePtrC@@QAE@ABVTDesC16@@@Z @ 11 NONAME ; public: __thiscall TParsePtrC::TParsePtrC(class TDesC16 const &)
+    ??0TVolumeInfo@@QAE@XZ @ 12 NONAME ; public: __thiscall TVolumeInfo::TVolumeInfo(void)
+    ??1CDir@@UAE@XZ @ 13 NONAME ; public: virtual __thiscall CDir::~CDir(void)
+    ??1CDirScan@@UAE@XZ @ 14 NONAME ; public: virtual __thiscall CDirScan::~CDirScan(void)
+    ??1CFileBase@@MAE@XZ @ 15 NONAME ; protected: virtual __thiscall CFileBase::~CFileBase(void)
+    ??4TDriveUnit@@QAEAAV0@ABVTDesC16@@@Z @ 16 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(class TDesC16 const &)
+    ??4TDriveUnit@@QAEAAV0@H@Z @ 17 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(int)
+    ??ACDir@@QBEABVTEntry@@H@Z @ 18 NONAME ; public: class TEntry const & __thiscall CDir::operator[](int)const 
+    ??ATEntryArray@@QBEABVTEntry@@H@Z @ 19 NONAME ; public: class TEntry const & __thiscall TEntryArray::operator[](int)const 
+    ?AbbreviatedPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 20 NONAME ; public: class TPtrC16  __thiscall CDirScan::AbbreviatedPath(void)
+    ?AbbreviatedPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 21 NONAME ; public: class TPtrC16  __thiscall CFileBase::AbbreviatedPath(void)
+    ?AddDir@TParseBase@@QAEHABVTDesC16@@@Z @ 22 NONAME ; public: int __thiscall TParseBase::AddDir(class TDesC16 const &)
+    ?AddFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 23 NONAME ; public: int __thiscall RFs::AddFileSystem(class TDesC16 const &)const 
+    ?AddL@CDir@@IAEXABVTEntry@@@Z @ 24 NONAME ; protected: void __thiscall CDir::AddL(class TEntry const &)
+    ?Att@RFile@@QBEHAAI@Z @ 25 NONAME ; public: int __thiscall RFile::Att(unsigned int &)const 
+    ?Att@RFs@@QBEHABVTDesC16@@AAI@Z @ 26 NONAME ; public: int __thiscall RFs::Att(class TDesC16 const &,unsigned int &)const 
+    ?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@I@Z @ 27 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int)
+    ?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@IAAVTRequestStatus@@@Z @ 28 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int,class TRequestStatus &)
+    ?BytesTransferredByCopyStep@CFileMan@@QAEHXZ @ 29 NONAME ; public: int __thiscall CFileMan::BytesTransferredByCopyStep(void)
+    ?ChangeMode@RFile@@QAEHW4TFileMode@@@Z @ 30 NONAME ; public: int __thiscall RFile::ChangeMode(enum TFileMode)
+    ?CharToDrive@RFs@@SAHVTChar@@AAH@Z @ 31 NONAME ; public: static int __cdecl RFs::CharToDrive(class TChar,int &)
+    ?CheckDisk@RFs@@QBEHABVTDesC16@@@Z @ 32 NONAME ; public: int __thiscall RFs::CheckDisk(class TDesC16 const &)const 
+    ?ClearPassword@RFs@@QAEHHABV?$TBuf8@$0BA@@@@Z @ 33 NONAME ; public: int __thiscall RFs::ClearPassword(int,class TBuf8<16> const &)
+    ?Duplicate@RFile@@QAEHABV1@W4TOwnerType@@@Z @ 34 NONAME ; public: int __thiscall RFile::Duplicate(class RFile const &,enum TOwnerType)
+    ?Close@RRawDisk@@QAEXXZ @ 35 NONAME ; public: void __thiscall RRawDisk::Close(void)
+    ?Compress@CDir@@IAEXXZ @ 36 NONAME ; protected: void __thiscall CDir::Compress(void)
+    ?Connect@RFs@@QAEHH@Z @ 37 NONAME ; public: int __thiscall RFs::Connect(int)
+    ?ConstructL@CFileBase@@IAEXXZ @ 38 NONAME ; protected: void __thiscall CFileBase::ConstructL(void)
+    ?ControlIo@RFs@@QAEHHHPAX0@Z @ 39 NONAME ; public: int __thiscall RFs::ControlIo(int,int,void *,void *)
+    ?Copy@CFileMan@@QAEHABVTDesC16@@0I@Z @ 40 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int)
+    ?Copy@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 41 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+    ?Count@CDir@@QBEHXZ @ 42 NONAME ; public: int __thiscall CDir::Count(void)const 
+    ?Count@TEntryArray@@QBEHXZ @ 43 NONAME ; public: int __thiscall TEntryArray::Count(void)const 
+    ?Create@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 44 NONAME ; public: int __thiscall RFile::Create(class RFs &,class TDesC16 const &,unsigned int)
+    ?CurrentAction@CFileMan@@QAE?AW4TAction@1@XZ @ 45 NONAME ; public: enum CFileMan::TAction  __thiscall CFileMan::CurrentAction(void)
+    ?CurrentEntry@CFileBase@@QAEABVTEntry@@XZ @ 46 NONAME ; public: class TEntry const & __thiscall CFileBase::CurrentEntry(void)
+    ?DefaultPath@RFs@@QBEHAAVTDes16@@@Z @ 47 NONAME ; public: int __thiscall RFs::DefaultPath(class TDes16 &)const 
+    ?Delete@CFileMan@@QAEHABVTDesC16@@I@Z @ 48 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int)
+    ?Delete@CFileMan@@QAEHABVTDesC16@@IAAVTRequestStatus@@@Z @ 49 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int,class TRequestStatus &)
+    ?Delete@RFs@@QAEHABVTDesC16@@@Z @ 50 NONAME ; public: int __thiscall RFs::Delete(class TDesC16 const &)
+    ?DismountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 51 NONAME ; public: int __thiscall RFs::DismountFileSystem(class TDesC16 const &,int)const 
+    ?Drive@RFs@@QBEHAAVTDriveInfo@@H@Z @ 52 NONAME ; public: int __thiscall RFs::Drive(class TDriveInfo &,int)const 
+    ?Drive@TParseBase@@QBE?AVTPtrC16@@XZ @ 53 NONAME ; public: class TPtrC16  __thiscall TParseBase::Drive(void)const 
+    ?DriveAndPath@TParseBase@@QBE?AVTPtrC16@@XZ @ 54 NONAME ; public: class TPtrC16  __thiscall TParseBase::DriveAndPath(void)const 
+    ?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@@Z @ 55 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &)const 
+    ?DrivePresent@TParseBase@@QBEHXZ @ 56 NONAME ; public: int __thiscall TParseBase::DrivePresent(void)const 
+    ?DriveToChar@RFs@@SAHHAAVTChar@@@Z @ 57 NONAME ; public: static int __cdecl RFs::DriveToChar(int,class TChar &)
+    ?Entry@RFs@@QBEHABVTDesC16@@AAVTEntry@@@Z @ 58 NONAME ; public: int __thiscall RFs::Entry(class TDesC16 const &,class TEntry &)const 
+    ?Ext@TParseBase@@QBE?AVTPtrC16@@XZ @ 59 NONAME ; public: class TPtrC16  __thiscall TParseBase::Ext(void)const 
+    ?ExtPresent@TParseBase@@QBEHXZ @ 60 NONAME ; public: int __thiscall TParseBase::ExtPresent(void)const 
+    ?ExtractL@CDir@@IAEXHAAPAV1@@Z @ 61 NONAME ; protected: void __thiscall CDir::ExtractL(int,class CDir * &)
+    ?FileSystemName@RFs@@QBEHAAVTDes16@@H@Z @ 62 NONAME ; public: int __thiscall RFs::FileSystemName(class TDes16 &,int)const 
+    ?Find@TFindFile@@QAEHXZ @ 63 NONAME ; public: int __thiscall TFindFile::Find(void)
+    ?FindByDir@TFindFile@@QAEHABVTDesC16@@0@Z @ 64 NONAME ; public: int __thiscall TFindFile::FindByDir(class TDesC16 const &,class TDesC16 const &)
+    ?FindByPath@TFindFile@@QAEHABVTDesC16@@PBV2@@Z @ 65 NONAME ; public: int __thiscall TFindFile::FindByPath(class TDesC16 const &,class TDesC16 const *)
+    ?FindWild@TFindFile@@QAEHAAPAVCDir@@@Z @ 66 NONAME ; public: int __thiscall TFindFile::FindWild(class CDir * &)
+    ?FindWildByDir@TFindFile@@QAEHABVTDesC16@@0AAPAVCDir@@@Z @ 67 NONAME ; public: int __thiscall TFindFile::FindWildByDir(class TDesC16 const &,class TDesC16 const &,class CDir * &)
+    ?FindWildByPath@TFindFile@@QAEHABVTDesC16@@PBV2@AAPAVCDir@@@Z @ 68 NONAME ; public: int __thiscall TFindFile::FindWildByPath(class TDesC16 const &,class TDesC16 const *,class CDir * &)
+    ?Flush@RFile@@QAEHXZ @ 69 NONAME ; public: int __thiscall RFile::Flush(void)
+    ?FullName@TParseBase@@QBEABVTDesC16@@XZ @ 70 NONAME ; public: class TDesC16 const & __thiscall TParseBase::FullName(void)const 
+    ?FullPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 71 NONAME ; public: class TPtrC16  __thiscall CDirScan::FullPath(void)
+    ?FullPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 72 NONAME ; public: class TPtrC16  __thiscall CFileBase::FullPath(void)
+    ?GetCurrentSource@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 73 NONAME ; public: void __thiscall CFileMan::GetCurrentSource(class TBuf<256> &)
+    ?GetCurrentTarget@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 74 NONAME ; public: void __thiscall CFileMan::GetCurrentTarget(class TBuf<256> &)
+    ?GetDir@RFs@@QBEHABVTDesC16@@ABVTUidType@@IAAPAVCDir@@@Z @ 75 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,class TUidType const &,unsigned int,class CDir * &)const 
+    ?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@1@Z @ 76 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &,class CDir * &)const 
+    ?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@@Z @ 77 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &)const 
+    ?GetDriveName@RFs@@QBEHHAAVTDes16@@@Z @ 78 NONAME ; public: int __thiscall RFs::GetDriveName(int,class TDes16 &)const 
+    ?GetLastError@CFileBase@@QAEHXZ @ 79 NONAME ; public: int __thiscall CFileBase::GetLastError(void)
+    ?GetLongName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 80 NONAME ; public: int __thiscall RFs::GetLongName(class TDesC16 const &,class TDes16 &)const 
+    ?GetMoreInfoAboutError@CFileBase@@QAE?AW4TFileManError@@XZ @ 81 NONAME ; public: enum TFileManError  __thiscall CFileBase::GetMoreInfoAboutError(void)
+    ?GetNotifyUser@RFs@@QAEHXZ @ 82 NONAME ; public: int __thiscall RFs::GetNotifyUser(void)
+    ?GetShortName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 83 NONAME ; public: int __thiscall RFs::GetShortName(class TDesC16 const &,class TDes16 &)const 
+    ?IsArchive@TEntry@@QBEHXZ @ 84 NONAME ; public: int __thiscall TEntry::IsArchive(void)const 
+    ?IsDir@TEntry@@QBEHXZ @ 85 NONAME ; public: int __thiscall TEntry::IsDir(void)const 
+    ?IsExtWild@TParseBase@@QBEHXZ @ 86 NONAME ; public: int __thiscall TParseBase::IsExtWild(void)const 
+    ?IsFileInRom@RFs@@QBEPAEABVTDesC16@@@Z @ 87 NONAME ; public: unsigned char * __thiscall RFs::IsFileInRom(class TDesC16 const &)const 
+    ?IsFileOpen@RFs@@QBEHABVTDesC16@@AAH@Z @ 88 NONAME ; public: int __thiscall RFs::IsFileOpen(class TDesC16 const &,int &)const 
+    ?IsHidden@TEntry@@QBEHXZ @ 89 NONAME ; public: int __thiscall TEntry::IsHidden(void)const 
+    ?IsKMatchAny@TParseBase@@QBEHXZ @ 90 NONAME ; public: int __thiscall TParseBase::IsKMatchAny(void)const 
+    ?IsKMatchOne@TParseBase@@QBEHXZ @ 91 NONAME ; public: int __thiscall TParseBase::IsKMatchOne(void)const 
+    ?IsNameWild@TParseBase@@QBEHXZ @ 92 NONAME ; public: int __thiscall TParseBase::IsNameWild(void)const 
+    ?IsReadOnly@TEntry@@QBEHXZ @ 93 NONAME ; public: int __thiscall TEntry::IsReadOnly(void)const 
+    ?IsRomAddress@RFs@@SAHPAX@Z @ 94 NONAME ; public: static int __cdecl RFs::IsRomAddress(void *)
+    ?IsRoot@TParseBase@@QBEHXZ @ 95 NONAME ; public: int __thiscall TParseBase::IsRoot(void)const 
+    ?IsSystem@TEntry@@QBEHXZ @ 96 NONAME ; public: int __thiscall TEntry::IsSystem(void)const 
+    ?IsValidDrive@RFs@@SAHH@Z @ 97 NONAME ; public: static int __cdecl RFs::IsValidDrive(int)
+    ?IsValidName@RFs@@QBEHABVTDesC16@@@Z @ 98 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &)const 
+    ?IsValidName@RFs@@QBEHABVTDesC16@@AAG@Z @ 99 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,unsigned short &)const 
+    ?IsWild@TParseBase@@QBEHXZ @ 100 NONAME ; public: int __thiscall TParseBase::IsWild(void)const 
+    ?LoaderHeapFunction@RFs@@QAEHHPAX0@Z @ 101 NONAME ; public: int __thiscall RFs::LoaderHeapFunction(int,void *,void *)
+    ?Lock@RFile@@QBEHHH@Z @ 102 NONAME ; public: int __thiscall RFile::Lock(int,int)const 
+    ?LockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@0H@Z @ 103 NONAME ; public: int __thiscall RFs::LockDrive(int,class TBuf8<16> const &,class TBuf8<16> const &,int)
+    ?MkDir@RFs@@QAEHABVTDesC16@@@Z @ 104 NONAME ; public: int __thiscall RFs::MkDir(class TDesC16 const &)
+    ?MkDirAll@RFs@@QAEHABVTDesC16@@@Z @ 105 NONAME ; public: int __thiscall RFs::MkDirAll(class TDesC16 const &)
+    ?Modified@RFile@@QBEHAAVTTime@@@Z @ 106 NONAME ; public: int __thiscall RFile::Modified(class TTime &)const 
+    ?Modified@RFs@@QBEHABVTDesC16@@AAVTTime@@@Z @ 107 NONAME ; public: int __thiscall RFs::Modified(class TDesC16 const &,class TTime &)const 
+    ?MountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 108 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int)const 
+    ?Move@CFileMan@@QAEHABVTDesC16@@0I@Z @ 109 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int)
+    ?Move@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 110 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+    ?Name@TDriveUnit@@QBE?AV?$TBuf@$01@@XZ @ 111 NONAME ; public: class TBuf<2>  __thiscall TDriveUnit::Name(void)const 
+    ?Name@TParseBase@@QBE?AVTPtrC16@@XZ @ 112 NONAME ; public: class TPtrC16  __thiscall TParseBase::Name(void)const 
+    ?NameAndExt@TParseBase@@QBE?AVTPtrC16@@XZ @ 113 NONAME ; public: class TPtrC16  __thiscall TParseBase::NameAndExt(void)const 
+    ?NameBuf@TParse@@MAEAAVTDes16@@XZ @ 114 NONAME ; protected: virtual class TDes16 & __thiscall TParse::NameBuf(void)
+    ?NameBuf@TParsePtr@@MAEAAVTDes16@@XZ @ 115 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtr::NameBuf(void)
+    ?NameBuf@TParsePtrC@@MAEAAVTDes16@@XZ @ 116 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtrC::NameBuf(void)
+    ?NameBufC@TParse@@MBEABVTDesC16@@XZ @ 117 NONAME ; protected: virtual class TDesC16 const & __thiscall TParse::NameBufC(void)const 
+    ?NameBufC@TParsePtr@@MBEABVTDesC16@@XZ @ 118 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtr::NameBufC(void)const 
+    ?NameBufC@TParsePtrC@@MBEABVTDesC16@@XZ @ 119 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtrC::NameBufC(void)const 
+    ?NameOrExtPresent@TParseBase@@QBEHXZ @ 120 NONAME ; public: int __thiscall TParseBase::NameOrExtPresent(void)const 
+    ?NamePresent@TParseBase@@QBEHXZ @ 121 NONAME ; public: int __thiscall TParseBase::NamePresent(void)const 
+    ?NewL@CDir@@KAPAV1@XZ @ 122 NONAME ; protected: static class CDir * __cdecl CDir::NewL(void)
+    ?NewL@CDirScan@@SAPAV1@AAVRFs@@@Z @ 123 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewL(class RFs &)
+    ?NewL@CFileMan@@SAPAV1@AAVRFs@@@Z @ 124 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &)
+    ?NewL@CFileMan@@SAPAV1@AAVRFs@@PAVMFileManObserver@@@Z @ 125 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &,class MFileManObserver *)
+    ?NewLC@CDirScan@@SAPAV1@AAVRFs@@@Z @ 126 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewLC(class RFs &)
+    ?Next@RFormat@@QAEHAAH@Z @ 127 NONAME ; public: int __thiscall RFormat::Next(int &)
+    ?Next@RFormat@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 128 NONAME ; public: void __thiscall RFormat::Next(class TPckgBuf<int> &,class TRequestStatus &)
+    ?NextL@CDirScan@@QAEXAAPAVCDir@@@Z @ 129 NONAME ; public: void __thiscall CDirScan::NextL(class CDir * &)
+    ?NextL@TOpenFileScan@@QAEXAAPAVCDir@@@Z @ 130 NONAME ; public: void __thiscall TOpenFileScan::NextL(class CDir * &)
+    ?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@@Z @ 131 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &)
+    ?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@ABVTDesC16@@@Z @ 132 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &,class TDesC16 const &)
+    ?NotifyChangeCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 133 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(class TRequestStatus &)
+    ?NotifyChangeCancel@RFs@@QAEXXZ @ 134 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(void)
+    ?NotifyFileManEnded@MFileManObserver@@UAE?AW4TControl@1@XZ @ 135 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManEnded(void)
+    ?NotifyFileManOperation@MFileManObserver@@UAE?AW4TControl@1@XZ @ 136 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManOperation(void)
+    ?NotifyFileManStarted@MFileManObserver@@UAE?AW4TControl@1@XZ @ 137 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManStarted(void)
+    ?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@ABVTUidType@@@Z @ 138 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,class TUidType const &)
+    ?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 139 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,unsigned int)
+    ?Open@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 140 NONAME ; public: int __thiscall RFile::Open(class RFs &,class TDesC16 const &,unsigned int)
+    ?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAH@Z @ 141 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &)
+    ?Open@RRawDisk@@QAEHAAVRFs@@H@Z @ 142 NONAME ; public: int __thiscall RRawDisk::Open(class RFs &,int)
+    ?Parse@RFs@@QBEHABVTDesC16@@0AAVTParse@@@Z @ 143 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TDesC16 const &,class TParse &)const 
+    ?Parse@RFs@@QBEHABVTDesC16@@AAVTParse@@@Z @ 144 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TParse &)const 
+    ?Path@TParseBase@@QBE?AVTPtrC16@@XZ @ 145 NONAME ; public: class TPtrC16  __thiscall TParseBase::Path(void)const 
+    ?PathPresent@TParseBase@@QBEHXZ @ 146 NONAME ; public: int __thiscall TParseBase::PathPresent(void)const 
+    ?PopDir@TParseBase@@QAEHXZ @ 147 NONAME ; public: int __thiscall TParseBase::PopDir(void)
+    ?Read@RDir@@QBEHAAVTEntry@@@Z @ 148 NONAME ; public: int __thiscall RDir::Read(class TEntry &)const 
+    ?Read@RDir@@QBEHAAVTEntryArray@@@Z @ 149 NONAME ; public: int __thiscall RDir::Read(class TEntryArray &)const 
+    ?Read@RDir@@QBEXAAV?$TPckg@VTEntry@@@@AAVTRequestStatus@@@Z @ 150 NONAME ; public: void __thiscall RDir::Read(class TPckg<class TEntry> &,class TRequestStatus &)const 
+    ?Read@RDir@@QBEXAAVTEntryArray@@AAVTRequestStatus@@@Z @ 151 NONAME ; public: void __thiscall RDir::Read(class TEntryArray &,class TRequestStatus &)const 
+    ?Read@RFile@@QBEHAAVTDes8@@@Z @ 152 NONAME ; public: int __thiscall RFile::Read(class TDes8 &)const 
+    ?Read@RFile@@QBEHAAVTDes8@@H@Z @ 153 NONAME ; public: int __thiscall RFile::Read(class TDes8 &,int)const 
+    ?Read@RFile@@QBEHHAAVTDes8@@@Z @ 154 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &)const 
+    ?Read@RFile@@QBEHHAAVTDes8@@H@Z @ 155 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &,int)const 
+    ?Read@RFile@@QBEXAAVTDes8@@AAVTRequestStatus@@@Z @ 156 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,class TRequestStatus &)const 
+    ?Read@RFile@@QBEXAAVTDes8@@HAAVTRequestStatus@@@Z @ 157 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,int,class TRequestStatus &)const 
+    ?Read@RFile@@QBEXHAAVTDes8@@AAVTRequestStatus@@@Z @ 158 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,class TRequestStatus &)const 
+    ?Read@RFile@@QBEXHAAVTDes8@@HAAVTRequestStatus@@@Z @ 159 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,int,class TRequestStatus &)const 
+    ?Read@_RRawDisk@@QAEHHAAVTDes8@@@Z @ 160 NONAME ; public: int __thiscall _RRawDisk::Read(int,class TDes8 &)
+    ?Read@TFileText@@QAEHAAVTDes16@@@Z @ 161 NONAME ; public: int __thiscall TFileText::Read(class TDes16 &)
+    ?ReadFileSection_RESERVED@RFs@@ABEHABVTDesC16@@HAAVTDes8@@H@Z @ 162 NONAME ; public: int __thiscall RFs::ReadFileSection_RESERVED(class TDesC16 const &,int,class TDes8 &,int)const 
+    ?RealName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 163 NONAME ; public: int __thiscall RFs::RealName(class TDesC16 const &,class TDes16 &)const 
+    ?RemoveFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 164 NONAME ; public: int __thiscall RFs::RemoveFileSystem(class TDesC16 const &)const 
+    ?Rename@CFileMan@@QAEHABVTDesC16@@0I@Z @ 165 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int)
+    ?Rename@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 166 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+    ?Rename@RFile@@QAEHABVTDesC16@@@Z @ 167 NONAME ; public: int __thiscall RFile::Rename(class TDesC16 const &)
+    ?Rename@RFs@@QAEHABVTDesC16@@0@Z @ 168 NONAME ; public: int __thiscall RFs::Rename(class TDesC16 const &,class TDesC16 const &)
+    ?Replace@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 169 NONAME ; public: int __thiscall RFile::Replace(class RFs &,class TDesC16 const &,unsigned int)
+    ?Replace@RFs@@QAEHABVTDesC16@@0@Z @ 170 NONAME ; public: int __thiscall RFs::Replace(class TDesC16 const &,class TDesC16 const &)
+    ?ResourceCount@RFs@@QBEHXZ @ 171 NONAME ; public: int __thiscall RFs::ResourceCount(void)const 
+    ?ResourceCountMarkEnd@RFs@@QBEXXZ @ 172 NONAME ; public: void __thiscall RFs::ResourceCountMarkEnd(void)const 
+    ?ResourceCountMarkStart@RFs@@QBEXXZ @ 173 NONAME ; public: void __thiscall RFs::ResourceCountMarkStart(void)const 
+    ?RmDir@CFileMan@@QAEHABVTDesC16@@@Z @ 174 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &)
+    ?RmDir@CFileMan@@QAEHABVTDesC16@@AAVTRequestStatus@@@Z @ 175 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &,class TRequestStatus &)
+    ?RmDir@RFs@@QAEHABVTDesC16@@@Z @ 176 NONAME ; public: int __thiscall RFs::RmDir(class TDesC16 const &)
+    ?RunInSeparateThreadL@CFileBase@@IAEXP6AHPAX@Z@Z @ 177 NONAME ; protected: void __thiscall CFileBase::RunInSeparateThreadL(int (__cdecl*)(void *))
+    ?RunL@CFileBase@@IAEXXZ @ 178 NONAME ; protected: void __thiscall CFileBase::RunL(void)
+    ?ScanDrive@RFs@@QBEHABVTDesC16@@@Z @ 179 NONAME ; public: int __thiscall RFs::ScanDrive(class TDesC16 const &)const 
+    ?Seek@RFile@@QBEHW4TSeek@@AAH@Z @ 180 NONAME ; public: int __thiscall RFile::Seek(enum TSeek,int &)const 
+    ?Seek@TFileText@@QAEHW4TSeek@@@Z @ 181 NONAME ; public: int __thiscall TFileText::Seek(enum TSeek)
+    ?SessionPath@RFs@@QBEHAAVTDes16@@@Z @ 182 NONAME ; public: int __thiscall RFs::SessionPath(class TDes16 &)const 
+    ?Set@RFile@@QAEHABVTTime@@II@Z @ 183 NONAME ; public: int __thiscall RFile::Set(class TTime const &,unsigned int,unsigned int)
+    ?Set@TFileText@@QAEXAAVRFile@@@Z @ 184 NONAME ; public: void __thiscall TFileText::Set(class RFile &)
+    ?Set@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 185 NONAME ; public: int __thiscall TParse::Set(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
+    ?SetAllocFailure@RFs@@QAEHH@Z @ 186 NONAME ; public: int __thiscall RFs::SetAllocFailure(int)
+    ?SetAtt@RFile@@QAEHII@Z @ 187 NONAME ; public: int __thiscall RFile::SetAtt(unsigned int,unsigned int)
+    ?SetAtt@RFs@@QAEHABVTDesC16@@II@Z @ 188 NONAME ; public: int __thiscall RFs::SetAtt(class TDesC16 const &,unsigned int,unsigned int)
+    ?SetDebugRegister@RFs@@QAEHH@Z @ 189 NONAME ; public: int __thiscall RFs::SetDebugRegister(int)
+    ?SetDefaultPath@RFs@@QAEHABVTDesC16@@@Z @ 190 NONAME ; public: int __thiscall RFs::SetDefaultPath(class TDesC16 const &)
+    ?SetDriveName@RFs@@QAEHHABVTDesC16@@@Z @ 191 NONAME ; public: int __thiscall RFs::SetDriveName(int,class TDesC16 const &)
+    ?SetEntry@RFs@@QAEHABVTDesC16@@ABVTTime@@II@Z @ 192 NONAME ; public: int __thiscall RFs::SetEntry(class TDesC16 const &,class TTime const &,unsigned int,unsigned int)
+    ?SetErrorCondition@RFs@@QAEHHH@Z @ 193 NONAME ; public: int __thiscall RFs::SetErrorCondition(int,int)
+    ?SetModified@RFile@@QAEHABVTTime@@@Z @ 194 NONAME ; public: int __thiscall RFile::SetModified(class TTime const &)
+    ?SetModified@RFs@@QAEHABVTDesC16@@ABVTTime@@@Z @ 195 NONAME ; public: int __thiscall RFs::SetModified(class TDesC16 const &,class TTime const &)
+    ?SetNoWild@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 196 NONAME ; public: int __thiscall TParse::SetNoWild(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
+    ?SetNotifyUser@RFs@@QAEXH@Z @ 197 NONAME ; public: void __thiscall RFs::SetNotifyUser(int)
+    ?SetObserver@CFileBase@@QAEXPAVMFileManObserver@@@Z @ 198 NONAME ; public: void __thiscall CFileBase::SetObserver(class MFileManObserver *)
+    ?SetScanDataL@CDirScan@@QAEXABVTDesC16@@IIW4TScanDirection@1@@Z @ 199 NONAME ; public: void __thiscall CDirScan::SetScanDataL(class TDesC16 const &,unsigned int,unsigned int,enum CDirScan::TScanDirection)
+    ?SetSessionPath@RFs@@QAEHABVTDesC16@@@Z @ 200 NONAME ; public: int __thiscall RFs::SetSessionPath(class TDesC16 const &)
+    ?SetSize@RFile@@QAEHH@Z @ 201 NONAME ; public: int __thiscall RFile::SetSize(int)
+    ?SetSubst@RFs@@QAEHABVTDesC16@@H@Z @ 202 NONAME ; public: int __thiscall RFs::SetSubst(class TDesC16 const &,int)
+    ?SetVolumeLabel@RFs@@QAEHABVTDesC16@@H@Z @ 203 NONAME ; public: int __thiscall RFs::SetVolumeLabel(class TDesC16 const &,int)
+    ?Size@RFile@@QBEHAAH@Z @ 204 NONAME ; public: int __thiscall RFile::Size(int &)const 
+    ?Sort@CDir@@QAEHI@Z @ 205 NONAME ; public: int __thiscall CDir::Sort(unsigned int)
+    ?Subst@RFs@@QBEHAAVTDes16@@H@Z @ 206 NONAME ; public: int __thiscall RFs::Subst(class TDes16 &,int)const 
+    ?Temp@RFile@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 207 NONAME ; public: int __thiscall RFile::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
+    ?ThreadId@TOpenFileScan@@QBE?AVTThreadId@@XZ @ 208 NONAME ; public: class TThreadId  __thiscall TOpenFileScan::ThreadId(void)const 
+    ?UnLock@RFile@@QBEHHH@Z @ 209 NONAME ; public: int __thiscall RFile::UnLock(int,int)const 
+    ?UnlockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@H@Z @ 210 NONAME ; public: int __thiscall RFs::UnlockDrive(int,class TBuf8<16> const &,int)
+    ?Version@RFs@@QBE?AVTVersion@@XZ @ 211 NONAME ; public: class TVersion  __thiscall RFs::Version(void)const 
+    ?Volume@RFs@@QBEHAAVTVolumeInfo@@H@Z @ 212 NONAME ; public: int __thiscall RFs::Volume(class TVolumeInfo &,int)const 
+    ?Write@RFile@@QAEHABVTDesC8@@@Z @ 213 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &)
+    ?Write@RFile@@QAEHABVTDesC8@@H@Z @ 214 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &,int)
+    ?Write@RFile@@QAEHHABVTDesC8@@@Z @ 215 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &)
+    ?Write@RFile@@QAEHHABVTDesC8@@H@Z @ 216 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &,int)
+    ?Write@RFile@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 217 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,class TRequestStatus &)
+    ?Write@RFile@@QAEXABVTDesC8@@HAAVTRequestStatus@@@Z @ 218 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,int,class TRequestStatus &)
+    ?Write@RFile@@QAEXHABVTDesC8@@AAVTRequestStatus@@@Z @ 219 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,class TRequestStatus &)
+    ?Write@RFile@@QAEXHABVTDesC8@@HAAVTRequestStatus@@@Z @ 220 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,int,class TRequestStatus &)
+    ?Write@_RRawDisk@@QAEHHAAVTDesC8@@@Z @ 221 NONAME ; public: int __thiscall _RRawDisk::Write(int,class TDesC8 &)
+    ?Write@TFileText@@QAEHABVTDesC16@@@Z @ 222 NONAME ; public: int __thiscall TFileText::Write(class TDesC16 const &)
+    ?DebugNotify@RFs@@QAEXHIAAVTRequestStatus@@@Z @ 223 NONAME ; public: void __thiscall RFs::DebugNotify(int,unsigned int,class TRequestStatus &)
+    ?NotifyDiskSpace@RFs@@QAEX_JHAAVTRequestStatus@@@Z @ 224 NONAME ; public: void __thiscall RFs::NotifyDiskSpace(__int64,int,class TRequestStatus &)
+    ?NotifyDiskSpaceCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 225 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(class TRequestStatus &)
+    ?NotifyDiskSpaceCancel@RFs@@QAEXXZ @ 226 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(void)
+    ??0TEntry@@QAE@ABV0@@Z @ 227 NONAME ; public: __thiscall TEntry::TEntry(class TEntry const &)
+    ??0TEntry@@QAE@XZ @ 228 NONAME ; public: __thiscall TEntry::TEntry(void)
+    ??4TEntry@@QAEAAV0@ABV0@@Z @ 229 NONAME ; public: class TEntry & __thiscall TEntry::operator=(class TEntry const &)
+    ??0TParse@@QAE@XZ @ 230 NONAME ; public: __thiscall TParse::TParse(void)
+    ?Drive@RFile@@QBEHAAHAAVTDriveInfo@@@Z @ 231 NONAME ; public: int __thiscall RFile::Drive(int &,class TDriveInfo &)const 
+    ?RemountDrive@RFs@@QAEHHPBVTDesC8@@I@Z @ 232 NONAME ; public: int __thiscall RFs::RemountDrive(int,class TDesC8 const *,unsigned int)
+    ?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@HAAH@Z @ 233 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,int,int &)const 
+    ?CreatePrivatePath@RFs@@QAEHH@Z @ 234 NONAME ; public: int __thiscall RFs::CreatePrivatePath(int)
+    ?PrivatePath@RFs@@QAEHAAVTDes16@@@Z @ 235 NONAME ; public: int __thiscall RFs::PrivatePath(class TDes16 &)
+    ?SetSessionToPrivate@RFs@@QAEHH@Z @ 236 NONAME ; public: int __thiscall RFs::SetSessionToPrivate(int)
+    ?FileNamesIdentical@@YAHABVTDesC16@@0@Z @ 237 NONAME ; int __cdecl FileNamesIdentical(class TDesC16 const &,class TDesC16 const &)
+    ?AddExtension@RFs@@QAEHABVTDesC16@@@Z @ 238 NONAME ; public: int __thiscall RFs::AddExtension(class TDesC16 const &)
+    ?DismountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 239 NONAME ; public: int __thiscall RFs::DismountExtension(class TDesC16 const &,int)
+    ?ExtensionName@RFs@@QAEHAAVTDes16@@HH@Z @ 240 NONAME ; public: int __thiscall RFs::ExtensionName(class TDes16 &,int,int)
+    ?MountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 241 NONAME ; public: int __thiscall RFs::MountExtension(class TDesC16 const &,int)
+    ?MountFileSystem@RFs@@QAEHABVTDesC16@@0H@Z @ 242 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int)
+    ?RemoveExtension@RFs@@QAEHABVTDesC16@@@Z @ 243 NONAME ; public: int __thiscall RFs::RemoveExtension(class TDesC16 const &)
+    ?StartupInitComplete@RFs@@QAEXAAVTRequestStatus@@@Z @ 244 NONAME ; public: void __thiscall RFs::StartupInitComplete(class TRequestStatus &)
+    ?SetLocalDriveMapping@RFs@@QAEHABVTDesC8@@@Z @ 245 NONAME ; public: int __thiscall RFs::SetLocalDriveMapping(class TDesC8 const &)
+    ?ControlIo@RFs@@QAEHHH@Z @ 246 NONAME ; public: int __thiscall RFs::ControlIo(int,int)
+    ?ControlIo@RFs@@QAEHHHAAVTDes8@@@Z @ 247 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&)   ?Adopt@RFile@@QAEHAAVRFs@@AAH@Z @ 246 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int &)
+    ?ControlIo@RFs@@QAEHHHAAVTDes8@@0@Z @ 248 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&,class TDes8&)
+    ?Adopt@RFile@@QAEHAAVRFs@@H@Z @ 249 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int)
+    ?MountFileSystem@RFs@@QAEHABVTDesC16@@0HH@Z @ 250 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int,int)
+    ?MountFileSystem@RFs@@QBEHABVTDesC16@@HH@Z @ 251 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int,int)const 
+    ?Read@RRawDisk@@QAEH_JAAVTDes8@@@Z @ 252 NONAME ; public: int __thiscall RRawDisk::Read(__int64,class TDes8 &)
+    ?Write@RRawDisk@@QAEH_JAAVTDesC8@@@Z @ 253 NONAME ; public: int __thiscall RRawDisk::Write(__int64,class TDesC8 &)
+    ?FinaliseDrives@RFs@@QAEHXZ @ 254 NONAME ; public: int __thiscall RFs::FinaliseDrives(void)
+    ?SwapFileSystem@RFs@@QBEHABVTDesC16@@0H@Z @ 255 NONAME ; public: int __thiscall RFs::SwapFileSystem(class TDesC16 const &,class TDesC16 const &,int)const 
+    ?ErasePassword@RFs@@QAEHH@Z @ 256 NONAME ; public: int __thiscall RFs::ErasePassword(int)
+    ?GetReserveAccess@RFs@@QAEHH@Z @ 257 NONAME ; public: int __thiscall RFs::GetReserveAccess(int)
+    ?ReleaseReserveAccess@RFs@@QAEHH@Z @ 258 NONAME ; public: int __thiscall RFs::ReleaseReserveAccess(int)
+    ?ReserveDriveSpace@RFs@@QAEHHH@Z @ 259 NONAME ; public: int __thiscall RFs::ReserveDriveSpace(int,int)
+    ?AdoptFromClient@RFile@@QAEHABVRMessage2@@HH@Z @ 260 NONAME ; public: int __thiscall RFile::AdoptFromClient(class RMessage2 const &,int,int)
+    ?AdoptFromCreator@RFile@@QAEHHH@Z @ 261 NONAME ; public: int __thiscall RFile::AdoptFromCreator(int,int)
+    ?AdoptFromServer@RFile@@QAEHHH@Z @ 262 NONAME ; public: int __thiscall RFile::AdoptFromServer(int,int)
+    ?TransferToClient@RFile@@QBEHABVRMessage2@@H@Z @ 263 NONAME ; public: int __thiscall RFile::TransferToClient(class RMessage2 const &,int)const 
+    ?TransferToProcess@RFile@@QBEHAAVRProcess@@HH@Z @ 264 NONAME ; public: int __thiscall RFile::TransferToProcess(class RProcess &,int,int)const 
+    ?TransferToServer@RFile@@QBEHAAVTIpcArgs@@HH@Z @ 265 NONAME ; public: int __thiscall RFile::TransferToServer(class TIpcArgs &,int,int)const 
+    ?Name@RFile@@QBEHAAVTDes16@@@Z @ 266 NONAME ; public: int __thiscall RFile::Name(class TDes16 &)const 
+    ?Close@RDir@@QAEXXZ @ 267 NONAME ; public: void __thiscall RDir::Close(void)
+    ?Close@RFile@@QAEXXZ @ 268 NONAME ; public: void __thiscall RFile::Close(void)
+    ?Close@RFormat@@QAEXXZ @ 269 NONAME ; public: void __thiscall RFormat::Close(void)
+    ?GetMediaSerialNumber@RFs@@QAEHAAV?$TBuf8@$0EA@@@H@Z @ 270 NONAME ; public: int __thiscall RFs::GetMediaSerialNumber(class TBuf8<64> &,int)
+    ?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@I@Z @ 271 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int)
+    ?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@IAAVTRequestStatus@@@Z @ 272 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+    ?FullName@RFile@@QBEHAAVTDes16@@@Z @ 273 NONAME ; public: int __thiscall RFile::FullName(class TDes16 &)const 
+    ?AddPlugin@RFs@@QBEHABVTDesC16@@@Z @ 274 NONAME ; public: int __thiscall RFs::AddPlugin(class TDesC16 const &)const 
+    ?Close@RPlugin@@QAEXXZ @ 275 NONAME ; public: void __thiscall RPlugin::Close(void)
+    ?DismountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 276 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &)const 
+    ?DismountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 277 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int)const 
+    ?DismountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 278 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int,int)const 
+    ?DoCancel@RPlugin@@IBEXI@Z @ 279 NONAME ; protected: void __thiscall RPlugin::DoCancel(unsigned int)const 
+    ?DoControl@RPlugin@@IBEHH@Z @ 280 NONAME ; protected: int __thiscall RPlugin::DoControl(int)const 
+    ?DoControl@RPlugin@@IBEHHAAVTDes8@@0@Z @ 281 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &,class TDes8 &)const 
+    ?DoControl@RPlugin@@IBEHHAAVTDes8@@@Z @ 282 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &)const 
+    ?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@@Z @ 283 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &)const 
+    ?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@1@Z @ 284 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &,class TDes8 &)const 
+    ?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@@Z @ 285 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &)const 
+    ?MountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 286 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &)const 
+    ?MountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 287 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int)const 
+    ?MountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 288 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int,int)const 
+    ?Open@RPlugin@@QAEHAAVRFs@@H@Z @ 289 NONAME ; public: int __thiscall RPlugin::Open(class RFs &,int)
+    ?PluginName@RFs@@QAEHAAVTDes16@@HH@Z @ 290 NONAME ; public: int __thiscall RFs::PluginName(class TDes16 &,int,int)
+    ?RemovePlugin@RFs@@QBEHABVTDesC16@@@Z @ 291 NONAME ; public: int __thiscall RFs::RemovePlugin(class TDesC16 const &)const 
+    ?AllowDismount@RFs@@QBEHH@Z @ 292 NONAME ; public: int __thiscall RFs::AllowDismount(int)const 
+    ?NotifyDismount@RFs@@QBEXHAAVTRequestStatus@@W4TNotifyDismountMode@@@Z @ 293 NONAME ; public: void __thiscall RFs::NotifyDismount(int,class TRequestStatus &,enum TNotifyDismountMode)const 
+    ?NotifyDismountCancel@RFs@@QBEXAAVTRequestStatus@@@Z @ 294 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(class TRequestStatus &)const 
+    ?NotifyDismountCancel@RFs@@QBEXXZ @ 295 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(void)const 
+    ?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAHABVTDesC8@@@Z @ 296 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &,class TDesC8 const &)
+    ?SetStartupConfiguration@RFs@@QBEHHPAX0@Z @ 297 NONAME ; public: int __thiscall RFs::SetStartupConfiguration(int,void *,void *)const 
+    ?ReadCancel@RFile@@QBEXAAVTRequestStatus@@@Z @ 298 NONAME ; public: void __thiscall RFile::ReadCancel(class TRequestStatus &)const 
+    ?ReadCancel@RFile@@QBEXXZ @ 299 NONAME ; public: void __thiscall RFile::ReadCancel(void)const 
+    ?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@0HAAH@Z @ 300 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,class TDesC16 const &,int,int &)const 
+    ?SetNotifyChange@RFs@@QAEHH@Z @ 301 NONAME ; public: int __thiscall RFs::SetNotifyChange(int)
+    ?AddCompositeMount@RFs@@QBEHABVTDesC16@@HHH@Z @ 302 NONAME ; int RFs::AddCompositeMount(class TDesC16 const &, int, int, int) const
+    ?Flush@RFile@@QAEXAAVTRequestStatus@@@Z @ 303 NONAME ; public: void __thiscall RFile::Flush(class TRequestStatus &)
+    ?GetSystemDrive@RFs@@SA?AW4TDriveNumber@@XZ @ 304 NONAME ; public: static enum TDriveNumber  __cdecl RFs::GetSystemDrive(void)
+    ??0TBlockMapEntry@@QAE@XZ @ 305 NONAME ; public: __thiscall TBlockMapEntry::TBlockMapEntry(void)
+    ?BlockMap@RFile@@QBEHAAUSBlockMapInfo@@AA_J_JH@Z @ 306 NONAME ; public: int __thiscall RFile::BlockMap(struct SBlockMapInfo &,__int64 &,__int64,int)const 
+    ?SetNumberOfBlocks@TBlockMapEntry@@QAEXI@Z @ 307 NONAME ; public: void __thiscall TBlockMapEntry::SetNumberOfBlocks(unsigned int)
+    ?SetStartBlock@TBlockMapEntry@@QAEXI@Z @ 308 NONAME ; public: void __thiscall TBlockMapEntry::SetStartBlock(unsigned int)
+    ?Clamp@RFileClamp@@QAEHAAVRFile@@@Z @ 309 NONAME ; public: int __thiscall RFileClamp::Clamp(class RFile &)
+    ?Close@RFileClamp@@QAEHAAVRFs@@@Z @ 310 NONAME ; public: int __thiscall RFileClamp::Close(class RFs &)
+    ?FileSystemSubType@RFs@@QBEHHAAVTDes16@@@Z @ 311 NONAME ; public: int __thiscall RFs::FileSystemSubType(int,class TDes16 &)const 
+    ?InitialisePropertiesFile@RFs@@QBEHABVTPtrC8@@@Z @ 312 NONAME ; public: int __thiscall RFs::InitialisePropertiesFile(class TPtrC8 const &)const 
+    ?QueryVolumeInfoExt@RFs@@QBEHHW4TQueryVolumeInfoExtCmd@@AAVTDes8@@@Z @ 313 NONAME ; public: int __thiscall RFs::QueryVolumeInfoExt(int,enum TQueryVolumeInfoExtCmd,class TDes8 &)const 
+    ?VolumeIOParam@RFs@@QBEHHAAVTVolumeIOParamInfo@@@Z @ 314 NONAME ; public: int __thiscall RFs::VolumeIOParam(int,class TVolumeIOParamInfo &)const 
+    ?GetSystemDriveChar@RFs@@SA?AVTChar@@XZ @ 315 NONAME ; public: static class TChar  __cdecl RFs::GetSystemDriveChar(void)
+    ?SetSystemDrive@RFs@@QAEHW4TDriveNumber@@@Z @ 316 NONAME ; public: int __thiscall RFs::SetSystemDrive(enum TDriveNumber)
+    ?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@I@Z @ 317 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &,unsigned int)const 
+    ?SetFindMask@TFindFile@@QAEHI@Z @ 318 NONAME ; public: int __thiscall TFindFile::SetFindMask(unsigned int)
+    ?FinaliseDrive@RFs@@QBEHHW4TFinaliseDrvMode@1@@Z @ 319 NONAME ; public: int __thiscall RFs::FinaliseDrive(int,enum RFs::TFinaliseDrvMode)const 
+    ?Volume@RFs@@QBEXAAVTVolumeInfo@@HAAVTRequestStatus@@@Z @ 320 NONAME ; public: void __thiscall RFs::Volume(class TVolumeInfo &,int,class TRequestStatus &)const 
+    ?AddProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 321 NONAME ; public: int __thiscall RFs::AddProxyDrive(class TDesC16 const &)
+    ?Caps@RRawDisk@@QAEHAAVTDes8@@@Z @ 322 NONAME ABSENT ; public: int __thiscall RRawDisk::Caps(class TDes8 &)
+    ?DismountProxyDrive@RFs@@QAEHI@Z @ 323 NONAME ; public: int __thiscall RFs::DismountProxyDrive(unsigned int)
+    ?DoMountProxyDrive@RFs@@AAEHABVTIpcArgs@@@Z @ 324 NONAME ; private: int __thiscall RFs::DoMountProxyDrive(class TIpcArgs const &)
+    ?RemoveProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 325 NONAME ; public: int __thiscall RFs::RemoveProxyDrive(class TDesC16 const &)
+    ?ReadFileSection@RFs@@QBEHABVTDesC16@@_JAAVTDes8@@H@Z @ 326 NONAME ; public: int __thiscall RFs::ReadFileSection(class TDesC16 const &,__int64,class TDes8 &,int)const 
+    ?AdoptFromClient@RFile64@@QAEHABVRMessage2@@HH@Z @ 327 NONAME ; public: int __thiscall RFile64::AdoptFromClient(class RMessage2 const &,int,int)
+    ?AdoptFromCreator@RFile64@@QAEHHH@Z @ 328 NONAME ; public: int __thiscall RFile64::AdoptFromCreator(int,int)
+    ?AdoptFromServer@RFile64@@QAEHHH@Z @ 329 NONAME ; public: int __thiscall RFile64::AdoptFromServer(int,int)
+    ?Create@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 330 NONAME ; public: int __thiscall RFile64::Create(class RFs &,class TDesC16 const &,unsigned int)
+    ?FileSize@TEntry@@QBE_JXZ @ 331 NONAME ; public: __int64 __thiscall TEntry::FileSize(void)const 
+    ?Lock@RFile64@@QBEH_J0@Z @ 332 NONAME ; public: int __thiscall RFile64::Lock(__int64,__int64)const 
+    ?Open@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 333 NONAME ; public: int __thiscall RFile64::Open(class RFs &,class TDesC16 const &,unsigned int)
+    ?Read@RFile64@@QBEHIAAVTDes8@@@Z @ 334 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &)const 
+    ?Read@RFile64@@QBEHIAAVTDes8@@H@Z @ 335 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &,int)const 
+    ?Read@RFile64@@QBEH_JAAVTDes8@@@Z @ 336 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &)const 
+    ?Read@RFile64@@QBEH_JAAVTDes8@@H@Z @ 337 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &,int)const 
+    ?Read@RFile64@@QBEXIAAVTDes8@@AAVTRequestStatus@@@Z @ 338 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,class TRequestStatus &)const 
+    ?Read@RFile64@@QBEXIAAVTDes8@@HAAVTRequestStatus@@@Z @ 339 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,int,class TRequestStatus &)const 
+    ?Read@RFile64@@QBEX_JAAVTDes8@@AAVTRequestStatus@@@Z @ 340 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,class TRequestStatus &)const 
+    ?Read@RFile64@@QBEX_JAAVTDes8@@HAAVTRequestStatus@@@Z @ 341 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,int,class TRequestStatus &)const 
+    ?Replace@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 342 NONAME ; public: int __thiscall RFile64::Replace(class RFs &,class TDesC16 const &,unsigned int)
+    ?Seek@RFile64@@QBEHW4TSeek@@AA_J@Z @ 343 NONAME ; public: int __thiscall RFile64::Seek(enum TSeek,__int64 &)const 
+    ?SetSize@RFile64@@QAEH_J@Z @ 344 NONAME ; public: int __thiscall RFile64::SetSize(__int64)
+    ?Size@RFile64@@QBEHAA_J@Z @ 345 NONAME ; public: int __thiscall RFile64::Size(__int64 &)const 
+    ?Temp@RFile64@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 346 NONAME ; public: int __thiscall RFile64::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
+    ?UnLock@RFile64@@QBEH_J0@Z @ 347 NONAME ; public: int __thiscall RFile64::UnLock(__int64,__int64)const 
+    ?Write@RFile64@@QAEHIABVTDesC8@@@Z @ 348 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &)
+    ?Write@RFile64@@QAEHIABVTDesC8@@H@Z @ 349 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int)
+    ?Write@RFile64@@QAEH_JABVTDesC8@@@Z @ 350 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &)
+    ?Write@RFile64@@QAEH_JABVTDesC8@@H@Z @ 351 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &,int)
+    ?Write@RFile64@@QAEXIABVTDesC8@@AAVTRequestStatus@@@Z @ 352 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,class TRequestStatus &)
+    ?Write@RFile64@@QAEXIABVTDesC8@@HAAVTRequestStatus@@@Z @ 353 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int,class TRequestStatus &)
+    ?Write@RFile64@@QAEX_JABVTDesC8@@AAVTRequestStatus@@@Z @ 354 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,class TRequestStatus &)
+    ?Write@RFile64@@QAEX_JABVTDesC8@@HAAVTRequestStatus@@@Z @ 355 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,int,class TRequestStatus &)
+    ?IsValidName@RFs@@QAEHABVTDesC16@@AAVTNameValidParam@1@@Z @ 356 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,class RFs::TNameValidParam &)
+    ?Close@RFs@@QAEXXZ @ 357 NONAME ; public: void __thiscall RFs::Close(void)
+    ??1CFsNotify@@UAE@XZ @ 358 NONAME ; public: virtual __thiscall CFsNotify::~CFsNotify(void)
+    ?AddNotification@CFsNotify@@QAEHIABVTDesC16@@0@Z @ 359 NONAME ; public: int __thiscall CFsNotify::AddNotification(unsigned int,class TDesC16 const &,class TDesC16 const &)
+    ?Attributes@TFsNotification@@QBEHAAI0@Z @ 360 NONAME ; public: int __thiscall TFsNotification::Attributes(unsigned int &,unsigned int &)const 
+    ?CancelNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 361 NONAME ; public: int __thiscall CFsNotify::CancelNotifications(class TRequestStatus &)
+    ?FileSize@TFsNotification@@QBEHAA_J@Z @ 362 NONAME ; public: int __thiscall TFsNotification::FileSize(__int64 &)const 
+    ?NewL@CFsNotify@@SAPAV1@AAVRFs@@H@Z @ 363 NONAME ; public: static class CFsNotify * __cdecl CFsNotify::NewL(class RFs &,int)
+    ?NewName@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 364 NONAME ; public: int __thiscall TFsNotification::NewName(class TPtrC16 &)const 
+    ?NextNotification@CFsNotify@@QAEPBVTFsNotification@@XZ @ 365 NONAME ; public: class TFsNotification const * __thiscall CFsNotify::NextNotification(void)
+    ?NotificationType@TFsNotification@@QBE?AW4TFsNotificationType@1@XZ @ 366 NONAME ; public: enum TFsNotification::TFsNotificationType __thiscall TFsNotification::NotificationType(void)const 
+    ?Path@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 367 NONAME ; public: int __thiscall TFsNotification::Path(class TPtrC16 &)const 
+    ?RemoveNotifications@CFsNotify@@QAEHXZ @ 368 NONAME ; public: int __thiscall CFsNotify::RemoveNotifications(void)
+    ?RequestNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 369 NONAME ; public: int __thiscall CFsNotify::RequestNotifications(class TRequestStatus &)
+    ?SupportedFileSystemName@RFs@@QBEHAAVTDes16@@HH@Z @ 370 NONAME ; public: int __thiscall RFs::SupportedFileSystemName(class TDes16 &,int,int)const 
+	??1CFsMountHelper@@UAE@XZ @ 371 NONAME ; public: virtual __thiscall CFsMountHelper::~CFsMountHelper(void)
 	?DismountFileSystem@CFsMountHelper@@QBEHXZ @ 372 NONAME ; public: int __thiscall CFsMountHelper::DismountFileSystem(void)const 
 	?DismountFileSystem@CFsMountHelper@@QBEXAAVTRequestStatus@@W4TFsDismountMode@1@@Z @ 373 NONAME ; public: void __thiscall CFsMountHelper::DismountFileSystem(class TRequestStatus &,enum CFsMountHelper::TFsDismountMode)const 
 	?GetMountProperties@CFsMountHelper@@QAEHXZ @ 374 NONAME ; public: int __thiscall CFsMountHelper::GetMountProperties(void)
--- a/userlibandfileserver/fileserver/eabi/efsrvu.def	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/eabi/efsrvu.def	Mon Oct 04 12:03:52 2010 +0100
@@ -412,8 +412,10 @@
 	_ZNK3RFs23SupportedFileSystemNameER6TDes16ii @ 411 NONAME
 	_ZN14CFsMountHelper18GetMountPropertiesEv @ 412 NONAME
 	_ZN14CFsMountHelper3NewER3RFsi @ 413 NONAME
-	_ZN14CFsMountHelper5CloseEv @ 414 NONAME
-	_ZNK14CFsMountHelper15MountFileSystemEv @ 415 NONAME
-	_ZNK14CFsMountHelper18DismountFileSystemER14TRequestStatusNS_15TFsDismountModeE @ 416 NONAME
-	_ZNK14CFsMountHelper18DismountFileSystemEv @ 417 NONAME
+	_ZN14CFsMountHelperD0Ev @ 414 NONAME
+	_ZN14CFsMountHelperD1Ev @ 415 NONAME
+	_ZN14CFsMountHelperD2Ev @ 416 NONAME
+	_ZNK14CFsMountHelper15MountFileSystemEv @ 417 NONAME
+	_ZNK14CFsMountHelper18DismountFileSystemER14TRequestStatusNS_15TFsDismountModeE @ 418 NONAME
+	_ZNK14CFsMountHelper18DismountFileSystemEv @ 419 NONAME
 
--- a/userlibandfileserver/fileserver/etshell/ts_com.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/etshell/ts_com.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -31,6 +31,13 @@
 #include <nkern/nk_trace.h>
 #include "filesystem_fat.h"
 
+#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+    #define	RFILE   RFile64
+#else
+    #define	RFILE	RFile
+#endif
+
+
 _LIT(KCrNl, "\r\n");
 _LIT(KNl, "\n");
 
@@ -42,6 +49,7 @@
 //	lint -e40,e30
 const TShellCommand CShell::iCommand[ENoShellCommands]=
 	{
+//	TShellCommand(_L("BLANK"),_L("Help"),_L("-?"),TShellCommand::EDSwitch,ShellFunction::BLANK),
 	TShellCommand(_L("ATTRIB"),_L("Displays or changes file attributes"),_L("[drive:][path][filename] [+R | -R] [+H |-H] [+S | -S] [+A | -A] [/p]\n\n  /p - Pause after each screen of information"), TShellCommand::EPSwitch, ShellFunction::Attrib),
 	TShellCommand(_L("CD"),_L("Change the current directory for a drive"),_L("[path] [/d]\n\n  /d - Change drive"),TShellCommand::EDSwitch,ShellFunction::Cd),
 	TShellCommand(_L("CHKDEPS"),_L("Check the dependencies of an executable or a Dll (ARM only)"),_L("[Filename.EXE] or [Filename.DLL]"),0,ShellFunction::ChkDeps),
@@ -49,6 +57,7 @@
 	TShellCommand(_L("COPY"),_L("Copy one (or more) file(s), overwriting existing one(s)"),_L("source [destination]"),TShellCommand::ESSwitch,ShellFunction::Copy),
 	TShellCommand(_L("DEL"),_L("Delete one file"),_L("[drive:][path][filename]"),TShellCommand::ESSwitch,ShellFunction::Del),
 	TShellCommand(_L("DIR"),_L("Show directory contents"),_L("[drive:][path][filename] [/p][/w]\n\n  /p - Pause after each screen of information\n  /w - Wide format"),TShellCommand::EPSwitch|TShellCommand::EWSwitch|TShellCommand::EASwitch,ShellFunction::Dir),
+//	TShellCommand(_L("EDLIN"),_L("Edit a text file"),_L("[drive:][path][filename] [/p]\n\n  /p - Pause after each screen of information"),TShellCommand::EPSwitch,ShellFunction::Edit),
     TShellCommand(_L("FORMAT"),_L("Format a disk"),ptrFormatHelp,TShellCommand::EQSwitch|TShellCommand::ESSwitch|TShellCommand::EESwitch|TShellCommand::EFSwitch,ShellFunction::Format),
     TShellCommand(_L("GOBBLE"),_L("Create a file"),_L("[filename] size [/e]\n\n /e - create an empty file, without writing any data"),TShellCommand::EESwitch,ShellFunction::Gobble),
 	TShellCommand(_L("HEXDUMP"),_L("Display the contents of a file in hexadecimal"),_L("[drive:][path][filename] [/p]\n\n  /p - Pause after each screen of information\n\n  Hit escape to exit from hexdump "),TShellCommand::EPSwitch,ShellFunction::Hexdump),
@@ -257,7 +266,7 @@
 			aPath.Insert(0,TheShell->currentPath.Left(2));
 		}
 
-	RFile64 file;
+	RFILE file;
 	r=file.Open(CShell::TheFs,aPath,EFileStream);
 	if (r!=KErrNone)	//		File could not be opened
 		{
@@ -749,7 +758,7 @@
 	ShellFunction::StripQuotes(aPath);
 
 	RDir    dir;
-	RFile64 file;
+	RFILE file;
 	TParse dirParse;
 //	Parses the given path to give a full path
 	GetFullPath(aPath,dirParse);
@@ -857,7 +866,7 @@
 	GetFullPath(aPath,dirParse);
 	aPath=dirParse.FullName();
 
-	RFile64 file;
+	RFILE file;
 	if (aPath[aPath.Length()-1]==KPathDelimiter)
 		aPath.Append('*');
 	else if( (aPath.Locate(KMatchAny)==KErrNotFound) && (aPath.Locate(KMatchOne)==KErrNotFound) )
@@ -2063,15 +2072,15 @@
 
 	ParsePath(aPath);
 	
-    RFile64 file;
+    RFILE file;
 	TInt r=file.Open(TheShell->TheFs,aPath,EFileStream);
 	if (r!=KErrNone)
 		return(r);
 
-		const TInt KLineLength = 16;
+	const TInt KLineLength = 16;
     TBuf<0x100> buf;
     TBuf<KLineLength> asciiBuf;
-		TBuf8<KLineLength> line;
+	TBuf8<KLineLength> line;
 
 	for (;;)
 		{
@@ -2164,7 +2173,7 @@
 
 	TParse fileName;
 	GetFullPath(aPath,fileName);
-	RFile64 file;
+	RFILE file;
 
     const TInt    KBufSize=65536; //-- buffer size for writing data
     const TUint32 K1Megabyte = 1<<20; //-- 1M, 1048576
@@ -2211,7 +2220,7 @@
 
 
     if(!(aSwitches&TShellCommand::EESwitch))
-    {//-- fill created file with random data
+    {//-- fill created file with randomn data
 
 	    while(rem)
 	    {
@@ -2284,7 +2293,7 @@
 
 	TBuf<KShellMaxCommandLine> newName;
 	TBuf<KShellMaxCommandLine> tempPath=aPath;
-	RFile64 file;
+	RFILE file;
 	TWord   word(aPath);
 
 	TInt r=word.FindNextWord(aPath);
@@ -2950,7 +2959,7 @@
 
 	TBuf<KShellMaxCommandLine> newName;
 	TBuf<KShellMaxCommandLine> tempPath=aPath;
-	RFile64 file;
+	RFILE file;
 	TWord   word(aPath);
 
 	TInt r=word.FindNextWord(aPath);
@@ -3237,7 +3246,7 @@
 TInt ShellFunction::Type(TDes& aPath,TUint aSwitches)
 	{
 	ParsePath(aPath);
-	RFile64 file;
+	RFILE file;
 	TInt r=file.Open(TheShell->TheFs,aPath,EFileStreamText|EFileShareReadersOnly);
 	if (r!=KErrNone)
 		return r;
@@ -3612,7 +3621,7 @@
 
 	TParse fileName;
 	GetFullPath(aPath,fileName);
-	RFile64 file;
+	RFILE file;
 	r=file.Open(CShell::TheFs,fileName.FullName(),EFileRead|EFileWrite);
 	if(r==KErrNotFound)
 		r=file.Create(CShell::TheFs,fileName.FullName(),EFileRead|EFileWrite);
--- a/userlibandfileserver/fileserver/group/release.txt	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/group/release.txt	Mon Oct 04 12:03:52 2010 +0100
@@ -1,3 +1,17 @@
+Version 2.00.4004
+=================
+(Made by vfebvre 24/09/2010)
+
+1.	dlyokhin
+	1.	ou1cimx1#582672 RVCT compiler behaves strangely for ~CFsMountHelper()
+
+2.	jcoppear
+	1.	ou1cimx1#587358 T_LDRCHECK fails when Setting/Clearing the Attributes of DLL File in C:\sys\bin
+
+3.	michcox
+	1.	ou1cimx1#508483 Cannot compile ts_com.cpp if 64 bit file server macro is undefined
+
+
 Version 2.00.4003
 =================
 (Made by vfebvre 21/09/2010)
--- a/userlibandfileserver/fileserver/inc/f32file.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32file.h	Mon Oct 04 12:03:52 2010 +0100
@@ -3246,10 +3246,8 @@
     {
  public:
 
-    inline ~CFsMountHelper();
-    
+    IMPORT_C ~CFsMountHelper();
     IMPORT_C static CFsMountHelper* New(RFs& aFs, TInt aDrvNum);
-    IMPORT_C void Close();
 
     /** file system dismounting options. Used by DismountFileSystem(). RFs::NotifyDismount(), RFs::DismountFileSystem()*/
     enum TFsDismountMode
@@ -3275,6 +3273,8 @@
     CFsMountHelper(const CFsMountHelper&);
     CFsMountHelper& operator=(const CFsMountHelper&);
 
+    void Close();
+
  private:
     TFsMntHelperImpl*  ipImpl; 
     };
--- a/userlibandfileserver/fileserver/inc/f32file.inl	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32file.inl	Mon Oct 04 12:03:52 2010 +0100
@@ -283,12 +283,6 @@
 
 //-------------------------------------------------------------------------------------------------------------------
 
-CFsMountHelper::~CFsMountHelper() 
-    {
-    Close();
-    } 
-
-
 CFsMountHelper::CFsMountHelper() 
     {}; 
 
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Mon Oct 04 12:03:52 2010 +0100
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=4003;
+const TInt KF32BuildVersionNumber=4004;
 //
 #endif
--- a/userlibandfileserver/fileserver/sfsrv/cl_drive.cpp	Tue Sep 28 15:28:31 2010 +0100
+++ b/userlibandfileserver/fileserver/sfsrv/cl_drive.cpp	Mon Oct 04 12:03:52 2010 +0100
@@ -409,7 +409,15 @@
 }
 
 
-
+//-------------------------------------------------------------------
+/** 
+    Closes the object, deletes the implementation
+*/
+void CFsMountHelper::Close()
+{
+    delete ipImpl;
+    ipImpl = NULL;
+}
 
 //-------------------------------------------------------------------
 /**
@@ -439,15 +447,6 @@
     return pSelf;
 }
 
-//-------------------------------------------------------------------
-/** 
-    Closes the object, deletes the implementation
-*/
-EXPORT_C void CFsMountHelper::Close()
-{
-    delete ipImpl;
-    ipImpl = NULL;
-}
 
 
 //-------------------------------------------------------------------
@@ -511,6 +510,10 @@
 
 
 
+EXPORT_C CFsMountHelper::~CFsMountHelper() 
+    {
+    Close();
+    }