201037_07
authorhgs
Wed, 22 Sep 2010 10:53:45 +0100
changeset 271 dc268b18d709
parent 269 d57b86b1867a
child 273 6a75fa55495f
201037_07
kernel/eka/bx86gcc/ekernsmp.def
kernel/eka/debug/crashMonitor/src/scmdatasave.cpp
kernel/eka/debug/crashMonitor/src/scmmulticrashinfo.cpp
kernel/eka/drivers/hcr/hcr_pil.cpp
kernel/eka/drivers/medmmc/medmmc.cpp
kernel/eka/drivers/medmmc/mmcptn.cpp
kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp
kernel/eka/drivers/pbus/mmc/stack.cpp
kernel/eka/drivers/resmanus/d_resmanus.cpp
kernel/eka/euser/us_exec.cpp
kernel/eka/include/e32const.h
kernel/eka/include/e32uid.h
kernel/eka/include/e32ver.h
kernel/eka/include/u32std.h
kernel/eka/kernel/arm/ckernel.cia
kernel/eka/kernel/sproperty.cpp
kernel/eka/release.txt
kerneltest/e32test/active/t_asyc.cpp
kerneltest/e32test/active/t_cact.cpp
kerneltest/e32test/active/t_messge.cpp
kerneltest/e32test/buffer/d_version.cpp
kerneltest/e32test/buffer/d_version.h
kerneltest/e32test/buffer/t_graph.cpp
kerneltest/e32test/buffer/t_hashtab.cpp
kerneltest/e32test/buffer/t_lex.cpp
kerneltest/e32test/buffer/t_regn.cpp
kerneltest/e32test/buffer/t_versio.cpp
kerneltest/e32test/datetime/t_time.cpp
kerneltest/e32test/device/t_usbcsc.cpp
kerneltest/e32test/digitiser/d_kerneldigitisertest.cpp
kerneltest/e32test/digitiser/d_kerneldigitisertest.h
kerneltest/e32test/digitiser/d_ldddigitisertest.cpp
kerneltest/e32test/digitiser/d_ldddigitisertest.h
kerneltest/e32test/digitiser/d_ldddigitisertest.inl
kerneltest/e32test/digitiser/t_kerneldigitisertest.cpp
kerneltest/e32test/digitiser/t_ldddigitisertest.cpp
kerneltest/e32test/dll/t_xxver2.cpp
kerneltest/e32test/group/bld.inf
kerneltest/e32test/group/d_kerneldigitisertest.mmp
kerneltest/e32test/group/d_keyrepeat.mmp
kerneltest/e32test/group/d_version.mmp
kerneltest/e32test/group/t_console.mmp
kerneltest/e32test/group/t_kerneldigitisertest.mmp
kerneltest/e32test/group/t_keyrepeat.mmp
kerneltest/e32test/group/t_msgtxt.mmp
kerneltest/e32test/locale/t_msgtxt.cpp
kerneltest/e32test/mmu/t_chunk.cpp
kerneltest/e32test/notifier/t_textnotifier.cpp
kerneltest/e32test/prime/t_timer.cpp
kerneltest/e32test/property/t_basic.cpp
kerneltest/e32test/property/t_prop_ldd.cpp
kerneltest/e32test/secure/t_platsecconfig.cpp
kerneltest/e32test/secure/t_shal.cpp
kerneltest/e32test/secure/t_sserver.cpp
kerneltest/e32test/system/t_atomicu.cpp
kerneltest/e32test/system/t_console.cpp
kerneltest/e32test/system/t_reason2.cpp
kerneltest/e32test/thread/t_thread.cpp
kerneltest/e32test/usb/t_usb_device/configs/usbtest.testlist.vasco.bat
kerneltest/e32test/usb/t_usb_device/configs/vasco-usbtest.iby
kerneltest/e32test/usb/t_usb_device/configs/vascobm.xml
kerneltest/e32test/usb/t_usb_device/configs/vascoif0.xml
kerneltest/e32test/usb/t_usb_device/configs/vascoif0a3.xml
kerneltest/e32test/usb/t_usb_device/configs/vascoif0a3if1a2if2.xml
kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp
kerneltest/e32test/usb/t_usb_device/src/usbms.cpp
kerneltest/e32test/usb/t_usb_win/bin_distribution/t_usb_win.exe
kerneltest/e32test/usb/t_usb_win/scripts/vascotests.bat
kerneltest/e32test/usb/t_usb_win/src/Perl.cpp
kerneltest/e32test/usb/t_usb_win/src/t_usb_wintests.cpp
kerneltest/e32test/usb/t_usb_win/usbtestloop.pl
kerneltest/e32test/usb/t_usb_win/usbtestloopvasco.pl
kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h
kerneltest/e32test/usbho/t_usbdi/inc/testliterals.h
kerneltest/e32test/usbho/t_usbdi/scripts/RDeviceA.txt
kerneltest/e32test/usbho/t_usbdi/scripts/RDeviceB.txt
kerneltest/e32test/usbho/t_usbdi/scripts/RLogitechHeadset.txt
kerneltest/e32test/usbho/t_usbdi/scripts/uca.bat
kerneltest/e32test/usbho/t_usbdi/scripts/uha.bat
kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp
kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp
kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp
kerneltest/e32test/window/d_keyrepeat.cpp
kerneltest/e32test/window/d_keyrepeat.h
kerneltest/e32test/window/t_colour.cpp
kerneltest/e32test/window/t_keyrepeat.cpp
kerneltest/f32test/filesystem/automounter/t_automounter.cpp
kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp
kerneltest/f32test/server/t_fsrv.cpp
kerneltest/f32test/server/t_fsys.cpp
kerneltest/f32test/smassstorage/group/smassstorage.inf
kerneltest/f32test/smassstorage/group/t_13cases.mmp
kerneltest/f32test/smassstorage/group/t_gml_tur.mmp
kerneltest/f32test/smassstorage/group/t_ms_password.mmp
kerneltest/f32test/smassstorage/group/t_msfs.mmp
kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp
kerneltest/f32test/smassstorage/src/t_ms_password.cpp
kerneltest/f32test/smassstorage/t_13cases/inc/cusbmassstoragecontroller.h
kerneltest/f32test/smassstorage/t_13cases/inc/t_13cases_protocol.h
kerneltest/f32test/smassstorage/t_13cases/src/controller.cpp
kerneltest/f32test/smassstorage/t_13cases/src/protocol.cpp
kerneltest/f32test/smassstorage/t_13cases/src/t_13cases.cpp
userlibandfileserver/fileserver/automounter/automounter.cpp
userlibandfileserver/fileserver/automounter/automounter.h
userlibandfileserver/fileserver/bmarm/efsrvu.def
userlibandfileserver/fileserver/bwins/efsrvu.def
userlibandfileserver/fileserver/bx86/efsrvu.def
userlibandfileserver/fileserver/eabi/efsrvu.def
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/f32file.h
userlibandfileserver/fileserver/inc/f32file.inl
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/sfat32/inc/sl_std.h
userlibandfileserver/fileserver/sfat32/sl_fatmisc32.cpp
userlibandfileserver/fileserver/sfat32/sl_fmt.cpp
userlibandfileserver/fileserver/sfat32/sl_mnt.cpp
userlibandfileserver/fileserver/sfile/sf_thread.cpp
userlibandfileserver/fileserver/sfsrv/cl_cli.cpp
userlibandfileserver/fileserver/sfsrv/cl_drive.cpp
userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevice.cpp
userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp
userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp
userlibandfileserver/fileserver/smassstorage/bld.inf
userlibandfileserver/fileserver/smassstorage/cbulkonlytransport.cpp
userlibandfileserver/fileserver/smassstorage/cbulkonlytransportusbcldd.cpp
userlibandfileserver/fileserver/smassstorage/cusbmassstoragecontroller.cpp
userlibandfileserver/fileserver/smassstorage/inc/cbulkonlytransport.h
userlibandfileserver/fileserver/smassstorage/inc/cusbmassstorageserver.h
userlibandfileserver/fileserver/smassstorage/inc/massstorageutil.h
userlibandfileserver/fileserver/smassstorage/massstorageutil.cpp
userlibandfileserver/fileserver/smassstorage/smassstorage.mmh
--- a/kernel/eka/bx86gcc/ekernsmp.def	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/bx86gcc/ekernsmp.def	Wed Sep 22 10:53:45 2010 +0100
@@ -1103,5 +1103,8 @@
 	_ZN10RArrayBase12SetKeyOffsetEi @ 1102 NONAME
 	_ZN5Cache10CpuRetiresEv @ 1103 NONAME
 	_ZN5Cache13KernelRetiresEv @ 1104 NONAME
+	_ZN9TRawEvent3SetENS_5TTypeEiiih @ 1105 NONAME
 
 
+
+
--- a/kernel/eka/debug/crashMonitor/src/scmdatasave.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/debug/crashMonitor/src/scmdatasave.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -148,7 +148,7 @@
 	{	
 	LOG_CONTEXT
 	aSizeDumped = 0;
-	TUint memDumped;	
+	TUint memDumped = 0;
 	
 	TUint svSp, usrSp;
 	iMonitor->GetStackPointers(&(aThread->iNThread), svSp, usrSp );
@@ -165,7 +165,7 @@
 		TUint8* svrStackPointer = (TUint8*)svSp;
 		
 		//size of stack we are to dump
-		svrStack.iStackSize = aFullStack || (svrStackPointer == svrStart) ? svrEnd - svrStart  : svrEnd - svrStackPointer;					
+		svrStack.iStackSize = aFullStack ? svrEnd - svrStart  : svrEnd - svrStackPointer;					
 		
 		if(svrStart)
 			{
@@ -176,13 +176,13 @@
 				}
 
 			//write struct to flash
-			aSizeDumped+=svrStack.GetSize();
+			aSizeDumped += svrStack.GetSize();
 			svrStack.Serialize(*iWriter);
 			
 			//now we dump the actual stack
 			//if there is a memErr when we read, there isnt much we can do - possibly a bit in the struct to say available/not available?
 			MTRAPD(memErr, LogMemory(svrStart, svrStack.iStackSize, aThread, memDumped));
-			aSizeDumped+=memDumped;
+			aSizeDumped += memDumped;
 			
 			if(KErrNone != memErr)
 				{
@@ -192,7 +192,7 @@
 		else
 			{
 			//write the struct
-			aSizeDumped+=svrStack.GetSize();
+			aSizeDumped += svrStack.GetSize();
 			svrStack.Serialize(*iWriter);
 			}
 		}
--- a/kernel/eka/debug/crashMonitor/src/scmmulticrashinfo.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/debug/crashMonitor/src/scmmulticrashinfo.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -106,8 +106,8 @@
 		while(p)
 			{
 			SCMCrashBlockEntry* tmp = p;
+			p = p->iNext;
 			delete tmp;
-			p = p->iNext;
 			}
 		
 		iFirstBlock = iCurrentBlock = NULL;
--- a/kernel/eka/drivers/hcr/hcr_pil.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/drivers/hcr/hcr_pil.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -524,6 +524,7 @@
     if(aNum == 1)
         {
         TSettingRef sref(0,0);
+		TSettingType types[1];
         TSettingType* pTypes;
                 
         //aTypes array is optional and user may not provided it for us. So we
@@ -532,7 +533,6 @@
             {
             //If this is a null pointer then just create our own element and 
             //assign it to the pTypes pointer
-            TSettingType types[1];
             pTypes = types;
             }
         else
--- a/kernel/eka/drivers/medmmc/medmmc.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/drivers/medmmc/medmmc.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -56,7 +56,8 @@
 GLREF_C TBool CreateMBRAfterFormat(const TMMCard* aCardP);
 GLREF_C TInt BlockSize(const TMMCard* aCardP);
 GLREF_C TInt EraseBlockSize(const TMMCard* aCardP);
-GLREF_C TInt GetCardFormatInfo(const TMMCard* aCardP, TLDFormatInfo& aFormatInfo);
+extern  TInt GetCardFormatInfo(const TMMCard* aCardP, TLocalDriveCapsV5& aCaps);
+
 
 const TInt KStackNumber = 0;
 
@@ -2793,12 +2794,12 @@
 	if (iCard->IsLocked())
 		aInfo.iMediaAtt |= KMediaAttLocked;
 
-	aInfo.iFileSystemId = KDriveFileSysFAT;
+	aInfo.iFileSystemId = KDriveFileSysFAT; //-- note, it may be overridden by GetCardFormatInfo()
 
 	// Format is performed in multiples of the erase sector (or multiple block) size
 	aInfo.iMaxBytesPerFormat = iEraseInfo.iPreferredEraseUnitSize;
 
-	if ((!iInternalSlot) && (GetCardFormatInfo(iCard,aInfo.iFormatInfo) == KErrNone))
+    if ((!iInternalSlot) && (GetCardFormatInfo(iCard, aInfo) == KErrNone))
 		{
 		TUint16 reservedSectors;
 		TMBRPartitionEntry dummy;	// Not used here
@@ -2810,7 +2811,9 @@
 		    }
 
 		aInfo.iFormatInfo.iReservedSectors = reservedSectors;
-		aInfo.iExtraInfo = ETrue;
+
+        //-- indicates that the driver wishes to dictate how the volume should be formatted
+        aInfo.iExtraInfo = ETrue;
 		}
 
     // Set serial number to CID
--- a/kernel/eka/drivers/medmmc/mmcptn.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/drivers/medmmc/mmcptn.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -186,12 +186,11 @@
 	return EFalse;
 	}
 
-GLDEF_C TInt GetCardFormatInfo(const TMMCard* /*aCardP*/, TLDFormatInfo& /*aFormatInfo*/)
 /**
- * Returns the preferred format parameters for the primary partition.
- * @return Standard Symbian OS error code.
- */
+    Returns the preferred format parameters for the primary partition.
+    @return Standard Symbian OS error code.
+*/
+TInt GetCardFormatInfo(const TMMCard* /*aCardP*/, TLocalDriveCapsV5& /*aCaps*/)
 	{
 	return KErrNotSupported;
 	}
-
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1621,7 +1621,7 @@
 	  		OstTraceExt2( TRACE_INTERNALS, DSDSTACK_SWITCHTOHIGHSPEEDMODESM18, "SD Switch[0x%x]=0x%x", (TUint) i, (TUint) iPSLBuf[i]);
 			}
 #endif
-
+	// Fall through to the next state
 	SMF_STATE(EStDone)
 	
         OstTrace0( TRACE_INTERNALS, DSDSTACK_SWITCHTOHIGHSPEEDMODESM19, "EStSwitchFunctionSent");
--- a/kernel/eka/drivers/pbus/mmc/stack.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/drivers/pbus/mmc/stack.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -3448,7 +3448,8 @@
 			// update the Extended CSD to reflect this			
 			memset( s.CardP()->iExtendedCSD.Ptr()+TExtendedCSD::EEraseGroupDefIndex, TExtendedCSD::EEraseGrpDefEnableHighCapSizes, 1);
 			}
-	
+
+	// Fall through to the next state
 	SMF_STATE(EStDetermineBusWidthAndClock)
 	
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_INITSTACKAFTERUNLOCKSM16, "EStDetermineBusWidthAndClock" );
@@ -3470,6 +3471,7 @@
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_INITSTACKAFTERUNLOCKSM18, "EStNoMoreCards" );
 
+	// Fall through to the next state
 	SMF_STATE(EStExit)
 	
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_INITSTACKAFTERUNLOCKSM19, "EStExit" );
@@ -3934,7 +3936,8 @@
 			}
 
 		s.PopCommandStack();	
-
+	
+	// Fall through to the next state
 	SMF_STATE(EStDone)
 	
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_EXECAWAKECOMMANDSM7, "EStDone" );
@@ -5160,6 +5163,7 @@
 		s.FillCommandDesc( ECmdSelectCard, 0 );		// Deselect - RCA=0
 		iCxDeselectCount=iDeselectsToIssue;
 
+	// Fall through to the next state
 	SMF_STATE(EStDeselectLoop)
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_EXECCOMMANDSM5, "EStDeselectLoop" );
 		SMF_INVOKES(IssueCommandCheckResponseSMST,EStDeselectEndCheck)	
@@ -5181,6 +5185,7 @@
 		s.PopCommandStack();
 		iStackState &= ~KMMCStackStateDoDeselect;
 
+	// Fall through to the next state
 	SMF_STATE(EStAnalyseCommand)
 
 		OstTrace0( TRACE_INTERNALS, DMMCSTACK_EXECCOMMANDSM7, "EStAnalyseCommand" );
@@ -6486,7 +6491,8 @@
 		DoAddressCard(iAutoUnlockIndex); 	// Address the card
 		TMMCard* cd = iCardArray->CardP(iAutoUnlockIndex);
 		s.SetCard(cd);
-
+	
+	// Fall through to the next state
 	SMF_STATE(EStSendStatus)
 		        
 		s.FillCommandDesc(ECmdSendStatus, 0);
@@ -6500,11 +6506,13 @@
 			{
 			SMF_GOTOS(EStNextIndex);
 		    }
-		                        
+
+	// Fall through to the next state	                        
 	SMF_STATE(EStUnlock)
 		                        
 		const TMapping *mp = NULL;
 		mp = iSocket->iPasswordStore->FindMappingInStore(iCardArray->CardP(iAutoUnlockIndex)->CID());
+		__ASSERT_DEBUG(mp, DMMCSocket::Panic(DMMCSocket::EMMCMachineState));
 
 		OstTrace1( TRACE_INTERNALS, DMMCSTACK_CIMAUTOUNLOCKSM4, "Attempting to unlock card %d", iCardArray->CardP(iAutoUnlockIndex)->Number() );
 		
@@ -7429,8 +7437,6 @@
 	{
 	OstTraceFunctionEntry1( DMMCSOCKET_INIT_ENTRY, this );
 	__KTRACE_OPT(KPBUS1,Kern::Printf(">MMC:Init"));
-	
-	GetMachineInfo();
 
 	// We need to make sure the stack is initialised,
 	// as DPBusSocket::Init() will initiate a power up sequence
@@ -7440,6 +7446,8 @@
 		return KErrNotReady;
 	    }
 
+	GetMachineInfo();
+
 	TInt r = iStack->Init();
 	if (r!=KErrNone)
 	    {
--- a/kernel/eka/drivers/resmanus/d_resmanus.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/drivers/resmanus/d_resmanus.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -59,6 +59,24 @@
 		request = ((TTrackNotifyBuf*)buffer)->iRequest;				\
 	}
 
+//Macro to call the correct destructor for the tracking buffer deletion
+#define DELETE_TRACKING_BUFFER(tracker,buf)							\
+	{																\
+	switch(tracker->iType)											\
+		{															\
+		case EGetState:												\
+			delete (TTrackGetStateBuf *)(buf);						\
+			break;													\
+		case ESetState:												\
+			delete (TTrackSetStateBuf *)(buf);						\
+			break;													\
+		case ENotify:												\
+			delete (TTrackNotifyBuf *)(buf);						\
+			break;													\
+		default:													\
+			__ASSERT_ALWAYS(0,RESMANUS_FAULT());					\
+		}															\
+	}
 /***************************************************************************************
 	class TTrackGetStateBuf
  ***************************************************************************************/
@@ -2165,7 +2183,8 @@
 		{
 		while(!aTracker->iFreeQue->IsEmpty())
 			{
-			delete aTracker->iFreeQue->GetFirst(); // Dequeues the element;
+			TTrackingBuffer *buf = (TTrackingBuffer *)aTracker->iFreeQue->GetFirst(); //Dequeues the element
+			DELETE_TRACKING_BUFFER(aTracker,buf)
 			}
 		delete aTracker->iFreeQue;
 		}
@@ -2174,7 +2193,8 @@
 		{
 		while(!aTracker->iBusyQue->IsEmpty())
 			{
-			delete aTracker->iBusyQue->GetFirst(); // Dequeues the element;
+			TTrackingBuffer *buf = (TTrackingBuffer *)aTracker->iBusyQue->GetFirst(); //Dequeues the element
+			DELETE_TRACKING_BUFFER(aTracker,buf)
 			}
 		delete aTracker->iBusyQue;
 		}
--- a/kernel/eka/euser/us_exec.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/euser/us_exec.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -4596,6 +4596,10 @@
 @return The Id of this thread.
 */
 	{
+#ifdef __USERSIDE_THREAD_DATA__
+	if(iHandle==KCurrentThreadHandle)
+		return TThreadId( LocalThreadData()->iThreadId );
+#endif // __USERSIDE_THREAD_DATA__
 
 	return TThreadId( (TUint)Exec::ThreadId(iHandle) );
 	}
--- a/kernel/eka/include/e32const.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/include/e32const.h	Wed Sep 22 10:53:45 2010 +0100
@@ -1363,6 +1363,15 @@
 const TUint KDriveFileNone=0x05;
 
 
+/**
+@internalComponent
+Identifies exFAT file system
+*/
+const TUint KDriveFileSysExFAT=0x06;
+
+
+
+
 
 
 /**
--- a/kernel/eka/include/e32uid.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/include/e32uid.h	Wed Sep 22 10:53:45 2010 +0100
@@ -1,126 +1,128 @@
-// Copyright (c) 1995-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:
-// e32\include\e32uid.h
-// 
-// 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.
-//
-
-/**
- @file
- @publishedPartner
- @released
-*/
-
-#ifndef __E32UID_H__
-#define __E32UID_H__
-#include <e32cmn.h>
-
-const TInt KDynamicLibraryUidValue=0x10000079;
-const TInt KExecutableImageUidValue=0x1000007a;
-const TUid KDynamicLibraryUid={KDynamicLibraryUidValue};
-const TUid KExecutableImageUid={KExecutableImageUidValue};
-
-#if defined(_UNICODE)
-#define KLogicalDeviceDriverUidValue KLogicalDeviceDriverUidValue16
-#define KLogicalDeviceDriverUid KLogicalDeviceDriverUid16
-#else
-#define KLogicalDeviceDriverUidValue KLogicalDeviceDriverUidValue8
-#define KLogicalDeviceDriverUid KLogicalDeviceDriverUid8
-#endif
-const TInt KLogicalDeviceDriverUidValue16=0x100000af;
-const TUid KLogicalDeviceDriverUid16={KLogicalDeviceDriverUidValue16};
-const TInt KLogicalDeviceDriverUidValue8=0x100000ae;
-const TUid KLogicalDeviceDriverUid8={KLogicalDeviceDriverUidValue8};
-
-#if defined(_UNICODE)
-#define KPhysicalDeviceDriverUidValue KPhysicalDeviceDriverUidValue16
-#define KPhysicalDeviceDriverUid KPhysicalDeviceDriverUid16
-#else
-#define KPhysicalDeviceDriverUidValue KPhysicalDeviceDriverUidValue8
-#define KPhysicalDeviceDriverUid KPhysicalDeviceDriverUid8
-#endif
-const TInt KPhysicalDeviceDriverUidValue16=0x100039d0;
-const TUid KPhysicalDeviceDriverUid16={KPhysicalDeviceDriverUidValue16};
-const TInt KPhysicalDeviceDriverUidValue8=0x100000ad;
-const TUid KPhysicalDeviceDriverUid8={KPhysicalDeviceDriverUidValue8};
-
-const TInt KMachineConfigurationUidValue=0x100000f4;
-const TUid KMachineConfigurationUid={KMachineConfigurationUidValue};
-
-#if defined(_UNICODE)
-#define KLocaleDllUidValue KLocaleDllUidValue16
-#define KLocaleDllUid KLocaleDllUid16
-#else
-#define KLocaleDllUidValue KLocaleDllUidValue8
-#define KLocaleDllUid KLocaleDllUid8
-#endif
-const TInt KLocaleDllUidValue16=0x100039e6;
-const TUid KLocaleDllUid16={KLocaleDllUidValue16};
-const TInt KLocaleDllUidValue8=0x100000c3;
-const TUid KLocaleDllUid8={KLocaleDllUidValue8};
-
-const TInt KSharedLibraryUidValue=0x1000008d;
-const TUid KSharedLibraryUid={KSharedLibraryUidValue};
-
-const TInt KKeyboardUidValue=0x100000db;
-const TUid KKeyboardUid={KKeyboardUidValue};
-
-/** @internalComponent */
-const TInt KEka1EntryStubUidValue=0x101fdf0f;
-/** @internalComponent */
-const TUid KEka1EntryStubUid={KEka1EntryStubUidValue};
-
-#if defined(_UNICODE)
-#define KKeyboardDataUidValue KKeyboardDataUidValue16
-#define KKeyboardDataUid KKeyboardDataUid16
-#else
-#define KKeyboardDataUidValue KKeyboardDataUidValue8
-#define KKeyboardDataUid KKeyboardDataUid8
-#endif
-const TInt KKeyboardDataUidValue16=0x100039e0;
-const TUid KKeyboardDataUid16={KKeyboardDataUidValue16};
-const TInt KKeyboardDataUidValue8=0x100000dc;
-const TUid KKeyboardDataUid8={KKeyboardDataUidValue8};
-
-#if defined(_UNICODE)
-#define KKeyboardTranUidValue KKeyboardTranUidValue16
-#define KKeyboardTranUid KKeyboardTranUid16
-#else
-#define KKeyboardTranUidValue KKeyboardTranUidValue8
-#define KKeyboardTranUid KKeyboardTranUid8
-#endif
-const TInt KKeyboardTranUidValue16=0x100039e1;
-const TUid KKeyboardTranUid16={KKeyboardTranUidValue16};
-const TInt KKeyboardTranUidValue8=0x100000dd;
-const TUid KKeyboardTranUid8={KKeyboardTranUidValue8};
-
-
-#if defined(_UNICODE)
-#define KConsoleDllUidValue KConsoleDllUidValue16
-#define KConsoleDllUid KConsoleDllUid16
-#else
-#define KConsoleDllUidValue KConsoleDllUidValue8
-#define KConsoleDllUid KConsoleDllUid8
-#endif
-const TInt KConsoleDllUidValue16=0x100039e7;
-const TUid KConsoleDllUid16={KConsoleDllUidValue16};
-const TInt KConsoleDllUidValue8=0x100000c5;
-const TUid KConsoleDllUid8={KConsoleDllUidValue8};
-
-const TUint KSystemStartupModeKey=0x10204BB5;
-
-#endif
-
+// Copyright (c) 1995-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:
+// e32\include\e32uid.h
+// 
+// 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.
+//
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef __E32UID_H__
+#define __E32UID_H__
+#include <e32cmn.h>
+
+const TInt KDynamicLibraryUidValue=0x10000079;
+const TInt KExecutableImageUidValue=0x1000007a;
+const TUid KDynamicLibraryUid={KDynamicLibraryUidValue};
+const TUid KExecutableImageUid={KExecutableImageUidValue};
+
+#if defined(_UNICODE)
+#define KLogicalDeviceDriverUidValue KLogicalDeviceDriverUidValue16
+#define KLogicalDeviceDriverUid KLogicalDeviceDriverUid16
+#else
+#define KLogicalDeviceDriverUidValue KLogicalDeviceDriverUidValue8
+#define KLogicalDeviceDriverUid KLogicalDeviceDriverUid8
+#endif
+const TInt KLogicalDeviceDriverUidValue16=0x100000af;
+const TUid KLogicalDeviceDriverUid16={KLogicalDeviceDriverUidValue16};
+const TInt KLogicalDeviceDriverUidValue8=0x100000ae;
+const TUid KLogicalDeviceDriverUid8={KLogicalDeviceDriverUidValue8};
+
+#if defined(_UNICODE)
+#define KPhysicalDeviceDriverUidValue KPhysicalDeviceDriverUidValue16
+#define KPhysicalDeviceDriverUid KPhysicalDeviceDriverUid16
+#else
+#define KPhysicalDeviceDriverUidValue KPhysicalDeviceDriverUidValue8
+#define KPhysicalDeviceDriverUid KPhysicalDeviceDriverUid8
+#endif
+const TInt KPhysicalDeviceDriverUidValue16=0x100039d0;
+const TUid KPhysicalDeviceDriverUid16={KPhysicalDeviceDriverUidValue16};
+const TInt KPhysicalDeviceDriverUidValue8=0x100000ad;
+const TUid KPhysicalDeviceDriverUid8={KPhysicalDeviceDriverUidValue8};
+
+const TInt KMachineConfigurationUidValue=0x100000f4;
+const TUid KMachineConfigurationUid={KMachineConfigurationUidValue};
+
+#if defined(_UNICODE)
+#define KLocaleDllUidValue KLocaleDllUidValue16
+#define KLocaleDllUid KLocaleDllUid16
+#else
+#define KLocaleDllUidValue KLocaleDllUidValue8
+#define KLocaleDllUid KLocaleDllUid8
+#endif
+const TInt KLocaleDllUidValue16=0x100039e6;
+const TUid KLocaleDllUid16={KLocaleDllUidValue16};
+const TInt KLocaleDllUidValue8=0x100000c3;
+const TUid KLocaleDllUid8={KLocaleDllUidValue8};
+
+const TInt KSharedLibraryUidValue=0x1000008d;
+const TUid KSharedLibraryUid={KSharedLibraryUidValue};
+
+const TInt KKeyboardUidValue=0x100000db;
+const TUid KKeyboardUid={KKeyboardUidValue};
+
+/** @internalComponent */
+const TInt KEka1EntryStubUidValue=0x101fdf0f;
+/** @internalComponent */
+const TUid KEka1EntryStubUid={KEka1EntryStubUidValue};
+
+#if defined(_UNICODE)
+#define KKeyboardDataUidValue KKeyboardDataUidValue16
+#define KKeyboardDataUid KKeyboardDataUid16
+#else
+#define KKeyboardDataUidValue KKeyboardDataUidValue8
+#define KKeyboardDataUid KKeyboardDataUid8
+#endif
+const TInt KKeyboardDataUidValue16=0x100039e0;
+const TUid KKeyboardDataUid16={KKeyboardDataUidValue16};
+const TInt KKeyboardDataUidValue8=0x100000dc;
+const TUid KKeyboardDataUid8={KKeyboardDataUidValue8};
+
+#if defined(_UNICODE)
+#define KKeyboardTranUidValue KKeyboardTranUidValue16
+#define KKeyboardTranUid KKeyboardTranUid16
+#else
+#define KKeyboardTranUidValue KKeyboardTranUidValue8
+#define KKeyboardTranUid KKeyboardTranUid8
+#endif
+const TInt KKeyboardTranUidValue16=0x100039e1;
+const TUid KKeyboardTranUid16={KKeyboardTranUidValue16};
+const TInt KKeyboardTranUidValue8=0x100000dd;
+const TUid KKeyboardTranUid8={KKeyboardTranUidValue8};
+
+
+#if defined(_UNICODE)
+#define KConsoleDllUidValue KConsoleDllUidValue16
+#define KConsoleDllUid KConsoleDllUid16
+#else
+#define KConsoleDllUidValue KConsoleDllUidValue8
+#define KConsoleDllUid KConsoleDllUid8
+#endif
+const TInt KConsoleDllUidValue16=0x100039e7;
+const TUid KConsoleDllUid16={KConsoleDllUidValue16};
+const TInt KConsoleDllUidValue8=0x100000c5;
+const TUid KConsoleDllUid8={KConsoleDllUidValue8};
+
+const TUint KSystemStartupModeKey=0x10204BB5;
+
+const TUint KSystemEmulatorOrientationKey=0x10204BB6;
+
+#endif
+
--- a/kernel/eka/include/e32ver.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/include/e32ver.h	Wed Sep 22 10:53:45 2010 +0100
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=3119;
+const TInt KE32BuildVersionNumber=4001;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/u32std.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/include/u32std.h	Wed Sep 22 10:53:45 2010 +0100
@@ -776,6 +776,7 @@
 	RAllocator* iHeap;				///< The thread's current heap
 	CActiveScheduler* iScheduler;	///< The thread's current active scheduler
 	TTrapHandler* iTrapHandler;		///< The thread's current trap handler
+	TUint iThreadId;                ///< The thread's id
 private:
 	RAllocator* iTlsHeap; 			///< The heap that the DLL TLS data is stored on
 	RArray<STls> iTls; 				///< DLL TLS data
--- a/kernel/eka/kernel/arm/ckernel.cia	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/kernel/arm/ckernel.cia	Wed Sep 22 10:53:45 2010 +0100
@@ -92,6 +92,14 @@
 	USER_MEMORY_GUARD_ON(,r2,r2);
 	asm("teq r0, r1 ");
 	asm("bne 1b ");
+	
+	// Save thread id in the local data
+	asm("ldr r3, [r4, #%a0]" : : "i" _FOFF(DThread, iId));
+	asm("sub r0, r1, #%a0 " : : "i" ((TInt)KLocalThreadDataSize - _FOFF(TLocalThreadData, iThreadId)));
+	USER_MEMORY_GUARD_OFF(,r2,r2);
+	asm("strt r3, [r0]");
+	USER_MEMORY_GUARD_ON(,r2,r2);
+
 	asm("sub r1, r1, #%a0 " : : "i" (KLocalThreadDataSize + 4));
 	asm("orr r8, r8, #%a0 " : : "i" ((TInt)KThreadFlagLocalThreadDataValid));
 	asm("str r8, [r4, #%a0]" : : "i" _FOFF(DThread, iFlags));
--- a/kernel/eka/kernel/sproperty.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/kernel/sproperty.cpp	Wed Sep 22 10:53:45 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"
@@ -1209,6 +1209,8 @@
 	TInt Subscribe(TRequestStatus* aStatus);
 	inline void Cancel();
 
+	TInt Close(TAny* /*aPtr*/);
+
 	inline TInt GetI(TInt* aValue);
 	inline TInt GetB(TUint8* aBuf, TInt* aSize, TBool aUser);
 	inline TInt SetI(TInt aValue);
@@ -1324,12 +1326,37 @@
 	client->Close(NULL);
 	}
 
+
+TInt DPropertyRef::Close(TAny* /*aPtr*/)
+	{
+	TInt error = KErrNone;
+	if (Dec()==1)
+		{
+		NKern::LockSystem();
+		iProp->Cancel(&iSubs); //Releases System Lock
+		K::ObjDelete(this);
+		return EObjectDeleted;
+		}
+
+	return error;
+	}
+
+
 // Enter system locked.
 // Return system unlocked.
 inline void DPropertyRef::Cancel()
 	{
 	__ASSERT_SYSTEM_LOCK;
+	
+	if (Open() != KErrNone) 
+		{ // Too late - destruction in progress ....
+		NKern::UnlockSystem();
+		return;
+		}
+	
 	iProp->Cancel(&iSubs);
+
+	Close(NULL);
 	}
 
 // Enter system locked.
@@ -1401,8 +1428,6 @@
 	__ASSERT_CRITICAL;
 	if (iProp)
 		{
-		NKern::LockSystem();
-		Cancel();
 		iProp->Close();
 		iProp = NULL;
 		}
@@ -1455,7 +1480,9 @@
 // Return system unlocked.
 void ExecHandler::PropertyCancel(DPropertyRef* aRef)
 	{
+	NKern::ThreadEnterCS();
 	aRef->Cancel();
+	NKern::ThreadLeaveCS();
 	}
 
 // Enter system locked.
@@ -2027,5 +2054,13 @@
 	aStatus.iType			= iProp->Type();
 	aStatus.iAttr			= 0;
 	aStatus.iOwner			= iProp->Owner();
+	if (iProp->Type() == RProperty::EByteArray || iProp->Type() == RProperty::ELargeByteArray)
+		{
+		aStatus.iSize		= TUint16(iProp->BufSize());
+		}
+	else
+		{
+		aStatus.iSize		= 0;
+		}
 	return iProp->IsDefined();
 	}
--- a/kernel/eka/release.txt	Mon Sep 13 15:16:07 2010 +0100
+++ b/kernel/eka/release.txt	Wed Sep 22 10:53:45 2010 +0100
@@ -1,3 +1,48 @@
+Version 2.00.4001
+=================
+(Made by vfebvre 14/09/2010)
+
+1.	maxxu
+	1.	ou1cimx1#570754 t_usb_device can't run on vasco
+
+
+Version 2.00.4000
+=================
+(Made by vfebvre 09/09/2010)
+
+1.	maxxu
+	1.	ou1cimx1#539523 Some usb driver tests can run on Vasco
+		add comments to t_usb_device scripts
+
+2.	vinjose
+	1.	ou1cimx1#533208 Improve the EventQ  CodeCoverage to 100%
+
+3.	marisood
+	1.	ou1cimx1#556625 Improve code coverage for resmanus to 95% or more
+
+4.	gcochran
+	1.	ou1cimx1#544949 Kernel - TB 10.1 the landscape mode doesn’t work on 10.1 emulator
+
+5.	shubmurt
+	1.	ou1cimx1#550808 Supervisor page fault crash
+
+6.	fagortz
+	1.	ou1cimx1#562537 Linux build problem with kernelhwsrv
+
+7.	paconway
+	1.	ou1cimx1#517481 Coverity errors - media#2
+
+8.	ricoles
+	1.	ou1cimx1#560671 [MCL] Current thread id should be cached in user side local data
+
+9.	mmoate
+	1.	ou1cimx1#467795 MCL Test Code Coverage Improvement Phase 2
+
+10.	davegord
+	1.	ou1cimx1#553101 coverity defects - Kernel - TB101 wk24 - /sf/os/kernelhwsrv/ -
+	2.	ou1cimx1#543315 ENV - SIROCCO - Vasco - T_TIME fails when Setting Secure time
+
+
 Version 2.00.3119
 =================
 (Made by fadhliM 31/08/2010)
--- a/kerneltest/e32test/active/t_asyc.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/active/t_asyc.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-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,7 +16,7 @@
 // Exercise the priority mechanism of active objects whereby active 
 // objects are run in the priority order.
 // API Information:
-// CAsyncOneShot, CActiveScheduler.
+// CAsyncOneShot, CAsyncCallBack, CActiveScheduler.
 // Details:
 // - Install active scheduler.
 // - Create active objects of different priorities and verify their RunL 
@@ -24,6 +24,8 @@
 // - Verify that a very low priority active object will not get the chance
 // to run if a higher priority object keeps rescheduling itself or a 
 // higher priority object stops the active scheduler.
+// - Do the same tests again by using CAsyncOneShot derived class
+// CAsyncCallBack which has a CallBack function to do the stuff
 // Platforms/Drives/Compatibility:
 // All.
 // Assumptions/Requirement/Pre-requisites:
@@ -34,18 +36,21 @@
 
 #include <e32test.h>
 
+LOCAL_D RTest test(_L("T_ASYC"));
+
 enum {ETopPriority=1000,EMiddlePriority=900,ELatePriority=800};
 
 const TInt KIToldYouSo=666;
 
+
+//
+
 class CMyActiveScheduler : public CActiveScheduler
 	{
 public:
 	virtual void Error(TInt anError) const;
 	};
 
-LOCAL_D RTest test(_L("T_ASYC"));
-
 void CMyActiveScheduler::Error(TInt anError) const
 //
 // Called if any Run() method leaves.
@@ -55,6 +60,10 @@
 	test.Panic(anError,_L("CMyActiveScheduler::Error"));
 	}
 
+// 
+// CAsyncOneShot derived class declarations
+//
+
 class CMyMultiShot : public CAsyncOneShot
 	{
 public:
@@ -66,14 +75,18 @@
 	TPtrC iMessage;
 	};
 
+//
+
 class CShouldNeverRun : public CAsyncOneShot
 	{
 public:
 	void RunL();
 	static CShouldNeverRun* NewL();
-	CShouldNeverRun();
+	CShouldNeverRun(TInt aValue);
 	};
 
+//
+
 class CStopTheScheduler : public CAsyncOneShot
 	{
 public:
@@ -82,6 +95,48 @@
 	void RunL();
 	};
 
+//
+// CAsyncCallBack derived class declarations
+//
+
+class CMyMultiShotACB : public CAsyncCallBack
+	{
+public:
+	static CMyMultiShotACB* NewL(TInt aPriority,const TDesC& aMessage,TInt aCount);
+	void RunL(); //needs to be implemented since CAsyncCallBack::RunL is not exported
+	static TInt CallBackFunc(TAny* aPtr); // this is called by the CAsyncCallBack::RunL
+	CMyMultiShotACB(const TCallBack& aCallBack, TInt aPriority, const TDesC& aMessage, TInt aCount);
+private:
+	TInt iCountRemaining;
+	TPtrC iMessage;
+	};
+
+//
+
+class CShouldNeverRunACB : public CAsyncCallBack
+	{
+public:
+	void RunL(); //needs to be implemented since CAsyncCallBack::RunL is not exported
+	static TInt CallBackFunc(TAny*); // this is called by the CAsyncCallBack::RunL
+	static CShouldNeverRunACB* NewL();
+	CShouldNeverRunACB();
+	};
+
+//
+
+class CStopTheSchedulerACB : public CAsyncCallBack
+	{
+public:
+	CStopTheSchedulerACB(TInt aPriority);
+	static CStopTheSchedulerACB* NewL(TInt aPriority);
+	static TInt CallBackFunc(TAny*); // this is called by the CAsyncCallBack::RunL
+	void RunL(); //needs to be implemented since CAsyncCallBack::RunL is not exported
+	};
+
+//
+// CAsyncOneShot implementations
+//
+
 CMyMultiShot* CMyMultiShot::NewL(TInt aPriority,const TDesC& aMessage,TInt aCount)
 	{
 	return new(ELeave)CMyMultiShot(aPriority,aMessage,aCount);
@@ -101,13 +156,14 @@
 		Call();
 		}
 	}
+
 CShouldNeverRun* CShouldNeverRun::NewL()
 	{
-	return new(ELeave)CShouldNeverRun;
+	return new(ELeave)CShouldNeverRun(KMinTInt);
 	}
 
-CShouldNeverRun::CShouldNeverRun()
-	:CAsyncOneShot(KMinTInt)
+CShouldNeverRun::CShouldNeverRun(TInt aValue)
+	:CAsyncOneShot(aValue)
 	{
 	}
 
@@ -131,13 +187,95 @@
 	CActiveScheduler::Stop();
 	}
 
+//
+// CAsyncCallBack derived implementations
+//
+
+CMyMultiShotACB* CMyMultiShotACB::NewL(TInt aPriority,const TDesC& aMessage,TInt aCount)
+	{
+	TCallBack myCallBack(CMyMultiShotACB::CallBackFunc);
+	return new(ELeave)CMyMultiShotACB(myCallBack, aPriority,aMessage,aCount);
+	}
+
+CMyMultiShotACB::CMyMultiShotACB(const TCallBack& aCallBack, TInt aPriority,const TDesC& aMessage,TInt aCount)
+	:CAsyncCallBack(aCallBack ,aPriority),iMessage(aMessage)
+// this is calling the 2 parameter constructor for CAsyncCallBack
+	{
+	iCallBack.iPtr=this;
+	iCountRemaining=aCount;
+	}
+
+TInt CMyMultiShotACB::CallBackFunc(TAny* aPtr)
+	{
+	CMyMultiShotACB* pMultiShot=(CMyMultiShotACB*)aPtr;
+
+	if (pMultiShot->iCountRemaining--)
+		{
+		test.Printf(_L("%S,%d\n\r"),&(pMultiShot->iMessage),pMultiShot->iCountRemaining);
+		pMultiShot->CallBack();
+		}
+	return KErrNone;
+	}
+
+void CMyMultiShotACB::RunL()
+	{
+	iCallBack.CallBack();
+	}
+
+CShouldNeverRunACB* CShouldNeverRunACB::NewL()
+	{
+	return new(ELeave)CShouldNeverRunACB;
+	}
+
+CShouldNeverRunACB::CShouldNeverRunACB()
+	:CAsyncCallBack(KMinTInt)
+// this is calling the 1 parameter constructor for CAsyncCallBack
+// callback function needs to be set before setting active using ::Set method
+	{
+	}
+
+TInt CShouldNeverRunACB::CallBackFunc(TAny*)
+	{
+	User::Panic(_L("CShouldNeverRunACB"),KIToldYouSo);
+	return KErrNone;
+	}
+
+void CShouldNeverRunACB::RunL()
+	{
+	iCallBack.CallBack();
+	}
+
+CStopTheSchedulerACB* CStopTheSchedulerACB::NewL(TInt aPriority)
+	{
+	return new(ELeave)CStopTheSchedulerACB(aPriority);
+	}
+
+CStopTheSchedulerACB::CStopTheSchedulerACB(TInt aPriority)
+	:CAsyncCallBack(aPriority)
+// this is calling the 1 parameter constructor for CAsyncCallBack
+// callback function needs to be set before setting active using ::Set method
+	{
+	}
+
+TInt CStopTheSchedulerACB::CallBackFunc(TAny*)
+	{
+	CActiveScheduler::Stop();
+	return KErrNone;
+	}
+
+void CStopTheSchedulerACB::RunL()
+	{
+	iCallBack.CallBack();
+	}
+
+
 GLDEF_C TInt E32Main()
 //
 // Test idle objects.
 //
     {
 	test.Title();
-	test.Start(_L("Testing idle object cancellation"));
+	test.Start(_L("Testing CAsyncOneShot derived objects"));
 //
 	CMyActiveScheduler* pR=new CMyActiveScheduler;
 	test(pR!=NULL);
@@ -156,7 +294,54 @@
 	multiShot2->Call();
 
 	CActiveScheduler::Start();	
+
+	test.Next(_L("Test DoCancel"));
+	// put to same priority as the CStopScheduler
+	CShouldNeverRun* pn2=new CShouldNeverRun(ELatePriority);
+	
+	pn2->Call(); // queue the panic object
+	
+	ps->Call();  // queue stop scheduler object
+
+	pn2->DoCancel(); //cancel immediately (panic if cancel fails)
+
+	CActiveScheduler::Start();	
+
+// cleanup, call destructors
+	delete pn;
+	delete pn2;
+	delete ps;
+	delete multiShot1;
+	delete multiShot2;
+
 //
+	test.Next(_L("Testing CAsyncCallBack derived objects"));
+
+	CShouldNeverRunACB* pnACB=CShouldNeverRunACB::NewL();
+	TCallBack myCB1(CShouldNeverRunACB::CallBackFunc,pn);
+	pnACB->Set(myCB1); // set callback func
+	pnACB->CallBack(); // set active
+		
+	CStopTheSchedulerACB* psACB=CStopTheSchedulerACB::NewL(ELatePriority);
+	TCallBack myCB2(CStopTheSchedulerACB::CallBackFunc,ps);
+	psACB->Set(myCB2); // set callback func
+	psACB->CallBack(); // set active
+
+	CMyMultiShotACB* multiShot1ACB=CMyMultiShotACB::NewL(EMiddlePriority,_L("Call Ten times"),10);
+	multiShot1ACB->CallBack(); // set active
+
+	CMyMultiShotACB* multiShot2ACB=CMyMultiShotACB::NewL(ETopPriority,_L("Call five times"),5);
+	multiShot2ACB->CallBack(); // set active
+
+	CActiveScheduler::Start();	
+
+// cleanup, call destructors
+	delete pR;
+	delete pnACB;
+	delete psACB;
+	delete multiShot1ACB;
+	delete multiShot2ACB;
+
 	test.End();
 	return(0);
     }
--- a/kerneltest/e32test/active/t_cact.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/active/t_cact.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -41,6 +41,8 @@
 // - Create a thread with its own heap and test that timers are scheduled in the order of
 // their expiration time, priority and order of addition to the scheduler
 // - Check the heap is not corrupted by all the tests
+// - Test replacing the scheduler and also check stack depths
+// - Call deprecated dummy functions
 // Platforms/Drives/Compatibility:
 // All
 // Assumptions/Requirement/Pre-requisites:
@@ -71,6 +73,7 @@
 	void Test2();
 	void Test3();
 	void Test4();
+	void Test5();
 	};
 
 class MyManager : public CActiveScheduler
@@ -793,6 +796,28 @@
 	User::After(100000);
 	}
 
+void TSecdulerTester::Test5()
+//
+// Replace scheduler and check depth
+//
+	{
+	MyManager* pManager=(MyManager*)CActiveScheduler::Current(); // get current
+
+	test.Next(_L("Test scheduler replace"));
+	TInt depthOld = pManager->StackDepth(); // get stack depth
+	MyManager* pManager2=new MyManager;
+	test(pManager2!=NULL);
+	// replace active scheduler and check the old one was pManager
+	test(CActiveScheduler::Replace(pManager2)==pManager);
+	test(CActiveScheduler::Current()==pManager2);
+	
+	test.Next(_L("Test stack depth of the new scheduler"));
+	TInt depthNew = pManager2->StackDepth(); // get stack depth
+	test(depthOld==depthNew); // compare
+
+	delete pManager2;
+	}
+
 GLDEF_C TInt E32Main()
     {
 
@@ -848,6 +873,10 @@
 	sched.Test4();
 	delete gTimer;
 	User::Check();
+//
+	test.Next(_L("Test5"));
+	sched.Test5();
+
 	delete pManager;
 	delete pLowest;
 	delete pLow;
--- a/kerneltest/e32test/active/t_messge.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/active/t_messge.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -27,6 +27,8 @@
 // - Send pointers as message arguments from client and test that the server receives the
 // same pointers. 
 // - Test Client() method of RMessage2 and verify it opened a handle to the client thread
+// - Test ClientProcessFlags() method of RMessagePtr2 and verify it matches to a known flag
+// - Test ClientIsRealtime() method of RMessagePtr2 and check that it isn't true
 // - Complete several messages using RMessage2::Complete and verify the client gets the
 // error codes back correctly.
 // - Complete several messages using RMessagePtr2::Complete and verify the client gets the
@@ -48,6 +50,7 @@
 //
 
 #include <e32std.h>
+#include <u32std.h>
 #include <e32std_private.h>
 #include <e32test.h>
 #include <e32ver.h>
@@ -66,7 +69,8 @@
 		EInt0Error=1, EInt1Error, EInt2Error, EInt3Error,
 		EPtr0Error, EPtr1Error, EPtr2Error, EPtr3Error,
 		ECreateNameError, ENewSessionError,
-		EClientError
+		EClientError, EClientProcessFlagsError,
+		EClientIsRealtimeError
 		};
 	static void Panic(TPanicType aReason);
 protected:
@@ -78,7 +82,7 @@
 class CTestSession : public CSession2
 	{
 public:
-	enum {EStop,ETestInt,ETestPtr,ETestClient,ETestComplete,ETestPtrComplete,ETestCompletePanic,ETestOtherSession,ETestCompleteAfter,ETestMessageConstruction, 
+	enum {EStop,ETestInt,ETestPtr,ETestClient,ETestClientProcessFlags,ETestClientIsRealtime,ETestComplete,ETestPtrComplete,ETestCompletePanic,ETestOtherSession,ETestCompleteAfter,ETestMessageConstruction, 
 		ETestRMessagePtr2LeavingInterface, ETestKillCompletePanic};
 //Override pure virtual
 	IMPORT_C virtual void ServiceL(const RMessage2& aMessage);
@@ -86,6 +90,8 @@
 	void TestInt(const RMessage2& aMessage);
 	void TestPtr(const RMessage2& aMessage);
 	void TestClient(const RMessage2& aMessage);
+	void TestClientProcessFlags(const RMessage2& aMessage);
+	void TestClientIsRealtime(const RMessage2& aMessage);
 	void TestComplete(const RMessage2& aMessage);
 	void TestPtrComplete(const RMessage2& aMessage);
 	void TestCompletePanic();
@@ -212,6 +218,40 @@
 	t.Close();
 	}
 
+
+void CTestSession::TestClientProcessFlags(const RMessage2& aMessage)
+//
+// Tests ClientProcessFlags()
+//
+	{
+	TBool justInTime=User::JustInTime();
+	TUint flags=aMessage.ClientProcessFlags();
+
+	if ((flags&KProcessFlagJustInTime) && justInTime)
+		{
+		return; //OK
+		}
+	else if ((flags&KProcessFlagJustInTime) || justInTime)
+		{
+		//mismatch
+		clientThread.Kill(0);
+		CTestServer::Panic(CTestServer::EClientProcessFlagsError);
+		}
+	}
+
+void CTestSession::TestClientIsRealtime(const RMessage2& aMessage)
+//
+// Tests ClientIsRealtime()
+//
+	{
+	if(aMessage.ClientIsRealtime())
+		{
+		clientThread.Kill(0);
+		CTestServer::Panic(CTestServer::EClientIsRealtimeError);
+		}
+	}
+
+
 void CTestSession::TestComplete(const RMessage2& aMessage)
 //
 // Stores messages up then Completes in reverse order 
@@ -304,6 +344,12 @@
 		case ETestClient:
 			TestClient(aMessage);
 			break;
+		case ETestClientProcessFlags:
+			TestClientProcessFlags(aMessage);
+			break;
+		case ETestClientIsRealtime:
+			TestClientIsRealtime(aMessage);
+			break;
 		case ETestComplete:
 			TestComplete(aMessage);
 			return;
@@ -377,6 +423,14 @@
 	r=session.PublicSendReceive(CTestSession::ETestClient, TIpcArgs());
 	test(r==KErrNone);
 
+	test.Next(_L("Signal to test ClientProcessFlags()"));
+	r=session.PublicSendReceive(CTestSession::ETestClientProcessFlags, TIpcArgs());
+	test(r==KErrNone);
+	
+	test.Next(_L("Signal to test ClientIsRealtime()"));
+	r=session.PublicSendReceive(CTestSession::ETestClientIsRealtime, TIpcArgs());
+	test(r==KErrNone);
+
 	test.Next(_L("Test RMessage2::Complete()"));
 	TRequestStatus stat[7];
 	for (r=0;r<4;r++)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/buffer/d_version.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,240 @@
+// 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\buffer\d_version.cpp
+// LDD for testing kernel side of TVersion
+// 
+//
+
+#include <kernel/kern_priv.h>
+#include "d_version.h"
+
+class DVersionTestFactory : public DLogicalDevice
+//
+// VersionTest LDD factory
+//
+	{
+public:
+	DVersionTestFactory();
+	~DVersionTestFactory();
+	virtual TInt Install();						//overriding pure virtual
+	virtual void GetCaps(TDes8& aDes) const;	//overriding pure virtual
+	virtual TInt Create(DLogicalChannelBase*& aChannel);	//overriding pure virtual
+	};
+
+class DVersionTest : public DLogicalChannelBase
+//
+// VersionTest LDD channel
+//
+	{
+public:
+	DVersionTest();
+	~DVersionTest();
+protected:
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Request(TInt aFunction, TAny* a1, TAny* a2);
+private:
+	TBool QVS(TInt aCurrent,TInt aRequested);
+    TVersion* iTV[KNumTVersions];
+    TVersion iDefTV;     // tests default constructor
+	};
+
+LOCAL_D const TText* Names[]=
+    {
+    _S("0.00(0)"),
+    _S("0.00(0)"),
+    _S("0.00(1)"),
+    _S("0.00(999)"),
+    _S("0.01(0)"),
+    _S("0.01(1)"),
+    _S("0.01(999)"),
+    _S("0.99(0)"),
+    _S("0.99(1)"),
+    _S("0.99(999)"),
+    _S("1.00(0)"),
+    _S("1.00(1)"),
+    _S("1.00(999)"),
+    _S("1.01(0)"),
+    _S("1.01(1)"),
+    _S("1.01(999)"),
+    _S("1.99(0)"),
+    _S("1.99(1)"),
+    _S("1.99(999)"),
+    _S("99.00(0)"),
+    _S("99.00(1)"),
+    _S("99.00(999)"),
+    _S("99.01(0)"),
+    _S("99.01(1)"),
+    _S("99.01(999)"),
+    _S("99.99(0)"),
+    _S("99.99(1)"),
+    _S("99.99(999)")
+    };
+
+DVersionTestFactory::DVersionTestFactory()
+//
+// Constructor
+//
+    {
+    }
+
+//
+// Destructor
+//
+DVersionTestFactory::~DVersionTestFactory()
+	{
+	}
+
+TInt DVersionTestFactory::Create(DLogicalChannelBase*& aChannel)
+//
+// Create 
+//
+    {
+	aChannel=new DVersionTest;
+	return aChannel?KErrNone:KErrNoMemory;
+    }
+
+TInt DVersionTestFactory::Install()
+//
+// Install the LDD - overriding pure virtual
+//
+    {
+	return SetName(&KVersionTestLddName);
+    }
+
+void DVersionTestFactory::GetCaps(TDes8& /*aDes*/) const
+//
+// Get capabilities - overriding pure virtual
+//
+    {
+    // Not used but required as DLogicalDevice::GetCaps is pure virtual
+    }
+
+DECLARE_STANDARD_LDD()
+	{
+    return new DVersionTestFactory;
+    }
+
+DVersionTest::DVersionTest()
+//
+// Constructor
+//
+    {
+    iTV[0]=&iDefTV;
+    TInt i=1;
+    TInt major=0;
+    FOREVER
+        {
+        TInt minor=0;
+        FOREVER
+            {
+            TInt build=0;
+            FOREVER
+                {
+                iTV[i++]=new TVersion(major,minor,build);
+                if (build==999)
+                    {
+                    break;
+                    }
+                build=(build==1? 999: 1);
+                }
+            if (minor==99)
+                {
+                break;
+                }
+            minor=(minor==1? 99: 1);
+            }
+        if (major==99)
+            {
+            break;
+            }
+        major=(major==1? 99: 1);
+        }
+	}
+	
+TInt DVersionTest::DoCreate(TInt /*aUnit*/, const TDesC8* /*anInfo*/, const TVersion& /*aVer*/)
+//
+// Create channel
+//
+    {
+	return KErrNone;
+	}
+
+DVersionTest::~DVersionTest()
+//
+// Destructor
+//
+    {
+    }
+
+TInt DVersionTest::Request(TInt aFunction, TAny* /*a1*/, TAny* /*a2*/)
+	{
+	TInt r=KErrNone;
+	switch (aFunction)
+		{
+		case RVersionTest::EVersionTestName:
+			{
+			//
+			// Test the version name
+			//
+			{
+			for (TInt i=0; i<KNumTVersions; i++)
+			    {
+                TPtrC Name=(TPtrC)Names[i];
+			    if (iTV[i]->Name().Compare(Name))
+			        {
+                    r=KErrNotSupported;
+			        return r;
+			        }
+			    }
+			}
+			break;
+			}
+		case RVersionTest::EVersionTestQVS:
+			{
+			//
+			// Check QueryVersionSupported()
+			//
+			for (TInt i=0; i<KNumTVersions; i++)
+			    {
+			    for (TInt j=0; j<KNumTVersions; j++)
+			        {
+			        if (Kern::QueryVersionSupported(*iTV[i],*iTV[j])!=QVS(i,j))
+			            {
+                        r=KErrNotSupported;
+			            return r;
+			            }
+			        }
+			    }
+			    
+			break;
+			}
+		default:
+			break;
+		}
+	return r;
+	}
+
+TBool DVersionTest::QVS(TInt aCurrent,TInt aRequested)
+//
+// An independent calculation of what QueryVersionSupported should return
+//
+    {
+    if (aCurrent)
+        aCurrent--;
+    if (aRequested)
+        aRequested--;
+    aCurrent/=3;
+    aRequested/=3;
+    return(aCurrent>=aRequested);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/buffer/d_version.h	Wed Sep 22 10:53:45 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:
+// e32test\buffer\d_version.h
+// 
+//
+
+#if !defined(__D_VERSION_H__)
+#define __D_VERSION_H__
+#include <e32cmn.h>
+#ifndef __KERNEL_MODE__
+#include <e32std.h>
+#endif
+
+const TInt KNumTVersions=1+3*3*3;
+
+_LIT(KVersionTestLddName,"d_version");
+
+class RVersionTest : public RBusLogicalChannel
+	{
+public:
+	enum TControl
+		{
+		EVersionTestName,
+		EVersionTestQVS		
+		};
+
+public:
+#ifndef __KERNEL_MODE__
+	inline TInt Open()
+		{ return DoCreate(KVersionTestLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
+
+	TInt VersionTestName()
+		{ return DoControl(EVersionTestName); }
+	TInt VersionTestQVS()
+		{ return DoControl(EVersionTestQVS); }
+
+#endif
+	};
+
+#endif
--- a/kerneltest/e32test/buffer/t_graph.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/buffer/t_graph.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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"
@@ -769,6 +769,13 @@
 	test(p3D3.AsPoint()==aPoint);
 	test(p3D5.AsPoint()==p3D3.AsPoint());
 	
+	aPoint.iX=iX2;
+	aPoint.iY=iY2;
+	TInt z = p3D5.iZ;
+	p3D5.SetPoint(aPoint);
+	test(p3D5.iX==iX2);
+	test(p3D5.iY==iY2);
+	test(p3D5.iZ==z);
 
 	p3D4.SetXYZ(iX4,iY4,iZ4);
 	test(p3D4.iX==iX4 && p3D4.iY==iY4);
--- a/kerneltest/e32test/buffer/t_hashtab.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/buffer/t_hashtab.cpp	Wed Sep 22 10:53:45 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"
@@ -1491,6 +1491,46 @@
 	map.ResetAndDestroy();
 	}
 
+void TestInsertL()
+    {
+    TInt i;
+    TInt count=50;
+    const TInt KMaxBufferSize=256;
+    // Array used to hold test data to store in the hash objects
+    RPointerArray<TDesC16> iPointerArray;
+    
+    for (i=0; i<count; ++i)
+        {
+        HBufC* hbuf = HBufC::NewLC(KMaxBufferSize);
+        TPtr buf = hbuf->Des();
+        TTestName number(NumberInWords(i));
+        buf.Copy(number);
+		// Append "one" "two" "three" .....
+        iPointerArray.AppendL(hbuf);
+        CleanupStack::Pop(hbuf);
+        }
+        
+    // Creates an object ptrHashMap using the template class RPtrHashMap
+    RPtrHashMap<TDesC16, TDesC16> ptrHashMap;
+    // Push object on to the cleanup stack
+    CleanupClosePushL(ptrHashMap);
+    // Expand the array with the number of key-value pairs for which space should be allocated
+    ptrHashMap.ReserveL(count);
+    
+    // Insert a key-value pairs into the array
+    for (i=0; i<count; ++i)
+        {
+        // "zero"-"forty nine" 
+        // "one"-"forty eight" .....
+        ptrHashMap.InsertL(iPointerArray[i], iPointerArray[count-1-i]);
+        }
+    
+    // Close and Cleanup
+    CleanupStack::PopAndDestroy(&ptrHashMap);
+    iPointerArray.ResetAndDestroy();
+    }
+                                       
+
 void TestOOM()
 	{
 	// Max out memory and check it still works
@@ -2425,7 +2465,17 @@
 	TestOOM();
 	Benchmark();
 	TestSmallReserve();
-
+	
+	// Get cleanup stack
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	TInt result = KErrNoMemory;
+	if (cleanup)
+	    {
+	    TRAP(result, TestInsertL());
+	    // Destroy the cleanup stack
+	    delete cleanup;
+	    }
+		
 	test.End();
 
 	__UHEAP_MARKEND;
--- a/kerneltest/e32test/buffer/t_lex.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/buffer/t_lex.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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,7 @@
 // - Test assignment operator of TLex, by initializing with TLex reference, string, 
 // TBuf reference and check it is as expected.
 // - Check that Eos, Inc, Mark, Get, Peek, UnGet, SkipSpace, SkipSpaceAndMark, 
-// SkipCharacters, TokenLength, MarkedToken methods are as expected.
+// SkipAndMark, SkipCharacters, TokenLength, MarkedToken methods are as expected.
 // - Initialize Lex string, assign different values, Parse to extract signed, 
 // unsigned integer of different lengths, using specified radix and verify 
 // that the return value is KErrNone when a valid string is parsed, KErrGeneral 
@@ -184,6 +184,7 @@
 	c.Mark(mark);
 	c.Mark();
 	c.Inc();
+	c.Inc(2);
 	c.Get();
 	(S)c.Peek();
 	c.UnGet();
@@ -192,6 +193,7 @@
 	c.SkipSpace();
 	c.SkipSpaceAndMark(mark);
 	c.SkipSpaceAndMark();
+	c.SkipAndMark(2,mark);
 	c.SkipCharacters();
 	c.TokenLength(mark);
 	c.TokenLength();
@@ -220,6 +222,7 @@
 	c.Val(TU);
 	TReal32 TR32=1.0F;
 	c.Val(TR32);
+	c.Val(TR32,'.');
 	TReal64 TR64=1.0;
 	c.Val(TR64);
 	TUint8 TU8='a';
@@ -388,6 +391,17 @@
 	test((S)c.Peek()==String[1]);
 	c.Inc();
 	test((S)c.Peek()==String[2]);
+	
+	test.Next(_L("Inc(aNumber)"));    // Inc(aNumber) increments iNext
+	_LL(&String[0], (TText8*)"mno");
+	TLexType c1(&String[0]);
+	c1.__DbgTest(&dump1);
+
+	TestDes(dump1.iNext, dump1.iEnd, &String[0]);
+	c1.Inc(1);
+	test((S)c1.Peek()==String[1]);
+	c1.Inc(1);
+	test((S)c1.Peek()==String[2]);
 
 	test.Next(_L("Mark()"));		//	Mark() sets iMark=iNext
 	_LL(&String[0], (TText8*)"pqr");
@@ -462,6 +476,17 @@
 	_LL(&String[0], (TText8*)"aaa");
 	TestDes(dump1.iNext, dump1.iEnd, &String[0]);
 	TestDes(mDump.iPtr, dump1.iEnd, &String[0]);
+	
+	test.Next(_L("SkipAndMark(4, aMark)"));  // Skips number of characters
+	_LL(&String[0], (TText8*)"abcdaaa");
+	TLexType j2(&String[0]);
+	TLexMarkType jmt;
+	j2.SkipAndMark(4, jmt);
+	j2.__DbgTest(&dump1);
+	jmt.__DbgTest(&mDump);
+	_LL(&String[0], (TText8*)"aaa");
+	TestDes(dump1.iNext, dump1.iEnd, &String[0]);
+	TestDes(mDump.iPtr, dump1.iEnd, &String[0]);
 
 	test.Next(_L("SkipCharacters()"));	// Skips non whitespace characters
 	_LL(&String[0], (TText8*)"abc   ");
@@ -714,20 +739,67 @@
 
 	////////////////////					
 	// Test Val(TReal32)
+	// 32-bit floating point number.
 	/////////////////////
-//	test.Next(_L("Val(TReal32)"));
-//	TReal32 TR32;
-//	test((ret=Lex.Val(TR32))==KErrNotSupported);
-
-
+	test.Next(_L("Val(TReal32)"));
+	TReal32 TR32 = 0;
+	
+	_LL(&String[0], (TText8*)"92.2337203685477");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR32))==KErrNone);
+				
+	_LL(&String[0], (TText8*)"92.2337203685477");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR32,'.'))==KErrNone);
+			
+	_LL(&String[0], (TText8*)"0.2337285477");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR32,'.'))==KErrNone);
+		
+	_LL(&String[0], (TText8*)"23");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR32,'.'))==KErrNone);
+		
+	_LL(&String[0], (TText8*)"0");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR32,'.'))==KErrNone);
+		
+	_LL(&String[0], (TText8*)"-324.27890");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR32,'.'))==KErrNone);
+	
 	////////////////////
-	// Test Val(TReal64)
+	// Test Val(TReal)
+	// 64-bit floating point number. Identical to TReal64.
 	///////////////////
-//	test.Next(_L("Val(TReal64)"));
-//	TReal64 TR64;
-//	test((ret=Lex.Val(TR64))==KErrNotSupported);
+	test.Next(_L("Val(TReal)"));
+	TReal TR64 = 0;
 
-
+	_LL(&String[0], (TText8*)"92.2337203685477");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR64))==KErrNone);
+		            
+	_LL(&String[0], (TText8*)"92.2337203685477");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR64,'.'))==KErrNone);
+		       
+	_LL(&String[0], (TText8*)"0.2337285477");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR64,'.'))==KErrNone);
+		    
+	_LL(&String[0], (TText8*)"23");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR64,'.'))==KErrNone);
+		    
+	_LL(&String[0], (TText8*)"0");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR64,'.'))==KErrNone);
+		    
+	_LL(&String[0], (TText8*)"-324.27890");
+	Lex=&String[0];
+	test((ret=Lex.Val(TR64,'.'))==KErrNone);
+	
+	
 	///////////////////////////
 	// Test Val(TUint8, TRadix)
 	///////////////////////////
--- a/kerneltest/e32test/buffer/t_regn.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/buffer/t_regn.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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 @@
 // Overview:
 // Test fixed and variable clipping regions.
 // API Information:
-// TRegionFix, RRegion .
+// TRegion, TRegionFix, RRegion .
 // Details:
 // - Construct some expandable clipping regions, add some rectangles, check the region 
 // matches the rectangles, clear the region, add some rectangles to the region and 
@@ -55,6 +55,9 @@
 // - Construct some regions with pre-allocated buffer (RRegionBuf), add some rectangles, 
 // get a pointer to the array of rectangles defining this region and check the 
 // rectangles are as expected.
+// - Test IsContainedBy method to check whether some rects cover the region used
+// as reference or are outside or overlapping
+// - Test Destroy method for a heap allocated object
 // Platforms/Drives/Compatibility:
 // All 
 // Assumptions/Requirement/Pre-requisites:
@@ -89,6 +92,8 @@
 	void TestSort();
 	void doTestRegionBuf(RRegion &aRegion);
 	void TestRegionBuf();
+	void TestIsContainedBy();
+	void TestDestroy();
 private:
 	void DoTestSet(TRegion** rgn,TInt rgnArraySize);
 	void CheckRectRegion(const TRegion& region,const TRect& rect);
@@ -793,6 +798,37 @@
 	doTestRegionBuf(rgn10);
 	}
 
+void TestRRegion::TestIsContainedBy()
+	{
+	TRect reference(5,5,90,90); // this is the one to compare against
+	TRect outer1(5,5,91,91);   // ref fits inside
+	TRect outer2(8,8,91,91); // reference is overlapping
+	TRect inner1(6,6,89,89); // this is inside ref
+
+	RRegion rRgn[1];
+	TRegion* tRgn[1]={&rRgn[0]};
+	
+	tRgn[0]->AddRect(reference);
+
+	test(tRgn[0]->IsContainedBy(outer1));
+	test(tRgn[0]->IsContainedBy(outer2)==EFalse);
+	test(tRgn[0]->IsContainedBy(inner1)==EFalse);
+	tRgn[0]->Clear();
+	rRgn[0].Close();
+	}
+
+void TestRRegion::TestDestroy()
+	{
+	TInt count=1;
+	// allocate from heap
+	TRect* pList = new TRect(1,2,3,4);
+	RRegion* rgnPtr = new RRegion(count, pList, 5 /*EDefaultGranularity*/ );
+	test(rgnPtr->Count()==count);
+	
+	// destroy the heap based object
+	rgnPtr->Destroy();
+	}
+
 // Top level test code
 LOCAL_C void test_region(TestRRegion t)
 	{
@@ -828,6 +864,10 @@
 	t.TestSort();
 	test.Next(_L("RegionBuf"));
 	t.TestRegionBuf();
+	test.Next(_L("IsContainedBy"));
+	t.TestIsContainedBy();
+	test.Next(_L("Destroy"));
+	t.TestDestroy();
 	test.End();
 	}
 
--- a/kerneltest/e32test/buffer/t_versio.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/buffer/t_versio.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -30,8 +30,7 @@
 //
 
 #include <e32test.h>
-
-const TInt KNumTVersions=1+3*3*3;
+#include "d_version.h"
 
 class RTvTest : public RTest
     {
@@ -40,8 +39,12 @@
     void TestName();
     void TestQVS();
     void Start(const TDesC &aHeading) {Printf(aHeading);Push();}
+    TInt LoadDeviceDriver();
+    TInt UnloadDeviceDriver();
 private:
     TBool QVS(TInt i,TInt j);
+public:
+    RVersionTest gLdd;
 private:
     TVersion* iTV[KNumTVersions];
     TVersion iDefTV;     // tests default constructor
@@ -79,6 +82,38 @@
     _S("99.99(999)")
     };
 
+TInt RTvTest::LoadDeviceDriver()
+//
+// Load device driver for kernel side test
+//
+    {
+    TInt r=KErrNone;
+    r=User::LoadLogicalDevice(KVersionTestLddName);
+    if(r!=KErrNone)
+        {
+        return r;
+        }
+    r=gLdd.Open();
+    return r;
+    }
+
+TInt RTvTest::UnloadDeviceDriver()
+//
+// Unload device driver
+//
+    {
+    TInt r=KErrNone;
+    gLdd.Close();
+
+    r = User::FreeLogicalDevice(KVersionTestLddName);
+    if(r!=KErrNone)
+        {
+        return r;
+        }
+    User::After(100000);
+    return r;
+    }
+
 RTvTest::RTvTest()
 //
 // Constructor
@@ -117,8 +152,7 @@
 // Test the version name
 //
     {
- 
-	Next(_L("Testing TVersion::Name()"));
+ 	Next(_L("Testing TVersion::Name()"));
     for (TInt i=0; i<KNumTVersions; i++)
         {
         TPtrC Name=(TPtrC)Names[i];
@@ -132,7 +166,6 @@
 // An independent calculation of what QueryVersionSupported should return
 //
     {
-
     if (aCurrent)
         aCurrent--;
     if (aRequested)
@@ -147,8 +180,7 @@
 // Check QueryVersionSupported()
 //
     {
- 
-   Next(_L("Testing User::QueryVersionSupported()"));
+    Next(_L("Testing User::QueryVersionSupported()"));
     for (TInt i=0; i<KNumTVersions; i++)
         {
         for (TInt j=0; j<KNumTVersions; j++)
@@ -164,10 +196,21 @@
 // Test TVersion class.
 //
     {
-
     RTvTest test;
 	test.Title();
 	test.Start(_L("Testing TVersion\n"));
+	
+	test.LoadDeviceDriver();
+
+	test.Printf(_L("Testing kernel side TVersion::Name()"));
+	TInt r = test.gLdd.VersionTestName();
+	test(r==KErrNone);
+
+	test.Printf(_L("Testing Kern::QueryVersionSupported()"));
+	test.gLdd.VersionTestQVS();
+	
+	test.UnloadDeviceDriver();
+	
     test.TestName();
     test.TestQVS();
     test.Printf(_L("TVersion passed testing\n"));
@@ -175,4 +218,3 @@
 	return(0);
     }
 
-
--- a/kerneltest/e32test/datetime/t_time.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/datetime/t_time.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1906,14 +1906,17 @@
 	// The platform may or may not support SecureTime, and even if it does,
 	// it may not have a secure time set. So we start this test by making
 	// sure that the NonSecureOffset is set (which may fail, if it's not
-	// supported OR if it's already set); then read and write the secure
-	// time, to make sure that it's supported and we have permission.
+	// supported OR if it's already set); then read and write and reread
+	// secure time, to make sure that it's supported and we have permission.
+	//
+	test.Next(_L("Test absolute timers with secure time change"));
 	User::SetUTCTime(now);
 	HAL::Set(HAL::ETimeNonSecureOffset, 0);
-	test.Next(_L("Test absolute timers with secure time change"));
 	TTime securetime;
-	if ((r = securetime.UniversalTimeSecure()) == KErrNone)
-		r = User::SetUTCTimeSecure(securetime);
+	if ((r = securetime.UniversalTimeSecure()) != KErrNone)
+		securetime = now;
+	if ((r = User::SetUTCTimeSecure(securetime)) == KErrNone)
+		r = securetime.UniversalTimeSecure();
 	if (r != KErrNone)
 		{
 		RDebug::Printf("WARNING: Secure clock change test skipped because secure time could not be changed!");
--- a/kerneltest/e32test/device/t_usbcsc.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/device/t_usbcsc.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -89,7 +89,7 @@
 //Command Line parameters 
 TBool gRealHardware = EFalse;
 TInt gVerbose = 0;
-enum TSpecTestType {EAll=0,EBufRead,EBufWrite,EEp0, EAltSet, EInterface, ECancel, EInvalidApi, EDescriptor, /*insert new non-bil here*/ EBilRw=100, EBilEp0, EBilAlt};
+enum TSpecTestType {EAll=0,EBufRead,EBufWrite,EEp0, EAltSet, EInterface, ECancel, EInvalidApi, EDescriptor,EHaltEndpoint, /*insert new non-bil here*/ EBilRw=100, EBilEp0, EBilAlt};
 TSpecTestType gSpecTest = EAll;
 
 RChunk gChunk;
@@ -1539,6 +1539,7 @@
 			DEBUGPRINT(OstTraceExt2(TRACE_NORMAL, TESTCANCEL_TESTCANCEL_DUP02, "header->iTail 0x%x header->iHead 0x%x\n", header->iTail, header->iHead));
 			transfer = (TUsbcScTransferHeader*) (header->iTail + base);
 			header->iTail = transfer->iNext;
+			header->iBilTail = transfer->iNext; 
 			}
 		while (r != KErrNone);	
 
@@ -1562,7 +1563,7 @@
 		test_KErrNone(WaitUntilTimeout(timeOut, status));	
 		test_Equal(status.Int(), KErrCancel);
 		
-	}//grealhardware
+		}//grealhardware
 
 	CloseStackIfOtg();
 	CloseChannel();
@@ -3129,30 +3130,59 @@
 		}
 
 	test.Next(_L("Endpoint stall status"));
-	TEndpointState epState = EEndpointStateUnknown;
-	test_Equal(EEndpointStateNotStalled, QueryEndpointState(1));
-	test_Equal(EEndpointStateNotStalled, QueryEndpointState(2));
-
-	test.Next(_L("Stall Ep1"));
-	gPort.HaltEndpoint(1);
-	epState = QueryEndpointState(1);
-	test(epState == EEndpointStateStalled);
-
-	test.Next(_L("Clear Stall Ep1"));
-	gPort.ClearHaltEndpoint(1);
-	epState = QueryEndpointState(1);
-	test(epState == EEndpointStateNotStalled);
-
-	test.Next(_L("Stall Ep2"));
-	gPort.HaltEndpoint(2);
-	epState = QueryEndpointState(2);
-	test(epState == EEndpointStateStalled);
-
-	test.Next(_L("Clear Stall Ep2"));
-	gPort.ClearHaltEndpoint(2);
-	epState = QueryEndpointState(2);
-	test(epState == EEndpointStateNotStalled);
-
+	
+	LoadDriver();
+	OpenChannel();
+	
+	TInt r; 
+	r = SettingOne(0);  
+	test_KErrNone(r);
+ 
+	r = gPort.RealizeInterface(gChunk);
+	test_KErrNone(r);
+    
+	OpenStackIfOtg();
+    
+	if (gRealHardware)
+		{       
+		test.Printf(_L("\n\n Trying hardware\nPlease start the Host side application...\n"));
+		OstTrace0(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP01, "\n \n Trying hardware\nPlease start the Host side application...\n");
+    
+		TRequestStatus status;
+		gPort.ReEnumerate(status);
+		User::WaitForRequest(status);
+		test.Printf(_L("Enumerated status = %d\n"), status.Int());
+		OstTrace1(TRACE_NORMAL, TESTENDPOINTSTALLSTATUS_TESTENDPOINTSTALLSTATUS_DUP02, "Enumerated status = %d\n", status.Int());
+        
+		TEndpointState epState = EEndpointStateUnknown;
+		test_Equal(EEndpointStateNotStalled, QueryEndpointState(1));
+		test_Equal(EEndpointStateNotStalled, QueryEndpointState(2));
+    
+		test.Next(_L("Stall Ep1"));
+		gPort.HaltEndpoint(1);
+		epState = QueryEndpointState(1);
+		test(epState == EEndpointStateStalled);
+    
+		test.Next(_L("Clear Stall Ep1"));
+		gPort.ClearHaltEndpoint(1);
+		epState = QueryEndpointState(1);
+		test(epState == EEndpointStateNotStalled);
+    
+		test.Next(_L("Stall Ep2"));
+		gPort.HaltEndpoint(2);
+		epState = QueryEndpointState(2);
+		test(epState == EEndpointStateStalled);
+    
+		test.Next(_L("Clear Stall Ep2"));
+		gPort.ClearHaltEndpoint(2);
+		epState = QueryEndpointState(2);
+		test(epState == EEndpointStateNotStalled);
+		}
+
+	CloseStackIfOtg();
+	CloseChannel();
+	UnloadDriver();  
+	
 	test.End();
 	}
 
@@ -3302,8 +3332,6 @@
 	TestExtendedEndpointDescriptor();
 
 	TestArbitraryStringDescriptors();
-	
-	TestEndpointStallStatus();
 
 	TestEndpointStatusNotify();
 
@@ -4294,6 +4322,13 @@
 		test.End();
 		break;
 		}
+	case EHaltEndpoint:
+		{
+		test.Start(_L("Halt Endpoint Tests \n"));
+		TestEndpointStallStatus();
+		test.End();
+		break;
+		}
 	default:
 		if (gSpecTest>=EBilRw)
 			TestBIL();
@@ -4350,7 +4385,7 @@
 		
 	if (gSpecTest == EAll)
 		{
-		for (TInt i = 1; i <= 7; i++)
+		for (TInt i = 1; i <= 9; i++)
 			{
 			gSpecTest = (TSpecTestType) i;
 			StartTests();
@@ -4395,8 +4430,8 @@
 				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE, "\nThis tests the Shared chunk version of the USBC driver.  It focuses on the elements specific to this driver and should be used in conjuntion with other USBC tests in order to validate the driver.\n\n");
 				test.Printf(_L("\n -h : Help.\n -r : test on Real hardware\n -v : Verbose\n -V : Very verbose\n-t <test> : Run a specific test.\n"));   
 				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP01, "\n -h : Help.\n -r : test on Real hardware\n -v : Verbose\n -V : Very verbose\n-t <test> : Run a specific test.\n");   
-				test.Printf(_L("\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt\n"));
-				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02, "\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt\n");
+				test.Printf(_L("\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt, halt_endpoint\n"));
+				OstTrace0(TRACE_NORMAL, PARSECOMMANDLINE_PARSECOMMANDLINE_DUP02, "\nAvailable tests:  buf_read, buf_write, ep0, altset, interface, cancel, api, descriptor, bil_rw, bil_ep0, bil_alt, halt_endpoint\n");
 				err=KErrCancel;
 				}
 			else
@@ -4435,7 +4470,10 @@
 						else if (subtoken==_L("interface"))
 								gSpecTest=EInterface;
 						else if (subtoken==_L("cancel"))
+								{
 								gSpecTest=ECancel;
+								gRealHardware = ETrue;
+								}
 						else if (subtoken==_L("api"))
 								gSpecTest=EInvalidApi;
 						else if (subtoken==_L("bil_rw"))
@@ -4458,6 +4496,11 @@
 								gRealHardware = ETrue;
 								gSpecTest=EAltSet;
 								}
+						else if (subtoken==_L("halt_endpoint"))
+								{
+								gRealHardware = ETrue;
+								gSpecTest=EHaltEndpoint;
+								}
 						else
 							{
 							err=KErrArgument;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/digitiser/d_kerneldigitisertest.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,194 @@
+// 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\digitiser\d_kerneldigitisertest.cpp
+// LDD for testing class TRawEvent digitiser kernel side entries
+// 
+//
+
+#include <kernel/kernel.h>
+
+#include "d_kerneldigitisertest.h"
+
+class DKLDDFactory : public DLogicalDevice
+//
+// Test LDD factory
+//
+	{
+public:
+	DKLDDFactory();
+	virtual TInt Install(); 								//overriding pure virtual
+	virtual void GetCaps(TDes8& aDes) const;				//overriding pure virtual
+	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
+	};
+
+class DKLDDChannel : public DLogicalChannelBase
+//
+// Test logical channel
+//
+	{
+public:
+	virtual ~DKLDDChannel();
+protected:
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
+	};
+
+
+DECLARE_STANDARD_LDD()
+	{
+	return new DKLDDFactory;
+	}
+
+//
+// Constructor
+//
+DKLDDFactory::DKLDDFactory()
+	{
+	}
+
+TInt DKLDDFactory::Create(DLogicalChannelBase*& aChannel)
+	{
+//
+// Create new channel
+//  
+	aChannel=new DKLDDChannel;
+	return aChannel?KErrNone:KErrNoMemory;
+	}
+
+TInt DKLDDFactory::Install()
+//
+// Install the LDD - overriding pure virtual
+	{
+	return SetName(&KLddName);
+	}
+
+void DKLDDFactory::GetCaps(TDes8& /*aDes*/) const
+//
+// Get capabilities - overriding pure virtual
+//
+	{
+	}
+
+TInt DKLDDChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
+//
+// Create channel
+//
+	{
+	return KErrNone;
+	}
+
+DKLDDChannel::~DKLDDChannel()
+//
+// Destructor
+//
+	{
+	}
+
+TInt DKLDDChannel::Request(TInt aReqNo, TAny* a1, TAny* /*a2*/)
+	{
+	TInt r=KErrNone;
+	TestTRawDigitiserEvent theEventObj;
+
+	switch(aReqNo)
+		{
+		case RTestDigitiserLdd::EStartTest:
+			kumemget(&theEventObj,a1,sizeof(TestTRawDigitiserEvent));
+			theEventObj.TestEvents();
+			break;
+
+		default:
+			r=KErrNotSupported;
+			break;
+		} 
+
+	return r;
+	}
+
+
+//
+// class TestTRawDigitiserEvent kernel side implementations
+//
+
+TestTRawDigitiserEvent::TestTRawDigitiserEvent()
+	{}
+
+TestTRawDigitiserEvent::TestTRawDigitiserEvent(TRawEvent::TType aType,TInt aX,TInt aY,TInt aZ,TInt aScanCode,TInt aPhi,TInt aTheta,TInt aAlpha,TUint8 aPointerNumber,TUint8 aTip)
+:iType(aType),iX(aX),iY(aY),iZ(aZ),iScanCode(aScanCode),iPhi(aPhi),iTheta(aTheta),iAlpha(aAlpha),iPointerNumber(aPointerNumber),iTip(aTip)
+	{}
+
+TInt TestTRawDigitiserEvent::TestEvents()
+	{
+	if(!(iDigitiser3DEvent.Type()==0))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.Set(iType);
+	if(!(iDigitiser3DEvent.Type()==iType))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.SetPointerNumber(iPointerNumber);
+	if(!(iPointerNumber == iDigitiser3DEvent.PointerNumber()))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.Set(iType,iScanCode);
+	//Set the Type temporarily to get through the assertion 
+	iDigitiser3DEvent.Set(TRawEvent::EKeyDown);
+    if(!(iScanCode==iDigitiser3DEvent.ScanCode()))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.Set(iType,iX,iY);
+	//Set the Type temporarily to get through the assertion
+	iDigitiser3DEvent.Set(TRawEvent::EPointerMove);
+	if(!( (iX==iDigitiser3DEvent.Pos().iX) && (iY==iDigitiser3DEvent.Pos().iY) ))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.Set(iType,iX,iY,iZ);
+	//Set the Type temporarily to get through the assertion
+	iDigitiser3DEvent.Set(TRawEvent::EPointerMove);
+	if(!((iX==iDigitiser3DEvent.Pos3D().iX) && (iY==iDigitiser3DEvent.Pos3D().iY) && (iZ==iDigitiser3DEvent.Pos3D().iZ) ))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.SetTip(iTip);
+	if(!(TBool(iTip) == iDigitiser3DEvent.IsTip()))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.SetTilt(iType,iPhi,iTheta);
+	//Set the Type temporarily to get through the assertion
+	iDigitiser3DEvent.Set(TRawEvent::EPointer3DTilt);
+	TAngle3D rawEventAnge3D=iDigitiser3DEvent.Tilt();
+	if(!((rawEventAnge3D.iPhi==iPhi) && (rawEventAnge3D.iTheta==iTheta)))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.SetRotation(iType,iAlpha);
+	//Set the Type temporarily to get through the assertion
+	iDigitiser3DEvent.Set(TRawEvent::EPointer3DRotation);
+	if(!(iAlpha == iDigitiser3DEvent.Rotation()))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	iDigitiser3DEvent.Set(iType,iX+1,iY+1,iZ+1,iPhi+1,iTheta+1,iAlpha+1);
+	//Set the Type temporarily to get through the assertion
+	iDigitiser3DEvent.Set(TRawEvent::EPointer3DTiltAndMove);
+	if(!( ((iX+1)==iDigitiser3DEvent.Pos3D().iX) && ((iY+1)==iDigitiser3DEvent.Pos3D().iY) && ((iZ+1)==iDigitiser3DEvent.Pos3D().iZ)))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+    rawEventAnge3D=iDigitiser3DEvent.Tilt();
+	if(!((rawEventAnge3D.iPhi==iPhi+1) &&(rawEventAnge3D.iTheta==iTheta+1)))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	if(!((iAlpha+1) == iDigitiser3DEvent.Rotation()))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+#ifndef __X86GMP__
+	iDigitiser3DEvent.Set(iType,iX+2,iY+2,iZ+2,static_cast<TUint8>(iPointerNumber+1));
+	//Set the Type temporarily to get through the assertion
+	iDigitiser3DEvent.Set(TRawEvent::EPointer3DTiltAndMove);
+  	if(!(((iX+2)==iDigitiser3DEvent.Pos3D().iX) && ((iY+2)==iDigitiser3DEvent.Pos3D().iY) && ((iZ+2)==iDigitiser3DEvent.Pos3D().iZ)))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+	if(!((iPointerNumber+1) == iDigitiser3DEvent.PointerNumber()))
+		{Kern::Printf("failed check at line %d, %S",__LINE__,__FILE__); return KErrArgument;}
+#endif //__X86GMP__
+	
+	NKern::ThreadEnterCS();
+	// queue the event
+	Kern::AddEvent(iDigitiser3DEvent);
+	NKern::ThreadLeaveCS();
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/digitiser/d_kerneldigitisertest.h	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,78 @@
+// 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\digitiser\d_kerneldigitisertest.h
+// 
+//
+
+#if !defined(__D_KERNELDIGITISERTEST_H__)
+#define __D_KERNELDIGITISERTEST_H__
+
+#include <e32cmn.h>
+#ifndef __KERNEL_MODE__
+#include <e32std.h>
+#endif
+
+_LIT(KLddName,"D_KERNELDIGITISERTEST.LDD");
+
+class TestTRawDigitiserEvent
+	{
+public:
+	TestTRawDigitiserEvent(TRawEvent::TType aType,TInt aX,TInt aY,TInt aZ,TInt aScanCode,TInt aPhi,TInt aTheta,TInt aAlpha,TUint8 aPointerNumber,TUint8 iTip);
+#ifdef __KERNEL_MODE__
+	TestTRawDigitiserEvent();
+	TInt TestEvents();
+#endif
+private:	
+	TRawEvent::TType iType;
+	TInt iX;
+    TInt iY;
+	TInt iZ;
+	TInt iScanCode;
+	TInt iPhi;
+	TInt iTheta;
+	TInt iAlpha;
+	TUint8 iPointerNumber;
+	TUint8 iTip;
+	TRawEvent iDigitiser3DEvent;
+	};
+
+class RTestDigitiserLdd : public RBusLogicalChannel
+	{
+public:
+
+	enum TControl
+		{
+		EStartTest=1
+		};
+
+
+public:
+	inline TInt Open();
+	inline TInt StartTest(TestTRawDigitiserEvent &aEventObject);
+	};
+
+
+#ifndef __KERNEL_MODE__
+inline TInt RTestDigitiserLdd::Open()
+	{
+	return DoCreate(KLddName,TVersion(0,1,0),KNullUnit,NULL,NULL);
+	}
+
+inline TInt RTestDigitiserLdd::StartTest(TestTRawDigitiserEvent &aEventObject)
+	{
+    return DoControl(EStartTest,&aEventObject);
+	}
+#endif //__KERNEL_MODE__
+
+#endif //__D_KERNELDIGITISERTEST_H__
--- a/kerneltest/e32test/digitiser/d_ldddigitisertest.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/digitiser/d_ldddigitisertest.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -25,8 +25,10 @@
 TUint 	gDeviceNumber=1;					// Device Number
 TUint	gRegisteredDeviceNumber;			// Represents the registered Hal Entry
 TBool	gHalEntryRegistered; 				// States HAL Entry Successfully registered or not
-static	TDigitiserInfoV02 gDigitserHalData;	// Buffer to  hold the HAL data; 
-static	TUint gPointer3DSupported;			// States whether the pointing device supports 3rd dimension.
+static TDigitiserInfoV02 gDigitserHalData;	// Buffer to  hold the HAL data; 
+static TUint gPointer3DSupported;			// States whether the pointing device supports 3rd dimension.
+static TRawEvent   kEvent;	
+
 
 class DDigitiserLDDTestFactory : public DLogicalDevice
 //
@@ -34,7 +36,6 @@
 //
 	{
 public:
-	DDigitiserLDDTestFactory();
 	virtual TInt Install(); 								//overriding pure virtual
 	virtual void GetCaps(TDes8& aDes) const;				//overriding pure virtual
 	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
@@ -50,7 +51,7 @@
 protected:
 	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
 	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
-	};
+	};			
 
 // Initialise Digitiser HAL Data
 void initialiseDigitiserHalData()
@@ -150,12 +151,6 @@
 	}
 #endif
 
-//
-// Constructor
-//
-DDigitiserLDDTestFactory::DDigitiserLDDTestFactory()
-	{
-	}
 
 TInt DDigitiserLDDTestFactory::Create(DLogicalChannelBase*& aChannel)
 	{
@@ -180,6 +175,7 @@
 	{
 	}
 
+
 TInt DDigitiserLDDTestChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
 //
 // Create channel
@@ -198,6 +194,11 @@
 TInt DDigitiserLDDTestChannel::Request(TInt aReqNo, TAny* a1, TAny* /*a2*/)
 	{
 	TInt r=KErrNone;
+	TUsrEventBuf eventBuf;
+	TPoint3D point3D;
+	TPoint   point2D;
+	TAngle3D angle3D;
+
 	switch(aReqNo)
 		{
 		case (RLddDigitiserTest::EADDHALENTRY):
@@ -311,8 +312,124 @@
 			r=gDigitserHalData.iPressureStep;
 			break;
 		case (RLddDigitiserTest::ESET_EPOINTER3DPRESSURESTEP):
-			gDigitserHalData.iPressureStep=(TInt)a1;
+			gDigitserHalData.iPressureStep=(TInt)a1; 		
 			break;
+		
+		//Testing TRawEvents;
+
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_EVENTTYPE): 
+			  kEvent.Set(static_cast<TRawEvent::TType>((TInt)a1));			
+			  break;
+
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_EVENTTYPE):   
+			    r=kEvent.Type();				 
+				break;
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_TILT): 			   
+			   kumemget32(&eventBuf,a1,sizeof(eventBuf));
+			   kEvent.SetTilt(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iPhi,eventBuf().iTheta);
+			   break;
+
+				
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_TILT): 				
+				angle3D=kEvent.Tilt();
+				eventBuf().iPhi =	angle3D.iPhi;
+				eventBuf().iTheta =	angle3D.iTheta;	
+				kumemput32(a1,&eventBuf,sizeof(eventBuf));
+			   break;
+
+
+		case  (RLddDigitiserTest::ESET_TEVENT_DNMBR):   
+			
+			   kEvent.SetDeviceNumber((TInt)a1);			   
+			   break;
+		case  (RLddDigitiserTest::EGET_TEVENT_DNMBR): 
+				r=kEvent.DeviceNumber();				
+				break;
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_ROTATION): 				    			    
+				kumemget32(&eventBuf,a1,sizeof(eventBuf));
+				kEvent.SetRotation(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iAlpha);				
+				break;
+
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_ROTATION):  
+			    r=kEvent.Rotation();				
+				break;
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_REPEAT): 
+			   kumemget32(&eventBuf,a1,sizeof(eventBuf));
+			   kEvent.SetRepeat(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iScanCode,eventBuf().iRepeats);
+			   break;
+
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_REPEAT): 
+				r=kEvent.Repeats();
+				break;
+	
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_SCANCODE):				    
+				kumemget32(&eventBuf,a1,sizeof(eventBuf));
+				kEvent.Set(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iScanCode);				
+				break;
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_SCANCODE): 			 
+				r=kEvent.ScanCode();				
+				break;
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_POS2D):				
+				kumemget32(&eventBuf,a1,sizeof(eventBuf));
+				kEvent.Set(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iX,eventBuf().iY);
+				break;
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_POS2D): 
+				point2D=kEvent.Pos();
+				eventBuf().iX =	point2D.iX;
+				eventBuf().iY =	point2D.iY;	  			 				
+				kumemput32(a1,&eventBuf,sizeof(eventBuf));
+				break;
+
+		
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_PTRNMBR): 
+				kEvent.SetPointerNumber(static_cast<TUint8>((TInt)a1));		
+				break;
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_3DNPTRNMBR):				
+				kumemget32(&eventBuf,a1,sizeof(eventBuf));
+				//IMPORT_C void Set (TType aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumbe
+				kEvent.Set(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iX,eventBuf().iY,eventBuf().iZ,eventBuf().iPointerNumber);
+				break;
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_PTRNMBR): 
+				r=kEvent.PointerNumber();				
+				break;
+ 
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_TICKS): 
+				r=kEvent.Ticks();
+				break;
+	
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_TIP): 
+				kEvent.SetTip(static_cast<TBool>((TInt)a1));			   
+				break;
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_TIP):
+				r=kEvent.IsTip();
+				break;
+
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_POS3D):								
+			kumemget32(&eventBuf,a1,sizeof(eventBuf));
+			kEvent.Set(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iX,eventBuf().iY,eventBuf().iZ);
+			break;
+			
+		case  (RLddDigitiserTest::EGET_TRAWEVENT_POS3D):
+
+			point3D=kEvent.Pos3D();	
+			eventBuf().iX =	point3D.iX;
+			eventBuf().iY =	point3D.iY;	  
+			eventBuf().iZ =	point3D.iZ;	  			
+			kumemput32(a1,&eventBuf,sizeof(eventBuf));
+			break;
+
+			
+		case  (RLddDigitiserTest::ESET_TRAWEVENT_ALL):								
+			kumemget32(&eventBuf,a1,sizeof(eventBuf));
+			kEvent.Set(static_cast<TRawEvent::TType>(eventBuf().iType),eventBuf().iX,eventBuf().iY,eventBuf().iZ,eventBuf().iPhi,eventBuf().iTheta,eventBuf().iAlpha);
+			break;
+			
 		default:
 			r=KErrNotSupported;
 			break;
--- a/kerneltest/e32test/digitiser/d_ldddigitisertest.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/digitiser/d_ldddigitisertest.h	Wed Sep 22 10:53:45 2010 +0100
@@ -20,11 +20,32 @@
 
 #include <e32cmn.h>
 #ifndef __KERNEL_MODE__
-#include <e32std.h>
+#include <e32svr.h>
 #endif
 
 _LIT(KLddName,"D_LDDDIGITISERTEST.LDD");
 
+struct TRawEventInfo
+	{
+
+	TInt iType;
+	TInt iScanCode;
+	TInt iRepeats;
+	TInt iX;
+    TInt iY;	   
+	TInt iZ;
+	TInt iPhi;
+	TInt iTheta;
+	TInt iAlpha;
+	TUint8 iPointerNumber;
+	TUint8 iTip;	
+	};
+
+ typedef TPckgBuf <TRawEventInfo> TUsrEventBuf;	
+ typedef TRawEvent::TType  RawEventType;
+
+
+
 class RLddDigitiserTest : public RBusLogicalChannel
 	{
 public:
@@ -67,49 +88,137 @@
 		ESET_EPOINTER3DMAXPRESSURE,
 
 		EGET_EPOINTER3DPRESSURESTEP,
-		ESET_EPOINTER3DPRESSURESTEP
+		ESET_EPOINTER3DPRESSURESTEP,		
+
+       //TRawEvents Get Set Enums		
+		
+		ESET_TRAWEVENT_EVENTTYPE,
+		EGET_TRAWEVENT_EVENTTYPE,
+
+		ESET_TRAWEVENT_TILT,
+		EGET_TRAWEVENT_TILT,
+
+
+		ESET_TEVENT_DNMBR,
+		EGET_TEVENT_DNMBR,
+
+		ESET_TRAWEVENT_ROTATION,
+		EGET_TRAWEVENT_ROTATION,
+
+		ESET_TRAWEVENT_REPEAT,
+		EGET_TRAWEVENT_REPEAT,
+		
+
+		ESET_TRAWEVENT_SCANCODE,
+		EGET_TRAWEVENT_SCANCODE,
+
+		ESET_TRAWEVENT_POS2D,
+		EGET_TRAWEVENT_POS2D,
+		
+		ESET_TRAWEVENT_POS3D,
+		EGET_TRAWEVENT_POS3D,
+
+	
+
+		
+		ESET_TRAWEVENT_PTRNMBR,
+		ESET_TRAWEVENT_3DNPTRNMBR,
+		EGET_TRAWEVENT_PTRNMBR,
+
+
+		EGET_TRAWEVENT_TICKS,	 
+
+	
+		ESET_TRAWEVENT_TIP,
+		EGET_TRAWEVENT_TIP,
+			
+		ESET_TRAWEVENT_ALL		
 		};
 
+	
+
+
 public:
-	inline TInt Open();
-	inline TInt registerHalHandler();
-	inline TInt removeHalHandler();
-	inline TInt getRegisteredDeviceNumber();
-	inline TInt initialiseHalData();
+	TInt Open();
+	TInt registerHalHandler();
+	TInt removeHalHandler();
+	TInt getRegisteredDeviceNumber();
+	TInt initialiseHalData();
 
-	inline TInt getPointer3D();
-	inline TInt setPointer3D(TUint aPointer3D);
+	TInt getPointer3D();
+	TInt setPointer3D(TUint aPointer3D);
 
-	inline TInt getPointer3DMaxProximity();
-	inline TInt setPointer3DMaxProximity(TUint aPointer3DMaxProximity);
+	TInt getPointer3DMaxProximity();
+	TInt setPointer3DMaxProximity(TUint aPointer3DMaxProximity);
+	
+	TInt getPointer3DThetaSupported();
+	TInt setPointer3DThetaSupported(TUint aPointer3DThetaSupported);
+	
+	TInt getPointer3DPhiSupported();
+	TInt setPointer3DPhiSupported(TUint aPointer3DPhiSupported);
+	
+	TInt getPointer3DRotationSupported();
+	TInt setPointer3DRotationSupported(TUint aPointer3DRotationSupported);
 	
-	inline TInt getPointer3DThetaSupported();
-	inline TInt setPointer3DThetaSupported(TUint aPointer3DThetaSupported);
+	TInt getPointer3DPressureSupported();
+	TInt setPointer3DPressureSupported(TUint aPointer3DPressureSupported);
+
+	TInt getPointer3DProximityStep();
+	TInt setPointer3DProximityStep(TUint aPointer3DProximityStep);
+	
+	TInt getPointerMaxPointers();
+	TInt setPointerMaxPointers(TUint aPointerMaxPointers);
 	
-	inline TInt getPointer3DPhiSupported();
-	inline TInt setPointer3DPhiSupported(TUint aPointer3DPhiSupported);
+	TInt getPointerNumberOfPointers();
+	TInt setPointerNumberOfPointers(TUint aPointerNumberOfPointers);
+	
+	TInt getPointer3DMaxPressure();
+	TInt setPointer3DMaxPressure(TUint aPointer3DMaxPressure);
+	
+	TInt getPointer3DPressureStep();
+	TInt setPointer3DPressureStep(TUint aPointer3DPressureStep);
 	
-	inline TInt getPointer3DRotationSupported();
-	inline TInt setPointer3DRotationSupported(TUint aPointer3DRotationSupported);
-	
-	inline TInt getPointer3DPressureSupported();
-	inline TInt setPointer3DPressureSupported(TUint aPointer3DPressureSupported);
+
+	//TRawEvents
 
-	inline TInt getPointer3DProximityStep();
-	inline TInt setPointer3DProximityStep(TUint aPointer3DProximityStep);
+	TInt setTEvntType(TInt aType);
+	TInt getTEvntType();
+
+	TInt setTEvntDNum(TInt aDNum);
+	TInt getTEvntDNum();
 	
-	inline TInt getPointerMaxPointers();
-	inline TInt setPointerMaxPointers(TUint aPointerMaxPointers);
-	
-	inline TInt getPointerNumberOfPointers();
-	inline TInt setPointerNumberOfPointers(TUint aPointerNumberOfPointers);
+	TInt setTEvnt3DnPntr (TInt aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber);
+	TInt setTEvntPntr(TInt aPointerNumber);    
+	TInt getTEvntPntr();
+
+	TInt getTEvntTicks();
+	 
+	TInt setTEvntTip(TBool aTip);
+	TBool TEvntTicksIsTip();		
+
+	TInt setTEvntScanCode(TInt aType,TInt aScanCode);
+	TInt getTEvntScanCode();
+
+	TInt setTEvntRotation(TInt aType,TInt aAlpha);	 
+	TInt getTEvntRotation();
+
+
+	TInt setTEvntPos(TInt aType,TInt aX,TInt aY);	 
+	TInt getTEvntPos(TUsrEventBuf& eventBuf);
 	
-	inline TInt getPointer3DMaxPressure();
-	inline TInt setPointer3DMaxPressure(TUint aPointer3DMaxPressure);
-	
-	inline TInt getPointer3DPressureStep();
-	inline TInt setPointer3DPressureStep(TUint aPointer3DPressureStep);
+	TInt setTEvntPos3D(TInt aType,TInt aX,TInt aY,TInt aZ);
+	TInt getTEventPos3D(TUsrEventBuf& eventBuf);
+
+	TInt setTEvntAll(TInt aType,TInt aX,TInt aY,TInt aZ,TInt aPhi,TInt aTheta,TInt aAlpha);
+
+	TInt setTEvntTilt(TInt aType,TInt aPhi,TInt aTheta);										
+	TInt getTEvntTilt(TUsrEventBuf& eventBuf);
+
+	TInt setTEvntRepeat(TInt aType,TInt aScanCode,TInt aRepeats);
+	TInt getTEvntRepeat();										 	
 	};
 
+
+
 #include "d_lddDigitisertest.inl"
 #endif   //__DLDDDIGITISERTEST_H__
--- a/kerneltest/e32test/digitiser/d_ldddigitisertest.inl	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/digitiser/d_ldddigitisertest.inl	Wed Sep 22 10:53:45 2010 +0100
@@ -150,6 +150,193 @@
 	{
     return DoControl(ESET_EPOINTER3DPRESSURESTEP, (TAny *)aPointer3DPressureStep);
 	}
+
+
+	
+
+//TrawEvents
+inline TInt RLddDigitiserTest::setTEvntType(TInt aType)
+	{
+	return 	DoControl(ESET_TRAWEVENT_EVENTTYPE, (TAny *)aType);
+	}
+
+inline TInt RLddDigitiserTest::getTEvntType()
+	{
+	return 	DoControl(EGET_TRAWEVENT_EVENTTYPE);
+	}
+
+inline	TInt RLddDigitiserTest::setTEvntDNum(TInt aDNum)
+	{	
+		return DoControl(ESET_TEVENT_DNMBR, (TAny *)aDNum);
+	    
+	}
+
+inline	TInt RLddDigitiserTest::getTEvntDNum()
+	{
+	return DoControl(EGET_TEVENT_DNMBR);
+	}
+
+	
+
+inline TInt RLddDigitiserTest::setTEvntScanCode(TInt aType,TInt aScanCode)
+
+	{
+	TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;
+	eventBuf().iScanCode=aScanCode;		
+	return DoControl(ESET_TRAWEVENT_SCANCODE, (TAny *)&eventBuf);
+
+	
+	}
+													 
+inline TInt RLddDigitiserTest::getTEvntScanCode()
+
+	{
+	return 	DoControl(EGET_TRAWEVENT_SCANCODE);
+	}
+
+
+inline TInt RLddDigitiserTest::setTEvntRotation(TInt aType,TInt aAlpha)
+
+	{
+		
+	TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;	
+	eventBuf().iAlpha=aAlpha;
+	return DoControl(ESET_TRAWEVENT_ROTATION, (TAny *)&eventBuf);
+	}
+
+inline TInt RLddDigitiserTest::getTEvntRotation()
+
+	{
+	return 	DoControl(EGET_TRAWEVENT_ROTATION);
+	}
+
+
+inline	TInt RLddDigitiserTest::setTEvntPntr(TInt aPointerNumber)
+	{ 
+	return 	DoControl(ESET_TRAWEVENT_PTRNMBR, (TAny *)aPointerNumber);
+	}   
+inline	TInt RLddDigitiserTest::getTEvntPntr()
+	{ 
+	return 	DoControl(EGET_TRAWEVENT_PTRNMBR);
+	}
+
+inline	TInt RLddDigitiserTest::getTEvntTicks()
+	{
+	return 	DoControl(EGET_TRAWEVENT_TICKS);
+	}
+	 
+inline	TBool RLddDigitiserTest::TEvntTicksIsTip()
+	{
+	return 	DoControl(EGET_TRAWEVENT_TIP);
+	}		
+inline	TInt RLddDigitiserTest::setTEvntTip(TBool aTip)
+	{
+	return 	DoControl(ESET_TRAWEVENT_TIP, (TAny *)aTip);
+	}
+
+
+													 
+inline TInt RLddDigitiserTest::setTEvnt3DnPntr (TInt aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber)
+	{
+
+	
+	TUsrEventBuf  eventBuf;
+
+	eventBuf().iType=aType;
+	eventBuf().iX=aX;		 
+	eventBuf().iY=aY;	
+	eventBuf().iZ=aZ;		 
+	eventBuf().iPointerNumber=aPointerNumber;
+	return DoControl(ESET_TRAWEVENT_3DNPTRNMBR, (TAny *)&eventBuf);
+
+
+	}
+
+inline TInt RLddDigitiserTest::setTEvntPos(TInt aType,TInt aX,TInt aY)
+	{
+
+	TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;
+	eventBuf().iX=aX;		 
+	eventBuf().iY=aY;	
+	return DoControl(ESET_TRAWEVENT_POS2D, (TAny *)&eventBuf);
+	}
+
+
+inline TInt RLddDigitiserTest::getTEvntPos(TUsrEventBuf& eventBuf)
+	{		
+	return DoControl(EGET_TRAWEVENT_POS2D,(TAny *)&eventBuf);
+	}
+								 
+
+  inline TInt RLddDigitiserTest::setTEvntPos3D(TInt aType,TInt aX,TInt aY,TInt aZ)
+	{
+	TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;
+	eventBuf().iX=aX;		 
+	eventBuf().iY=aY;
+	eventBuf().iZ=aZ;		   	
+	return DoControl(ESET_TRAWEVENT_POS3D, (TAny *)&eventBuf);
+	}						
+
+
+TInt RLddDigitiserTest::getTEventPos3D(TUsrEventBuf& eventBuf)
+	{		   	
+	return DoControl(EGET_TRAWEVENT_POS3D,(TAny *)&eventBuf);
+	}
+
+
+
+inline TInt RLddDigitiserTest::setTEvntAll(TInt aType,TInt aX,TInt aY,TInt aZ,TInt aPhi,TInt aTheta,TInt aAlpha)
+	{
+	TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;
+	eventBuf().iX=aX;		 
+	eventBuf().iY=aY;
+	eventBuf().iZ=aZ;		   
+	eventBuf().iPhi=aPhi;	   
+	eventBuf().iTheta=aTheta;
+	eventBuf().iAlpha=aAlpha;	
+	return DoControl(ESET_TRAWEVENT_ALL, (TAny *)&eventBuf);
+	}
+
+ inline TInt RLddDigitiserTest::setTEvntTilt(TInt aType,TInt aPhi,TInt aTheta)
+
+	{
+	 TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;
+	eventBuf().iPhi=aPhi;	   
+	eventBuf().iTheta=aTheta;
+	return DoControl(ESET_TRAWEVENT_TILT, (TAny *)&eventBuf);
+	}
+
+
+  inline TInt RLddDigitiserTest::getTEvntTilt(TUsrEventBuf& eventBuf)
+
+	{
+	return DoControl(EGET_TRAWEVENT_TILT,(TAny *)&eventBuf);
+	}
+
+
+inline TInt RLddDigitiserTest::setTEvntRepeat(TInt aType,TInt aScanCode,TInt aRepeats)
+	{
+	TUsrEventBuf  eventBuf;
+	eventBuf().iType=aType;
+	eventBuf().iScanCode=aScanCode;	
+	eventBuf().iRepeats=aRepeats;		   	
+	return DoControl(ESET_TRAWEVENT_REPEAT, (TAny *)&eventBuf);
+	}
+
+inline TInt RLddDigitiserTest::getTEvntRepeat()
+	{
+	return DoControl(EGET_TRAWEVENT_REPEAT);
+	}
+
+
+
 #endif
 
 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/digitiser/t_kerneldigitisertest.cpp	Wed Sep 22 10:53:45 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:
+// e32test\digitiser\t_kerneldigitisertest.cpp
+// Overview:
+// Test the TRawEvent APIS and events associated with the Digitiser and also verify the BTRACEs (manually)
+// Tests kernel side functions
+// API Information:
+// TRawEvent
+// Details:
+// - Test the following 6  Events types 
+// 1.	EPointerMove
+// 2.	EPointer3DInRange,
+// 3.	EPointer3DOutOfRange,
+// 4.	EPointer3DTilt,
+// 5.	EPointer3DRotation,
+// 6.	EPointer3DTiltAndMove,
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites: 
+// Failures and causes:
+// 
+//
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32svr.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include "d_kerneldigitisertest.h"
+
+LOCAL_D RTest test(_L("T_KernelDigitiserTest"));
+
+RTestDigitiserLdd gLdd;
+
+//
+// class TestTRawDigitiserEvent user side constructor
+//
+
+TestTRawDigitiserEvent::TestTRawDigitiserEvent(TRawEvent::TType aType,TInt aX,TInt aY,TInt aZ,TInt aScanCode,TInt aPhi,TInt aTheta,TInt aAlpha,TUint8 aPointerNumber,TUint8 aTip)
+:iType(aType),iX(aX),iY(aY),iZ(aZ),iScanCode(aScanCode),iPhi(aPhi),iTheta(aTheta),iAlpha(aAlpha),iPointerNumber(aPointerNumber),iTip(aTip)
+	{}
+
+
+//
+// other functions
+//
+void LoadDeviceDriver()
+	{
+	test_KErrNone(User::LoadLogicalDevice(KLddName));
+	test_KErrNone(gLdd.Open());
+	}
+
+void UnloadDeviceDriver()
+	{
+	gLdd.Close();
+	test_KErrNone(User::FreeLogicalDevice(KLddName));
+	}
+
+
+GLDEF_C TInt E32Main()
+//
+//
+    {
+	__UHEAP_MARK;
+ 	test.Title();
+
+	test.Start(_L("Testing kernel side digitiser events"));
+	
+	TestTRawDigitiserEvent kDigitiserEvent1(TRawEvent::EPointerMove, -890,-123, -823,455,2563,156,62,3,1);
+	TestTRawDigitiserEvent kDigitiserEvent2(TRawEvent::EPointer3DInRange, 23,45,23,1,2,6,4,2,1);
+	TestTRawDigitiserEvent kDigitiserEvent3(TRawEvent::EPointer3DOutOfRange, 23,45,23,1,2,6,4,2,0);
+	TestTRawDigitiserEvent kDigitiserEvent4(TRawEvent::EPointer3DTilt, 23,45,23,1,2,6,4,2,1);
+	TestTRawDigitiserEvent kDigitiserEvent5(TRawEvent::EPointer3DRotation, 23,45,23,1,2,6,4,2,1);
+	TestTRawDigitiserEvent kDigitiserEvent6(TRawEvent::EPointer3DTiltAndMove, 23,45,23,1,2,6,4,2,0);
+
+	LoadDeviceDriver();
+
+	test.Printf(_L("kDigitiserEvent1"));
+	test_KErrNone(gLdd.StartTest(kDigitiserEvent1));
+
+	test.Printf(_L("kDigitiserEvent2"));
+	test_KErrNone(gLdd.StartTest(kDigitiserEvent2));
+
+	test.Printf(_L("kDigitiserEvent3"));
+	test_KErrNone(gLdd.StartTest(kDigitiserEvent3));
+
+	test.Printf(_L("kDigitiserEvent4"));
+	test_KErrNone(gLdd.StartTest(kDigitiserEvent4));
+
+	test.Printf(_L("kDigitiserEvent5"));
+	test_KErrNone(gLdd.StartTest(kDigitiserEvent5));
+
+	test.Printf(_L("kDigitiserEvent6"));
+	test_KErrNone(gLdd.StartTest(kDigitiserEvent6));
+
+	UnloadDeviceDriver();
+
+	test.Printf(_L("T_KERNELDIGITISERTEST: Successfully Completed\n"));
+
+	test.End();
+	test.Close();
+
+	__UHEAP_MARKEND;
+    return KErrNone;
+    }
--- a/kerneltest/e32test/digitiser/t_ldddigitisertest.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/digitiser/t_ldddigitisertest.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -129,7 +129,6 @@
    	test.Printf(_L("Testing Derived Attributes using a test Driver for Digitiser\n"));
 	r=User::LoadLogicalDevice(KLddFileName);
 	test(r==KErrNone);
-
 	r=gLDD.Open();
 	test(r==KErrNone);
 
@@ -269,8 +268,7 @@
 	
 	r=HAL::Get(testDeviceNumber,HALData::EPointer3DPressureStep,halApiVal);
 	test(r==KErrNone);
-	test(halApiVal == newPointer3DPressureStep);  
-	
+	test(halApiVal == newPointer3DPressureStep);  	
 	r=gLDD.removeHalHandler();
     test(r == KErrNone);
 
@@ -376,6 +374,382 @@
 	__UHEAP_MARKEND;
 	}
 
+
+
+
+void  DoTestTEvntTypes()
+	{
+	TInt r;
+	TRawEvent::TType firstEvent=TRawEvent::ENone;
+	TRawEvent::TType lastEvent=TRawEvent::ERestartSystem;
+    for(int i=firstEvent;i<=lastEvent;++i)
+		{
+		gLDD.setTEvntType(i);			
+		r=gLDD.getTEvntType();
+		test(r == i);
+		}   	
+
+	}
+
+
+void  DoTestTEvntDNum()
+	{
+	TInt r;
+	TInt aDvcNum1=2;
+	TInt aDvcNum2=100;
+
+
+	 
+	gLDD.setTEvntDNum(aDvcNum1);
+	r=gLDD.getTEvntDNum();
+	test(r == aDvcNum1);
+
+	gLDD.setTEvntDNum(aDvcNum2);
+	r=gLDD.getTEvntDNum();
+	test(r == aDvcNum2);
+		
+	}
+
+
+
+void  DoTestTEvntScanCode()
+	{
+
+	TInt r;
+    TInt aScanCode1=0;
+	TInt aScanCode2=235;
+	gLDD.setTEvntScanCode(TRawEvent::EPointer3DInRange, aScanCode1);
+	r=gLDD.getTEvntScanCode();
+	test(r == aScanCode1);
+
+
+	gLDD.setTEvntScanCode(TRawEvent::EPointer3DRotation, aScanCode2);
+	r=gLDD.getTEvntScanCode();
+	test(r == aScanCode2);
+
+	}
+	
+
+void  DoTestTEvnTilt()
+	{
+	TInt aPhi1 =0, aTheta1=3;
+	TInt aPhi2 =20, aTheta2=45;
+	TInt r;
+	TUsrEventBuf  eventBuf;
+	
+
+	r=gLDD.setTEvntTilt(TRawEvent::EPointerMove,aPhi1,aTheta1);
+	test(r==KErrNone);
+	r=gLDD.getTEvntTilt(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iPhi == aPhi1) && (eventBuf().iTheta == aTheta1));
+
+
+	r=gLDD.setTEvntTilt(TRawEvent::EPointer3DInRange,aPhi2,aTheta2);
+	test(r==KErrNone);
+
+	r=gLDD.getTEvntTilt(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iPhi == aPhi2) && (eventBuf().iTheta == aTheta2));	
+	
+	}
+
+
+
+
+
+void  DoTestTEvntRotation()
+	{
+	TInt r;
+    TInt  aRotation1 =12, aRotation2=323;
+
+	r=gLDD.setTEvntRotation(TRawEvent::EPointerMove,aRotation1);
+	test(r==KErrNone);
+	r=gLDD.getTEvntRotation();
+	test(r == aRotation1);
+
+
+	r=gLDD.setTEvntRotation(TRawEvent::EPointerMove,aRotation2);
+	test(r==KErrNone);
+	r=gLDD.getTEvntRotation();
+	test(r == aRotation2);
+	
+	}
+
+void  DoTestTEvntPtr()
+	{
+	TInt r;
+	TUint8 aPointerNumber1=123;
+	TUint8 aPointerNumber2=2;
+	TUint8 aPointerNumber3=3;
+	TUint8 aPointerNumber4=125;
+
+	TPoint3D tPoint3D1(-23 ,-85 ,-93);
+	TPoint3D tPoint3D2(-23 ,0 ,100);
+	TUsrEventBuf  eventBuf;
+
+
+    r=gLDD.setTEvnt3DnPntr(TRawEvent::EPointerMove,tPoint3D1.iX,tPoint3D1.iY,tPoint3D1.iZ,aPointerNumber1);
+	test(r==KErrNone);			 
+	r=gLDD.getTEvntPntr();
+	test(r == aPointerNumber1);	 
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D1.iX) && (eventBuf().iY == tPoint3D1.iY)  && (eventBuf().iZ == tPoint3D1.iZ) );
+
+ 	
+	gLDD.setTEvntPntr(aPointerNumber2);
+	r=gLDD.getTEvntPntr();
+	test(r == aPointerNumber2);
+
+	r=gLDD.setTEvnt3DnPntr(TRawEvent::EPointerMove,tPoint3D2.iX,tPoint3D2.iY,tPoint3D2.iZ,aPointerNumber3);
+	test(r==KErrNone);			 
+	r=gLDD.getTEvntPntr();
+	test(r == aPointerNumber3);	 
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D2.iX) && (eventBuf().iY == tPoint3D2.iY)  && (eventBuf().iZ == tPoint3D2.iZ) );	  
+
+	gLDD.setTEvntPntr(aPointerNumber4);
+	r=gLDD.getTEvntPntr();
+	test(r == aPointerNumber4);
+	
+	}
+
+
+
+void  DoTestTEvntTicksNTips()
+	{
+	TInt r;
+	TBool aTip=true;
+
+	gLDD.setTEvntTip(aTip);
+	r=gLDD.TEvntTicksIsTip();
+	test(r == aTip);
+	
+	aTip=false;
+    gLDD.setTEvntTip(aTip);
+	r=gLDD.TEvntTicksIsTip();
+	test(r == aTip);
+
+	r=gLDD.getTEvntTicks();
+	test(r > 0             );
+	
+	}
+
+
+	
+
+
+
+void  DoTestTEvntPOS2D()
+	{
+	TInt r;		
+	TPoint tPoint1(0,0);
+	TPoint tPoint2(323232,45454);
+	TPoint tPoint3(-85 ,-93);
+	TPoint tPoint4 (0 ,100);
+	TUsrEventBuf  eventBuf;
+
+
+    r=gLDD.setTEvntPos(TRawEvent::EPointerMove,tPoint1.iX,tPoint1.iY);
+	test(r==KErrNone);
+	r=gLDD.getTEvntPos(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint1.iX) && (eventBuf().iY == tPoint1.iY) );
+
+
+	r=gLDD.setTEvntPos(TRawEvent::EPointerMove,tPoint2.iX,tPoint2.iY);
+	test(r==KErrNone);
+	r=gLDD.getTEvntPos(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint2.iX) && (eventBuf().iY == tPoint2.iY) );
+
+
+
+	r=gLDD.setTEvntPos(TRawEvent::EPointerMove,tPoint3.iX,tPoint3.iY);
+	test(r==KErrNone);
+	r=gLDD.getTEvntPos(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3.iX) && (eventBuf().iY == tPoint3.iY) );
+
+
+	r=gLDD.setTEvntPos(TRawEvent::EPointerMove,tPoint4.iX,tPoint4.iY);
+	test(r==KErrNone);
+	r=gLDD.getTEvntPos(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint4.iX) && (eventBuf().iY == tPoint4.iY) );
+
+	}
+		
+
+
+
+void  DoTestTEvntRepeat()
+	{
+	TInt r;
+
+	TInt aType=TRawEvent::EPointerMove;
+	 TInt aScanCode=20;
+	 TInt aRepeats1=1;
+	 TInt aRepeats2=13430;
+	 TInt aRepeats3=0;
+
+	 r=gLDD.setTEvntRepeat(aType,aScanCode,aRepeats1);
+	 test(r==KErrNone);
+	 r=gLDD.getTEvntRepeat();
+	 test( r== aRepeats1);
+
+	 r=gLDD.setTEvntRepeat(aType,aScanCode,aRepeats2);
+	 test(r==KErrNone);
+	 r=gLDD.getTEvntRepeat();
+	 test( r== aRepeats2);
+
+
+	 r=gLDD.setTEvntRepeat(aType,aScanCode,aRepeats3);
+	 test(r==KErrNone);
+	 r=gLDD.getTEvntRepeat();
+	 test( r== aRepeats3);
+	
+	}
+		
+
+
+
+void  DoTestTEvntPos3D()
+	{
+	
+	TPoint3D tPoint3D1(0,0,0);
+	TPoint3D tPoint3D2(23232,323232,45454);
+	TPoint3D tPoint3D3(-23 ,-85 ,-93);
+	TPoint3D tPoint3D4(-23 ,0 ,100);
+	TUsrEventBuf  eventBuf;
+	TInt r;
+
+     r=gLDD.setTEvntPos3D(TRawEvent::EPointerMove,tPoint3D1.iX,tPoint3D1.iY,tPoint3D1.iZ);
+	test(r==KErrNone);
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D1.iX) && (eventBuf().iY == tPoint3D1.iY)  && (eventBuf().iZ == tPoint3D1.iZ) );
+
+
+	r=gLDD.setTEvntPos3D(TRawEvent::EPointer3DInRange,tPoint3D2.iX,tPoint3D2.iY,tPoint3D2.iZ);
+	test(r==KErrNone);
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D2.iX) && (eventBuf().iY == tPoint3D2.iY)  && (eventBuf().iZ == tPoint3D2.iZ) );
+
+
+	r=gLDD.setTEvntPos3D(TRawEvent::EPointer3DRotation,tPoint3D3.iX,tPoint3D3.iY,tPoint3D3.iZ);
+	test(r==KErrNone);
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D3.iX) && (eventBuf().iY == tPoint3D3.iY)  && (eventBuf().iZ == tPoint3D3.iZ) );
+
+
+	r=gLDD.setTEvntPos3D(TRawEvent::EPointer3DTiltAndMove,tPoint3D4.iX,tPoint3D4.iY,tPoint3D4.iZ);
+	test(r==KErrNone);
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D4.iX) && (eventBuf().iY == tPoint3D4.iY)  && (eventBuf().iZ == tPoint3D4.iZ) );
+	
+	}
+
+
+
+
+
+void  DoTestTEvntPos3DAll()
+	{
+	TInt r;
+	TPoint3D tPoint3D1(0,322,45454);
+	TPoint3D tPoint3D2(-23 ,0 ,-93);
+
+    TInt aPhi1 =0, aTheta1=3, alpha1=10;
+	TInt aPhi2 =20, aTheta2=45,alpha2=126;
+
+	TRawEvent::TType event1 =TRawEvent::EPointerMove;
+	TRawEvent::TType event2= TRawEvent::EPointer3DRotation;
+
+	TUsrEventBuf  eventBuf;
+		
+    r=gLDD.setTEvntAll(event1,tPoint3D1.iX,tPoint3D1.iY,tPoint3D1.iZ,aPhi1,aTheta1,alpha1);
+	test(r==KErrNone);
+
+	r=gLDD.getTEvntType();
+    test(r == event1);
+
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D1.iX) && (eventBuf().iY == tPoint3D1.iY)  && (eventBuf().iZ == tPoint3D1.iZ) );
+    
+
+	r=gLDD.getTEvntRotation();
+	test(r == alpha1);
+    r=gLDD.getTEvntTilt(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iPhi == aPhi1) && (eventBuf().iTheta == aTheta1));
+
+
+  
+
+	r=gLDD.setTEvntAll(event2,tPoint3D2.iX,tPoint3D2.iY,tPoint3D2.iZ,aPhi2,aTheta2,alpha2);
+	test(r==KErrNone);
+
+	r=gLDD.getTEvntType();
+    test(r == event2);
+
+	r=gLDD.getTEventPos3D(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iX == tPoint3D2.iX) && (eventBuf().iY == tPoint3D2.iY)  && (eventBuf().iZ == tPoint3D2.iZ) );
+    
+
+	r=gLDD.getTEvntRotation();
+	test(r == alpha2);
+    r=gLDD.getTEvntTilt(eventBuf);
+	test(r==KErrNone);
+	test((eventBuf().iPhi == aPhi2) && (eventBuf().iTheta == aTheta2));
+
+	}
+
+
+
+void DoTestKernelTrawEvents()
+	{
+	__UHEAP_MARK;
+	TInt r;
+	test.Printf(_L("Testing KernelSide TrawEvents \n"));
+	r=User::LoadLogicalDevice(KLddFileName);	
+	test(r==KErrNone);
+	r=gLDD.Open();
+	test(r==KErrNone);
+
+	//Test Kernel Side TRawevents
+
+	DoTestTEvntTypes();
+	DoTestTEvntDNum();	
+	DoTestTEvntScanCode();
+	DoTestTEvnTilt();
+	DoTestTEvntRotation();
+	DoTestTEvntPtr();
+	DoTestTEvntTicksNTips();
+	DoTestTEvntPOS2D();
+	DoTestTEvntRepeat();
+	DoTestTEvntPos3D();
+	DoTestTEvntPos3DAll();
+	
+	gLDD.Close();
+	r = User::FreeLogicalDevice(KLddFileName);;
+	test(r==KErrNone);
+	User::After(100000);
+
+	// Finished Testing Derived attributes
+   	test.Printf(_L("Successully Finished Testing KernelSide TrawEvents \n"));
+   	__UHEAP_MARKEND;
+
+	}
+
+
 GLDEF_C TInt E32Main()
 //
 // Test Digitiser LDD
@@ -397,9 +771,11 @@
 			{
 			 DoTestOnUnregisteredDevice(); 
 			 DoTestDerivedeAtributes();	
+			 DoTestKernelTrawEvents();			
 			}
 		}
 	test.End();
 	test.Close();
  	return(KErrNone);
     }
+
--- a/kerneltest/e32test/dll/t_xxver2.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/dll/t_xxver2.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -428,6 +428,12 @@
 	test.Printf(_L("Ord 1 returns %08x\n"), result);
 	test(result == DllVersion[expected]);
 	CheckExports(expected, l);
+
+	TInt codeSize=0;
+	TInt constDataSize=0;
+	test(KErrNone==l.GetRamSizes(codeSize, constDataSize));
+	test.Printf(_L("Code size: 0x%x, const data size:0x%x\n"),codeSize,constDataSize);
+	test(codeSize>0);
 	l.Close();
 	}
 
--- a/kerneltest/e32test/group/bld.inf	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/group/bld.inf	Wed Sep 22 10:53:45 2010 +0100
@@ -96,6 +96,7 @@
 ../power/d_powermisctest					support
 #endif
 d_ldddigitisertest			support
+d_kerneldigitisertest	        support
 d_lddturnaroundtimertest	support
 d_newldd					support
 d_ipccpy					support
@@ -124,6 +125,7 @@
 d_asid						support
 d_entropysources			support
 d_khal						support
+d_version					support
 
 #ifdef GENERIC_MARM
 d_schedhook					support
@@ -217,6 +219,8 @@
 d_crazyints support
 #endif
 
+d_keyrepeat    support
+
 /******************************************************************************
  User side code here - builds a single variant for both SMP and non-SMP.
  ******************************************************************************/
@@ -410,6 +414,7 @@
 t_ldddigitisertest
 t_userdigitisertest
 t_userdigitisernocaps
+t_kerneldigitisertest
 t_persistrestart	manual
 halsettings	support
 
@@ -560,7 +565,7 @@
 loadntfs        support
 
 // /E32TEST/LOCALE tests
-t_msgtxt    manual
+t_msgtxt
 t_names 
 t_currencyformat
 
@@ -778,6 +783,8 @@
 t_condvar
 t_condvar2  support
 
+t_console
+
 t_tick      manual
 t_tock
 
@@ -836,7 +843,7 @@
 // /E32TEST/WINDOW tests
 
 t_calib     support
-t_colour    manual
+t_colour
 t_wjpwin    support
 t_wsimp     support
 t_wwins     manual
@@ -845,6 +852,8 @@
 refkeymap   support //Reference template keyboard look-up tables for T_KEYS test 
 t_keys
 
+t_keyrepeat
+
 // /E32TEST/Y2K tests
 t_y2k
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/d_kerneldigitisertest.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,36 @@
+// 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_kerneldigitisertest.mmp				 
+// 
+//
+
+#include "kernel/kern_ext.mmh"
+
+TARGET      d_kerneldigitisertest.ldd
+TARGETTYPE  ldd
+
+SOURCEPATH  ../digitiser
+SOURCE      d_kerneldigitisertest.cpp
+
+EPOCALLOWDLLDATA
+
+UID				0x100000af
+VENDORID		0x70000001
+
+capability		all
+
+start wins
+win32_headers
+end
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/d_keyrepeat.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,36 @@
+// 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_keyrepeat.mmp				 
+// 
+//
+
+#include "kernel/kern_ext.mmh"
+
+TARGET      d_keyrepeat.ldd
+TARGETTYPE  ldd
+
+SOURCEPATH  ../window
+SOURCE      d_keyrepeat.cpp
+
+EPOCALLOWDLLDATA
+
+UID				0x100000af
+VENDORID		0x70000001
+
+capability		all
+
+start wins
+win32_headers
+end
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/d_version.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,44 @@
+// 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_version.mmp
+// 
+//
+
+#include		"kernel/kern_ext.mmh"
+
+TARGET		    	d_version.ldd
+TARGETTYPE		LDD
+ROMTARGET		d_version.ldd
+
+SOURCEPATH		../buffer
+SOURCE			d_version.cpp
+
+LIBRARY			EKERN.LIB
+
+epocallowdlldata
+
+UID			0x100000af
+VENDORID 		0x70000001
+
+START WINS
+Win32_Library		kernel32.lib
+#if defined(VC32)
+Win32_Library		msvcrt.lib
+#endif
+END
+
+capability		all
+
+SMPSAFE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_console.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,30 @@
+// 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_console.mmp
+// 
+//
+
+TARGET         t_console.exe        
+TARGETTYPE     EXE
+SOURCEPATH     ../system
+SOURCE         t_console.cpp
+LIBRARY        euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+
+capability		all
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_kerneldigitisertest.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,30 @@
+// 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_kerneldigitisertest.mmp
+// 
+//
+
+TARGET         t_kerneldigitisertest.exe        
+TARGETTYPE     EXE
+SOURCEPATH	../digitiser
+SOURCE         t_kerneldigitisertest.cpp
+LIBRARY        euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+
+capability		all
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_keyrepeat.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,30 @@
+// 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_keyrepeat.mmp				 
+// 
+//
+
+TARGET         t_keyrepeat.exe        
+TARGETTYPE     EXE
+SOURCEPATH	../window
+SOURCE         t_keyrepeat.cpp
+LIBRARY        euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+
+capability		all
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/group/t_msgtxt.mmp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/group/t_msgtxt.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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,7 +23,7 @@
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 
-capability		none
+capability		SwEvent
 
 VENDORID 0x70000001
 
--- a/kerneltest/e32test/locale/t_msgtxt.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/locale/t_msgtxt.cpp	Wed Sep 22 10:53:45 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"
@@ -22,18 +22,22 @@
 LOCAL_D	TBuf<KMaxLocaleMessageText>* localeBufs[ELocaleMessages_LastMsg];
 
 RTest test(_L("T_MSGTXT"));
+	
+const TUint KTimeOut=5000000; // 5 seconds timeout for the notifier
 
 LOCAL_C void DisplayMessages()
 //
 // Display the locale messages
 //
 	{
-
 	RNotifier notifier;
 	TInt r=notifier.Connect();
 	test(r==KErrNone);
 	TRequestStatus status;
+	TRequestStatus timerStatus;
 	TInt buttonVal=0;
+	RTimer timer;
+	timer.CreateLocal();
 
 	test.Next(_L("Test File Server Error Dialogs"));
 	TLocaleMessageText msgTxt;
@@ -42,37 +46,80 @@
 	msgTxt.Set(EFileServer_Button2);
 	TBuf<KMaxLocaleMessageText> button2(msgTxt);
 
-	test.Next(_L("DIALOG1: Displayed if a disk is removed during a write"));
-	User::After(300000);
-	test.Printf(_L("***Press SHIFT+R or SHIFT+S to confim dialogue***\n"));
+	test.Next(_L("DIALOG1: Displayed if a disk is removed during a write (will timeout in 5 seconds)"));
 	TInt count=2;
 	msgTxt.Set((TLocaleMessage)count++);
 	TBuf<KMaxLocaleMessageText> line1=msgTxt;
 	msgTxt.Set((TLocaleMessage)count++);
 	TBuf<KMaxLocaleMessageText> line2=msgTxt;
 	notifier.Notify(line1,line2,button1,button2,buttonVal,status);
-	User::WaitForRequest(status);
-	User::After(300000);
+	timer.After(timerStatus,KTimeOut);
+	User::WaitForRequest(status,timerStatus);
+	if (status==KRequestPending)
+		{
+		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
+		// make the notifier to disappear
+		TRawEvent eventDown;
+		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
+		TRawEvent eventUp;
+		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
+		UserSvr::AddEvent(eventDown);
+		UserSvr::AddEvent(eventUp);
+		}
+	else
+		{
+		timer.Cancel();
+		}
 
-	test.Next(_L("DIALOG2: Write failed due to low power"));
-	User::After(300000);
+	test.Next(_L("DIALOG2: Write failed due to low power (will timeout in 5 seconds)"));
 	msgTxt.Set((TLocaleMessage)count++);
 	line1=msgTxt;
 	msgTxt.Set((TLocaleMessage)count++);
 	line2=msgTxt;
 	notifier.Notify(line1,line2,button1,button2,buttonVal,status);
-	User::WaitForRequest(status);
-	User::After(300000);
+	timer.After(timerStatus,KTimeOut);
+	User::WaitForRequest(status,timerStatus);
+	if (status==KRequestPending)
+		{
+		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
+		// make the notifier to disappear
+		TRawEvent eventDown;
+		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
+		TRawEvent eventUp;
+		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
+		UserSvr::AddEvent(eventDown);
+		UserSvr::AddEvent(eventUp);
+		}
+	else
+		{
+		timer.Cancel();
+		}
 
-	test.Next(_L("DIALOG3: General error message - disk write failed"));
-	User::After(300000);
+	test.Next(_L("DIALOG3: General error message - disk write failed (will timeout in 5 seconds)"));
 	msgTxt.Set((TLocaleMessage)count++);
 	line1=msgTxt;
 	msgTxt.Set((TLocaleMessage)count++);
 	line2=msgTxt;
 	notifier.Notify(line1,line2,button1,button2,buttonVal,status);
-	User::WaitForRequest(status);
-	User::After(300000);
+	timer.After(timerStatus,KTimeOut);
+	User::WaitForRequest(status,timerStatus);
+	if (status==KRequestPending)
+		{
+		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
+		// make the notifier to disappear
+		TRawEvent eventDown;
+		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
+		TRawEvent eventUp;
+		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
+		UserSvr::AddEvent(eventDown);
+		UserSvr::AddEvent(eventUp);
+		}
+	else
+		{
+		timer.Cancel();
+		}
+
+	timer.Close();
 	test.Printf(_L("***End***\n\n"));
 
 	msgTxt.Set((TLocaleMessage)count++);
@@ -81,8 +128,6 @@
 	test.Printf(_L("ALARMNAME: 'Rings' - %S\n"),&msgTxt);
 	msgTxt.Set((TLocaleMessage)count++);
 	test.Printf(_L("ALARMNAME: 'Signal' - %S\n"),&msgTxt);
-	test.Printf(_L("***Press any key***\n\n"));
-	test.Getch();
 
 	msgTxt.Set((TLocaleMessage)count++);
 	test.Printf(_L("DISKNAME: 'Internal' - %S\n"),&msgTxt);
@@ -102,8 +147,6 @@
 	test.Printf(_L("DISKNAME: 'External7' - %S\n"),&msgTxt);
 	msgTxt.Set((TLocaleMessage)count++);
 	test.Printf(_L("DISKNAME: 'External8' - %S\n"),&msgTxt);
-	test.Printf(_L("***Press any key***\n\n"));
-	test.Getch();
 	
 	msgTxt.Set((TLocaleMessage)count++);
 	test.Printf(_L("SOCKETNAME0: - %S\n"),&msgTxt);
@@ -123,9 +166,8 @@
 	{
 
 	test.Title();
-//	TBuf<KMaxLocaleMessageText>* localeBufs[ELocaleMessages_LastMsg];    {Too big for local decleration}
-																	   															
 	test.Start(_L("Constructor"));
+
 	TLocaleMessageText msgTxt;
 	msgTxt.Set((TLocaleMessage)4);
 	TInt count=0;
--- a/kerneltest/e32test/mmu/t_chunk.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/mmu/t_chunk.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -38,6 +38,7 @@
 // the expected notifications.
 // - Test finding a global chunk by name and verify results are as expected.
 // - Check read-only global chunks cannot be written to by other processes.
+// - Test Top and Bottom API with DoubleEnded chunk
 // Platforms/Drives/Compatibility:
 // All.
 // Assumptions/Requirement/Pre-requisites:
@@ -1341,6 +1342,41 @@
 	User::SetJustInTime(jit);
 	}
 
+
+void TestTopBottom()
+//
+// test chunk top and bottom exec calls and check size
+//
+	{
+	RChunk chunk;
+	TInt r;
+	TInt init_bottom = 0x1000;
+	TInt init_top = 0x5000;
+	TInt max=0x10000;
+
+	TInt top;
+	TInt bottom;
+
+	r=chunk.CreateDoubleEndedLocal(init_bottom,init_top,max);
+	test_KErrNone(r);
+
+	top=chunk.Top();
+	bottom=chunk.Bottom();
+	test_Equal(top, init_top);
+	test_Equal(bottom, init_bottom);
+	
+	r=chunk.AdjustDoubleEnded(init_bottom+0x1000, init_top-0x1000);
+	test_KErrNone(r);
+
+	top=chunk.Top();
+	bottom=chunk.Bottom();
+	test_Equal(top, init_top-0x1000);
+	test_Equal(bottom, init_bottom+0x1000);
+	
+	chunk.Close();
+	}
+
+
 TInt E32Main()
 //
 //	Test RChunk class
@@ -1428,6 +1464,10 @@
 		TestClosure();
 		test.Next(_L("Read-only chunks"));
 		TestReadOnly();
+
+		test.Next(_L("Test chunk top and bottom"));
+		TestTopBottom();
+
 		test.End();
 		__KHEAP_MARKEND;
 		}
--- a/kerneltest/e32test/notifier/t_textnotifier.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/notifier/t_textnotifier.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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,8 +24,9 @@
 // - For IPC Ver. 1 and IPC Ver 2, using MNotifierManager, connect to and 
 // start anotifier server. Perform a variety of tests including CancelNotifier, 
 // StartNotifier, UpdateNotifier, UpdateNotifierAndGetResponse, 
-// StartNotifierAndGetResponse. Verify results are as expected. 
-// Check for memory leaks and cleanup.
+// StartNotifierAndGetResponse, Notify and NotifyCancnel.
+// Verify results are as expected. Check for memory leaks and cleanup.
+// - Tests also removed but exported methods that they return expected values
 // - Do interactive tests as requested.
 // Platforms/Drives/Compatibility:
 // Hardware (Automatic).
@@ -40,9 +41,13 @@
 #include <e32test.h>
 #include "textnotifier.h"
 #include <e32debug.h>
+#include <e32event.h>
+#include <e32svr.h>
 
 LOCAL_D RTest test(_L("T_TEXTNOTIFIER"));
 
+const TUint KTimeOut=3000000; // 3 seconds
+
 void DoMemoryLeakTests(TUid aUid,TBool aCheckMNotifierManager)
 	{
 	TInt r;
@@ -188,7 +193,7 @@
 	User::WaitForRequest(updateStat);
 	test(updateStat==KErrNone);
 	test(response==KResponseData);
-
+	
 	test.Next(_L("CancelNotifier"));
 	r = n.CancelNotifier(aUid);
 	test(r==KErrNone);
@@ -219,6 +224,121 @@
 	test.End();
 	}
 
+
+void TestNotify()
+//
+// Test Notify by launching a simple notifier. Gets closed
+// using timer and simulated keypress.
+//
+	{
+	TInt r;
+	test.Start(_L("Connect to notifier server"));
+	RNotifier n;
+	r = n.Connect();
+	test(r==KErrNone);
+	TInt button=0;
+	TRequestStatus status;
+	TRequestStatus timerStatus;
+	RTimer timer;
+	timer.CreateLocal();
+
+	test.Next(_L("Launching simple notifier"));
+	_LIT(KLine1,"Line1 - Select Button2");
+	_LIT(KLine2,"Line2 - or press enter");
+	_LIT(KButton1,"Button1");
+	_LIT(KButton2,"Button2");
+
+	n.Notify(KLine1,KLine2,KButton1,KButton2,button,status);
+	timer.After(timerStatus,KTimeOut); // launch timer for getting control back after timeout
+	User::WaitForRequest(status, timerStatus);
+	if (status==KRequestPending)
+		{
+		test.Printf(_L("Timeout in waiting for keypress, continuing\n"));
+
+		// make the notifier to disappear
+		TRawEvent eventDown;
+		eventDown.Set(TRawEvent::EKeyDown,EStdKeyEnter);
+		TRawEvent eventUp;
+		eventUp.Set(TRawEvent::EKeyUp,EStdKeyEnter);
+		UserSvr::AddEvent(eventDown);
+		UserSvr::AddEvent(eventUp);
+		User::WaitForRequest(status); // wait again
+		}
+	else
+		{
+		timer.Cancel();
+		}
+	
+	timer.Close();
+
+	test(status.Int()==KErrNone);
+
+	test.Next(_L("Close connection to notifier server"));
+	n.Close();
+
+	test.End();
+	}
+
+void TestNotifyCancel()
+//
+// Simple test to just call NotifyCancel. Just sends a message
+// which goes to window server. Window server ignores the cancel event
+// and because of this, no notification to be canceled is started.
+//
+	{
+	TInt r;
+	test.Start(_L("Connect to notifier server"));
+	RNotifier n;
+	r = n.Connect();
+	test(r==KErrNone);
+
+	test.Next(_L("Call NotifyCancel"));
+	n.NotifyCancel();
+
+	test.Next(_L("Close connection to notifier server"));
+	n.Close();
+
+	test.End();
+	}
+
+
+void TestRemovedMethods()
+//
+// Test deprecated but exported methods
+//
+	{
+	test.Start(_L("Test removed methods of RNotifier class"));
+	
+	// connect to server
+	RNotifier n;
+	TInt r = n.Connect();
+	test(r==KErrNone);
+
+	test.Next(_L("StartNotifierAndGetResponse (5-params with dllUid)"));
+	TBuf8<128> response;
+	response.SetMax();
+	response.FillZ();
+	response.Zero();
+	TRequestStatus stat;
+	n.StartNotifierAndGetResponse(stat,KUidTestTextNotifier1,KUidTestTextNotifier2,*&KStartData,response);
+	User::WaitForRequest(stat);
+	test(stat==KErrNotSupported);
+
+	test.Next(_L("StartNotifier (4-params with dllUid)"));
+	test(n.StartNotifier(KUidTestTextNotifier2,KUidTestTextNotifier1,*&KStartData,response)==KErrNotSupported);
+	
+	test.Next(_L("Test removed method LoadNotifiers()"));
+	test(n.LoadNotifiers(KUidTestTextNotifier1)==KErrNotSupported);
+	
+	test.Next(_L("Test removed method UnloadNotifiers()"));
+	test(n.UnloadNotifiers(KUidTestTextNotifier1)==KErrNotSupported);
+
+	test.Next(_L("Close connection to notifier server"));
+	n.Close();
+	test.End();
+	}
+
+
 void DoInteractiveTests()
 	{
 	TInt r;
@@ -272,6 +392,16 @@
 	else
 		test.Printf(_L("FIX ME! - Can't run because IPC V1 not supported\n"));
 
+	
+	test.Next(_L("TestNotify"));
+	TestNotify();
+	
+	test.Next(_L("TestNotifyCancel"));
+	TestNotifyCancel();
+
+	test.Next(_L("Test removed methods"));
+	TestRemovedMethods();
+
 	test.Next(_L("Interactive Tests"));
 	test.Printf(_L("  Do you want to test notifiers interactively? y/n\n"));
 	test.Printf(_L("  Waiting 10 seconds for answer...\n"));
--- a/kerneltest/e32test/prime/t_timer.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/prime/t_timer.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-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"
@@ -515,6 +515,7 @@
 	t.Lock(stat, ETwelveOClock);
 	User::WaitForRequest(stat);
 	test(stat==KErrNone);
+	test(User::LockPeriod()==ETwelveOClock);
 	time2.UniversalTime();
 	test(time<time2);
 	User::After(500000);
@@ -712,6 +713,7 @@
 	test.Start(_L("Test User::ResetInactivityTime()"));
 	RTimer t,t2;
 	TRequestStatus stat,stat2;
+	TTimeIntervalSeconds inact;
 	t.CreateLocal();
 	t2.CreateLocal();
 	User::ResetInactivityTime();
@@ -747,6 +749,10 @@
 	test(stat==KRequestPending);
 	User::After(5000000);
 	test(stat!=KRequestPending);
+	inact=User::InactivityTime();
+	test.Printf(_L("User inactivity after 5 secs, reports %d secs\n"),inact.Int());
+	test(inact > TTimeIntervalSeconds(3)); // test that inactivity lasted more than 3 seconds
+	test(inact < TTimeIntervalSeconds(7)); // test that inactivity lasted less than 7 seconds
 	test.End();
 	}
 
--- a/kerneltest/e32test/property/t_basic.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/property/t_basic.cpp	Wed Sep 22 10:53:45 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"
@@ -52,6 +52,14 @@
 		r = prop.Delete(mySid, iKey);
 		TF_ERROR(r, r == KErrNone);
 
+		// Test deprecated method without policies
+		r = prop.Define(iCategory, iKey, iType);
+		TF_ERROR(r, r == KErrNone);
+		r = prop.Define(iCategory, iKey, iType);
+		TF_ERROR(r, r == KErrAlreadyExists);
+		r = prop.Delete(iCategory, iKey);
+		TF_ERROR(r, r == KErrNone);
+
 		// Test re-definition doesn't change security settings
 		// Defect DEF050961 - Re-defining an RProperty causes the security policy to be overwritten
 		{
--- a/kerneltest/e32test/property/t_prop_ldd.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/property/t_prop_ldd.cpp	Wed Sep 22 10:53:45 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"
@@ -135,6 +135,7 @@
 	for (TUint i = 0; i < count; ++i)
 		{
 		RPropertyRef prop;
+		TPropertyStatus propStatus;
 		TInt r = prop.Open(category, key);
 		BASIC_ERROR(r, r == KErrNotFound);
 		r = prop.Attach(category, key);
@@ -146,8 +147,20 @@
 
 		TSecurityPolicy policy;
 
+		NKern::LockSystem();
+		TBool defined = prop.GetStatus(propStatus);
+		NKern::UnlockSystem();
+		BASIC_ERROR(defined, !defined); // should be EFALSE when not defined
+		
 		r = prop.Define(type, policy, policy);
 		BASIC_ERROR(r, r == KErrNone);
+
+		NKern::LockSystem();
+		defined = prop.GetStatus(propStatus);
+		NKern::UnlockSystem();
+		BASIC_ERROR(defined, defined);  // should be ETRUE, when defined
+		BASIC_ERROR(propStatus.iType, propStatus.iType==type);
+
 		r = prop.Define(type, policy, policy);
 		BASIC_ERROR(r, r == KErrAlreadyExists);
 		r = prop.Delete();
@@ -339,6 +352,12 @@
 			TPtr8 optr((TUint8*) obuf.Ptr(), 0, 15);
 			r = prop.Set(ibuf);
 			BASIC_ERROR(r, r == KErrNone);
+
+			NKern::LockSystem();
+			defined = prop.GetStatus(propStatus);
+			NKern::UnlockSystem();
+			BASIC_ERROR(propStatus.iSize, propStatus.iSize == ibuf.Length());
+
 			r = prop.Get(optr);
 			BASIC_ERROR(r, r == KErrOverflow);
 			BASIC_ERROR(optr.Length(), optr.Length() == 15); 
--- a/kerneltest/e32test/secure/t_platsecconfig.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/secure/t_platsecconfig.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -235,7 +235,9 @@
 	{
 	CTrapCleanup* cleanupStack = CTrapCleanup::New();
 	if(!cleanupStack)
+		{
 		return KErrNoMemory;
+		}
 	TRAPD(leaveError,DoStartServer())
 	delete cleanupStack;
 	return leaveError;
@@ -272,7 +274,9 @@
 	{
 	TInt i;
 	for(i=0; i<ECapability_Limit; i++)
+		{
 		test((!a1.HasCapability((TCapability)i))==(!a2.HasCapability((TCapability)i)));
+		}
 	}
 
 TBuf8<1024> CapabilityNameBuffer;
@@ -293,9 +297,13 @@
 			if(allCaps.HasCapability((TCapability)i))
 				{
 				if(i&1)
+					{
 					odd = EFalse;
+					}
 				else
+					{
 					even = EFalse;
+					}
 				}
 			continue;
 			}
@@ -305,11 +313,17 @@
 		CapabilityNameBuffer.Append((TChar)' ');
 		}
 	if(!CapabilityNameBuffer.Length())
+		{
 		CapabilityNameBuffer.Append(_L8("NONE"));
+		}
 	if(even)
+		{
 		CapabilityNameBuffer.Append(_L8("(These are all EVEN numbered capabilities)"));
+		}
 	if(odd)
+		{
 		CapabilityNameBuffer.Append(_L8("(These are all ODD numbered capabilities)"));
+		}
 	return CapabilityNameBuffer.Expand();
 }
 
@@ -343,10 +357,16 @@
 	TCapabilitySet notEnforced;
 	notEnforced.SetEmpty();
 	for(TInt i=0; i<ECapability_HardLimit; i++)
+		{
 		if(!PlatSec::IsCapabilityEnforced((TCapability)i))
+			{
 			notEnforced.AddCapability((TCapability)i);
+			}
+		}	
 	if(!PlatSec::ConfigSetting(PlatSec::EPlatSecEnforcement))
+		{
 		disabled.SetAllSupported();
+		}
 	CheckCapabilitySetEqual(notEnforced,disabled);
 
 	test.End();
@@ -377,15 +397,22 @@
 	test(process.ExitType()==EExitKill);
 	r=logon.Int();
 	CLOSE_AND_WAIT(process);
+
 	if(PlatSecEnforcement)
+		{
 		test(r==KErrPermissionDenied);
+		}
 	else
+		{
 		test(r==KErrNone);
+		}
 
 	test.Next(_L("Check static linkage without required capabilities"));
 	r=process.Create(_L("T_PSC_STATIC"),_L(""));
 	if(PlatSecEnforcement)
+		{
 		test(r==KErrPermissionDenied);
+		}	
 	else
 		{
 		test(r==KErrNone);
@@ -396,6 +423,23 @@
 	test.End();
 	}
 
+/**
+Do simple test of diagnostic function without parameters (EmitDiagnostic())
+*/
+void TestPlatSecDiagnostic()
+	{
+	TInt r;
+	r=PlatSec::EmitDiagnostic();
+	if(PlatSecEnforcement)
+		{
+		test(r==KErrPermissionDenied);
+		}
+	else
+		{
+		test(r==KErrNone);
+		}
+	}
+
 #include <e32svr.h>
 IMPORT_C void dummyExport();
 
@@ -446,6 +490,9 @@
 	test.Next(_L("Test PlatSecEnforcement"));
 	TestPlatSecEnforcement();
 
+	test.Next(_L("Test PlatSecDiagnostic()"));
+	TestPlatSecDiagnostic();
+
 	test.Next(_L("Closing server session"));
 	Session.Send(CTestSession::EShutdown);
 	Session.Close();
@@ -474,7 +521,9 @@
 	timer.After(timerStat,20*1000000);
 	User::WaitForRequest(timerStat,keyStat);
 	if(keyStat!=KRequestPending)
+		{
 		(void)test.Console()->KeyCode();
+		}
 	timer.Cancel();
 	test.Console()->ReadCancel();
 	User::WaitForAnyRequest();
--- a/kerneltest/e32test/secure/t_shal.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/secure/t_shal.cpp	Wed Sep 22 10:53:45 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"
@@ -30,6 +30,7 @@
 // 
 //
 
+#define __E32TEST_EXTENSION__
 #define __INCLUDE_CAPABILITY_NAMES__
 
 #include <e32test.h>
@@ -83,6 +84,21 @@
 
 #define SET_CHECK(a,c) 	GetSetCheck(#a,a,c);
 
+LOCAL_C void TestUnusedFunctions()
+    {
+    TAny * mem = 0;
+    TInt ret=0;
+    ret=UserSvr::HalGet(HALData::EMemoryRAMFree, mem);
+    test_Equal(KErrNotSupported, ret);
+    ret=UserSvr::HalSet(HALData::EMemoryRAMFree, mem);
+    test_Equal(KErrNotSupported, ret);
+    ret=UserSvr::ResetMachine(EStartupCold);
+    test_Equal(KErrNotSupported, ret);
+    UserSvr::WsSwitchOnScreen();
+    ret=User::Beep(220,1000000);
+	test_Equal(KErrNotSupported, ret);
+    }
+
 LOCAL_C TInt DoTests()
 	{
 	TInt r;
@@ -194,6 +210,8 @@
 
 	test.Title();
 
+	TestUnusedFunctions();
+	
 	if(User::CommandLineLength())
 		{
 		TBuf<128> message;
--- a/kerneltest/e32test/secure/t_sserver.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/secure/t_sserver.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2001-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"
@@ -590,6 +590,8 @@
 		{ RSubSessionBase::SendReceive(aFunction,aStatus); }
 	inline void Send(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus)
 		{ RSubSessionBase::SendReceive(aFunction,aArgs,aStatus); }
+	inline TInt BlindSend(TInt aFunction)
+		{ return RSubSessionBase::Send(aFunction); }
 	};
 
 
@@ -964,6 +966,10 @@
 	r = sub.Send(ETestEmptySubSessionMessage);
 	test(r==KSubSessionHandle);
 
+	test.Next(_L("Sending empty message blindly"));
+	r = sub.BlindSend(ETestEmptySubSessionMessage);
+	test(r==KErrNone);
+
 	test.Next(_L("Closing subsession"));
 	sub.CloseSubSession(ETestCloseSubSession);	
 	test(((TInt*)&sub)[0]==0);  // check sub.iSession
--- a/kerneltest/e32test/system/t_atomicu.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/system/t_atomicu.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -47,9 +47,9 @@
 	{
 	gValue=0;
 	// increasing when 0, should return 0
-	test(User::SafeInc(gValue)==0);
+	test_Equal(0,User::SafeInc(gValue));
 	// value also should be 0
-	test(gValue==0);
+	test_Equal(0,gValue);
 	
 	gValue=1;
 	TInt expected=0;
@@ -57,37 +57,37 @@
 	for (TInt i=0; i<KMaxOps; i++)
 		{
 		expected=User::SafeInc(gValue)+1;
-		test(expected==User::SafeDec(gValue));
+		test_Equal(expected,User::SafeDec(gValue));
 		}
 
 	// after running these, it should be 1
-	test(gValue==1);
+	test_Equal(1,gValue);
 	
 	// should stay zero after decreasing from 1 multiple times
-	test(User::SafeDec(gValue)==1);
-	test(User::SafeDec(gValue)==0);
-	test(User::SafeDec(gValue)==0);
-	test(gValue==0);
+	test_Equal(1,User::SafeDec(gValue));
+	test_Equal(0,User::SafeDec(gValue));
+	test_Equal(0,User::SafeDec(gValue));
+	test_Equal(0,gValue);
 	}
 
 void TestLockedIncAndLockedDec()
 	{
 	gValue=0;
 	// increasing when 0, should return 0 as old value
-	test(User::LockedInc(gValue)==0);
+	test_Equal(0,User::LockedInc(gValue));
 	// new value should be 1
-	test(gValue==1);
+	test_Equal(1,gValue);
 
 	gValue=-1;
 
 	// gValue should vary only between 1 and 2
 	for (TInt i=0; i<KMaxOps; i++)
 		{
-		test((User::LockedInc(gValue)+1)==User::LockedDec(gValue));
+		test_Equal((User::LockedInc(gValue)+1),User::LockedDec(gValue));
 		}
 
 	// after running these, it should be back in -1
-	test(gValue==-1);
+	test_Equal(-1,gValue);
 	}
 
 TInt MultiThreadSafeIncAndSafeDec_FUNC(TAny*)
@@ -128,7 +128,9 @@
 
 	test.Printf(_L("Resuming threads...\n"));
 	for(i=0; i<KNumThreads; i++)
+		{
 		threads[i].Resume();
+		}
 
 	for(i=0; i<KNumThreads; i++)
 		{
@@ -143,7 +145,7 @@
 	RThread().SetPriority(EPriorityNormal);
 
 	// test that we returned to the startvalue
-	test(gValue==1);
+	test_Equal(1,gValue);
 	}
 
 void MultiThreadLockedIncAndLockedDec()
@@ -164,7 +166,9 @@
 
 	test.Printf(_L("Resuming threads...\n"));
 	for(i=0; i<KNumThreads; i++)
+		{
 		threads[i].Resume();
+		}
 
 	for(i=0; i<KNumThreads; i++)
 		{
@@ -179,7 +183,7 @@
 	RThread().SetPriority(EPriorityNormal);
 
 	// test that we returned to the startvalue
-	test(gValue==-1);
+	test_Equal(-1,gValue);
 	}
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/system/t_console.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,247 @@
+// 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\system\t_console.cpp
+// Overview:
+// Test methods of CConsoleBase, CProxyConsole and CColorConsole class.
+// API Information:
+// CConsoleBase.
+// Details:
+// - Create an object of CTestConsole class which is derived from CColorConsole. 
+// - Call methods of CColorConsole class with this test object.
+// - Create a full screen console object of CConsoleBase.
+// - Call methods of CConsoleBase class with this console object.
+// Platforms/Drives/Compatibility:
+// All 
+// Assumptions/Requirement/Pre-requisites:
+// Failures and causes:
+// Base Port information:
+// 
+//
+
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32event.h>
+#include <e32svr.h>
+
+LOCAL_D RTest test(_L("T_CONSOLE"));
+
+// Literals
+_LIT(KTxtTitle,"Console App");
+_LIT(KTxtNewTitle,"New Console Title");
+_LIT(KTxtWrite,"Write some text ");
+_LIT(KTxtPressAnyKey,"Press any key or wait 2 seconds");
+
+// This is test class for testing methods of CColorConsoleBase
+class CTestConsole : public CColorConsoleBase
+    {
+    public:
+    TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
+        {
+        return CColorConsoleBase::Extension_(aExtensionId, a0, a1);
+        }
+    };
+
+// Creates an object of CTestConsole.
+// Calls methods of CColorConsoleBase 
+LOCAL_C void InitTestConsoleL()
+    {
+    // create a full screen test console object
+    CTestConsole* testConsole;
+    testConsole = (CTestConsole*)Console::NewL(KTxtTitle, TSize(KConsFullScreen,KConsFullScreen));
+        
+    CleanupStack::PushL(testConsole);
+    
+    // Defines the bold text attribute.
+    testConsole->SetTextAttribute(ETextAttributeBold);
+    testConsole->Write(KTxtWrite);
+    // Defines the inverse text attribute.
+    testConsole->SetTextAttribute(ETextAttributeInverse);
+    testConsole->Write(KTxtWrite);
+    // Defines the highlight text attribute.
+    testConsole->SetTextAttribute(ETextAttributeHighlight);
+    testConsole->Write(KTxtWrite);
+    // Defines the normal text attribute.
+    testConsole->SetTextAttribute(ETextAttributeNormal);
+    testConsole->Write(KTxtWrite);
+	    
+    TInt a1 = 0;
+    TAny* any = 0;
+    testConsole->Extension_((TUint)a1,any,any);
+    
+    // cleanup and return
+    CleanupStack::PopAndDestroy(); // close console
+    }
+
+LOCAL_C void SimulateKeyPress(TStdScanCode aScanCode)
+    {
+    TRawEvent eventDown;
+    eventDown.Set(TRawEvent::EKeyDown, aScanCode);
+    UserSvr::AddEvent(eventDown);
+    TRawEvent eventUp;
+    eventUp.Set(TRawEvent::EKeyUp, aScanCode);
+    UserSvr::AddEvent(eventUp);    
+    }
+
+LOCAL_C void ReadConsole(CConsoleBase* aConsole)
+    {
+    aConsole->Printf(KTxtPressAnyKey);
+    
+    TRequestStatus keyStatus;
+    // Gets a keystroke from the console window, asynchronously
+    aConsole->Read(keyStatus);
+    RTimer timer;
+    test_KErrNone(timer.CreateLocal());
+    TRequestStatus timerStatus;
+    timer.After(timerStatus,2*1000000);
+    User::WaitForRequest(timerStatus,keyStatus);
+    if(keyStatus!=KRequestPending)
+        {
+        TKeyCode keyCode = aConsole->KeyCode();
+        aConsole->Printf(_L("Keycode %d\n"),keyCode);
+        }
+    timer.Cancel();
+    // Cancels any outstanding request 
+    aConsole->ReadCancel();
+    User::WaitForAnyRequest();
+    }
+
+LOCAL_C void InitConsoleL()
+    {
+    // create a full screen console object
+    CConsoleBase* console;
+    console = Console::NewL(KTxtTitle, TSize(KConsFullScreen,KConsFullScreen));
+      
+    CleanupStack::PushL(console);
+  
+    //Gets the size of the console
+    TSize screenSize = console->ScreenSize();
+    test.Printf(_L("Screen size %d %d\r\n"),screenSize.iWidth,screenSize.iHeight);
+  
+    // Gets the cursor's x-position
+    TInt x = console->WhereX();
+    // Gets the cursor's y-position
+    TInt y = console->WhereY();
+    test_Equal(x, 0);
+    test_Equal(y, 0);
+    test.Printf(_L("**1** Cursor positions x: %d  y: %d\r\n"),x, y);
+  
+    // Sets the cursor's x-position
+    for(TInt i=0; i<4; i++)
+        {
+        console->SetPos(screenSize.iWidth + i);
+        x = console->WhereX();
+        test_Equal(x, screenSize.iWidth -3);
+		}
+    
+    test.Printf(_L("**2** Cursor positions x: %d  y: %d\r\n"),x, y);
+      
+    // Clears the console and set cursor to position 0,0
+    console->ClearScreen();
+    test_Equal(console->WhereX(), 0);
+	test_Equal(console->WhereY(), 0);
+        
+    // Sets the cursor's x-position and y-position
+    for(TInt j=0; j<4; j++)
+        {
+        console->SetPos(screenSize.iWidth - j, screenSize.iHeight - j);
+        x = console->WhereX();
+        y = console->WhereY();
+        test_Equal(x, screenSize.iWidth -3);
+		test_Equal(y, screenSize.iHeight -3);
+		}
+    test.Printf(_L("**3** Cursor positions x: %d  y: %d\r\n"),x, y);
+     
+    console->SetPos(0,0);
+    x = console->WhereX();
+    y = console->WhereY();
+    test_Equal(x, 0);
+    test_Equal(y, 0);
+	test.Printf(_L("**4** Cursor positions x: %d  y: %d\r\n"),x, y);
+  
+    console->SetPos(screenSize.iWidth/2,screenSize.iHeight/2);
+    x = console->WhereX();
+    y = console->WhereY();
+    test.Printf(_L("**5** Cursor positions x: %d  y: %d\r\n"),x, y);
+  
+    // Sets the percentage height of the cursor
+    console->SetCursorHeight(50);
+  
+    // Gets the current cursor position relative to the console window
+    TPoint cursorPos = console->CursorPos();
+    test.Printf(_L("CursorPos iX: %d  iY: %d\r\n"),cursorPos.iX, cursorPos.iY);
+    
+    // Puts the cursor at the specified position relative
+    // to the current cursor position
+    TPoint relPos;
+    relPos.iX = screenSize.iWidth/4;
+    relPos.iY = screenSize.iHeight/4;
+    console->SetCursorPosRel(relPos);
+    cursorPos = console->CursorPos();
+    test.Printf(_L("CursorPosRel iX: %d  iY: %d\r\n"),cursorPos.iX, cursorPos.iY);
+  
+    // Puts the cursor at the absolute position in the window
+    cursorPos.iX = screenSize.iWidth/6;
+    cursorPos.iY = screenSize.iHeight/6;
+    console->SetCursorPosAbs(cursorPos);
+    cursorPos = console->CursorPos();
+    test.Printf(_L("CursorPosAbs iX: %d  iY: %d\r\n"),cursorPos.iX, cursorPos.iY);
+  
+    // Sets a new console title
+    console->SetTitle(KTxtNewTitle);
+    // Writes the content of the specified descriptor to the console window
+    console->Write(KTxtWrite);
+    cursorPos.iX = cursorPos.iX + 6;
+    console->SetCursorPosAbs(cursorPos);
+    // Clears the console from the current cursor position to the end of the line
+    console->ClearToEndOfLine();
+    // Clears the console and set cursor to position 0,0
+    console->ClearScreen();
+  
+    TUint keyModifiers = console->KeyModifiers();
+	test.Printf(_L("keyModifiers %d"),keyModifiers);
+    TKeyCode keyCode = console->KeyCode();
+    ReadConsole(console);
+  
+    SimulateKeyPress(EStdKeyEnter);
+    keyCode = console->Getch();
+  
+    // cleanup and return
+    CleanupStack::PopAndDestroy(); // close console
+    }
+
+TInt E32Main()
+//
+// 
+//
+    {
+    test.Title();
+    __UHEAP_MARK;
+
+    test.Start(_L("Testing Console"));
+    // Get cleanup stack
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    TInt result = KErrNoMemory;
+    if (cleanup)
+	    {
+        TRAP(result, InitTestConsoleL());
+	    TRAP(result, InitConsoleL());
+	    // Destroy the cleanup stack
+	    delete cleanup;
+	    }
+	__UHEAP_MARKEND;
+	test.End();
+	return(result);
+	}
+
--- a/kerneltest/e32test/system/t_reason2.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/system/t_reason2.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -67,7 +67,7 @@
 	test.Next(_L("Get system startup reason using HAL::Get()"));
 	r=HAL::Get(HAL::ESystemStartupReason,gSysReason);
 #if defined(__WINS__)
-	test(r=KErrNotSupported);
+	test_Equal(KErrNotSupported,r);
 #else
 	test_KErrNone(r);
 	switch (gSysReason)
--- a/kerneltest/e32test/thread/t_thread.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/thread/t_thread.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1342,7 +1342,17 @@
 	User::WaitForRequest(stat);
 	test(stat==88863);
 	CLOSE_AND_WAIT(thread);
-	
+
+	test.Next(_L("Test getting own thread ID"));
+	id=RThread().Id();
+	id2=RThread().Id();
+	test(id==id2);
+	r=thread.Open(id);
+	test(r==KErrNone);
+	id2=thread.Id();
+	test(id==id2);
+	thread.Close();
+
 	test.End();
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_device/configs/usbtest.testlist.vasco.bat	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,31 @@
+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_usb_device z:\test\vascoif0.xml /script=sanity.uts
+t_usb_device z:\test\vascoif0a3.xml /script=singleif1.uts
+t_usb_device z:\test\vascoif0a3.xml /script=singleif2.uts
+t_usb_device z:\test\vascoif0a3if1a2if2.xml /script=multif1.uts
+t_usb_device z:\test\vascoif0a3if1a2if2.xml /script=multif2.uts
+t_usb_device z:\test\vascobm.xml /script=streambm.uts
+t_usb_device z:\test\vascoif0a3.xml /script=mstore.uts
+
+t_usb_scdevice z:\test\scvascoif0.xml /script=sanity.uts
+t_usb_scdevice z:\test\scvascoif0a3.xml /script=singleif1.uts
+t_usb_scdevice z:\test\scvascoif0a3.xml /script=singleif2.uts
+t_usb_scdevice z:\test\scvascoif0a3if1a2if2.xml /script=multif1.uts
+t_usb_scdevice z:\test\scvascoif0a3if1a2if2.xml /script=multif2.uts
+t_usb_scdevice z:\test\scvascobm.xml /script=streambm.uts
+t_usb_scdevice z:\test\scvascoif0a3.xml /script=mstore.uts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_device/configs/vasco-usbtest.iby	Wed Sep 22 10:53:45 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:
+// vasco-usbtest.iby
+// 
+//
+
+#ifndef VASCO_USBTEST_IBY
+#define VASCO_USBTEST_IBY
+
+REM the autoexec file and the list of tests to run
+
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\usbtest.testlist.vasco.bat				test\usbtest.bat
+
+REM The test applications
+
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usbapi.exe			sys\bin\t_usbapi.exe
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usb_scdevice.exe			sys\bin\t_usb_scdevice.exe
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usbcsc.exe				sys\bin\t_usbcsc.exe
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usb.exe					sys\bin\t_usb.exe
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usb_device.exe			sys\bin\t_usb_device.exe
+
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usb_transfersrv.dll			sys\bin\t_usb_transfersrv.dll
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usb_transfersrv.exe			sys\bin\t_usb_transfersrv.exe
+file=EPOCROOT##epoc32\release\armv5\udeb\t_usb_tranhandlesrv.dll			sys\bin\t_usb_tranhandlesrv.dll
+
+REM t_usb_device xml configuration files
+
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\scvascoif0.xml				test\scvascoif0.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\scvascoif0a3.xml				test\scvascoif0a3.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\scvascoif0a3if1a2if2.xml		test\scvascoif0a3if1a2if2.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\scvascobm.xml				test\scvascobm.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\vascoif0.xml				test\vascoif0.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\vascoif0a3.xml				test\vascoif0a3.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\vascoif0a3if1a2if2.xml		test\vascoif0a3if1a2if2.xml
+data=\sf\os\kernelhwsrv\kerneltest\e32test\usb\t_usb_device\configs\vascobm.xml				test\vascobm.xml
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_device/configs/vascobm.xml	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,43 @@
+<LDD name="eusbc">
+<ENDPOINTS>30</ENDPOINTS>
+<SOFTCONNECT>Y</SOFTCONNECT>
+<SELFPOWER>N</SELFPOWER>
+<REMOTEWAKEUP>N</REMOTEWAKEUP>
+<HIGHSPEED>Y</HIGHSPEED>
+<FEATURES>1</FEATURES>
+<MAXPOWER>50</MAXPOWER>
+<EPSTALL>Y</EPSTALL>
+<SPEC>0x200</SPEC>
+<VID>0xE22</VID>
+<PID>0x1110</PID>
+<RELEASE>0x305</RELEASE>
+<PRODUCT>VascoDevice</PRODUCT>
+<INTERFACE>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
+<BANDWIDTH_OUT>3</BANDWIDTH_OUT>
+<BANDWIDTH_IN>3</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>Y</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>Y</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>Y</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>Y</DOUBLEBUFF>
+</ENDPOINT>
+</INTERFACE>
+</LDD>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_device/configs/vascoif0.xml	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,33 @@
+<LDD name="eusbc">
+<ENDPOINTS>30</ENDPOINTS>
+<SOFTCONNECT>Y</SOFTCONNECT>
+<SELFPOWER>N</SELFPOWER>
+<REMOTEWAKEUP>N</REMOTEWAKEUP>
+<HIGHSPEED>Y</HIGHSPEED>
+<FEATURES>1</FEATURES>
+<MAXPOWER>50</MAXPOWER>
+<EPSTALL>Y</EPSTALL>
+<SPEC>0x200</SPEC>
+<VID>0xE22</VID>
+<PID>0x1110</PID>
+<RELEASE>0x305</RELEASE>
+<PRODUCT>VascoDevice</PRODUCT>
+<INTERFACE>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
+<BANDWIDTH_OUT>0</BANDWIDTH_OUT>
+<BANDWIDTH_IN>0</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</INTERFACE>
+</LDD>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_device/configs/vascoif0a3.xml	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,119 @@
+<LDD name="eusbc">
+<ENDPOINTS>30</ENDPOINTS>
+<SOFTCONNECT>Y</SOFTCONNECT>
+<SELFPOWER>N</SELFPOWER>
+<REMOTEWAKEUP>N</REMOTEWAKEUP>
+<HIGHSPEED>Y</HIGHSPEED>
+<FEATURES>1</FEATURES>
+<MAXPOWER>50</MAXPOWER>
+<EPSTALL>Y</EPSTALL>
+<SPEC>0x200</SPEC>
+<VID>0xE22</VID>
+<PID>0x1110</PID>
+<RELEASE>0x305</RELEASE>
+<PRODUCT>VascoDevice</PRODUCT>
+<INTERFACE>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
+<BANDWIDTH_OUT>0</BANDWIDTH_OUT>
+<BANDWIDTH_IN>0</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="OUT">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</INTERFACE>
+<ALT_SETTING>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 1)"</DESCRIPTOR>
+<BANDWIDTH_OUT>1</BANDWIDTH_OUT>
+<BANDWIDTH_IN>1</BANDWIDTH_IN>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="OUT">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</ALT_SETTING>
+<ALT_SETTING>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 2)"</DESCRIPTOR>
+<BANDWIDTH_OUT>2</BANDWIDTH_OUT>
+<BANDWIDTH_IN>2</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<SIZE>64</SIZE>
+<INTERVAL>1</INTERVAL>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</ALT_SETTING>
+</LDD>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_device/configs/vascoif0a3if1a2if2.xml	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,175 @@
+<LDD name="eusbc">
+<ENDPOINTS>30</ENDPOINTS>
+<SOFTCONNECT>Y</SOFTCONNECT>
+<SELFPOWER>N</SELFPOWER>
+<REMOTEWAKEUP>N</REMOTEWAKEUP>
+<HIGHSPEED>Y</HIGHSPEED>
+<FEATURES>1</FEATURES>
+<MAXPOWER>50</MAXPOWER>
+<EPSTALL>Y</EPSTALL>
+<SPEC>0x200</SPEC>
+<VID>0xE22</VID>
+<PID>0x1110</PID>
+<RELEASE>0x305</RELEASE>
+<PRODUCT>VascoDevice</PRODUCT>
+<INTERFACE>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Default Setting 0)"</DESCRIPTOR>
+<BANDWIDTH_OUT>0</BANDWIDTH_OUT>
+<BANDWIDTH_IN>0</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="OUT">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</INTERFACE>
+<ALT_SETTING>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 1)"</DESCRIPTOR>
+<BANDWIDTH_OUT>1</BANDWIDTH_OUT>
+<BANDWIDTH_IN>1</BANDWIDTH_IN>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="OUT">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</ALT_SETTING>
+<ALT_SETTING>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 0 (Alternate Setting 2)"</DESCRIPTOR>
+<BANDWIDTH_OUT>2</BANDWIDTH_OUT>
+<BANDWIDTH_IN>2</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<SIZE>64</SIZE>
+<INTERVAL>1</INTERVAL>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>N</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</ALT_SETTING>
+<INTERFACE>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 1 (Default Setting 0)"</DESCRIPTOR>
+<BANDWIDTH_OUT>0</BANDWIDTH_OUT>
+<BANDWIDTH_IN>0</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="IN">
+<SIZE>512</SIZE>
+<DMA>Y</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>Y</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</INTERFACE>
+<ALT_SETTING>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 1 (Alternate Setting 1)"</DESCRIPTOR>
+<BANDWIDTH_OUT>1</BANDWIDTH_OUT>
+<BANDWIDTH_IN>1</BANDWIDTH_IN>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>Y</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>Y</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</ALT_SETTING>
+<INTERFACE>
+<CLASS>255</CLASS>
+<SUBCLASS>255</SUBCLASS>
+<PROTOCOL>255</PROTOCOL>
+<DESCRIPTOR>"T_USB Test Interface 2 (Default Setting 0)"</DESCRIPTOR>
+<BANDWIDTH_OUT>0</BANDWIDTH_OUT>
+<BANDWIDTH_IN>0</BANDWIDTH_IN>
+<ENDPOINT type="INTERRUPT" direction="IN">
+<INTERVAL>1</INTERVAL>
+<SIZE>64</SIZE>
+<DMA>Y</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+<ENDPOINT type="BULK" direction="OUT">
+<SIZE>512</SIZE>
+<DMA>Y</DMA>
+<DOUBLEBUFF>N</DOUBLEBUFF>
+</ENDPOINT>
+</INTERFACE>
+</LDD>
\ No newline at end of file
--- a/kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usb/t_usb_device/src/activecontrol.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1079,6 +1079,10 @@
 						    OstTrace1 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP09, "Closing USB channel number %d",portNumber);
 						    }
 #ifdef USB_SC
+						if (0 == portNumber)
+							{
+							iEp0Buf.Close();
+							}
 						RChunk* commChunk;
 						User::LeaveIfError(iPort[portNumber].GetDataTransferChunk(commChunk));
 						commChunk->Close(); 
@@ -1421,6 +1425,10 @@
 						    OstTrace1 (TRACE_VERBOSE, CACTIVECONTROL_PROCESSEP0CONTROLPACKET_DUP34, "Closing USB channel number %d",portNumber);
 						    }
 #ifdef USB_SC
+						if (0 == portNumber)
+							{
+							iEp0Buf.Close();
+							}
 						RChunk* commChunk;
 						User::LeaveIfError(iPort[portNumber].GetDataTransferChunk(commChunk));
 						commChunk->Close();	
@@ -1440,7 +1448,6 @@
 					StartMassStorage(&iPort[0]);
 
 					OpenStackIfOtg();
-					
 					test.Next (_L("Enumeration..."));
 					r = ReEnumerate();
 					test_KErrNone(r);
--- a/kerneltest/e32test/usb/t_usb_device/src/usbms.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usb/t_usb_device/src/usbms.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -392,7 +392,7 @@
 static TBool IsDriveInMountList(TUint driveLetter)
 	{
 	TUint16 driveLetter16 = static_cast<TUint16>(driveLetter);
-	return(!mountList.Length() || KErrNotFound != mountList.Find(&driveLetter16, 1));
+	return KErrNotFound != mountList.Find(&driveLetter16, 1);
 	}
 
 void CUsbWatch::RunL()
@@ -622,6 +622,11 @@
 				{
 				gActiveControl->SetMSFinished(ETrue);
 				}
+			if ((driveStatus == EUsbMsDriveState_Connecting) && (mountList.Length() < 1))
+				{ // If there are more than one drive in the device, only mount one to test. 
+                  // For the usb test purpose, it is enough.
+                mountList.Append(static_cast<TChar>(driveLetter));
+				}
 			if(IsDriveInMountList(driveLetter))
 				{
 				if (driveStatus == EUsbMsDriveState_Connecting)
Binary file kerneltest/e32test/usb/t_usb_win/bin_distribution/t_usb_win.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_win/scripts/vascotests.bat	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,22 @@
+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_usb_win /L="..\Results\sanity.log"       /P="VascoDevice" "sanity.uts"
+..\t_usb_win /L="..\Results\singleif1.log"       /P="VascoDevice" "singleif1.uts"
+..\t_usb_win /L="..\Results\singleif2.log"       /P="VascoDevice" "singleif2.uts"
+..\t_usb_win /L="..\Results\multif1.log"       /P="VascoDevice" "multif1.uts"
+..\t_usb_win /L="..\Results\multif2.log"       /P="VascoDevice" "multif2.uts"
+..\t_usb_win /L="..\Results\streambm.log" /P="VascoDevice" "streambm.uts"
+..\t_usb_win /L="..\Results\mstore.log"       /P="VascoDevice" "mstore.uts"
--- a/kerneltest/e32test/usb/t_usb_win/src/Perl.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usb/t_usb_win/src/Perl.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2001-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,7 +25,7 @@
 #endif
 
 // define the CreateProcess strings for Perl
-#define APPNAME "C:\\Apps\\Perl\\Bin\\Perl.exe"
+#define APPNAME "C:\\Apps\\actperl\\bin\\perl.exe"
 #define APPTITLE "Perl Script"
 
 #define WAIT_SLEEP 1000			// checks for for perl script completion every second		
@@ -43,8 +43,7 @@
     ZeroMemory( &pi, sizeof(pi) );
 
 	if (!CreateProcess (APPNAME,scriptName,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi))
-		return USBIO_ERR_INVALID_PROCESS;
-
+	return USBIO_ERR_FAILED;
 	for (int i = 0; i < EXIT_WAIT && exitCode == STILL_ACTIVE; i++)
 		{
 		Sleep (WAIT_SLEEP);
--- a/kerneltest/e32test/usb/t_usb_win/src/t_usb_wintests.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usb/t_usb_win/src/t_usb_wintests.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2001-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"
@@ -1156,6 +1156,7 @@
 	logStream = fopen (gLogfileName, "rb");
 	if (logStream == NULL)
 		{
+		PRINT_TIME "fopen failed  ");
 		return;
 		}
 
@@ -1170,28 +1171,36 @@
 	// Create the bulk OUT pipe
 	epAddress = gEndpointMap[0][0][1];
 	dwRC = outPipePtr->Bind(gDevNumber, epAddress, gDevList, &gUsbioID);
+	
 	if (dwRC != USBIO_ERR_SUCCESS)
 		{
+		PRINT_TIME "bind failed  ");
 		return;
 		}
 
 	bytesRead = fread ( logBuffer, sizeof(char), KHostLogFileSize, logStream );
 	if (bytesRead > 0)
 		{
+		PRINT_TIME "fread success. %d bytes read", bytesRead);
 		bufPtr.NumberOfBytesToTransfer = bytesRead;
 		outPipePtr->Write(&bufPtr);
 		dwRC = outPipePtr->WaitForCompletion(&bufPtr, gReadWriteTimeOut);
+		PRINT_TIME "write completes with %l",dwRC);
 		if (dwRC != USBIO_ERR_SUCCESS)
 			{
 			return;
 			}
 		}
-
-
-	bufPtr.NumberOfBytesToTransfer = 0;
-	outPipePtr->Write(&bufPtr);
-	dwRC = outPipePtr->WaitForCompletion(&bufPtr, gReadWriteTimeOut);
-
+	
+	// The sending of empty buffer is removed because mobile receives only one packet 
+	// (in CActiveControl::PrintHostLog function) from PC in both non-shared chunk 
+	// and shared chunk implementation, and then mobile exits the application.
+	// PC may be dead if PC sends this redundant packet while mobile is exiting 
+	//CUsbIoBuf bufPtrEnd((VOID*) logBuffer, 0);
+	//bufPtrEnd.NumberOfBytesToTransfer = 0;
+	//outPipePtr->Write(&bufPtrEnd);
+	//dwRC = outPipePtr->WaitForCompletion(&bufPtrEnd, gReadWriteTimeOut);
+	
 	return;
 	}
 
--- a/kerneltest/e32test/usb/t_usb_win/usbtestloop.pl	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usb/t_usb_win/usbtestloop.pl	Wed Sep 22 10:53:45 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-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,11 +24,11 @@
 print localtime()."\n";
 print "======================================\n";
 
-unless (-e "h4testsusbcv.bat")
-	{
-	print "Cannot find h4testsusbcv.bat\n";
-	exit 0;
-	}
+# unless (-e "h4testsusbcv.bat")
+# 	{
+# 	print "Cannot find h4testsusbcv.bat\n";
+# 	exit 0;
+# 	}
 unless (-e "h4tests.bat")
 	{
 	print "Cannot find h4tests.bat\n";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/usb/t_usb_win/usbtestloopvasco.pl	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2009-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:
+#
+#
+
+use strict;
+
+chdir "scripts" or die "$!";
+
+print "======================================\n";
+print "USBTESTLOOP starts\n";
+print localtime()."\n";
+print "======================================\n";
+
+unless (-e "vascotests.bat")
+	{
+	print "Cannot find vascotests.bat\n";
+	exit 0;
+	}
+
+while (1)
+	{
+	my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+
+		print localtime().": Start vascotests.bat\n";
+		system "vascotests.bat";
+		print localtime().": Execution of vascotests.bat complete\n";
+	($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+	my $prefix = sprintf("%04d%02d%02d%02d%02d%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec);
+	system "COPY /Y ..\\Results\\vascotests.log ..\\${prefix}_vascotests.log";
+	system "COPY /Y ..\\Results\\vascoperformance.log ..\\${prefix}_vascoperformance.log";
+	}
--- a/kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/BasicWatcher.h	Wed Sep 22 10:53:45 2010 +0100
@@ -68,66 +68,41 @@
 	@param aInterface the usb interface to suspend  
 	@param aCallBack the call back object to call once a resumption signal has happened
 	*/
-	CInterfaceWatcher(RUsbInterface& aInterface,const TCallBack& aCallBack)
-	:	CActive(EPriorityUserInput),
-		iUsbInterface(aInterface),
-		iResumeCallBack(aCallBack),
-		iCompletionCode(KErrNone)
-		{
-		CActiveScheduler::Add(this);
-		}
+	CInterfaceWatcher(RUsbInterface& aInterface,const TCallBack& aCallBack);
 
 	/**
 	Destructor
 	*/
-	~CInterfaceWatcher()
-		{
-		Cancel();
-		}
+	~CInterfaceWatcher();
 
 	/**
 	Suspend the interface and watch for resumtions
 	*/
-	void SuspendAndWatch()
-		{
-		iUsbInterface.PermitSuspendAndWaitForResume(iStatus);
-		SetActive();
-		}
+	void SuspendAndWatch();
+
 
 	/**
 	Obtains the most recent completion code for the interface resumption
 	asynchronous action
 	@return the completion error code
 	*/
-	TInt CompletionCode() const
-		{
-		return iCompletionCode;
-		}
+	TInt CompletionCode() const;
+
 
 protected: // From CActive
 
 	/**
 	*/
-	void DoCancel()
-		{
-		iUsbInterface.CancelPermitSuspend();
-		}
+	void DoCancel();
 
 	
 	/**
 	*/
-	void RunL()
-		{
-		iCompletionCode = iStatus.Int();
-		User::LeaveIfError(iResumeCallBack.CallBack());
-		}
+	void RunL();
 	
 	/**
 	*/
-	TInt RunError()
-		{
-		return KErrNone;
-		}
+	TInt RunError();
 
 private:
 
--- a/kerneltest/e32test/usbho/t_usbdi/inc/testliterals.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/inc/testliterals.h	Wed Sep 22 10:53:45 2010 +0100
@@ -206,6 +206,90 @@
 Be off, or I'll kick you down stairs.\" \
 "); // 1438 bytes
 
+_LIT8(KLiteralEnglish16,
+"\
+1: \
+\"You are old, father William,\" the young man said, \
+\"And your hair has become very white; \
+And yet you incessantly stand on your head-- \
+Do you think, at your age, it is right?\" \
+2: \
+\"In my youth,\" father William replied to his son, \
+\"I feared it might injure the brain; \
+But, now that I'm perfectly sure I have none, \
+Why, I do it again and again.\" \
+3: \
+\"You are old,\" said the youth, \"as I mentioned before, \
+And you have grown most uncommonly fat; \
+Yet you turned a back-somersault in at the door-- \
+Pray what is the reason for that?\" \
+4: \
+\"In my youth,\" said the sage, as he shook his grey locks, \
+\"I kept all my limbs very supple \
+By the use of this ointment - one shilling a box-- \
+Allow me to sell you a couple?\" \
+5: \
+\"You are old,\" said the youth, \"and your jaws are too weak \
+For anything tougher than suet; \
+Yet you finished the goose, with the bones and the beak-- \
+Pray, how did you manage to do it?\" \
+6: \
+\"In my youth,\" said his father, \"I took to the law, \
+And argued each case with my wife; \
+And the muscular strength, which it gave to my jaw, \
+Has lasted the rest of my life.\" \
+7: \
+\"You are old,\" said the youth, \"one would hardly suppose \
+That your eye was as steady as ever;\
+Yet you balanced an eel on the end of your nose-- \
+What made you so awfully clever?\" \
+8: \
+\"I have answered three questions, and that is enough,\" \
+Said his father. \"Don't give yourself airs! \
+Do you think I can listen all day to such stuff? \
+Be off, or I'll kick you down stairs.\" \
+From 9 to 16, just simply repeats 1 to 8:\
+9: \
+\"You are old, father William,\" the young man said, \
+\"And your hair has become very white; \
+And yet you incessantly stand on your head-- \
+Do you think, at your age, it is right?\" \
+10: \
+\"In my youth,\" father William replied to his son, \
+\"I feared it might injure the brain; \
+But, now that I'm perfectly sure I have none, \
+Why, I do it again and again.\" \
+11: \
+\"You are old,\" said the youth, \"as I mentioned before, \
+And you have grown most uncommonly fat; \
+Yet you turned a back-somersault in at the door-- \
+Pray what is the reason for that?\" \
+12: \
+\"In my youth,\" said the sage, as he shook his grey locks, \
+\"I kept all my limbs very supple \
+By the use of this ointment - one shilling a box-- \
+Allow me to sell you a couple?\" \
+13: \
+\"You are old,\" said the youth, \"and your jaws are too weak \
+For anything tougher than suet; \
+Yet you finished the goose, with the bones and the beak-- \
+Pray, how did you manage to do it?\" \
+14: \
+\"In my youth,\" said his father, \"I took to the law, \
+And argued each case with my wife; \
+And the muscular strength, which it gave to my jaw, \
+Has lasted the rest of my life.\" \
+15: \
+\"You are old,\" said the youth, \"one would hardly suppose \
+That your eye was as steady as ever;\
+Yet you balanced an eel on the end of your nose-- \
+What made you so awfully clever?\" \
+16: \
+\"I have answered three questions, and that is enough,\" \
+Said his father. \"Don't give yourself airs! \
+Do you think I can listen all day to such stuff? \
+Be off, or I'll kick you down stairs.\" \
+");
 	}
 
 #endif
\ No newline at end of file
--- a/kerneltest/e32test/usbho/t_usbdi/scripts/RDeviceA.txt	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/scripts/RDeviceA.txt	Wed Sep 22 10:53:45 2010 +0100
@@ -1,28 +1,28 @@
   + length=18, type=0x01
    >12010002ffffff40220e4000050301020301
   + length=9, type=0x02
-   >09024a00020104e000
+   >09024a000201048032
    \ 
-    + length=3, type=0x09
-     >030903
     + length=9, type=0x04
      >0904000000ffffff06
     + length=9, type=0x04
      >0904010002ffffff07
      \ 
       + length=7, type=0x05
-       >07050102400000
+       >070501020002ff
       + length=7, type=0x05
-       >07058402400000
+       >070581020002ff
      / 
     + length=9, type=0x04
      >0904010103ffffff08
      \ 
       + length=7, type=0x05
-       >07058103080040
+       >07058103000207
       + length=7, type=0x05
-       >07050102400000
+       >070501020002ff
       + length=7, type=0x05
-       >07058402400000
+       >070582020002ff
      / 
+    + length=3, type=0x09
+     >030903
    / 
--- a/kerneltest/e32test/usbho/t_usbdi/scripts/RDeviceB.txt	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/scripts/RDeviceB.txt	Wed Sep 22 10:53:45 2010 +0100
@@ -1,10 +1,8 @@
   + length=18, type=0x01
    >12010002ffffff40220e4000050301020301
   + length=9, type=0x02
-   >0902ea03010104e000
+   >0902ea030101048032
    \ 
-    + length=3, type=0x09
-     >030903
     + length=9, type=0x04
      >090400000300000006
      \ 
@@ -12,21 +10,21 @@
        >4b24ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
         ffffffffffffffffffffff
       + length=7, type=0x05
-       >07050102400000
+       >070501020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
       + length=7, type=0x05
-       >07050202400000
+       >070502020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
       + length=7, type=0x05
-       >07050302400000
+       >070503020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -40,21 +38,21 @@
        >4b24ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
         ffffffffffffffffffffff
       + length=7, type=0x05
-       >07050102400000
+       >070501020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
       + length=7, type=0x05
-       >07050202400000
+       >070502020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
       + length=7, type=0x05
-       >07050302400000
+       >070503020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -68,25 +66,27 @@
        >4b24ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
         ffffffffffffffffffffff
       + length=7, type=0x05
-       >07050102400000
+       >070501020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
       + length=7, type=0x05
-       >07050202400000
+       >070502020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
       + length=7, type=0x05
-       >07050302400000
+       >070503020002ff
        \ 
         - length=75, type=0x25
          >4b250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
           0000000000000000000000
        / 
      / 
+    + length=3, type=0x09
+     >030903
    / 
--- a/kerneltest/e32test/usbho/t_usbdi/scripts/RLogitechHeadset.txt	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/scripts/RLogitechHeadset.txt	Wed Sep 22 10:53:45 2010 +0100
@@ -1,15 +1,15 @@
   + length=18, type=0x01
-   >12011001000000086d04020a131001020001
+   >12010002000000086d040c0a131001020001
   + length=9, type=0x02
-   >090257010401008032
+   >09022b010401038032
    \ 
     + length=9, type=0x04
      >090400000001010000
      \ 
       - length=10, type=0x24
-       >0a240100017500020102
+       >0a240100016400020102
       - length=12, type=0x24
-       >0c24020d0102000101000000
+       >0c24020d0102000100000000
       - length=9, type=0x24
        >092406060d01030000
       - length=12, type=0x24
@@ -20,14 +20,12 @@
        >0a240601090101020200
       - length=9, type=0x24
        >0924030e0103000100
-      - length=12, type=0x24
-       >0c24020b0102000101000000
       - length=9, type=0x24
-       >092406020b01030000
-      - length=12, type=0x24
-       >0c2404070102010100000000
+       >092406020d01030000
+      - length=7, type=0x24
+       >07240508010200
       - length=9, type=0x24
-       >0924030a0101000700
+       >0924030a0101000800
      / 
     + length=9, type=0x04
      >090401000001020000
@@ -36,10 +34,10 @@
      \ 
       - length=7, type=0x24
        >0724010c010100
-      - length=23, type=0x24
-       >1724020102021005401f00112b0022560044ac0080bb00
+      - length=14, type=0x24
+       >0e24020102021000401f0080bb00
       - length=9, type=0x05
-       >09050109c000010000
+       >0905010dc000010000
        \ 
         - length=7, type=0x25
          >07250101000000
@@ -50,10 +48,10 @@
      \ 
       - length=7, type=0x24
        >0724010c010100
-      - length=23, type=0x24
-       >1724020101021005401f00112b0022560044ac0080bb00
+      - length=14, type=0x24
+       >0e24020101021000401f0080bb00
       - length=9, type=0x05
-       >090501096000010000
+       >0905010d6000010000
        \ 
         - length=7, type=0x25
          >07250101000000
@@ -66,10 +64,10 @@
      \ 
       - length=7, type=0x24
        >0724010a000100
-      - length=23, type=0x24
-       >1724020101021005401f00112b0022560044ac0080bb00
+      - length=14, type=0x24
+       >0e24020101021000401f0080bb00
       - length=9, type=0x05
-       >090584096000010000
+       >0905840d6000010000
        \ 
         - length=7, type=0x25
          >07250101020100
--- a/kerneltest/e32test/usbho/t_usbdi/scripts/uca.bat	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/scripts/uca.bat	Wed Sep 22 10:53:45 2010 +0100
@@ -14,4 +14,10 @@
 REM 
 REM 
 
-t_usbdi -role=client -cases=0472,0473,0474,0477,0478,0479,0480,0481,0483,0484,0485,0486,0487,0488,0489,0490,0491,0492,0493,0494,0495,0496,0497,0498,0499,0500,1229,1230,1231,1234,1235,1236
\ No newline at end of file
+REM t_usbdi -role=client -cases=0472,0473,0474,0477,0478,0479,0480,0481,0483,0484,0485,0486,0487,0488,0489,0490,0491,0492,0493,0494,0495,0496,0497,0498,0499,0500,1229,1230,1231,1234,1235,1236
+REM VASCO REMOVE 0473 since remote wakeup is not supported by vasco
+REM VASCO REMOVE 0486(ou1cimx1#563256)
+REM VASCO REMOVE 0499(ou1cimx1#553963). 
+REM VASCO REMOVE 0496/0497/0498(ou1cimx1#553913)
+REM VASCO REMOVE manual 0482(ou1cimx1#554096)
+t_usbdi -role=client -cases=0472,0474,0477,0478,0479,0480,0481,0483,0484,0485,0487,0488,0489,0490,0491,0492,0493,0494,0495,0500,1229,1230,1231,1234,1235,1236
\ No newline at end of file
--- a/kerneltest/e32test/usbho/t_usbdi/scripts/uha.bat	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/scripts/uha.bat	Wed Sep 22 10:53:45 2010 +0100
@@ -12,5 +12,12 @@
 REM 
 REM Description:
 REM 
-REM 
-t_usbdi -role=host -cases=0472,0473,0474,0477,0478,0479,0480,0481,0483,0484,0485,0486,0487,0488,0489,0490,0491,0492,0493,0494,0495,0496,0497,0498,0499,0500,1229,1230,1231,1234,1235,1236,0475,0476
\ No newline at end of file
+REM
+ 
+REM t_usbdi -role=host -cases=0472,0473,0474,0477,0478,0479,0480,0481,0483,0484,0485,0486,0487,0488,0489,0490,0491,0492,0493,0494,0495,0496,0497,0498,0499,0500,1229,1230,1231,1234,1235,1236,0475,0476
+REM VASCO REMOVE 0473 since remote wakeup is not supported by vasco
+REM VASCO REMOVE 0486(ou1cimx1#563256)
+REM VASCO REMOVE 0499(ou1cimx1#553963). 
+REM VASCO REMOVE 0496/0497/0498(ou1cimx1#553913)
+REM VASCO REMOVE manual 0482(ou1cimx1#554096)
+t_usbdi -role=host -cases=0472,0474,0477,0478,0479,0480,0481,0483,0484,0485,0487,0488,0489,0490,0491,0492,0493,0494,0495,0500,1229,1230,1231,1234,1235,1236,0475,0476
\ No newline at end of file
--- a/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -86,5 +86,47 @@
 	return KErrNone;
 	}
 
+
+CInterfaceWatcher::CInterfaceWatcher(RUsbInterface& aInterface,const TCallBack& aCallBack)
+:	CActive(EPriorityUserInput),
+	iUsbInterface(aInterface),
+	iResumeCallBack(aCallBack),
+	iCompletionCode(KErrNone)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CInterfaceWatcher::~CInterfaceWatcher()
+	{
+	Cancel();
+	}
+
+void CInterfaceWatcher::SuspendAndWatch()
+	{
+	iUsbInterface.PermitSuspendAndWaitForResume(iStatus);
+	SetActive();
+	}
+
+TInt CInterfaceWatcher::CompletionCode() const
+	{
+	return iCompletionCode;
+	}
+
+void CInterfaceWatcher::DoCancel()
+	{
+	iUsbInterface.CancelPermitSuspend();
+	}
+
+void CInterfaceWatcher::RunL()
+	{
+	iCompletionCode = iStatus.Int();
+	User::LeaveIfError(iResumeCallBack.CallBack());
 	}
 	
+TInt CInterfaceWatcher::RunError()
+	{
+	return KErrNone;
+	}		
+									
+	}
+	
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0475.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -97,7 +97,7 @@
 	err	= UsbDescriptorParser::Parse(KConfigurationDescriptorInsufficientDataTestCase2, parsed);
 	configDesc = TUsbConfigurationDescriptor::Cast(parsed);
 
-	CHECK(configDesc != 0) // tree should be kept, even if there is a parse error at the end
+	CHECK(configDesc == 0) // tree is freed if there are errors, refer to source code
 	CHECK(err == KErrCorrupt) // KErrCorrupt
 	
 	// Parse Configuration Descriptor ---------- Case 3
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0477.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -265,7 +265,7 @@
 	RUsbInterface::TDeviceSpeed deviceSpeed;
 	CHECK(iUsbInterface1.GetDeviceSpeed(deviceSpeed) == KErrNone);
 	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP07, "GetDeviceSpeed = %d", deviceSpeed);
-	CHECK(deviceSpeed == RUsbInterface::EFullSpeed);	
+	CHECK(deviceSpeed == RUsbInterface::EHighSpeed);	
 		
 	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0477_DEVICEINSERTEDL_DUP08, "Number of alternate interface settings available: %d",iUsbInterface1.GetAlternateInterfaceCount());
 	gtest(iUsbInterface1.GetAlternateInterfaceCount() == 2);
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0487.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -411,6 +411,7 @@
 			TTestCaseFailed request(KErrCompletion,msg);
 			return iControlEp0->SendRequest(request,this);
 			}
+		User::After(2000000); // so that interrupt transfer 2 complete on peripheral side			
 		// Comparison is a match, continue
 		TEndpointWriteRequest request(1,1,KDataPayload1);
 		return iControlEp0->SendRequest(request,this);		
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0493.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -30,16 +30,18 @@
 
 namespace NUnitTesting_USBDI
 	{
-const TInt  KLiteralEnglish8Length = KLiteralEnglish8().Length(); 
-const TUint KBulkTransferMaxSize = 320;
-const TUint KHostNumWriteBytes = 256;
-const TUint KHostNumReadBytes = 256;
-const TUint KHostFinalNumReadBytes = 300;
+const TInt  KLiteralEnglish16Length = KLiteralEnglish16().Length(); 
+// High speed peripheral vasco max packet size is 512. 
+// Size for reading/writing shall be multiple of endpoint max packet size to prevent the return of RDevUsbcClient::ReadUntilShort.
+const TUint KBulkTransferMaxSize = 640;
+const TUint KHostNumWriteBytes = 512;
+const TUint KHostNumReadBytes = 512;
+const TUint KHostFinalNumReadBytes = 600;
 
-const TUint KStartNumTransferBytes = 1023;
-const TUint KFinishNumTransferBytes = 1025;
+const TUint KStartNumTransferBytes = 2047;
+const TUint KFinishNumTransferBytes = 2049;
 
-const TUint KClientNumReadBytes = 2000;
+const TUint KClientNumReadBytes = 4000;
 
 //Make these single bit values ... 
 // ... so that their completion can be easily recorded in a bit mask!
@@ -134,13 +136,13 @@
 		case ETransferOut:
 			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP02, "Try to send %d bytes of data", iNumTransferBytes);
 			{
-			    const TPtrC8& midKLiteralEnglish = KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes);
+			    const TPtrC8& midKLiteralEnglish = KLiteralEnglish16().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes);
                 OstTraceData(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_EP0TRANSFERCOMPLETEL_DUP52, "", midKLiteralEnglish.Ptr(), midKLiteralEnglish.Length());
 			}
-			iOutTransfer[0]->TransferOut(KLiteralEnglish8().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
-			iOutTransfer[1]->TransferOut(KLiteralEnglish8().Mid(1*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
-			iOutTransfer[2]->TransferOut(KLiteralEnglish8().Mid(2*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
-			iOutTransfer[3]->TransferOut(KLiteralEnglish8().Mid(3*KHostNumWriteBytes, iNumTransferBytes - 3*KHostNumWriteBytes), ETrue);
+			iOutTransfer[0]->TransferOut(KLiteralEnglish16().Mid(0*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
+			iOutTransfer[1]->TransferOut(KLiteralEnglish16().Mid(1*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
+			iOutTransfer[2]->TransferOut(KLiteralEnglish16().Mid(2*KHostNumWriteBytes, KHostNumWriteBytes), EFalse);
+			iOutTransfer[3]->TransferOut(KLiteralEnglish16().Mid(3*KHostNumWriteBytes, iNumTransferBytes - 3*KHostNumWriteBytes), ETrue);
 			break;
 		
 		case ETransferIn:
@@ -238,25 +240,25 @@
 				TPtrC8 data2(iInTransfer[1]->DataPolled());		
 				TPtrC8 data3(iInTransfer[2]->DataPolled());		
 				TPtrC8 data4(iInTransfer[3]->DataPolled());		
-				if(ValidateData(data1, KLiteralEnglish8().Mid(0*KHostNumReadBytes, KHostNumReadBytes)) == EFalse)
+				if(ValidateData(data1, KLiteralEnglish16().Mid(0*KHostNumReadBytes, KHostNumReadBytes)) == EFalse)
 					{
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 
-				if(ValidateData(data2, KLiteralEnglish8().Mid(1*KHostNumReadBytes, KHostNumReadBytes)) == EFalse)
+				if(ValidateData(data2, KLiteralEnglish16().Mid(1*KHostNumReadBytes, KHostNumReadBytes)) == EFalse)
 					{
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 
-				if(ValidateData(data3, KLiteralEnglish8().Mid(2*KHostNumReadBytes, KHostNumReadBytes)) == EFalse)
+				if(ValidateData(data3, KLiteralEnglish16().Mid(2*KHostNumReadBytes, KHostNumReadBytes)) == EFalse)
 					{
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
 					}
 
-				if(ValidateData(data4, KLiteralEnglish8().Mid(3*KHostNumReadBytes, iNumTransferBytes - 3*KHostNumReadBytes)) == EFalse)
+				if(ValidateData(data4, KLiteralEnglish16().Mid(3*KHostNumReadBytes, iNumTransferBytes - 3*KHostNumReadBytes)) == EFalse)
 					{
 					err = KErrCompletion; //indicates data validation failure
 					break; //switch(iCaseStep)
@@ -315,7 +317,7 @@
 	{
 	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL_ENTRY, this );
 	Cancel();
-	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL, "****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish8Length);
+	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0493_DEVICEINSERTEDL, "****** Father William Pattern Length is %d bytes! *********", KLiteralEnglish16Length);
 	if(BaseBulkDeviceInsertedL(aDeviceHandle) == EDeviceConfigurationError)
 		// Prepare for response from control transfer to client
 		{
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0497.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -30,12 +30,13 @@
 
 namespace NUnitTesting_USBDI
 	{
-const TInt KBulkMaxTransferSize = 40000;
-const TUint KHostNumWriteBytes1 = 32000;
-const TUint KHostNumWriteBytes2 = 32000;
-const TInt KDeviceNumReadBytes = 64000;
-const TUint KHostNumReadBytes1 = 32000;
-const TUint KHostNumReadBytes2 = 32001; //allow or ZLP
+// write/read size shall be a multiple of endpoint.MaxPacketSize(Hight speed == 512)		
+const TInt KBulkMaxTransferSize = 80000;
+const TUint KHostNumWriteBytes1 = 64000;
+const TUint KHostNumWriteBytes2 = 64000;
+const TInt KDeviceNumReadBytes = 128000;
+const TUint KHostNumReadBytes1 = 64000;
+const TUint KHostNumReadBytes2 = 64001; //allow or ZLP
 
 
 //Make these single bit values ... 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0498.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -30,13 +30,14 @@
 
 namespace NUnitTesting_USBDI
 	{
-const TInt KBulkMaxTransferSize = 40000;
-const TUint KHostNumWriteBytes1 = 32000;
-const TUint KHostNumWriteBytes2 = 32000;
-const TInt KDeviceNumReadBytes = 64000;
-const TInt KDeviceNumWriteBytes = 64000;
-const TUint KHostNumReadBytes1 = 32000;
-const TUint KHostNumReadBytes2 = 32001; //allow or ZLP
+// write/read size shall be a multiple of endpoint.MaxPacketSize(Hight speed == 512)			
+const TInt KBulkMaxTransferSize = 80000;
+const TUint KHostNumWriteBytes1 = 64000;
+const TUint KHostNumWriteBytes2 = 64000;
+const TInt KDeviceNumReadBytes = 128000;
+const TInt KDeviceNumWriteBytes = 128000;
+const TUint KHostNumReadBytes1 = 64000;
+const TUint KHostNumReadBytes2 = 64001; //allow or ZLP
 
 
 //Make these single bit values ... 
--- a/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/PBASE-T_USBDI-0500.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -30,13 +30,13 @@
 
 namespace NUnitTesting_USBDI
 	{
-const TInt KBulkMaxINTransferSize = 600;
-const TInt KDeviceNumWriteBytesPreHalt = 256;
-const TUint KHostNumReadBytesPreHalt1 = 512;
-const TUint KHostNumReadBytesPreHalt2 = 512;
-const TUint KHostNumReadBytesPostHalt1 = 256;
-const TUint KHostNumReadBytesPostHalt2 = 257;
-const TInt KDeviceNumWriteBytesPostHalt = 512;
+const TInt KBulkMaxINTransferSize = 1200;
+const TInt KDeviceNumWriteBytesPreHalt = 512;
+const TUint KHostNumReadBytesPreHalt1 = 1024;
+const TUint KHostNumReadBytesPreHalt2 = 1024;
+const TUint KHostNumReadBytesPostHalt1 = 512;
+const TUint KHostNumReadBytesPostHalt2 = 513;
+const TInt KDeviceNumWriteBytesPostHalt = 1024;
 
 
 //Make these single bit values ... 
--- a/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestDeviceBase.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -426,164 +426,171 @@
 
 
 void RUsbTestDevice::RemoteWakeup()
-    {
-    OstTraceFunctionEntry1( RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY, this );
-    if(iDeviceCaps().iConnect) 
-        {
-        TInt err(iClientDriver.SignalRemoteWakeup());
-        if(err != KErrNone)
-            {
-            OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP, "<Error %d> Unable to perform a remote wakeup",err);
-            ReportError(err);
-            }
-        }
-    else
-        {
-        OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP_DUP01, "remote wakeup not supported");
-        }
-    OstTraceFunctionExit1( RUSBTESTDEVICE_REMOTEWAKEUP_EXIT, this );
-    }
+	{
+	OstTraceFunctionEntry1( RUSBTESTDEVICE_REMOTEWAKEUP_ENTRY, this );
+	if(iDeviceCaps().iConnect) 
+		{
+		TInt err(iClientDriver.SignalRemoteWakeup());
+		if(err != KErrNone)
+			{
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP, "<Error %d> Unable to perform a remote wakeup",err);
+			ReportError(err);
+			}
+		}
+	else
+		{
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_REMOTEWAKEUP_DUP01, "remote wakeup not supported");
+		}
+	OstTraceFunctionExit1( RUSBTESTDEVICE_REMOTEWAKEUP_EXIT, this );
+	}
 
 
 TInt RUsbTestDevice::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,
-    TUint16 aDataReqLength,const TDesC8& aPayload)
-    {
-    OstTraceFunctionEntryExt( RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY, this );
-    
-    if(aRequest == KVendorEmptyRequest)
-        {
-        // Handle an empty request (i.e. do nothing)
-        
-        AcknowledgeRequestReceived();
-        }
-    else if(aRequest == KVendorReconnectRequest)
-        {
-        // Handle a reconnect requests from the host
-        
-        AcknowledgeRequestReceived();
-        iConnectTimer->SoftwareReConnect(aValue);
-        }
-    else if(aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest)
-        {
-        OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL, "**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this);
-        // Handle a reconnect requests from the host        
-        AcknowledgeRequestReceived();            
-        
-        SoftwareDisconnect();    
-        User::After(1000000);
-        //    connect device C now    
-        CUT_PBASE_T_USBDI_0486* iTestCaseT_USBDI_0486 = reinterpret_cast<CUT_PBASE_T_USBDI_0486*>(iTestCase);
-        Close();         
-        
-        User::After(3000000);
-        iTestCaseT_USBDI_0486->TestDeviceC()->OpenL(KTestDeviceC_SN);        
-        // Connect the device to the host    
-        iTestCaseT_USBDI_0486->TestDeviceC()->SoftwareConnect();
-        OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT, this, KErrAbort );
-        return KErrAbort;
-        }
-    else if(aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest)
-        {
-        OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP01, "**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this);
-        // Handle a reconnect requests from the host        
-        AcknowledgeRequestReceived();        
-         
-        SoftwareDisconnect();    
-        User::After(1000000); 
-         
-        //    connect device A now    
-        CUT_PBASE_T_USBDI_0486* iTestCaseT_USBDI_0486 = reinterpret_cast<CUT_PBASE_T_USBDI_0486*>(iTestCase);
-        
-        
-        Close();        
-        User::After(3000000);         
-        iTestCaseT_USBDI_0486->Cancel();
-        iTestCaseT_USBDI_0486->HandleDeviceDConnection();
-        iTestCaseT_USBDI_0486->TestDeviceD()->OpenL(iTestCaseT_USBDI_0486->TestCaseId());    
-        
-        // Connect the device to the host    
-        iTestCaseT_USBDI_0486->TestDeviceD()->SoftwareConnect();    
-        OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01, this, KErrAbort );
-        return KErrAbort;
-        }        
-    else if(aRequest == KVendorTestCasePassed)
-        { 
-        // Test case has completed successfully 
-        // so report to client test case that host is happy        
-        
-        AcknowledgeRequestReceived();
-        ReportError(KErrNone);
-        }
-    else if(aRequest == KVendorTestCaseFailed)
-        {
-        // The test case has failed, so report to client test case
-        // and display/log the error message
-        
-        AcknowledgeRequestReceived();
-        
-        HBufC16* msg = HBufC16::NewL(aPayload.Length());
-        msg->Des().Copy(aPayload);
-        OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP02, "<Host> Test case failed: %S",*msg);
-        delete msg;
-        msg = 0;
-        ReportError(-aValue);
-        }
-    else if(aRequest == KVendorRemoteWakeupRequest)
-        {
-        // Handle a remote wakeup request
+	TUint16 aDataReqLength,const TDesC8& aPayload)
+	{
+	OstTraceFunctionEntryExt( RUSBTESTDEVICE_PROCESSREQUESTL_ENTRY, this );
+	
+	if(aRequest == KVendorEmptyRequest)
+		{
+		// Handle an empty request (i.e. do nothing)
+		
+		AcknowledgeRequestReceived();
+		}
+	else if(aRequest == KVendorReconnectRequest)
+		{
+		// Handle a reconnect requests from the host
+		
+		AcknowledgeRequestReceived();
+		iConnectTimer->SoftwareReConnect(aValue);
+		}
+	else if(aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest)
+		{
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL, "**aRequest == KVendorDisconnectDeviceAThenConnectDeviceCRequest, this = 0x%08x", this);
+		// Handle a reconnect requests from the host		
+		AcknowledgeRequestReceived();			
+		
+		SoftwareDisconnect();	
+		User::After(1000000);
+		//	connect device C now	
+		CUT_PBASE_T_USBDI_0486* iTestCaseT_USBDI_0486 = reinterpret_cast<CUT_PBASE_T_USBDI_0486*>(iTestCase);
+		Close(); 		
+		
+		User::After(3000000);
+		iTestCaseT_USBDI_0486->TestDeviceC()->OpenL(KTestDeviceC_SN);		
+		// Connect the device to the host	
+		iTestCaseT_USBDI_0486->TestDeviceC()->SoftwareConnect();
+		OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT, this, KErrAbort );
+		return KErrAbort;
+		}
+	else if(aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest)
+		{
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP01, "**aRequest == KVendorDisconnectDeviceCThenConnectDeviceARequest, this = 0x%08x", this);
+		// Handle a reconnect requests from the host		
+		AcknowledgeRequestReceived();		
+		 
+		SoftwareDisconnect();	
+		User::After(1000000); 
+		 
+		//	connect device A now	
+		CUT_PBASE_T_USBDI_0486* iTestCaseT_USBDI_0486 = reinterpret_cast<CUT_PBASE_T_USBDI_0486*>(iTestCase);
+		
+		
+		Close();		
+		User::After(3000000); 		
+		iTestCaseT_USBDI_0486->Cancel();
+		iTestCaseT_USBDI_0486->HandleDeviceDConnection();
+		iTestCaseT_USBDI_0486->TestDeviceD()->OpenL(iTestCaseT_USBDI_0486->TestCaseId());	
+		
+		// Connect the device to the host	
+		iTestCaseT_USBDI_0486->TestDeviceD()->SoftwareConnect();	
+		OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP01, this, KErrAbort );
+		return KErrAbort;
+		}		
+	else if(aRequest == KVendorTestCasePassed)
+		{ 
+		// Test case has completed successfully 
+		// so report to client test case that host is happy		
+		
+		AcknowledgeRequestReceived();
+		
+		// allow time for host side t_usbdi.exe so that CloseInterface/Pipe happen after CloseDevice
+		User::After(1000*5); 
+		
+		ReportError(KErrNone);
+		}
+	else if(aRequest == KVendorTestCaseFailed)
+		{
+		// The test case has failed, so report to client test case
+		// and display/log the error message
+		
+		AcknowledgeRequestReceived();
+		
+		// allow time for host side t_usbdi.exe so that CloseInterface/Pipe happen after CloseDevice
+		User::After(1000*5); 
+		
+		HBufC16* msg = HBufC16::NewL(aPayload.Length());
+		msg->Des().Copy(aPayload);
+		OstTraceExt1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP02, "<Host> Test case failed: %S",*msg);
+		delete msg;
+		msg = 0;
+		ReportError(-aValue);
+		}
+	else if(aRequest == KVendorRemoteWakeupRequest)
+		{
+		// Handle a remote wakeup request
 
-        AcknowledgeRequestReceived();
-        iWakeupTimer->WakeUp(aValue);
-        }
-    else if(aRequest == KVendorPutPayloadRequest)
-        {
-        // Handle a payload request from the host
+		AcknowledgeRequestReceived();
+		iWakeupTimer->WakeUp(aValue);
+		}
+	else if(aRequest == KVendorPutPayloadRequest)
+		{
+		// Handle a payload request from the host
 
-        AcknowledgeRequestReceived();
-        OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP03, "Put payload");
-        if(aPayload.Compare(_L8("DEADBEEF")) != 0)
-            {
-            OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP04, "<Error %d> Payload not as expected",KErrCorrupt);
-            ReportError(KErrCorrupt);
-            }
-        }
-    else if(aRequest == KVendorGetPayloadRequest)
-        {
-        // Handle a payload request to the host
+		AcknowledgeRequestReceived();
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP03, "Put payload");
+		if(aPayload.Compare(_L8("DEADBEEF")) != 0)
+			{
+			OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP04, "<Error %d> Payload not as expected",KErrCorrupt);
+			ReportError(KErrCorrupt);
+			}
+		}
+	else if(aRequest == KVendorGetPayloadRequest)
+		{
+		// Handle a payload request to the host
 
-        OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP05, "Get payload");
-        __ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
-        OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP06, "iAuxBuffer = ....");
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP05, "Get payload");
+		__ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP06, "iAuxBuffer = ....");
         OstTraceData(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP56, "", iAuxBuffer->Ptr(), iAuxBuffer->Length());
-        OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP07, "\n");
-        
-        //Perform synchronous write to EP0
-        //This allows the subsequent 'Read' request to
-        //take place
-        TInt ret = iDeviceEp0->SendDataSynchronous(*iAuxBuffer);
-        OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP08, "Write (from device callback) executed with error %d", ret);
-        }
-    else if(aRequest == KVendorUnrespondRequest)
-        {
-        // Do not acknowledge this request
-        
-        OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP09, "Unrespond request: continually NAK the host");
-        }
-    else if(aRequest == KVendorStallRequest)
-        {
-        // Stall the specified endpoint
-        
-        AcknowledgeRequestReceived();
-        OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP10, "Stalling endpoint %d",aValue);
-                        
-        }
-    else
-        {
-        // Maybe forward to derived classes
-        }
-    OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02, this, KErrNone );
-    return KErrNone;
-    }
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP07, "\n");
+		
+		//Perform synchronous write to EP0
+		//This allows the subsequent 'Read' request to
+		//take place
+		TInt ret = iDeviceEp0->SendDataSynchronous(*iAuxBuffer);
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP08, "Write (from device callback) executed with error %d", ret);
+		}
+	else if(aRequest == KVendorUnrespondRequest)
+		{
+		// Do not acknowledge this request
+		
+		OstTrace0(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP09, "Unrespond request: continually NAK the host");
+		}
+	else if(aRequest == KVendorStallRequest)
+		{
+		// Stall the specified endpoint
+		
+		AcknowledgeRequestReceived();
+		OstTrace1(TRACE_NORMAL, RUSBTESTDEVICE_PROCESSREQUESTL_DUP10, "Stalling endpoint %d",aValue);
+						
+		}
+	else
+		{
+		// Maybe forward to derived classes
+		}
+	OstTraceFunctionExitExt( RUSBTESTDEVICE_PROCESSREQUESTL_EXIT_DUP02, this, KErrNone );
+	return KErrNone;
+	}
 
 
 void RUsbTestDevice::StateChangeL(TUsbcDeviceState aNewState,TInt aChangeCompletionCode)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/window/d_keyrepeat.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,138 @@
+// 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\window\d_keyrepeat.cpp
+// LDD for testing class TRawEvent kernel side keyrepeat entries
+// 
+//
+
+#include <kernel/kernel.h>
+
+#include "d_keyrepeat.h"
+
+class DKLDDFactory : public DLogicalDevice
+//
+// Test LDD factory
+//
+	{
+public:
+	DKLDDFactory();
+	virtual TInt Install(); 								//overriding pure virtual
+	virtual void GetCaps(TDes8& aDes) const;				//overriding pure virtual
+	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
+	};
+
+class DKLDDChannel : public DLogicalChannelBase
+//
+// Test logical channel
+//
+	{
+public:
+	virtual ~DKLDDChannel();
+protected:
+	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
+public:
+	RKeyEvent iStoredKeyEvent;
+	TRawEvent iStoredEvent;
+	};
+
+
+DECLARE_STANDARD_LDD()
+	{
+	return new DKLDDFactory;
+	}
+
+//
+// Constructor
+//
+DKLDDFactory::DKLDDFactory()
+	{
+	}
+
+TInt DKLDDFactory::Create(DLogicalChannelBase*& aChannel)
+	{
+//
+// Create new channel
+//  
+	aChannel=new DKLDDChannel;
+	return aChannel?KErrNone:KErrNoMemory;
+	}
+
+TInt DKLDDFactory::Install()
+//
+// Install the LDD - overriding pure virtual
+	{
+	return SetName(&KLddName);
+	}
+
+void DKLDDFactory::GetCaps(TDes8& /*aDes*/) const
+//
+// Get capabilities - overriding pure virtual
+//
+	{
+	}
+
+TInt DKLDDChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
+//
+// Create channel
+//
+	{
+	return KErrNone;
+	}
+
+DKLDDChannel::~DKLDDChannel()
+//
+// Destructor
+//
+	{
+	}
+
+RKeyEvent::RKeyEvent()
+//
+// default constructor
+//
+	{
+	}
+
+TInt DKLDDChannel::Request(TInt aReqNo, TAny* a1, TAny* /*a2*/)
+	{
+	TInt r=KErrNone;
+	TInt repeats=0;
+
+	switch(aReqNo)
+		{
+		case RTestKeyRepeatLdd::ESetRepeat:
+			kumemget(&iStoredKeyEvent,a1,sizeof(RKeyEvent));
+			iStoredEvent.SetRepeat(TRawEvent::EKeyRepeat, iStoredKeyEvent.iKey, iStoredKeyEvent.iRepeatCount);
+			NKern::ThreadEnterCS();
+			r=Kern::AddEvent(iStoredEvent);
+			NKern::ThreadLeaveCS();
+			break;
+		case RTestKeyRepeatLdd::ERepeats:
+			repeats = iStoredEvent.Repeats();
+			if (repeats!=iStoredKeyEvent.iRepeatCount)
+				{
+				r=KErrGeneral;
+				}
+			break;
+
+		default:
+			r=KErrNotSupported;
+			break;
+		} 
+	return r;
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/window/d_keyrepeat.h	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,77 @@
+// 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\window\d_keyrepeat.h
+// 
+//
+
+#if !defined(__D_KEYREPEAT_H__)
+#define __D_KEYREPEAT_H__
+
+#include <e32cmn.h>
+#include <e32keys.h>
+#ifndef __KERNEL_MODE__
+#include <e32std.h>
+#endif
+
+_LIT(KLddName,"D_KEYREPEAT.LDD");
+
+
+// class RKeyEvent
+class RKeyEvent
+	{
+public:
+	RKeyEvent();
+	RKeyEvent(TStdScanCode aKey, TInt aRepeatCount);
+public:
+	TStdScanCode iKey;
+	TInt iRepeatCount;
+	};
+
+// class RTestKeyRepeatLdd
+class RTestKeyRepeatLdd : public RBusLogicalChannel
+	{
+public:
+
+	enum TControl
+		{
+		ESetRepeat=1,
+		ERepeats
+		};
+
+public:
+	inline TInt Open();
+	inline TInt SetRepeat(RKeyEvent &aEvent);
+	inline TInt Repeats();
+	};
+
+// inlines
+#ifndef __KERNEL_MODE__
+inline TInt RTestKeyRepeatLdd::Open()
+	{
+	return DoCreate(KLddName,TVersion(0,1,0),KNullUnit,NULL,NULL);
+	}
+
+inline TInt RTestKeyRepeatLdd::SetRepeat(RKeyEvent &aEvent)
+	{
+    return DoControl(ESetRepeat,&aEvent);
+	}
+
+inline TInt RTestKeyRepeatLdd::Repeats()
+	{
+    return DoControl(ERepeats);
+	}
+
+#endif //__KERNEL_MODE__
+
+#endif   //__D_KEYREPEAT_H__
--- a/kerneltest/e32test/window/t_colour.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/window/t_colour.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-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,9 +15,26 @@
 // 
 //
 
+#define __E32TEST_EXTENSION__
+
 #include <e32test.h>
 #include <e32twin.h>
 #include <e32debug.h>
+#include <e32svr.h>
+
+const TInt KNumColors=256;
+
+LOCAL_D RTest test(_L("T_COLOUR"));
+
+LOCAL_C void SimulateKeyPress(TStdScanCode aScanCode)
+    {
+    TRawEvent eventDown;
+    eventDown.Set(TRawEvent::EKeyDown, aScanCode);
+    UserSvr::AddEvent(eventDown);
+    TRawEvent eventUp;
+    eventUp.Set(TRawEvent::EKeyUp, aScanCode);
+    UserSvr::AddEvent(eventUp);    
+    }
 
 class ColorTest
 	{
@@ -35,8 +52,10 @@
 	if(r!=KErrNone)
         {
 		con.Write(_L("Not supported."));
+		test.Printf(_L("Not supported.\r\n"));
     	TConsoleKey key;
-	    con.Read(key);
+    	SimulateKeyPress(EStdKeyEnter);
+    	con.Read(key);
         }
 	else
 		{
@@ -67,20 +86,54 @@
 	col.Control(_L("+Max"));
 	col.SetWindowPosAbs(TPoint(1,0));
 	col.Control(_L("+Vis -Cursor"));
-	for(TInt t=0;t<256;t++)
+	for(TInt t=0;t<KNumColors;t++)
 		{
 		if(!(t%16))
+			{
 			col.SetCursorPosAbs(TPoint(1,1+t/16));
+			}
 		col.SetTextColors(0,t);
 		col.Write(_L(" "));
 		}
+	
+	for(TInt i=0;i<KNumColors;i++)
+	    {
+        TUint8 red, green, blue;
+        col.GetPaletteEntry(i, red, green, blue);
+        }
+	
+	col.SetPaletteEntry(1,20,250,250);	
+	
+	TInt j = 0;
+	// Window background color
+	for(j=0;j<KNumColors;j++)
+	    {
+	    col.SetUIColors(j,0,0);
+	    }
+	// Border color
+	for(j=0;j<KNumColors;j++)
+	    {
+	    col.SetUIColors(0,j,0);
+	    }
+	// Screen color
+	for(j=0;j<KNumColors;j++)
+	    {
+	    col.SetUIColors(0,0,j);
+	    }
+	
 	TConsoleKey key;
+	SimulateKeyPress(EStdKeyEnter);
 	col.Read(key);
+	col.ClearScreen();
 	col.Destroy();
 	}
 
 GLDEF_C TInt E32Main()
     {
+    test.Title();
+    __UHEAP_MARK;
+    
+    test.Start(_L("Testing RConsole"));
 	ColorTest t;
 
 	TInt r = t.con.Init(_L("Colour Test"),TSize(28,12));
@@ -90,16 +143,34 @@
 		return r;
 		}
 	
+	TInt ret = t.con.SetSize(TSize(10,10));
+	test_Equal(KErrNotSupported, ret);
+	 
 	t.con.Control(_L("+Max"));
 	t.con.SetCursorPosAbs(TPoint(3,2));
+	test.Next(_L("Testing mode EMono:"));
 	t.con.Write(_L("Testing mode EMono:"));
 	t.ModesAndText(EMono);
+	test.Next(_L("Testing mode EGray4:"));
 	t.con.Write(_L("Testing mode EGray4:"));
 	t.ModesAndText(EGray4);
+	test.Next(_L("Testing mode EGray16:"));
 	t.con.Write(_L("Testing mode EGray16:"));
 	t.ModesAndText(EGray16);
+	test.Next(_L("Testing mode EColor256:"));
 	t.con.Write(_L("Testing mode EColor256:"));
 	t.ModesAndText(EColor256);
-
+	test.Next(_L("Testing mode EColor4K:"));
+	t.con.Write(_L("Testing mode EColor4K:"));
+	t.ModesAndText(EColor4K);
+	test.Next(_L("Testing mode EColor64K:"));
+	t.con.Write(_L("Testing mode EColor64K:"));
+	t.ModesAndText(EColor64K);
+	test.Next(_L("Testing mode EColor16M:"));
+	t.con.Write(_L("Testing mode EColor16M:"));
+	t.ModesAndText(EColor16M);
+		
+	__UHEAP_MARKEND;
+	test.End();
 	return(0);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/window/t_keyrepeat.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,107 @@
+// 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\window\t_keyrepeat.cpp
+// Overview:
+// Test the TRawEvent APIS and events related to keyrepeat
+// Tests both user and kernel side functions
+// API Information:
+// UserSvr, TRawEvent
+// Details:
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites: 
+// Failures and causes:
+// 
+//
+
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32svr.h>
+#include <e32cmn.h>
+#include <e32cmn_private.h>
+#include "d_keyrepeat.h"
+
+LOCAL_D RTest test(_L("T_KEYREPEAT"));
+
+RTestKeyRepeatLdd gLdd;
+
+// default constructor
+RKeyEvent::RKeyEvent()
+	{
+	}
+
+// constructor for RKeyEvent
+RKeyEvent::RKeyEvent(TStdScanCode aKey, TInt aRepeatCount)
+: iKey(aKey), iRepeatCount(aRepeatCount)
+	{
+	}
+
+void LoadDeviceDriver()
+	{
+	TInt r;
+
+	r=User::LoadLogicalDevice(KLddName);
+	test_KErrNone(r);
+	
+	r=gLdd.Open();
+	test_KErrNone(r);
+	}
+
+void UnloadDeviceDriver()
+	{
+	TInt r;
+	gLdd.Close();
+
+	r = User::FreeLogicalDevice(KLddName);
+	test_KErrNone(r);
+	User::After(100000);
+	}
+
+
+GLDEF_C TInt E32Main()
+//
+//
+    {
+ 	test.Title();
+	test.Start(_L("Testing user side TRawEvent::SetRepeat and ::Repeats API"));
+	TInt numRepeats=10;
+
+	// create event objects
+	RKeyEvent theKeyEvent(EStdKeySpace, numRepeats);
+	TRawEvent theEvent;
+	// set repeat
+	theEvent.SetRepeat(TRawEvent::EKeyRepeat, theKeyEvent.iKey, theKeyEvent.iRepeatCount);
+	// send event
+	test_KErrNone(UserSvr::AddEvent(theEvent));
+	// check repeat value
+	test_Equal(theKeyEvent.iRepeatCount, theEvent.Repeats());
+	test.Printf(_L("T_KEYREPEAT: USER SIDE TEST Successfully Completed\n"));
+
+	test.Next(_L("Testing kernel side TRawEvent::SetRepeat and ::Repeats API"));
+
+	LoadDeviceDriver();
+	// call kernel side to set repeat values and send the event
+	test_KErrNone(gLdd.SetRepeat(theKeyEvent));
+	// call kernel side to check that the repeat count was set correctly
+	test_KErrNone(gLdd.Repeats());
+
+	UnloadDeviceDriver();
+	test.Printf(_L("T_KEYREPEAT: KERNEL SIDE TEST Successfully Completed\n"));
+
+	test.End();
+	test.Close();
+    return KErrNone;
+    }
+
--- a/kerneltest/f32test/filesystem/automounter/t_automounter.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/filesystem/automounter/t_automounter.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -47,6 +47,14 @@
 //-------------------------------------------------------------------
 //-- the debug test property string can be used to control automounter in debug mode.
 const TUid KThisTestSID={0x10210EB3}; ///< this EXE SID
+const TUint KPropKey = 0; //-- property key
+
+//-------------------------------------------------------------------
+/** strings for the test property that will override estart.txt setting for the automounter */
+//_LIT8(KSection,  "AutoMounter");        ///< section name
+_LIT8(KKey_ChildFsList, "AM_FSNames");     ///< a key for the CSV list of child file system names
+_LIT8(KProp_DefFmtFsIdx, "AM_DefFmtFsIdx");///< a key for the optional parameter that specifies the child file system index, which will be used for formatting unrecognised media
+
 
 //-------------------------------------------------------------------
 //-- Actually, for testing autoounter, it is neccessary to have at least 3 filesystems:
@@ -123,6 +131,9 @@
     nRes = TheFs.Delete(KTestFile);
     test_KErrNone(nRes);
 
+    nRes = TheFs.CheckDisk(gSessionPath);
+    test_KErrNone(nRes);
+
 }
 
 //-------------------------------------------------------------------
@@ -157,7 +168,7 @@
 */
 static TInt DoDismountFS()
 {
-    TBuf<40> fsName(0);
+    TFSName fsName;
     TInt nRes;
    
     nRes = TheFs.FileSystemName(fsName, gDriveNum);
@@ -190,7 +201,7 @@
     TRequestStatus stat;
     TheFs.NotifyDismount(gDriveNum, stat, EFsDismountForceDismount); 
     User::WaitForRequest(stat);         
-    test(stat.Int() == KErrNone);
+    //test(stat.Int() == KErrNone);
 }
 
 
@@ -348,7 +359,7 @@
     //-- automounter must be able to parse this string.
     //-- The property key is a drive number being tested
     {
-        const TUint KPropKey = 0; //-- property key
+        
         _LIT_SECURITY_POLICY_PASS(KTestPropPolicy);
         
         nRes = RProperty::Define(KThisTestSID, KPropKey, RProperty::EText, KTestPropPolicy, KTestPropPolicy);
@@ -356,8 +367,13 @@
 
         //-- set the propery, it will override automounter config from estart.txt. 
         //-- the config string has following format: "<fs_name1>,<fsname2>"
+        //-- and this looks like: 'FSNames fat, exfat'
+        
     
         TBuf8<50> cfgBuf(0);
+        cfgBuf.Append(KKey_ChildFsList);
+
+        cfgBuf.Append(_L(" "));
         cfgBuf.Append(KFSName1);
         cfgBuf.Append(_L(" , "));
         cfgBuf.Append(KFSName2);
@@ -429,7 +445,7 @@
     {//-- the original file system had been dismounted during test initialisation; dismount whatever we have now
         test.Printf(_L("Mounting back the original FS:%S, PExt:%S \n"), &orgFsDescriptor.iFsName, &orgFsDescriptor.iPExtName);
         
-        TBuf<40> fsName;
+        TFSName fsName;
 
         nRes = TheFs.FileSystemName(fsName, gDriveNum);
         if(nRes == KErrNone && fsName.CompareF(orgFsDescriptor.iFsName) != KErrNone)
@@ -526,8 +542,8 @@
     test.Next(_L("Testing automounter basic functionality \n"));
 
     TVolumeInfo v;
-    TBuf<40> fsName(0);
-    TBuf<40> fsSubType(0);
+    TFSName fsName(0);
+    TFSName fsSubType(0);
     TInt nRes;
    
     //================================================================================
@@ -759,8 +775,8 @@
     test.Next(_L("Testing media dismounting/remounting with automounter FS \n"));
 
     TInt nRes;
-    TBuf<40>    fsName(0);
-    TBuf<40>    fsSubType(0);
+    TFSName    fsName(0);
+    TFSName    fsSubType(0);
     TBuf8<40>   buf;
 
     //================================================================================
@@ -869,8 +885,8 @@
     test.Next(_L("Testing media formatting with default parameters. Automounter FS\n"));
 
     TInt nRes;
-    TBuf<40>    fsName(0);
-    TBuf<40>    fsSubType(0);
+    TFSName    fsName(0);
+    TFSName    fsSubType(0);
 
 
     //================================================================================
@@ -1034,8 +1050,8 @@
 
 
     TInt nRes;
-    TBuf<40>    fsName(0);
-    TBuf<40>    fsSubType(0);
+    TFSName    fsName(0);
+    TFSName    fsSubType(0);
     
     TBuf<10>    drivePath;
     drivePath.Format(_L("%C:\\"), gDriveNum+'A');
@@ -1269,7 +1285,7 @@
     test.Next(_L("Testing RFormat API that allows specifying particular FS name for fixed FS.\n"));
 
     TInt nRes;
-    TBuf<40>    fsName(0);
+    TFSName    fsName(0);
    
     TBuf<10>    drivePath;
     drivePath.Format(_L("%C:\\"), gDriveNum+'A');
@@ -1416,7 +1432,7 @@
     test.Next(_L("Testing TVolFormatParam_FAT formatting API\n"));
 
     TInt nRes;
-    TBuf<40>    fsName(0);
+    TFSName    fsName(0);
    
     TBuf<10>    drivePath;
     drivePath.Format(_L("%C:\\"), gDriveNum+'A');
@@ -1527,7 +1543,7 @@
     test.Next(_L("Testing TVolFormatParam_exFAT formatting API\n"));
 
     TInt nRes;
-    TBuf<40>    fsName(0);
+    TFSName    fsName(0);
    
     TBuf<10>    drivePath;
     drivePath.Format(_L("%C:\\"), gDriveNum+'A');
@@ -1615,11 +1631,220 @@
 }
 
 //-------------------------------------------------------------------
+/**
+    A helper method. Unloads and loads back automounter FSY plugin.
+    This makes it re-parse its config either from estart.txt or from the debug property if it is set.
+*/
+void  MakeAutomounterReparseConfig()
+{
+    //-- make automounter re-parse the config property
+    ForceDismountFS();
+
+    TInt nRes = TheFs.RemoveFileSystem(KAutoMounterFSName);
+    test(nRes == KErrNone);
+
+    nRes = TheFs.AddFileSystem(KAutoMounterFsy);
+    test(nRes == KErrNone);
+}
+
+
+//-------------------------------------------------------------------
+/**
+    Test how the automounter supports only 1 child FS configured.
+    Everything should be the same as in the case with multiple childs, apart from the use case
+    of formatting the unrecognisable media.
+
+    In this case such formatting should succeed, because the one and only child FS will be used for this        
+*/
+void TestHandlingOneChildFS()
+{
+    test.Next(_L("Testing automounter with the only 1 Child FS bound\n"));
+
+    TInt nRes;
+    TBuf8<50> cfgBuf(0);
+    
+    //================================================================================
+    //-- make automounter configuration property that has only one child FS 
+    //-- and this looks like: 'FSNames fat'
+    
+    cfgBuf.Append(KKey_ChildFsList);
+
+    cfgBuf.Append(_L(" "));
+    cfgBuf.Append(KFSName1);
+  
+    nRes = RProperty::Set(KThisTestSID, KPropKey, cfgBuf);
+    test_KErrNone(nRes);
+
+    //-- make automounter re-parse the config property
+    MakeAutomounterReparseConfig();
+
+    //================================================================================
+    //-- 1. prepare the volume
+    Mount_FileSystem1();    
+    FormatVolume(); 
+
+    TFSName    fsName;
+    TFSName    fsSubType;
+
+
+    //================================================================================
+    //-- 2. mount "automounter", previous FS must be recognised and set as an active child
+    Mount_AutomounterFS();
+   
+    //-- check file system name / subtype etc.
+    nRes = TheFs.FileSystemName(fsName, gDriveNum);
+    test(fsName.CompareF(KAutoMounterFSName) == 0); //-- the file system name shall be "automounter" - it is a root FS
+    test_KErrNone(nRes);
+
+    //-- the FS Subtype must be the subtype of the recognised child FS
+    nRes = TheFs.FileSystemSubType(gDriveNum, fsSubType);   
+    test_KErrNone(nRes);
+    CheckSubtype_FS1(fsSubType);
+
+    //================================================================================
+    //-- 3. check the list of supported file system names
+    nRes = TheFs.SupportedFileSystemName(fsName, gDriveNum, RFs::KRootFileSystem); //-- "root" filesystem
+    test(nRes == KErrNone && fsName.CompareF(KAutoMounterFSName) == 0);
+    test.Printf(_L("Root FS:'%S'\n"), &fsName);
+
+    fsName.SetLength(0);
+    nRes = TheFs.SupportedFileSystemName(fsName, gDriveNum, 0); //-- 1st "child" filesystem
+    test(nRes == KErrNone && fsName.CompareF(KFSName1) == 0);
+
+    fsName.SetLength(0);
+    nRes = TheFs.SupportedFileSystemName(fsName, gDriveNum, 1); //-- 2nd "child" filesystem can't be found, it doesn't exist in config
+    test(nRes == KErrNotFound);
+
+    //================================================================================
+    //-- 4. corrupt the media, check that FS is not recognised.
+    CorruptDrive(); 
+
+    //-- check file system name / subtype etc.
+    nRes = TheFs.FileSystemName(fsName, gDriveNum);
+    test(fsName.CompareF(KAutoMounterFSName) == 0); //-- the file system name shall be "automounter" - it is a root FS
+    test_KErrNone(nRes);
+
+    //-- the FS Subtype query requires mounted and recognised file system. this shall fail
+    nRes = TheFs.FileSystemSubType(gDriveNum, fsSubType);   
+    test(nRes == KErrCorrupt);
+
+    //================================================================================
+    //-- 5. format the volume, this must be OK, because there is only 1 child file system
+    FormatVolume();
+    CheckFsOperations();
+
+    //-- the FS Subtype must be the subtype of the recognised child FS
+    nRes = TheFs.FileSystemSubType(gDriveNum, fsSubType);   
+    test_KErrNone(nRes);
+    CheckSubtype_FS1(fsSubType);
+
+
+
+}
+
+//-------------------------------------------------------------------
+/**
+    A helper method that does the real job:
+         - makes automounter config in a test property, specifying child FS for formatting unrecognisable media
+         - corrupts the drive
+         - format the drive w/o specifying the child FS
+         - check that the child FS from the config had been used for formatting
+
+
+*/
+void DoTestDefaultChildForFormatting(TInt aChildIdx)
+{
+
+    TInt nRes;
+    TBuf8<50> cfgBuf(0);
+    
+    //================================================================================
+    //-- make automounter configuration property that 2 child FS and explicitly specifies a child FS for formatting unrecognisable media
+    //-- and this looks like: 'FSNames fat, exfat'
+    //--                       DefFmtFsIdx 1 
+
+    cfgBuf.Append(KKey_ChildFsList);
+
+    cfgBuf.Append(_L(" "));
+    cfgBuf.Append(KFSName1);
+    cfgBuf.Append(_L(" , "));
+    cfgBuf.Append(KFSName2);
+
+    cfgBuf.AppendFormat(_L8("\n%S %d"), &KProp_DefFmtFsIdx(), aChildIdx);
+    
+    nRes = RProperty::Set(KThisTestSID, KPropKey, cfgBuf);
+    test_KErrNone(nRes);
+
+    //-- make automounter re-parse the config property
+    MakeAutomounterReparseConfig();
+
+
+    //================================================================================
+    //-- 1. mount "automounter"
+    Mount_AutomounterFS();
+
+    TFSName    fsName;
+    TFSName    fsSubType;
+
+    //================================================================================
+    //-- 2. corrupt the media, check that FS is not recognised.
+    CorruptDrive(); 
+
+    //-- check file system name / subtype etc.
+    nRes = TheFs.FileSystemName(fsName, gDriveNum);
+    test(fsName.CompareF(KAutoMounterFSName) == 0); //-- the file system name shall be "automounter" - it is a root FS
+    test_KErrNone(nRes);
+
+    //-- the FS Subtype query requires mounted and recognised file system. this shall fail
+    nRes = TheFs.FileSystemSubType(gDriveNum, fsSubType);   
+    test(nRes == KErrCorrupt);
+
+
+    //================================================================================
+    //-- 3. format the volume, this must be OK, because the child FS for corrupting unrecognised media is specified 
+    FormatVolume();
+    CheckFsOperations();
+
+    //-- the FS Subtype must be the subtype of the recognised child FS
+    nRes = TheFs.FileSystemSubType(gDriveNum, fsSubType);   
+    test_KErrNone(nRes);
+    
+    if(aChildIdx == 0)  //-- child idx=0, see cfgBuf
+        CheckSubtype_FS1(fsSubType);
+    else if(aChildIdx == 1) //-- child idx=1, see cfgBuf1
+        CheckSubtype_FS2(fsSubType);
+    else 
+        test(0);
+        
+
+
+
+}
+
+//-------------------------------------------------------------------
+/**
+    test a special case of formatting unrecognisable media, when automounter is configured to use 
+    some explicit child FS for this
+*/
+void TestDefaultChildForFormatting()
+{
+    test.Next(_L("Test automounter formatting unrecognisable media when child FS is explicitly specified\n"));
+
+    const TInt KDefFmtChild_FAT   = 0; //-- child FS#0 FAT
+    const TInt KDefFmtChild_ExFAT = 1; //-- child FS#1 exFAT
+
+    DoTestDefaultChildForFormatting(KDefFmtChild_FAT);
+    DoTestDefaultChildForFormatting(KDefFmtChild_ExFAT);
+
+    //-- do this test to check that this particular config hasn't broken automounter functionality
+    TestFixedFsFormatting_FsNameSpecified();
+}
+
+//-------------------------------------------------------------------
 
 void CallTestsL()
     {
 
-    
     //-- set up console output
     Fat_Test_Utils::SetConsole(test.Console());
 
@@ -1668,8 +1893,14 @@
           TestFormatting_FsName_Parameters_FAT();
           TestFormatting_FsName_Parameters_exFAT();
         
+        //-- these 2 tests must be the last ones before calling DestroyGlobals()
+        //-- they fiddle with the automounter config and may affect following tests.
+        TestHandlingOneChildFS();    
+        TestDefaultChildForFormatting();
+
         }
     //-------------------------------------
+
     DestroyGlobals();
 #endif
     }
--- a/kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1987,7 +1987,7 @@
         ReadFatDisk(fatBuf);
         }
 
-    // use first entry \scndrv\dir2\almostfull\ 
+    // use first entry \scndrv\dir2\almostfull
     test.Next(_L("Partial entry in middle of subdir"));
     last = GetStartCluster(gClusterDir2_AFull,7);
     TEntryInfo partial2(ClusterEntryToBytes(gClusterDir2_AFull,2),6);
@@ -1998,7 +1998,7 @@
     res=TestPartialEntry(partial2);
     test(res);
 
-    // reduce size of \scndrv\dir2\full\ 
+    // reduce size of \scndrv\dir2\full
     test.Next(_L("Test directory reclaim"));
     last = GetStartCluster(gClusterDir2_Full,gEntriesPerCluster-2);
     WriteEndOfDir(ClusterEntryToBytes(gClusterDir2_Full,gEntriesPerCluster-2));
@@ -2018,7 +2018,7 @@
     res=IsSameAsDrive(fatBuf,dirBuf);
     test(res);
 
-    // use last entry of first cluster in \scndrv\dir2\full\ 
+    // use last entry of first cluster in \scndrv\dir2\full
     test.Next(_L("Partial entry at end of subdir"));
     r=temp.Create(TheFs,_L("\\scndrv\\dir2\\full\\temp"),EFileShareAny);
     test_KErrNone(r);
@@ -2030,7 +2030,7 @@
     res=TestPartialEntry(partial3);
     test(res);
 
-    // use entry in \scndrv\dir2\almostfull\ 
+    // use entry in \scndrv\dir2\almostfull
     test.Next(_L("Partial entry preceeding end-of-dir marker"));
     last = GetStartCluster(gClusterDir2_AFull,14);
     if (last > 0)
@@ -2052,7 +2052,7 @@
 	//	as it is impossible for ScanDrive to judge if the illegal byte is part of a legal
 	//	DBCS charater.
 
-	// create entry in \scndrv\dir2\almostfull\ 
+	// create entry in \scndrv\dir2\almostfull
 //	test.Next(_L("Partial entry with invalid dos name"));
 //	r=temp.Create(TheFs,_L("\\scndrv\\dir2\\almostfull\\Dodgy file name"),EFileShareAny);
 //	test_KErrNone(r);
@@ -2069,7 +2069,7 @@
 
     if (BootSector.SectorsPerCluster() == 1)
         {
-        // use entry created in \scndrv\dir2\ 
+        // use entry created in \scndrv\dir2
         test.Next(_L("Partial entry spanning more than two clusters"));
         last = GetStartCluster(gClusterDir2_Full,gEntriesPerCluster-1);
         WriteEndOfDir(ClusterEntryToBytes(gClusterDir2_Full,gEntriesPerCluster-2));
@@ -2121,7 +2121,7 @@
     test(res);
 
     // matching entries between 2 subdirs, one which has a full cluster
-    // first entry in \scndrv\dir2\full\ + end of \scndrv\dir2\almostfull\ 
+    // first entry in \scndrv\dir2\full\ + end of \scndrv\dir2\almostfull
     test.Next(_L("matching entries between 2 subdirs"));
     TEntryInfo from2(ClusterEntryToBytes(gClusterDir2_Full,2),2);
     TEntryInfo to2(ClusterEntryToBytes(gClusterDir2_AFull,14),2);
@@ -2130,7 +2130,7 @@
     test(res);
 
     // matching entries between two subdirs - one with end of dir marker next
-    // \scndrv\dir2\somedirwith3entries to \scndrv\ 
+    // \scndrv\dir2\somedirwith3entries to \scndrv
     test.Next(_L("matching entries between two subdirs"));
     TEntryInfo from3(ClusterEntryToBytes(gClusterDir2,4),3);
     TEntryInfo to3(ClusterEntryToBytes(gClusterScnDrv,6),3);
@@ -2139,7 +2139,7 @@
     test(res);
 
     // matching entries in same subdir, one in new cluster - irrelevant if matching names
-    // 1st and last entries in \scndrv\dir2\full\ 
+    // 1st and last entries in \scndrv\dir2\full
     test.Next(_L("matching entries in same subdir"));
     // delete entries to allow contiguous clusters in \scndrv\dir2\full directory
     TInt r=TheFs.RmDir(_L("\\scndrv\\dir2\\somedirwith3entries\\"));
@@ -2161,7 +2161,7 @@
     res=TestMatchingEntry(to4);
     test(res);
 
-    // \scndrv\dir1\very long name to \\scndrv\dir2\full\ 
+    // \scndrv\dir1\very long name to \\scndrv\dir2\full
     test.Next(_L("matching entries in diff dirs + new cluster"));
     // delete last entry in directory
     r=TheFs.Delete(LastInFull);
--- a/kerneltest/f32test/server/t_fsrv.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/server/t_fsrv.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -65,7 +65,7 @@
 	const TText* ext;
 	};
 
-LOCAL_D SParse parse[KMaxParses] =
+static SParse parse[KMaxParses] =
 	{
 	{_S("A:\\PATH\\NAME.EXT"),NULL,NULL,_S("A:\\PATH\\NAME.EXT"),_S("A:"),_S("\\PATH\\"),_S("NAME"),_S(".EXT")},
 	{_S("A:\\PATH\\NAME"),NULL,NULL,_S("A:\\PATH\\NAME"),_S("A:"),_S("\\PATH\\"),_S("NAME"),_S("")},
@@ -76,7 +76,7 @@
 	{_S("NAME"),_S(".YYY"),_S("A:\\PATH\\"),_S("A:\\PATH\\NAME.YYY"),_S("A:"),_S("\\PATH\\"),_S("NAME"),_S(".YYY")}
 	};
 
-LOCAL_D SParseServer parseServer[KMaxParses] =
+static SParseServer parseServer[KMaxParses] =
 	{
 	{_S("A:\\PATH\\NAME.EXT"),NULL,_S("A:\\PATH\\NAME.EXT"),_S("A:"),_S("\\PATH\\"),_S("NAME"),_S(".EXT")},
 	{_S("A:\\PATH\\NAME"),NULL,_S("A:\\PATH\\NAME"),_S("A:"),_S("\\PATH\\"),_S("NAME"),_S("")},
@@ -87,7 +87,7 @@
 	{_S("NAME"),_S(".YYY"),_S("C:\\ABCDEF\\NAME.YYY"),_S("C:"),_S("\\ABCDEF\\"),_S("NAME"),_S(".YYY")}
 	};
 
-LOCAL_C TInt pathTestThread(TAny*)
+static TInt pathTestThread(TAny*)
 //
 // The entry point for the producer thread.
 //
@@ -107,7 +107,7 @@
 	return(KErrNone);
 	}
 
-LOCAL_C void printDriveAtt(TInt aDrive,TUint anAtt)
+static void printDriveAtt(TInt aDrive,TUint anAtt)
 //
 // Print a drive attribute.
 //
@@ -134,7 +134,7 @@
 	test.Printf(_L("\n"));
 	}
 
-LOCAL_C void printDriveInfo(TInt aDrive,TDriveInfo& anInfo)
+static void printDriveInfo(TInt aDrive,TDriveInfo& anInfo)
 //
 // Print a drive info.
 //
@@ -181,7 +181,7 @@
 	
 			
 	
-LOCAL_C void MountRemoteFilesystem()
+static void MountRemoteFilesystem()
 	{
 	test.Next(_L("Mount Remote Drive simulator on Q:"));
 
@@ -200,7 +200,7 @@
 	}	
 
 
-LOCAL_C void DisMountRemoteFilesystem()	
+static void DisMountRemoteFilesystem()	
 	{
 
 	test.Printf(_L("Dismounting the remote Drives \n"));
@@ -213,7 +213,7 @@
 	}
 
 
-LOCAL_C void CreateSubstDrive()
+static void CreateSubstDrive()
 	{
 	test.Printf(_L("Create Substitute Drive \n"));
 
@@ -261,7 +261,7 @@
 	}
 
 		
-LOCAL_C void RemoveSubstDrive()
+static void RemoveSubstDrive()
 	{
 	 	if( substDrive)
 	 		{
@@ -274,7 +274,7 @@
 
 
 
-LOCAL_C void testDriveInfo(TInt aDrive,TDriveInfo& anInfo)
+static void testDriveInfo(TInt aDrive,TDriveInfo& anInfo)
 //
 // Test the drive info is reasonable
 //
@@ -336,7 +336,7 @@
 */
 
 
-LOCAL_C void testDriveList()
+static void testDriveList()
 //
 // Test the drive list.
 //
@@ -901,7 +901,7 @@
 
 
 
-LOCAL_C void testDriveInfo()
+static void testDriveInfo()
 //
 // Test the drive info.
 //
@@ -928,7 +928,7 @@
 	test.End();
 	}
 
-LOCAL_C void testVolumeInfo()
+static void testVolumeInfo()
 //
 // Test volume info.
 //
@@ -971,7 +971,7 @@
 	test.End();
 	}
 
-LOCAL_C void testClientParse()
+static void testClientParse()
 //
 // Test the client side parse.
 //
@@ -1012,7 +1012,7 @@
 	test.End();
 	}
 
-LOCAL_C void testPath()
+static void testPath()
 //
 // Test the path handling.
 //
@@ -1050,7 +1050,7 @@
 	test.End();
 	}
 
-LOCAL_C void testServerParse()
+static void testServerParse()
 //
 // Test the client side parse.
 //
@@ -1086,7 +1086,7 @@
 	test.End();
 	}
 
-LOCAL_C void testSubst()
+static void testSubst()
 //
 // Test the substitute functions.
 //
@@ -1267,7 +1267,7 @@
 	test_Value(d.iDriveAtt, d.iDriveAtt==0);
 	}
 
-LOCAL_C void testSetVolume()
+static void testSetVolume()
 //
 // Test setting the volume info.
 //
@@ -1377,21 +1377,22 @@
 	test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
 	test(v.iName==_L(""));
 
-	// test volume label after remount (for removable media only)
+	
+    //-- test volume label after remount (for FAT FS only on removable drives)
 	test.Next(_L("Test volume label after remount"));
 
 	TDriveInfo info;
 	r = TheFs.Drive(info, driveNum);
 	test_KErrNone(r);
 
-	if((info.iDriveAtt & KDriveAttRemovable) != 0)
+	if(Is_Fat(TheFs, gDrive) && (info.iDriveAtt & KDriveAttRemovable))
 		{
 		// 1. set volume label
-		r = TheFs.SetVolumeLabel(_L("XXX"), driveNum);
+		r = TheFs.SetVolumeLabel(_L("XXX"), gDrive);
 		test_KErrNone(r);
 
-		// 2. change bootsector volume label
-		const TInt	offset = IsFileSystemFAT32(TheFs, driveNum)? 
+		// 2. hack volume label in the boot sector directly
+		const TInt	offset = Is_Fat32(TheFs, gDrive)? 
 			71 /*KFat32VolumeLabelPos*/ 
 			: 
 			43 /*KFat16VolumeLabelPos*/;	// both from sfat32\inc\sl_bpb.h
@@ -1406,18 +1407,18 @@
 		rdisk.Close();
 
 		// 3. remount the drive
-		r = TheFs.RemountDrive(driveNum);
+		r = TheFs.RemountDrive(driveNum); //-- won't work on non-removable drives
 		test_KErrNone(r);
 
-		// 4. check volume label
+		// 4. check volume label; it should nopt change, because "Volume label" entry in the root dir. was used 
 		r = TheFs.Volume(v, driveNum);
 		test_KErrNone(r);
 		test.Printf(_L("VOL=\"%S\"\n"),&v.iName);
 		test(v.iName == _L("XXX"));
 		test.Printf(_L("- Passed.\n"));
 		}
-	else
-		test.Printf(_L("- Skipped (drive is not removable).\n"));
+
+
 
 	// clean up
 	test.Next(_L("Set volume label to original"));
@@ -1431,7 +1432,7 @@
 	test.End();
 	}
 
-LOCAL_C void testModified()
+static void testModified()
 //
 // Test the Modified/SetModified functions.
 //
@@ -1514,7 +1515,7 @@
 	test.End();
 	}
 
-LOCAL_C void testName()
+static void testName()
 //
 // Test the Modified/SetModified functions.
 //
@@ -1555,7 +1556,7 @@
 	test.End();
 	}
 	
-LOCAL_C TInt CreateFileX(const TDesC& aBaseName,TInt aX)
+static TInt CreateFileX(const TDesC& aBaseName,TInt aX)
 //
 // Create a large file. Return KErrEof or KErrNone
 //
@@ -1599,7 +1600,7 @@
 	return(KErrNone);
 	}
 
-LOCAL_C TInt DeleteFileX(TBuf<128>& aBaseName,TInt aX)
+static TInt DeleteFileX(TBuf<128>& aBaseName,TInt aX)
 //
 // Delete a file.
 //
@@ -1619,7 +1620,7 @@
 	return(KErrNone);
 	}
 
-LOCAL_C void MakeAndDeleteFiles()
+static void MakeAndDeleteFiles()
 //
 // Create and delete large files in a randomish order
 //
@@ -1661,7 +1662,7 @@
 	test.End();
 	}
 
-LOCAL_C void FillUpDisk()
+static void FillUpDisk()
 //
 // Test that a full disk is ok
 //
@@ -1698,7 +1699,7 @@
 	test.End();
 	}
 
-LOCAL_C void CopyFileToTestDirectory()
+static void CopyFileToTestDirectory()
 //
 // Make a copy of the file in ram
 //
--- a/kerneltest/f32test/server/t_fsys.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/server/t_fsys.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -55,6 +55,197 @@
 {
 }
 
+
+//---------------------------------------------------
+/**
+    Test CFsMountHelper class functionality
+*/
+void TestFsMountHelper()
+{
+    test.Next(_L("Test CFsMountHelper class functionality\n"));
+
+    if(Is_SimulatedSystemDrive(TheFs, CurrentDrive()))
+    {
+        test.Printf(_L("Can't test on a simulated drive, skipping!\n"));
+        return;
+    }
+
+    TInt    nRes;
+    TFSName fsName;
+    TFSName fsName1;
+
+    CFsMountHelper* pHelper1 = CFsMountHelper::New(TheFs, CurrentDrive());
+    test(pHelper1 !=0);
+
+    CFsMountHelper* pHelper2 = CFsMountHelper::New(TheFs, CurrentDrive());
+    test(pHelper2 !=0);
+
+
+    //-- 1. store the original file system state
+    nRes = pHelper1->GetMountProperties();
+    test_KErrNone(nRes);
+
+    //-- 1.1 simple case. dismount the file system and mount it back
+    nRes = TheFs.FileSystemName(fsName, CurrentDrive());
+    test_KErrNone(nRes);
+    
+    nRes = pHelper1->DismountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = pHelper1->MountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = TheFs.FileSystemName(fsName1, CurrentDrive());
+    test_KErrNone(nRes);
+    test(fsName1 == fsName);
+
+    //-- 1.2 attempts to dismount FS that has files opened
+    _LIT(KFileName, "\\myfile");
+    _LIT8(KFileData, "\\this is the file data");
+    RFile file;
+
+    nRes = file.Replace(TheFs, KFileName, EFileWrite);
+    test_KErrNone(nRes);
+
+    //-- 1.2.1 simplistic API
+    nRes = pHelper1->DismountFileSystem();
+    test_Value(nRes, nRes == KErrInUse);
+
+    //-- 1.2.1 more advanced asynchronous API
+    
+    TRequestStatus stat;
+    
+    //-- 1.2.1.1 simple normal dismounting, Rfs::DismountFileSystem() analog
+    pHelper1->DismountFileSystem(stat, CFsMountHelper::ENormal);
+    User::WaitForRequest(stat);
+    test_Value(stat.Int(), stat.Int() == KErrInUse);
+
+    //-- 1.2.1.2 dismount with notifying clients (no clients, so it should succeed)
+    //-- this will be a kind of forced dismounting
+    pHelper1->DismountFileSystem(stat, CFsMountHelper::ENotifyClients);
+    User::WaitForRequest(stat);
+    test_KErrNone(stat.Int());
+
+    nRes = file.Write(KFileData);
+    test_Value(nRes, nRes == KErrNotReady); //-- no file system on the drive
+
+    //-- mount the file system back
+    nRes = pHelper1->MountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = file.Write(KFileData);
+    test_Value(nRes, nRes == KErrDisMounted);
+    file.Close();
+    
+    //-- 1.2.1.3 forced dismounting
+    nRes = file.Replace(TheFs, KFileName, EFileWrite);
+    test_KErrNone(nRes);
+
+    pHelper1->DismountFileSystem(stat, CFsMountHelper::ENormal);
+    User::WaitForRequest(stat);
+    test_Value(stat.Int(), stat.Int() == KErrInUse);
+
+
+    pHelper1->DismountFileSystem(stat, CFsMountHelper::EForceImmediate);
+    User::WaitForRequest(stat);
+    test_KErrNone(stat.Int());
+
+    nRes = file.Write(KFileData);
+    test_Value(nRes, nRes == KErrNotReady); //-- no file system on the drive
+    
+    file.Close();
+
+    //-- there is no file system on the drive. 
+    
+    //-- test weird use cases 
+    nRes = pHelper2->GetMountProperties();
+    test_Value(nRes, nRes == KErrNotFound)
+    
+    //nRes = pHelper2->MountFileSystem(); //-- this will trigger an assert in debug mode
+
+    //-- 2. test extensions
+    
+    //-- 2.1 mount the file system back
+    nRes = pHelper1->MountFileSystem();
+    test_KErrNone(nRes);
+    
+    //-- 2.2 install secondary extension
+    _LIT(KExtensionLog,"T_LOGEXT");     //-- test secondary extension module name *.fxt
+    _LIT(KExtensionLogName,"Logger");   //-- extension name
+
+    nRes = TheFs.AddExtension(KExtensionLog);
+    test_KErrNone(nRes);
+
+    nRes = TheFs.MountExtension(KExtensionLogName, CurrentDrive());
+    test_KErrNone(nRes);
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 0); //-- extension slot 0
+    test(nRes == KErrNone);
+    test(fsName1 == KExtensionLogName);
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 1); //-- extension slot 1
+    test_Value(nRes, nRes == KErrNotFound)
+
+
+    //-- 2.3 dismount the file system, it has now different set of properties comparing to ones stored in the pHelper1
+    nRes = pHelper2->GetMountProperties();
+    test(nRes == KErrNone);
+
+    nRes = pHelper2->DismountFileSystem();
+    test_KErrNone(nRes);
+
+    //-- 2.3.1 mount the original FS (without extension)
+    nRes = pHelper1->MountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 0); //-- extension slot 0
+    test_Value(nRes, nRes == KErrNotFound)
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 1); //-- extension slot 1
+    test_Value(nRes, nRes == KErrNotFound)
+
+    nRes = pHelper1->DismountFileSystem();
+    test_KErrNone(nRes);
+
+    //-- 2.3.2 mount back the FS with extension
+    nRes = pHelper2->MountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 0); //-- extension slot 0
+    test(nRes == KErrNone);
+    test(fsName1 == KExtensionLogName);
+
+    //-- 2.4 remove the extensions and dismount the file system with properties stored in pHelper2
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 1); //-- extension slot 1
+    test_Value(nRes, nRes == KErrNotFound)
+
+    nRes = pHelper2->DismountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = TheFs.RemoveExtension(KExtensionLogName);
+    test_KErrNone(nRes);
+
+
+    //-- 2.4 restore the original file system
+    nRes = pHelper1->MountFileSystem();
+    test_KErrNone(nRes);
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 0); //-- extension slot 0
+    test_Value(nRes, nRes == KErrNotFound)
+
+    nRes = TheFs.ExtensionName(fsName1, CurrentDrive(), 1); //-- extension slot 1
+    test_Value(nRes, nRes == KErrNotFound)
+
+    nRes = TheFs.FileSystemName(fsName1, CurrentDrive());
+    test_KErrNone(nRes);
+    test(fsName1 == fsName);
+
+    pHelper1->Close(); //-- just for testing
+
+    delete pHelper1;
+    delete pHelper2;
+}
+
 //---------------------------------------------------
 
 /**
@@ -138,11 +329,14 @@
     
     //====================================================
     //-- dismount original file system from the drive
-    TFSDescriptor orgFSDesc;
-    nRes = GetFileSystemDescriptor(TheFs, CurrentDrive(), orgFSDesc);
+    
+    CFsMountHelper* pHelper = CFsMountHelper::New(TheFs, CurrentDrive());
+    test(pHelper !=0);
+
+    nRes = pHelper->GetMountProperties();
     test_KErrNone(nRes);
 
-    nRes = TheFs.DismountFileSystem(orgFSDesc.iFsName, CurrentDrive());
+    nRes = pHelper->DismountFileSystem();
     test_KErrNone(nRes);
 
     //-- 2. try to mount a FS/extension with the invalid name
@@ -182,8 +376,10 @@
     
     
     //-- mount original file system back to the drive
-    nRes = MountFileSystem(TheFs, CurrentDrive(), orgFSDesc);
+    nRes = pHelper->MountFileSystem();
     test_KErrNone(nRes);
+
+    delete pHelper;
 }
 
 //---------------------------------------------------
@@ -1260,6 +1456,8 @@
     InitGlobals();
     
     //---------------------------------------
+
+    TestFsMountHelper();
     TestFileSystemNames();
     TestFileSystemNameLength();
     TestDismountFileSystem(CurrentDrive());
--- a/kerneltest/f32test/smassstorage/group/smassstorage.inf	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/smassstorage/group/smassstorage.inf	Wed Sep 22 10:53:45 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"
@@ -23,14 +23,14 @@
 PRJ_TESTMMPFILES
 
 // mass storage tests
-#if !defined(WINS) && !defined(GENERIC_X86)
 t_msfs	manual
+t_ms_publish	manual
 t_gml_tur	manual
 t_ms_mountstart	manual
-t_ms_publish	manual
-#endif
 t_msfs_scsi	manual
 t_msdrive	manual
+t_13cases	manual
+t_ms_password	manual
 
 // Mock MS file server for client API and server API test
 t_ms_mocksvr	support
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/group/t_13cases.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,44 @@
+// 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"
+// 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:
+//
+
+TARGET			t_13cases.exe        
+TARGETTYPE		EXE
+
+SOURCEPATH		../t_13cases/src
+SOURCE			t_13cases.cpp protocol.cpp controller.cpp
+SOURCEPATH		../../../../userlibandfileserver/fileserver/smassstorage
+SOURCE			cbulkonlytransport.cpp
+SOURCE			cbulkonlytransportusbcldd.cpp
+#if !defined(WINS) && !defined(GENERIC_X86)
+SOURCE			cbulkonlytransportusbcscldd.cpp
+#endif
+SOURCE			cactivedevicestatenotifierbase.cpp
+
+
+USERINCLUDE		../t_13cases/inc
+USERINCLUDE		../../../../userlibandfileserver/fileserver/smassstorage/inc
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE    ../inc
+
+
+LIBRARY			euser.lib
+#if !defined(WINS) && !defined(GENERIC_X86)
+LIBRARY			usbcsc_bil.lib
+#endif
+
+capability      all
+
+SMPSAFE
--- a/kerneltest/f32test/smassstorage/group/t_gml_tur.mmp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/smassstorage/group/t_gml_tur.mmp	Wed Sep 22 10:53:45 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"
@@ -21,14 +21,19 @@
 SOURCEPATH		../../../../userlibandfileserver/fileserver/smassstorage
 SOURCE			cbulkonlytransport.cpp
 SOURCE			cbulkonlytransportusbcldd.cpp
+#if !defined(WINS) && !defined(GENERIC_X86)
 SOURCE			cbulkonlytransportusbcscldd.cpp
+#endif
 SOURCE			cactivedevicestatenotifierbase.cpp
 
 USERINCLUDE		../inc
 USERINCLUDE		../../../../userlibandfileserver/fileserver/smassstorage/inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-LIBRARY			euser.lib usbcsc_bil.lib
+LIBRARY			euser.lib 
+#if !defined(WINS) && !defined(GENERIC_X86)
+LIBRARY			usbcsc_bil.lib
+#endif
 
 capability      all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/group/t_ms_password.mmp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,30 @@
+// 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"
+// 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:
+//
+
+TARGET			t_ms_password.exe        
+TARGETTYPE		EXE
+
+SOURCEPATH		..\src
+SOURCE			t_ms_main.cpp t_ms_password.cpp
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		..\inc
+SYSTEMINCLUDE	\EPOC32\INCLUDE
+
+LIBRARY			EUSER.LIB efsrv.lib
+
+capability      all
+
+SMPSAFE
--- a/kerneltest/f32test/smassstorage/group/t_msfs.mmp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/smassstorage/group/t_msfs.mmp	Wed Sep 22 10:53:45 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"
@@ -33,14 +33,19 @@
 SOURCE		drivepublisher.cpp
 SOURCE		cbulkonlytransport.cpp
 SOURCE		cbulkonlytransportusbcldd.cpp
+#if !defined(WINS) && !defined(GENERIC_X86)
 SOURCE		cbulkonlytransportusbcscldd.cpp
+#endif
 SOURCE		cactivedevicestatenotifierbase.cpp
-SOURCE		massstorageutil.cpp
 SOURCE		scsiprot.cpp
 SOURCE		cusbmassstorageserver.cpp
 SOURCE 		cusbmassstoragesession.cpp
 	
-LIBRARY        euser.lib efsrv.lib hal.lib usbcsc_bil.lib
+LIBRARY     euser.lib efsrv.lib hal.lib
+#if !defined(WINS) && !defined(GENERIC_X86)
+LIBRARY		usbcsc_bil.lib
+#endif
+
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE    ../../../../userlibandfileserver/fileserver/smassstorage/inc
 USERINCLUDE    ../inc
--- a/kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/f32test/smassstorage/src/t_ms_fsunit.cpp	Wed Sep 22 10:53:45 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"
@@ -208,7 +208,7 @@
 	return KErrNone;
 	}
 
-EXPORT_C void CFileSystem::DriveInfo(TDriveInfo& aInfo, TInt aDriveNumber) const
+EXPORT_C void CFileSystem::DriveInfo(TDriveInfo& /* aInfo */, TInt /* aDriveNumber */) const
 	{
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/src/t_ms_password.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,181 @@
+// 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"
+// 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 <f32file.h>
+#include <e32test.h>
+#include <e32std.h>
+#include <e32svr.h>
+#include <e32property.h>
+#include <usbmsshared.h>
+#include "t_ms_main.h"
+
+_LIT(KMsFsyName, "MassStorageFileSystem");
+_LIT(KMsFs, "MSFS.FSY");
+_LIT(KPassword, "hello");
+
+LOCAL_D TChar driveLetter;
+
+//
+// Parses the command line arguments
+//
+LOCAL_C void ParseCommandArguments()
+	{
+	TBuf<0x100> cmd;
+	User::CommandLine(cmd);
+	TLex lex(cmd);
+	
+	TPtrC token;
+	token.Set(lex.NextToken());
+	if (token.Length() != 0)
+		{
+		driveLetter = token[0];
+		driveLetter.UpperCase();
+		test.Printf(_L("CmdLine Param=%S"),&token);
+		}
+	else
+		{
+		test.Printf(_L("Not enough command line arguments"));
+		test(EFalse);
+		}
+	}
+	
+LOCAL_C void doTest()
+	{
+	ParseCommandArguments();
+	
+	TInt err;
+	TBuf8<16> password;
+	password.Copy(KPassword);
+	_LIT(KEmpty, "");
+	TBuf8<16> emptyString;
+	emptyString.Copy(KEmpty);
+	
+	RFs fs;
+	test(KErrNone == fs.Connect());
+	
+	TInt drive;
+	err = fs.CharToDrive(driveLetter, drive);
+	test(KErrNone == err);
+	
+	//Load MS file system
+	err = fs.AddFileSystem(KMsFs);
+    test(err == KErrNone);
+	
+	//Lock drive and save password
+	err = fs.LockDrive(drive, emptyString, password, ETrue);
+	test(err == KErrNone);
+	
+	//If the drive has a filesystem mounted then dismount it
+	TBuf<128> oldFs;
+	err = fs.FileSystemName(oldFs, drive);
+	if (err == KErrNone)
+		{
+		err = fs.DismountFileSystem(oldFs, drive);
+		test(err == KErrNone);
+		}
+	
+	//Mount MsFs on the drive
+	err = fs.MountFileSystem(KMsFsyName, drive);
+	test(err == KErrNone);
+	
+	//Try to unlock, the drive should have already been unlocked by the file system
+	err = fs.UnlockDrive(drive, password, ETrue);
+	test(err == KErrAlreadyExists);
+	
+	//Dismount the drive
+	err = fs.DismountFileSystem(KMsFsyName, drive);
+	test(err == KErrNone);
+	
+	//Remount the original file system
+	err = fs.MountFileSystem(oldFs, drive);
+	test(err == KErrNone);
+	
+	//Relock the drive and clear the password
+	err = fs.LockDrive(drive, emptyString, password, ETrue);
+	test(err == KErrNone);
+	err = fs.ClearPassword(drive, password);
+	test(err == KErrNone);
+	
+	//Dismount the drive
+	err = fs.DismountFileSystem(oldFs, drive);
+	test(err == KErrNone);
+	 
+	//Mount MsFs on the drive
+	err = fs.MountFileSystem(KMsFsyName, drive);
+	test(err == KErrNone);
+	
+	//Check P&S variable, drive state should be locked
+	TBuf8<16> driveStates;
+	TBool stateCorrect = EFalse;
+	RProperty::Get(KUsbMsDriveState_Category, EUsbMsDriveState_DriveStatus, driveStates);
+	TInt i = 0;
+	for (; i < 8; i++)
+		{
+		if (driveStates[2*i] == drive && driveStates[2*i+1] == EUsbMsDriveState_Locked)
+			{
+			stateCorrect = ETrue;
+			}
+		}
+	test(stateCorrect);
+	
+	//Unlock drive.
+	err = fs.UnlockDrive(drive, password, ETrue);
+	test(err == KErrNone);
+	
+	//Check P&S variable, drive state should not be locked
+	stateCorrect = EFalse;
+	RProperty::Get(KUsbMsDriveState_Category, EUsbMsDriveState_DriveStatus, driveStates);
+
+	for (i=0; i < 8; i++)
+		{
+		if (driveStates[2*i] == drive && driveStates[2*i+1] != EUsbMsDriveState_Locked)
+			{
+			stateCorrect = ETrue;
+			}
+		}
+	test(stateCorrect);
+
+	//Lock the drive
+	err = fs.LockDrive(drive, emptyString, password, ETrue);
+	test(err == KErrNone);
+	
+	//Dismount the drive
+	err = fs.DismountFileSystem(KMsFsyName, drive);
+	test(err == KErrNone);
+	
+	//Remount MsFs
+	err = fs.MountFileSystem(KMsFsyName, drive);
+	test(err == KErrNone);
+	
+	//Check P&S variable, drive state should not be locked
+	stateCorrect = EFalse;
+	RProperty::Get(KUsbMsDriveState_Category, EUsbMsDriveState_DriveStatus, driveStates);
+	for (i = 0; i < 8; i++)
+		{
+		if (driveStates[2*i] == drive && driveStates[2*i+1] != EUsbMsDriveState_Locked)
+			{
+			stateCorrect = ETrue;
+			}
+		}
+	test(stateCorrect);
+	}
+	
+GLDEF_C void CallTestsL()
+//
+// Do all tests
+//
+	{
+    doTest();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/t_13cases/inc/cusbmassstoragecontroller.h	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,67 @@
+// 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"
+// 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:
+// 
+
+
+/** @file
+@internalTechnology
+Class declaration for CUsbMassStorageController.
+*/
+ 
+#ifndef __CUSBMASSSTORAGECONTROLLER_H__
+#define __CUSBMASSSTORAGECONTROLLER_H__
+
+#include "cusbmassstorageserver.h"
+#include "t_13cases_protocol.h"
+#include "usbmsshared.h"
+
+class CBulkOnlyTransport;
+
+/**
+Stub drive manager for bulk-only transport testing.
+*/
+class CDriveManager
+	{
+public:
+	TInt Connect(TUint aLun);
+	TInt Disconnect(TUint aLun);
+	};
+
+/**
+Stub Mass Storage Controller class for bulk-only transport testing.
+*/
+class CUsbMassStorageController : public CActive
+	{
+public:
+	CUsbMassStorageController();
+	~CUsbMassStorageController();
+	void CreateL(TUint aMaxDrives);
+	TInt Start();
+	TInt Stop();
+	void Reset();
+	void RunL();
+	void DoCancel();
+	CDriveManager& DriveManager();
+	void GetTransport(MTransportBase* &aTransport);
+	void SetTransport(MTransportBase* aTransport);
+    enum TTransportldd {EUsbc = 1, EUsbcsc};
+	
+private:
+	TInt iMaxDrives;
+	CScsiProtocol* iProtocol;
+	MTransportBase* iTransport;
+	CDriveManager iStubDriveManager;
+	};
+
+#endif //__CUSBMASSSTORAGECONTROLLER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/t_13cases/inc/t_13cases_protocol.h	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,52 @@
+// 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"
+// 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:
+// 
+
+
+/**
+@file 
+@internalTechnology
+
+Classes for bulk-only transport testing.
+*/
+
+#ifndef __T_13CASES_PROTOCOL_H__
+#define __T_13CASES_PROTOCOL_H__
+
+#include <e32base.h> 
+#include <e32def.h>
+#include <e32std.h>
+	
+#include "protocol.h"
+
+class CScsiProtocol : public CBase, public MProtocolBase
+	{
+public:
+	CScsiProtocol::CScsiProtocol();
+	static CScsiProtocol* NewL();
+	void RegisterTransport(MTransportBase* aTransport);
+	TBool DecodePacket(TPtrC8& aData, TUint aLun);
+	TInt ReadComplete(TInt aError);
+	TInt Cancel();
+	~CScsiProtocol();
+
+private:
+	TBool iReadingData;
+	MTransportBase* iTransport;
+	HBufC8* iReadData;
+	HBufC8* iWriteData;
+	};
+	
+#endif // __T_13CASES_PROTOCOL_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/t_13cases/src/controller.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,116 @@
+// 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"
+// 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 "protocol.h"
+#include "cusbmassstoragecontroller.h"
+#include "cbulkonlytransport.h"
+
+/**
+ Stub MS controller for bulk only transport testing.  
+*/
+
+CUsbMassStorageController::CUsbMassStorageController() : CActive(EPriorityStandard)
+	{
+	}
+	
+CUsbMassStorageController::~CUsbMassStorageController()
+	{
+	delete iProtocol;
+	delete iTransport;
+	}
+	
+void CUsbMassStorageController::CreateL(TUint aMaxDrives)
+	{
+	iMaxDrives = aMaxDrives;
+	iStatus = KRequestPending;
+	CActiveScheduler::Add(this);
+	SetActive();
+	}
+	
+TInt CUsbMassStorageController::Start()
+	{
+	TInt err;
+	TRAP(err, iProtocol = CScsiProtocol::NewL());
+	if (err != KErrNone)
+		{
+		return err;
+		}
+		
+	TRAP(err, iTransport = CBulkOnlyTransport::NewL(iMaxDrives, *this));
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+    TRAP(err, iTransport->InitialiseTransportL(1));
+		
+	iTransport->RegisterProtocol(*iProtocol);
+	iProtocol->RegisterTransport(iTransport);
+	
+	iTransport->Start();
+	
+	return KErrNone;
+	}
+	
+TInt CUsbMassStorageController::Stop()
+	{
+	return 0;
+	}
+	
+void CUsbMassStorageController::Reset()
+	{
+	delete iProtocol;
+	TRAPD(err, iProtocol = CScsiProtocol::NewL());
+	__ASSERT_ALWAYS(err == KErrNone, User::Invariant());
+	iTransport->RegisterProtocol(*iProtocol);
+	iProtocol->RegisterTransport(iTransport);
+	}
+
+
+void CUsbMassStorageController::GetTransport(MTransportBase* &aTransport)
+	{
+	aTransport = iTransport;
+	}
+
+void CUsbMassStorageController::SetTransport(MTransportBase* aTransport)
+	{
+	iTransport = aTransport;
+	}
+
+
+void CUsbMassStorageController::RunL()
+	{
+	CActiveScheduler::Stop();
+	}
+	
+void CUsbMassStorageController::DoCancel()
+	{
+	}
+
+CDriveManager& CUsbMassStorageController::DriveManager()
+	{
+	return iStubDriveManager;
+	}
+
+TInt CDriveManager::Connect(TUint /*aLun*/)
+	{
+	return KErrNone;
+	}
+
+TInt CDriveManager::Disconnect(TUint /*aLun*/)
+	{
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/t_13cases/src/protocol.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,106 @@
+// 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"
+// 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 "t_13cases_protocol.h"
+
+/**
+ Stub SCSI protocol class for testing the bulk only transport classes.
+*/
+
+CScsiProtocol::CScsiProtocol() :
+	iReadData(NULL),
+	iWriteData(NULL)
+	{
+	}
+		
+CScsiProtocol* CScsiProtocol::NewL()
+	{
+	return new (ELeave) CScsiProtocol();
+	}
+	
+void CScsiProtocol::RegisterTransport(MTransportBase* aTransport)
+	{
+	iTransport = aTransport;
+	}
+	
+TBool CScsiProtocol::DecodePacket(TPtrC8& aData, TUint /*aLun*/)
+	{
+	ASSERT(aData[0] == 2);
+	TUint8 direction = aData[1];
+	TInt length = aData[2];
+	if (length != 0)
+		{
+		ASSERT(direction == 0 || direction == 1);
+		if (direction == 0) //In
+			{
+			//Write data
+			delete iWriteData;
+			iWriteData = HBufC8::NewMax(length);
+			ASSERT(iWriteData != NULL);
+			TPtrC8 ptr(iWriteData->Des().Ptr(), length);
+			iTransport->SetupWriteData(ptr);
+			}
+		else if (direction == 1) //Out
+			{
+			//Read data
+			ASSERT(iReadData == NULL);
+			iReadData = HBufC8::NewMax(length);
+			ASSERT(iReadData != NULL);
+			iReadingData = ETrue;
+			iTransport->SetupReadData(length);
+			}
+		}
+	else
+	{
+		// initialise receive buffer to be zero length
+		if (direction == 1)
+		{
+			ASSERT(iReadData == NULL);
+			iReadData = HBufC8::NewMax(0);
+			ASSERT(iReadData != NULL);
+			iReadingData = ETrue;
+			iTransport->SetupReadData(0);
+		}
+	}
+		
+	return ETrue;
+	}
+	
+TInt CScsiProtocol::ReadComplete(TInt aError)
+	{
+	ASSERT(iReadingData);
+	ASSERT(iReadData != NULL);
+	iReadingData = EFalse;
+	if (aError != KErrNone)
+		{
+		return KErrAbort;
+		}
+	delete iReadData;
+	iReadData = NULL;
+	return KErrNone;
+	}
+	
+TInt CScsiProtocol::Cancel()
+	{
+	return KErrNone;
+	}
+	
+CScsiProtocol::~CScsiProtocol()
+	{
+	delete iReadData;
+	delete iWriteData;
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/smassstorage/t_13cases/src/t_13cases.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -0,0 +1,703 @@
+// 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"
+// 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:
+// 
+
+
+/**
+Test for the 13 cases as specified in the Bulk-Only Transport
+specification secton 6.7.
+*/
+
+#include <e32std.h>
+#include <e32test.h>
+#include <testusbc.h>
+#include "t_13cases_protocol.h"
+#include "cusbmassstoragecontroller.h"
+#include "cbulkonlytransport.h"
+
+LOCAL_D RTest test(_L("T_13Cases"));
+
+_LIT(KDriverFileName,"TESTUSBC.LDD");
+_LIT(KLddName,"usbc");
+_LIT(KTransportThreadName,"TransportThread");
+_LIT(KTransportSemName,"TransportThreadSem");
+
+// const TInt KCswLength = 13;
+
+LOCAL_D const TEndpointNumber KInEp = EEndpoint2;
+LOCAL_D const TEndpointNumber KOutEp = EEndpoint1;
+
+LOCAL_D const TInt K3Seconds = 3000000;
+
+LOCAL_C TInt TransportThreadEntry(TAny* aPtr)
+	{
+	TInt numDrives = 5;
+	
+	//Create and install cleanup trap and active scheduler
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if (cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+
+	CActiveScheduler* sched = new CActiveScheduler;
+	if (sched == NULL)
+		{
+		delete cleanup;
+		return KErrNoMemory;
+		}
+	CActiveScheduler::Install(sched);
+		
+	CUsbMassStorageController* controller = (CUsbMassStorageController*)aPtr;
+	controller->CreateL(numDrives);
+	
+	TInt err = controller->Start();
+	
+	//Synchronize with test thread
+	RSemaphore gSemThreadReady;
+	gSemThreadReady.OpenGlobal(KTransportSemName);
+	gSemThreadReady.Signal();
+	gSemThreadReady.Close();
+	
+	//If start returned an error do not start the scheduler.
+	if (err == KErrNone)
+		{
+		CActiveScheduler::Start();
+		}
+	
+	delete controller;
+	delete sched;
+	delete cleanup;
+	
+	return KErrNone;
+	}
+
+LOCAL_C void SetCBWHeader(TDes8& cbwData, TInt32 aDataTransferLength, TBool aDataIn, TUint8 aLun, TUint8 aCBLength)
+	{
+	//dCBWSignature
+	cbwData[0] = 0x55;
+	cbwData[1] = 0x53;
+	cbwData[2] = 0x42;
+	cbwData[3] = 0x43;
+	//dCBWTag
+	cbwData[4] = 0x01;
+	cbwData[5] = 0x00;
+	cbwData[6] = 0x00;
+	cbwData[7] = 0x00;
+	//dCBWDataTransferLength
+	cbwData[8] = (TUint8)(aDataTransferLength & 0x000000FF);
+	cbwData[9] = (TUint8)((aDataTransferLength & 0x0000FF00) >> 8);
+	cbwData[10] = (TUint8)((aDataTransferLength & 0x00FF0000) >> 16);
+	cbwData[11] = (TUint8)((aDataTransferLength & 0xFF000000) >> 24);
+	//bmCBWFlags
+	if (aDataIn)
+		{
+		cbwData[12] = 0x80;
+		}
+	else
+		{
+		cbwData[12] = 0x00;
+		}
+	//bCBWLUN
+	cbwData[13] = aLun;
+	//bCBWCBLength
+	cbwData[14] = aCBLength;
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	test.Title();
+	
+	TInt err;
+	
+	test.Start(_L("Loading ldd"));
+	err = User::LoadLogicalDevice(KDriverFileName);
+	test(err == KErrNone || err == KErrAlreadyExists);
+	
+	RDevTestUsbcClient ldd;
+	err = ldd.Open(0);
+	test(err == KErrNone);
+	
+	RSemaphore gSemThreadReady;
+	err = gSemThreadReady.CreateGlobal(KTransportSemName, 0);
+	test(err == KErrNone);
+	
+	//Start transport thread.
+	RThread transportThread;
+	test.Next(_L("Creating transport thread"));
+	CUsbMassStorageController* controller = new CUsbMassStorageController();
+	test(controller != NULL);
+	err = transportThread.Create(KTransportThreadName, TransportThreadEntry, KDefaultStackSize, NULL, (void*)controller);
+	test(err == KErrNone);
+	transportThread.Resume();
+	
+	//Synchronize with transport thread.
+	gSemThreadReady.Wait();
+	gSemThreadReady.Close();
+	
+	TBuf8<KCbwLength> cbwData(KCbwLength);
+	TBuf8<KCswLength> cswData(KCswLength);
+	TBuf8<KRequestHdrSize> controlData(KRequestHdrSize);
+	TBuf8<8> data(8);
+	TRequestStatus status;
+	TRequestStatus notifyStatus;
+	
+	RTimer timer;
+	timer.CreateLocal();
+	
+	// ***** Case 1: Hn = Dn *****
+	test.Next(_L("Case 1"));
+	//Send a command that requires no data transfer. dCBWDataTransferLength = 0.
+	SetCBWHeader(cbwData, 0, EFalse, 0, 2);
+	cbwData[15] = 0;
+	cbwData[16] = 0; //No data transfer
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	
+	// ***** Case 2: Hn < Di ***** /
+	test.Next(_L("Case 2"));
+	//Send a command that requires data transfer to the host.
+	//dCBWDataTransferLength = 0.
+	SetCBWHeader(cbwData, 0, EFalse, 0, 2);
+	cbwData[15] = 0; //In
+	cbwData[16] = 8;
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 2
+	test(cswData[12] == 2);
+	
+	test.Printf(_L("Performing Reset Recovery\n"));
+	//Perform Reset Recovery
+	controlData.FillZ();
+	controlData[0] = 0x21;
+	controlData[1] = 0xFF;
+	ldd.HostWrite(status, EEndpoint0, controlData, KRequestHdrSize);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	User::After(K3Seconds);
+	
+	// ***** Case 3: Hn < Do *****
+	test.Next(_L("Case 3"));
+	//Send a command that requires data transfer to the device.
+	//dCBWDataTransferLength = 0.
+	SetCBWHeader(cbwData, 0, EFalse, 0, 2);
+	cbwData[15] = 1; //Out
+	cbwData[16] = 8;
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 2
+	test(cswData[12] == 2);
+	
+	test.Printf(_L("Performing Reset Recovery\n"));
+	//Perform Reset Recovery
+	controlData.FillZ();
+	controlData[0] = 0x21;
+	controlData[1] = 0xFF;
+	ldd.HostWrite(status, EEndpoint0, controlData, KRequestHdrSize);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	User::After(K3Seconds);
+	
+	// ***** Case 4: Hi > Dn *****
+	test.Next(_L("Case 4"));
+	//Send a command that requires no data transfer.
+	//dCBWDataTransferLength = 8, direction = in
+	SetCBWHeader(cbwData, 8, ETrue, 0, 2);
+	cbwData[15] = 0; //In
+	cbwData[16] = 0; //no data
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KInEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Reading data\n"));
+	data.SetLength(8);
+	ldd.HostRead(status, KInEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KInEp);
+		}
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	//dCSWDataResidue == 8
+	test(cswData[8] == 8 || cswData[9] == 0 || cswData[10] == 0 || cswData[11] == 0);
+	
+	// ***** Case 5: Hi > Di *****
+	test.Next(_L("Case 5"));
+	//Send a command that requires 4 bytes of data transfer to the host.
+	//dCBWDataTransferLength = 8, direction = in
+	SetCBWHeader(cbwData, 8, ETrue, 0, 2);
+	cbwData[15] = 0; //In
+	cbwData[16] = 4; //4 bytes
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KInEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Reading data\n"));
+	data.SetLength(8);
+	ldd.HostRead(status, KInEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KInEp);
+		}
+		
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	//dCSWDataResidue == 8
+	test(cswData[8] == 4 || cswData[9] == 0 || cswData[10] == 0 || cswData[11] == 0);
+	
+	// **** Case 6: Hi = Di *****
+	test.Next(_L("Case 6"));
+	//Send a command that requires 8 bytes of data transfer to the host.
+	//dCBWDataTransferLength = 8, direction = in
+	SetCBWHeader(cbwData, 8, ETrue, 0, 2);
+	cbwData[15] = 0; //In
+	cbwData[16] = 8; //8 bytes
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Reading data\n"));
+	data.SetLength(8);
+	ldd.HostRead(status, KInEp, data, data.Length());
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	//dCSWDataResidue == 0
+	test(cswData[8] == 0 || cswData[9] == 0 || cswData[10] == 0 || cswData[11] == 0);
+	
+	// **** Case 7: Hi < Di *****
+	test.Next(_L("Case 7"));
+	//Send a command that requires 8 bytes of data transfer to the host.
+	//dCBWDataTransferLength = 4, direction = in
+	SetCBWHeader(cbwData, 4, ETrue, 0, 2);
+	cbwData[15] = 0; //In
+	cbwData[16] = 8; //8 bytes
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KInEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Reading data\n"));
+	data.SetLength(4);
+	ldd.HostRead(status, KInEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KInEp);
+		}
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 2
+	test(cswData[12] == 2);
+	
+	test.Printf(_L("Performing Reset Recovery\n"));
+	//Perform Reset Recovery
+	controlData.FillZ();
+	controlData[0] = 0x21;
+	controlData[1] = 0xFF;
+	ldd.HostWrite(status, EEndpoint0, controlData, KRequestHdrSize);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	User::After(K3Seconds);
+	
+	// **** Case 8: Hi <> Do *****
+	test.Next(_L("Case 8"));
+	//Send a command that requires 8 bytes of data transfer to the host.
+	//dCBWDataTransferLength = 8, direction = in
+	SetCBWHeader(cbwData, 8, ETrue, 0, 2);
+	cbwData[15] = 1; //Out
+	cbwData[16] = 8; //8 bytes
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KInEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Reading data\n"));
+	data.SetLength(8);
+	ldd.HostRead(status, KInEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+		
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KInEp);
+		}
+
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 2
+	test(cswData[12] == 2);
+	
+	test.Printf(_L("Performing Reset Recovery\n"));
+	//Perform Reset Recovery
+	controlData.FillZ();
+	controlData[0] = 0x21;
+	controlData[1] = 0xFF;
+	ldd.HostWrite(status, EEndpoint0, controlData, KRequestHdrSize);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	User::After(K3Seconds);
+
+	// ***** Case 9: Ho > Dn *****
+	test.Next(_L("Case 9"));
+	//Send a command that requires no data transfer.
+	//dCBWDataTransferLength = 8, direction = out
+	SetCBWHeader(cbwData, 8, EFalse, 0, 2);
+	cbwData[15] = 1; //Out
+	cbwData[16] = 0; //no data
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KOutEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Writing data\n"));
+	data.SetLength(8);
+	ldd.HostWrite(status, KOutEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KOutEp);
+		}
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	//dCSWDataResidue == 8
+	test(cswData[8] == 8 || cswData[9] == 0 || cswData[10] == 0 || cswData[11] == 0);
+	
+	// ***** Case 10: Ho <> Di *****
+	test.Next(_L("Case 10"));
+	//Send a command that requires 8 bytes of data transfer to the host.
+	//dCBWDataTransferLength = 8, direction = out
+	SetCBWHeader(cbwData, 8, EFalse, 0, 2);
+	cbwData[15] = 0; //In
+	cbwData[16] = 8; //8
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KOutEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Writing data\n"));
+	data.SetLength(8);
+	ldd.HostWrite(status, KOutEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KOutEp);
+		}
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 2
+	test(cswData[12] == 2);
+	
+	test.Printf(_L("Performing Reset Recovery\n"));
+	//Perform Reset Recovery
+	controlData.FillZ();
+	controlData[0] = 0x21;
+	controlData[1] = 0xFF;
+	ldd.HostWrite(status, EEndpoint0, controlData, KRequestHdrSize);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	User::After(K3Seconds);
+	
+	// ***** Case 11: Ho > Do *****
+	test.Next(_L("Case 11"));
+	//Send a command that requires 4 bytes of data transfer to the device.
+	//dCBWDataTransferLength = 8, direction = out
+	SetCBWHeader(cbwData, 8, EFalse, 0, 2);
+	cbwData[15] = 1; //Out
+	cbwData[16] = 4; //4 bytes
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KOutEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Writing data\n"));
+	data.SetLength(8);
+	ldd.HostWrite(status, KOutEp, data, data.Length());
+	
+	//Out endpoint could be stalled
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KOutEp);
+		}
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	//dCSWDataResidue == 4
+	test(cswData[8] == 4 || cswData[9] == 0 || cswData[10] == 0 || cswData[11] == 0);
+	
+	// ***** Case 12: Ho = Do *****
+	test.Next(_L("Case 12"));
+	//Send a command that requires 8 bytes of data transfer to the device.
+	//dCBWDataTransferLength = 8, direction = out
+	SetCBWHeader(cbwData, 8, EFalse, 0, 2);
+	cbwData[15] = 1; //Out
+	cbwData[16] = 8; //8 bytes
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Writing data\n"));
+	data.SetLength(8);
+	ldd.HostWrite(status, KOutEp, data, data.Length());
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 0 or 1
+	test(cswData[12] == 0 || cswData[12] == 1);
+	//dCSWDataResidue == 0
+	test(cswData[8] == 0 || cswData[9] == 0 || cswData[10] == 0 || cswData[11] == 0);
+	
+	// ***** Case 13: Ho < Do *****
+	test.Next(_L("Case 13"));
+	//Send a command that requires 8 bytes of data transfer to the device.
+	//dCBWDataTransferLength = 4, direction = out
+	SetCBWHeader(cbwData, 4, EFalse, 0, 2);
+	cbwData[15] = 1; //Out
+	cbwData[16] = 8; //8 bytes
+	
+	ldd.HostEndpointStatusNotify(notifyStatus, KOutEp);
+	
+	test.Printf(_L("Writing CBW\n"));
+	ldd.HostWrite(status, KOutEp, cbwData, KCbwLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	test.Printf(_L("Writing data\n"));
+	data.SetLength(8);
+	ldd.HostWrite(status, KOutEp, data, data.Length());
+	
+	test.Printf(_L("Waiting for end of transfer or stall\n"));
+	User::WaitForRequest(status, notifyStatus);
+	test(status == KErrNone || notifyStatus == KErrNone);
+	
+	if (notifyStatus == KErrNone)
+		{
+		ldd.HostClearEndpoint(KOutEp);
+		}
+	
+	//Receive and check CSW
+	test.Printf(_L("Reading CSW\n"));
+	ldd.HostRead(status, KInEp, cswData, KCswLength);
+	
+	User::WaitForRequest(status);
+	test(status == KErrNone);
+	
+	//bCSWStatus == 2
+	test(cswData[12] == 2);
+	
+	test.Printf(_L("Performing Reset Recovery\n"));
+	//Perform Reset Recovery
+	controlData.FillZ();
+	controlData[0] = 0x21;
+	controlData[1] = 0xFF;
+	ldd.HostWrite(status, EEndpoint0, controlData, KRequestHdrSize);
+	
+	// ***** End of 13 cases *****
+	
+	TRequestStatus logonStatus;
+	transportThread.Logon(logonStatus);
+	TRequestStatus* statusPtr = &(controller->iStatus);
+	transportThread.RequestComplete(statusPtr, KErrNone);
+	//Wait for thread to die
+	test.Printf(_L("Waiting for controller thread to die\n"));
+	User::WaitForRequest(logonStatus);
+	transportThread.Close();
+	test.Printf(_L("The thread is dead, long live the thread\n"));
+	
+	ldd.Close();
+	
+	test.Printf(_L("Unloading ldd"));
+	err = User::FreeLogicalDevice(KLddName);
+	test(err == KErrNone);
+	
+	timer.Close();
+	
+    test.End();
+    
+	return 0;
+	}
+	
--- a/userlibandfileserver/fileserver/automounter/automounter.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/automounter/automounter.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -69,6 +69,7 @@
     {
     __PRINT1(_L("#<<- CAutoMounterFileSystem::CAutoMounterFileSystem() [0x%x]"), this);
 
+    iChildFsForDefFmt = KErrNotFound;
     SetState(EInvalid);
     }   
 
@@ -187,11 +188,11 @@
     {
     __PRINT1(_L("#<<- CAutoMounterFileSystem::IsExtensionSupported() [0x%x]"), this);
     
-    ASSERT(State() == EInitialised && iFSNames.Count() > 1);
+    ASSERT(State() == EInitialised && ChildFsNum() >= KMinChildFsNum);
 
 
     //-- in debug mode check file systems compatibility: ALL childs must support this feature
-    for(TUint i=0; i<iFSNames.Count(); ++i)
+    for(TUint i=0; i<ChildFsNum(); ++i)
         {
         if( !(GetChildFileSystem(i)->IsExtensionSupported()))
             {
@@ -258,7 +259,10 @@
 //-----------------------------------------------------------------------------
 
 /**
-    Find out if _all_ child file systems support the proxy drive. All childs shall behave exactly the same way.
+    Find out if _all_ child file systems support the proxy drive. All child file systems shall behave exactly the same way.
+    This is mostly for the USB host drives support. All child file systems should either support this feature or do not.
+    Otherwise, it may lead to very obscured cases of susystem misbehaviour.
+    
     @return KErrNone if all child file systems support proxy drives, or KErrNotSupported if all of them do not.
 */
 TInt CAutoMounterFileSystem::DoProcessProxyDriveSupport()
@@ -266,9 +270,8 @@
     __PRINT1(_L("#<<- CAutoMounterFileSystem::DoProcessProxyDriveSupport[0x%x]"), this);
     ASSERT(State() == EInitialised);
 
-    const TUint cnt = iFSNames.Count();
-    ASSERT(cnt > 1);
-
+    const TUint cnt = ChildFsNum();
+    ASSERT(cnt >= KMinChildFsNum);
     
     //-- query the default filesystem #0
     const TBool bRes = GetChildFileSystem(KDefaultFSNo)->IsProxyDriveSupported();
@@ -307,7 +310,7 @@
         }
     
     //-- this is a query for one of the child filesystems
-    if((TUint)aFsNumber < iFSNames.Count())
+    if((TUint)aFsNumber < ChildFsNum())
         {
         aFsName = iFSNames[aFsNumber]; 
         return KErrNone;
@@ -324,8 +327,8 @@
     In this method the automounter sequentially tries to mount every child and on success produces the corresponding CMountCB object.
 
     @param  apDrive         pointer to the TDrive, child FS will need this to access media.
-    @param  apFileSystem    on return will contain the pointer to the CFileSystem that has produced the proped CMountCB if 
-                            one of the child file system has recognised the volume.
+    @param  apFileSystem    on return will contain the pointer to the CFileSystem that has produced the proper CMountCB if 
+                            one of the child file system has recognised the volume layout.
     @param  aForceMount     if ETrue the appropriate child FS (designated by aFsNameHash) will be forcedly mounted on the volume. for volume formatting purposes.
     @param  aFsNameHash     if !=0 specifies the file system name, see TVolFormatParam::CalcFSNameHash(). 0 means "file system name is not specified"
 
@@ -344,42 +347,61 @@
     if(apDrive->IsSynchronous())
         Fault(EWrongDriveAttributes);
 
-    if(iFSNames.Count() < 2)
+    if(ChildFsNum() < KMinChildFsNum)
         Fault(EWrongConfiguration);
 
 
     //-- if aForceMount is true, this means that the TDrive tries mount the filesystem by force for formatting because normal mounting has failed before. 
     //-- in our case it means that the file system on the volume hadn't been recognised by any child FS.
     //-- aFsNameHash shall designate the file system to be forcedly mounted. Depending on this the appropriat CMounCB object will be produced.
-    //-- if aFsNameHash is 0, i.e. not provided, this method will fail with KErrNotFound because it is impossible to select appropriat child FS.
+    //-- if aFsNameHash is 0, i.e. not provided, this method will fail with KErrNotFound if it can't to select appropriate child FS to be used.
     if(aForceMount)
         {
+        CFileSystem *pFS = NULL; //-- the FS selected to produce CMountCB for media formatting
+
         if(aFsNameHash == 0)
             {//-- the file system to mount forcedly is not specified
+             //-- 1. check if we have only 1 child FS supported. Quite a weird case, but an easy choice.
+             if(ChildFsNum() == 1)
+                {//-- use the single known child FS
+                __PRINT1(_L("#<<- only 1 child FS available for formatting: %S"), &iFSNames[KDefaultFSNo]);
+                pFS = GetChildFileSystem(KDefaultFSNo);
+                }
+             else if(iChildFsForDefFmt >= 0)
+                {//-- the parameter "child fs for default formatting" is defined. try using this
+                __PRINT1(_L("#<<- using the default child FS for formatting: %S"), &iFSNames[iChildFsForDefFmt]);
+                pFS = GetChildFileSystem(iChildFsForDefFmt);
+                }
+             else
+                {
             __PRINT(_L("#<<- Unable to select appropriate child FS for formatting!"));
             User::Leave(KErrNotFound);
             }
-        else
-            {//-- try to find appropriate child FS by its name hash
-            CFileSystem *pFS = GetChildFileSysteByNameHash(aFsNameHash);
+            }
+        else //if(aFsNameHash == 0)
+            {//-- try to find appropriate child FS by its name hash provided by the upper level
+            pFS = GetChildFileSysteByNameHash(aFsNameHash);
             if(!pFS)
                 {
                 __PRINT(_L("#<<- no child FS found by its name hash!"));
                 ASSERT(0);
                 User::Leave(KErrNotFound);
                 }
+            }
 
+        //-- ask the selected FS to produce us a mount for media formating
+        ASSERT(pFS);
             CMountCB* pMount = pFS->NewMountL();
             ASSERT(pMount);
 
             *apFileSystem = pFS; 
             return pMount;
-            }
         }//if(aForceMount)
 
 
 
     //-- try instantiate a new CMountCB depending on the file system on the media
+    ASSERT(!aForceMount);
 
     CMountCB* pMatchedMount;
     TInt nRes = TryMountFilesystem(apDrive, &pMatchedMount, apFileSystem);
@@ -391,63 +413,30 @@
         }
 
 
-
     User::Leave(nRes);
     return NULL;
     }
 
+
 //-----------------------------------------------------------------------------
 /**
-    Initialise this file system. Reads and processes configuration, fills in file system names container, etc. 
-*/
-void CAutoMounterFileSystem::InitialiseFileSystem()
-    {
-    __PRINT1(_L("#<<- CAutoMounterFileSystem::InitialiseFileSystem() [0x%x]"), this);
-
-    ASSERT(State() == ENotInitialised);
+    Parse the string with child file system names. These names come from config, which can be either 
+    estart.txt or a text debug property that can override it.
 
-    TInt nRes;
-    
+    @param  aList string descriptor with contents like "fat,exfat" i.e. it is comma separated file system names
+*/
+void CAutoMounterFileSystem::DoParseChildNames(const TDesC8& aList)
+    {
+    ASSERT(State() == EInitialising);
 
-    //-- 1. initialise the array of file system names. These names shall be listed in a config string.
-    //-- the config string is taken from estart.txt usually and its format is like this: 
-    //-- section: [AutoMounter] and property "FSNames fat,exfat"
-    //-- in debug version a special text property can override the config string. This allows controlling automounter from
-    //-- the test environment.
-
-    TBuf8<0x100> buf(0);   
     TBuf<0x100>  fsName;   
 
-
-#ifdef _DEBUG
-    const TUid KSID_Test1={0x10210EB3}; //-- SID of the test that will define and set test property to control volume mounting
-    const TUint KPropKey = 0; //-- property key
-
-    //-- in debug mode the property will override the estart.txt config
-    if(RProperty::Get(KSID_Test1, KPropKey, buf) == KErrNone)
-        {
-        __PRINT(_L("#<<- reading config from the debug propery..."));
-        }
-    else
-#endif
-        {
-        __PRINT(_L("#<<- reading config from estart.txt..."));
-        _LIT8(KSection,  "AutoMounter");
-        _LIT8(KProperty, "FSNames");
-
-        nRes = F32Properties::GetString(KSection, KProperty, buf);
-        if(!nRes)
-            Fault(EPluginInitialise);
-        }
-
-
-    fsName.Copy(buf);
-    __PRINT1(_L("#<<- config:'%S'"), &fsName);
+    fsName.Copy(aList);
+    __PRINT1(_L("#<<- childFS list:'%S'"), &fsName);
 
     //-- parse CSV config line and fill in the file system names array
     const TChar chDelim = ','; //-- token delimiter, comma
-    buf.Trim();
-    TPtrC8 ptrCurrLine(buf);
+    TPtrC8 ptrCurrLine(aList);
     for(TInt i=0; ;++i)
         {
         const TInt delimPos = ptrCurrLine.Locate(chDelim);
@@ -478,7 +467,8 @@
             }
         
         
-        nRes = iFSNames.Append(fsName);
+        TInt nRes = iFSNames.Append(fsName);
+        (void)nRes;
         ASSERT(nRes ==KErrNone);
         
         if(delimPos <=0 )
@@ -487,14 +477,203 @@
         ptrCurrLine.Set(ptrCurrLine.Ptr()+delimPos+1, ptrCurrLine.Length()-delimPos-1);
         }
 
+    }
+
+//-----------------------------------------------------------------------------
+
+//-- if this macro is defined, the automounter will use a default hard-coded list of child file systems if it is not found in the estart.txt
+//-- and this list will consist of one filesystem "FAT".
+//-- otherwise automounter will panic if it can't find appropriate config in estart.txt
+#define ALLOW_CONFIGLESS
+
+/**
+    Process Automounter configuration
+*/
+void CAutoMounterFileSystem::ParseConfig()
+    {
+
+
+    ASSERT(State() == ENotInitialised);
+
+    SetState(EInitialising);
+
+    
+
+    //-- 1. initialise the array of file system names. These names shall be listed in a config string.
+    //-- the config string is taken from estart.txt usually and its format is like this: 
+    //-- section: [AutoMounter] and property "AM_FSNames fat,exfat"
+    //-- in debug version a special text property can override the config string. This allows controlling automounter from
+    //-- the test environment.
+
+    TBuf8<0x100> buf(0);   
+
+    _LIT8(KSection,  "AutoMounter");        ///< section name
+    _LIT8(KKey_ChildFsList, "AM_FSNames");     ///< a key for the CSV list of child file system names
+    _LIT8(KProp_DefFmtFsIdx, "AM_DefFmtFsIdx");///< a key for the optional parameter that specifies the child file system index, which will be used for formatting unrecognised media
+
+    TBool bUseEstart= ETrue;
+
+#ifdef _DEBUG
+    
+    TInt nRes;
+
+    const TUid KSID_Test1={0x10210EB3}; //-- SID of the test that will define and set test property to control volume mounting
+    const TUint KPropKey = 0; //-- property key
+
+    //-- in debug mode the property will override the estart.txt config
+    if(RProperty::Get(KSID_Test1, KPropKey, buf) == KErrNone)
+        {
+        __PRINT(_L("#<<- reading config from the debug propery:"));
+        TBuf<0x100> buf16(0);   
+        buf16.Copy(buf);
+        __PRINT(buf16);
+        
+        bUseEstart = EFalse;
+        }
+#endif //_DEBUG
+
+    if(bUseEstart)
+        {//-- need to read data from the estart.txt, section [AutoMounter]
+        __PRINT(_L("#<<- reading config from estart.txt..."));
+
+        //-- 1. read and parse a CSV list of child file system names
+        //-- this is a mandatory parameter
+        TBool bFound = F32Properties::GetString(KSection, KKey_ChildFsList, buf);
+        if(!bFound)
+            {
+            __PRINT(_L("#<<- child FS list isn't found in config !"));
+
+    #ifdef ALLOW_CONFIGLESS
+            //-- let's use a default list of child file systems (consisting of only one: "FAT")
+            //-- if it is allowed. FAT FS is suggested to be available and already loaded by file server.
+            //-- otherwise it will panic later
+
+            _LIT(KDefChildFS_Config, "fat"); //-- default list
+            __PRINT1(_L("#<<- Using a default list:'%S'"), &KDefChildFS_Config());
+            buf.Copy(KDefChildFS_Config);
+    
+    #else //ALLOW_CONFIGLESS
+    
+            Fault(EPluginInitialise);
+    
+    #endif //ALLOW_CONFIGLESS
+            }
+
+        DoParseChildNames(buf);    
+        
+        ASSERT(iFSNames.Count());
+
+        //-- 2. read a child FS index that can be used for unrecognisable media default formatting
+        //-- this is an optional parameter. If we have just 1 Child FS, this parameter doesn't make much sense.
+        if(iFSNames.Count() > 1)
+            {
+            TInt32 nVal;
+            bFound = F32Properties::GetInt(KSection, KProp_DefFmtFsIdx, nVal);
+
+            if(!bFound) 
+                iChildFsForDefFmt = KErrNotFound;
+            else                    
+                {//-- check the index validity
+                if(nVal <0 || nVal >= (TInt)iFSNames.Count())
+                    {
+                    __PRINT1(_L("#<<- Bad DefFmtFsIdx value:%d"), nVal);
+                    Fault(EPluginInitialise);    
+                    }
+                else
+                    {
+                    iChildFsForDefFmt = nVal;
+                    }
+                }    
+            }
+        else//if(iFSNames.Count() > 1)
+            {//-- it looks like we have a weird case when the automounter is configured with just 1 child file system
+            iChildFsForDefFmt = KDefaultFSNo;
+            }
+
+        }//if(bUseEstart)
+    else
+        {
+#ifdef _DEBUG        
+
+        //-- it looks like there is a test property that overrides the estart.txt settings. This property should contain 
+        //-- a representation of a whole [AutoMounter] section in estart.txt and can have "multiple lines" separated by 0x0d,0x0a
+        buf.TrimAll();
+        
+        TInt nPos1;
+        TInt nPos2;
+
+        //-- 1. process "AM_FSNames" key
+        nPos1 = buf.FindF(KKey_ChildFsList);
+        if(nPos1 < 0)
+            {
+            __PRINT(_L("#<<- child FS list isn't found!"));
+            Fault(EPluginInitialise);
+            }
+        
+        TPtrC8  ptr(buf.Mid(nPos1));
+        nPos2 = ptr.Locate('\n');
+        if(nPos2 > 0)
+            ptr.Set(ptr.Left(nPos2));    
+
+        TLex8 lex(ptr);
+        
+        lex.NextToken();
+        lex.SkipSpace();
+        ptr.Set(lex.Remainder());
+
+        DoParseChildNames(ptr);    
+        ASSERT(iFSNames.Count());
+
+
+        //-- 2. process "DefFmtFsIdx" key
+        nPos1 = buf.FindF(KProp_DefFmtFsIdx);
+        if(nPos1 > 0 && iFSNames.Count() > 1)
+            {
+            ptr.Set(buf.Mid(nPos1));
+            nPos2 = ptr.Locate('\n');
+            if(nPos2 > 0)
+                ptr.Set(ptr.Left(nPos2));    
+
+            lex.Assign(ptr);
+            lex.NextToken();
+            lex.SkipSpace();
+            
+            nRes = lex.Val(nPos1);
+            ASSERT(nRes == KErrNone);
+            ASSERT(nPos1 >= 0 && nPos1 < (TInt)iFSNames.Count());
+            
+            iChildFsForDefFmt = nPos1;
+            }
+         else
+            {
+            iChildFsForDefFmt = KErrNotFound;
+            }
+        
+#endif //_DEBUG
+        }
+
+    }
+
+
+//-----------------------------------------------------------------------------
+/**
+    Initialise this file system. Reads and processes configuration, fills in file system names container, etc. 
+*/
+void CAutoMounterFileSystem::InitialiseFileSystem()
+    {
+    __PRINT1(_L("#<<- CAutoMounterFileSystem::InitialiseFileSystem() [0x%x]"), this);
+
+    ASSERT(State() == ENotInitialised);
+
+    ParseConfig();
 
     SetState(EInitialised);
 
     //-- 2. check that the file server has all filesystems we need instantiated and stored in a global container
-    TUint cnt = iFSNames.Count();
-    if(cnt < 2)
+    TUint cnt = ChildFsNum();
+    if(cnt < KMinChildFsNum)
         {
-        __PRINT(_L("#<<- ::InitialiseFileSystem(): too few File Systems bound!"));
+        __PRINT1(_L("#<<- ::InitialiseFileSystem(): too few File Systems bound: %d!"), cnt);
         Fault(EPluginInitialise);
         }
 
@@ -523,9 +702,8 @@
     {
     __PRINT1(_L("#<<- CAutoMounterFileSystem::TryMountFilesystem()[0x%x]"), this);
 
-    const TInt KNumFS = iFSNames.Count();
-  
-    ASSERT(State() == EInitialised && (KNumFS >1));
+    const TUint KNumFS = ChildFsNum(); //-- number of child file systems supported
+    ASSERT(State() == EInitialised && (KNumFS >= KMinChildFsNum));
 
 
     *apMount = NULL;
@@ -533,7 +711,7 @@
     
     
     TInt nRes;
-    TInt cntFS;
+    TUint cntFS;
     CMountCB*       pMountCB = NULL;
     CFileSystem*    pMatchedFS = NULL;
 
@@ -550,7 +728,7 @@
         TRAP(nRes, pMountCB = pFS->NewMountL());
         if(nRes != KErrNone)
             {
-            return KErrNoMemory;
+            return nRes;
             }
 
         ASSERT(pMountCB);
@@ -626,7 +804,7 @@
 */
 CFileSystem* CAutoMounterFileSystem::GetChildFileSystem(TUint aIndex) const
     {
-    ASSERT(State() == EInitialised && (iFSNames.Count() >1) && aIndex < iFSNames.Count());
+    ASSERT(State() == EInitialised && (ChildFsNum() >= KMinChildFsNum) && aIndex < ChildFsNum());
 
     const TDesC& fsName = iFSNames[aIndex]; //-- registered child file system name
     CFileSystem* pFS = GetFileSystem(fsName); //-- Find filesystem object in the FileServer's global container
@@ -648,9 +826,10 @@
 */
 CFileSystem* CAutoMounterFileSystem::GetChildFileSysteByNameHash(TUint32 aFsNameHash) const
     {
-    ASSERT(State() == EInitialised && (iFSNames.Count() >1) && aFsNameHash);
+    ASSERT(State() == EInitialised && (ChildFsNum() >= KMinChildFsNum) && aFsNameHash);
     
-    for(TUint i=0; i<iFSNames.Count(); ++i)
+    const TUint cnt = ChildFsNum(); 
+    for(TUint i=0; i<cnt; ++i)
         {
         if(aFsNameHash == iFSNames.GetStringHash(i))
             {
--- a/userlibandfileserver/fileserver/automounter/automounter.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/automounter/automounter.h	Wed Sep 22 10:53:45 2010 +0100
@@ -137,6 +137,15 @@
 
 //-----------------------------------------------------------------------------
 
+
+/**
+    A min. number of the child file systems supported by the automounter. 
+    using less than 2 child fs doesn't make much sense, though can be useful in some circumstances.
+    The shild FS names must be set in config.
+*/
+const TUint KMinChildFsNum = 1;
+
+
 /**
     File system class definition
 */
@@ -185,6 +194,7 @@
         {
         EInvalid = 0,       ///< initial, invalid
         ENotInitialised,
+        EInitialising,
         EInitialised, 
         };
 
@@ -192,7 +202,7 @@
     inline void SetState(TState aState) {iState = aState;}
 
     
-    /** "default child" file system name index in the child names container. "default child" is used in some weir cases, when
+    /** "default child" file system name index in the child names container. "default child" is used in some weird cases, when
         it doesn't matter which particular child FS to use, e.g. getting access to the media driver for media unlocking. */
     enum {KDefaultFSNo = 0}; 
 
@@ -200,13 +210,18 @@
     CFileSystem* GetChildFileSystem(TUint aIndex) const;
     CFileSystem* GetChildFileSysteByNameHash(TUint32 aFsNameHash) const;
 
+    TUint ChildFsNum() const {ASSERT(State() == EInitialised); return iFSNames.Count();} ///< @return Number of supported Child file systems
+
     void InitialiseFileSystem();
     TInt DoProcessProxyDriveSupport();
+    void ParseConfig();
+    void DoParseChildNames(const TDesC8& aList);
 
 private:
     
     TState       iState;    ///< this object current state
     XStringArray iFSNames;  ///< child file system names container.
+    TInt            iChildFsForDefFmt;  ///< child FS number for formatting "unrecognised" media by default. value <0, means "not specified" 
 
     };
 
--- a/userlibandfileserver/fileserver/bmarm/efsrvu.def	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/bmarm/efsrvu.def	Wed Sep 22 10:53:45 2010 +0100
@@ -369,4 +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)
 
--- a/userlibandfileserver/fileserver/bwins/efsrvu.def	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/bwins/efsrvu.def	Wed Sep 22 10:53:45 2010 +0100
@@ -369,4 +369,10 @@
 	?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)
+	?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)
+	?MountFileSystem@CFsMountHelper@@QBEHXZ @ 375 NONAME ; public: int __thiscall CFsMountHelper::MountFileSystem(void)const 
+	?New@CFsMountHelper@@SAPAV1@AAVRFs@@H@Z @ 376 NONAME ; public: static class CFsMountHelper * __cdecl CFsMountHelper::New(class RFs &,int)
 
--- a/userlibandfileserver/fileserver/bx86/efsrvu.def	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/bx86/efsrvu.def	Wed Sep 22 10:53:45 2010 +0100
@@ -369,4 +369,10 @@
 	?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)
+	?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)
+	?MountFileSystem@CFsMountHelper@@QBEHXZ @ 375 NONAME ; public: int __thiscall CFsMountHelper::MountFileSystem(void)const 
+	?New@CFsMountHelper@@SAPAV1@AAVRFs@@H@Z @ 376 NONAME ; public: static class CFsMountHelper * __cdecl CFsMountHelper::New(class RFs &,int)
 
--- a/userlibandfileserver/fileserver/eabi/efsrvu.def	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/eabi/efsrvu.def	Wed Sep 22 10:53:45 2010 +0100
@@ -410,4 +410,10 @@
 	_ZTV19CFsNotificationList @ 409 NONAME
 	_ZTV9CFsNotify @ 410 NONAME
 	_ZNK3RFs23SupportedFileSystemNameER6TDes16ii @ 411 NONAME
+	_ZN14CFsMountHelper18GetMountPropertiesEv @ 412 NONAME
+	_ZN14CFsMountHelper3NewER3RFsi @ 413 NONAME
+	_ZN14CFsMountHelper5CloseEv @ 414 NONAME
+	_ZNK14CFsMountHelper15MountFileSystemEv @ 415 NONAME
+	_ZNK14CFsMountHelper18DismountFileSystemER14TRequestStatusNS_15TFsDismountModeE @ 416 NONAME
+	_ZNK14CFsMountHelper18DismountFileSystemEv @ 417 NONAME
 
--- a/userlibandfileserver/fileserver/group/release.txt	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/group/release.txt	Wed Sep 22 10:53:45 2010 +0100
@@ -1,3 +1,28 @@
+Version 2.00.4001
+=================
+(Made by vfebvre 14/09/2010)
+
+1.	niccox
+	1.	ou1cimx1#554000 Vasco to Vasco connection can freeze the USB/Connectivity UI
+	2.	ou1cimx1#436063 Increase CUsbHostMsDeviceThread priority
+	3.	ou1cimx1#544601 SPPR_PERF: USB not suspended
+	4.	ou1cimx1#558741 smassstorage tests
+	5.	ou1cimx1#554478 Remove unused code in smassstorage
+	6.	ou1cimx1#553937 smassstorage tests can run under WINSCW
+
+
+Version 2.00.4000
+=================
+(Made by vfebvre 09/09/2010)
+
+1.	dlyokhin
+	1.	ou1cimx1#473244 SD stack, FAT, exFAT FS should be compliant with SD specs v3.00
+	2.	ou1cimx1#545727 t_fsrv test corrupts exFAT volume
+
+2.	fagortz
+	1.	ou1cimx1#540214 [GCCE] Terminal backslashes in comments are parsed as line-continuations in f32test
+
+
 Version 2.00.3061
 =================
 (Made by fadhliM 31/08/2010)
--- a/userlibandfileserver/fileserver/inc/f32file.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32file.h	Wed Sep 22 10:53:45 2010 +0100
@@ -43,6 +43,28 @@
 #endif
 
 
+//-------------------------------------------------------------------------------------------------------------------
+/*
+    A brief description of the structure of paths and filenames in the Symbian OS.
+
+    A full file or directory name consists of four components:
+        - the drive: a single letter followed by a colon.
+        - the path, starting with a backslash and ending with the final backslash in the name. The backslashes divide the path into components.
+        - the file name: everything from the character following the last backslash to the character preceding the final dot.
+        - optional extension, which consists of everything after the final dot. 
+
+    A directory is identified by a trailing slash: thus, 'c:\\wrd\\' indicates a directory, but 'c:\\wrd' indicates a file with no extension. 
+
+    There are some restrictions that apply to the file or directory names.
+        - full name should not contain wild cards ('?' or '*' characters)
+        - file or directory name should not contain illegal characters like '<', '>', ':', '"', '/', '|' and '\000'. 
+        - file or directory name containing only white space characters is illegal.
+        - white space characters are those one that are identified by TChar::IsSpace(). ASCII and all UNICODE white space characters
+          are considered equivalent. E.g. characters with codes 0x20, U+0020, U+3000, U+2009, etc. considered as equivalent white spaces.
+*/
+//-------------------------------------------------------------------------------------------------------------------
+
+
 /**
 @publishedAll
 @released
@@ -3206,6 +3228,60 @@
 
 
 
+//-------------------------------------------------------------------------------------------------------------------
+/*
+    This is a helper class intended to make it easier to dismount and re-mount a file system
+    The purpose of this class is to gather and encapsulate all the necessary file system parameters such
+    as the file system name, the extensions name(s), etc. ;
+    these parameters are then retrieved & restored when mounting the file system back again
+    
+    The typical scenario:
+        1. some client dismounts an existing file system (FS1) from the drive
+        2. then the client mounts another file system (FS2) on to the drive to do some work
+        3. Dismounts FS2
+        4. Mounts FS1 back again with exactly the same parameters as they were there before it was dismounted.
+*/
+class TFsMntHelperImpl;
+NONSHARABLE_CLASS(CFsMountHelper) : public CBase
+    {
+ public:
+
+    inline ~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
+        {
+        ENormal,            ///< normal graceful attempt to dismount the file system. Usual call to RFs::DismountFileSystem().
+        EForceImmediate,    ///< immediate force dismount without respect to opened objects like files, directories etc. The same as call to RFs::NotifyDismount(,,EFsDismountForceDismount); 
+        
+        /** 
+        an attempt dismount FS with notifying clients before. The same as call to RFs::NotifyDismount(,,EFsDismountNotifyClients); 
+        Note that in this case the API user might need to call RFs::NotifyDismountCancel()
+        */
+        ENotifyClients      
+        };
+
+
+    IMPORT_C TInt GetMountProperties();
+    IMPORT_C TInt MountFileSystem() const;
+    IMPORT_C void DismountFileSystem(TRequestStatus& aStat, TFsDismountMode aDismountMode=ENormal) const;
+    IMPORT_C TInt DismountFileSystem() const;
+
+ protected:
+    inline CFsMountHelper(); 
+    CFsMountHelper(const CFsMountHelper&);
+    CFsMountHelper& operator=(const CFsMountHelper&);
+
+ private:
+    TFsMntHelperImpl*  ipImpl; 
+    };
+
+
+
+//-------------------------------------------------------------------------------------------------------------------
 
 /**
 @publishedAll
--- a/userlibandfileserver/fileserver/inc/f32file.inl	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32file.inl	Wed Sep 22 10:53:45 2010 +0100
@@ -221,7 +221,7 @@
     Calculates the file system name hash. For use in conjunction with this class only
     The file system name hash is a standard CRC32 on the up-cased name.
     
-    @param  aFsName given name.
+    @param  aFsName given name. Its length should not exceed KMaxFSNameLength
     @return CRC32 name hash value
 
 */    
@@ -231,7 +231,7 @@
         
     if(aFsName.Length() > 0)
         {
-        TFullName fsName;
+        TFSName fsName;
         fsName.Copy(aFsName);
         fsName.UpperCase();
         Mem::Crc32(nameHash, fsName.Ptr(), fsName.Length());
@@ -281,9 +281,19 @@
     return iData[aIndex];
     }
 
+//-------------------------------------------------------------------------------------------------------------------
+
+CFsMountHelper::~CFsMountHelper() 
+    {
+    Close();
+    } 
+
+
+CFsMountHelper::CFsMountHelper() 
+    {}; 
+
+//-------------------------------------------------------------------------------------------------------------------
 
 
 
 
-
-
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Wed Sep 22 10:53:45 2010 +0100
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=3061;
+const TInt KF32BuildVersionNumber=4001;
 //
 #endif
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_std.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_std.h	Wed Sep 22 10:53:45 2010 +0100
@@ -966,7 +966,7 @@
     TInt ProcessVolParam_User(const TLocalDriveCapsV6& aCaps);
     TInt ProcessVolParam_Custom(const TLocalDriveCapsV6& aCaps);
     TInt ProcessVolParam_Default(const TLocalDriveCapsV6& aCaps);
-    TInt ProcessVolParam_RamDisk();
+    TInt ProcessVolParam_RamDisk(const TLocalDriveCapsV6& aCaps);
     
 	void AdjustClusterSize(TUint aRecommendedSectorsPerCluster);
 	TInt AdjustFirstDataSectorAlignment(TUint aBlockSize);
--- a/userlibandfileserver/fileserver/sfat32/sl_fatmisc32.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_fatmisc32.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -593,8 +593,10 @@
     Tries to figure out number of FATs, SPC, etc. values passed from the user side.
     This method is called if the user has specified some formatting parameters, like SPC
 */
-TInt CFatFormatCB::ProcessVolParam_User(const TLocalDriveCapsV6& /*aCaps*/)
+TInt CFatFormatCB::ProcessVolParam_User(const TLocalDriveCapsV6& aCaps)
 {
+    (void)aCaps;
+
     __PRINT1(_L("CFatFormatCB::ProcessVolParam_User() sectors:%d"), iMaxDiskSectors);
     Dump_TLDFormatInfo(iSpecialInfo());
 
@@ -739,6 +741,17 @@
 {
     __PRINT(_L("CFatFormatCB::ProcessVolParam_Custom()"));
     
+    ASSERT(aCaps.iExtraInfo);
+
+    //-- the driver may have decided which file system should be used on the media.
+    //-- E.g. for SD cards > 32GB exFAT must be used.
+    if(aCaps.iFileSystemId != KDriveFileSysFAT)
+        {//-- the media driver decides that other than FAT FS must be used on the media.
+        __PRINT1(_L(" the media driver required other than FAT FS:%d"), aCaps.iFileSystemId);
+        return KErrNotSupported;
+        }
+    
+    
     //-- TLDFormatInfo structure is filled by the media driver, it decides the media formatting parameters
     const TLDFormatInfo& fmtInfo = aCaps.iFormatInfo;
     Dump_TLDFormatInfo(fmtInfo);
@@ -934,13 +947,19 @@
 /**
     Initialize the format parameters for a variable sized disk (RAM drive)
     
-    @param  aDiskSizeInSectors volume size in sectors
     @return standard error code
 */
-TInt CFatFormatCB::ProcessVolParam_RamDisk()
+TInt CFatFormatCB::ProcessVolParam_RamDisk(const TLocalDriveCapsV6& aCaps)
 	{
 	__PRINT1(_L("CFatFormatCB::ProcessVolParam_RamDisk() sectors:%d"), iMaxDiskSectors);
 
+    if(aCaps.iFileSystemId != KDriveFileSysFAT)
+        {//-- RAM media driver must set this value correctly.
+        __PRINT1(_L("RAM media driver required other than FAT FS:%d"), aCaps.iFileSystemId);
+        ASSERT(0);
+        return KErrNotSupported;
+        }
+
     iNumberOfFats   = 2; // 1 FAT 1 Indirection table (FIT)
 	iReservedSectors= 1;
 	iRootDirEntries = 2*(4*KDefaultSectorSize)/sizeof(SFatDirEntry);
--- a/userlibandfileserver/fileserver/sfat32/sl_fmt.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_fmt.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -142,6 +142,22 @@
 }
 
 //-------------------------------------------------------------------------------------------------------------------
+void Dump_LocalDrvCaps(const TLocalDriveCapsV6& aCaps)
+{
+    (void)aCaps;
+#ifdef _DEBUG
+    __PRINT(_L("----- TLocalDriveCapsV6 dump:"));
+    __PRINT1(_L("iSize:%LU"), aCaps.iSize);
+    __PRINT4(_L("iType:%d, iDriveAtt:0x%x, iMediaAtt:0x%x, iConnectionBusType:%d"), aCaps.iType, aCaps.iDriveAtt, aCaps.iMediaAtt, aCaps.iConnectionBusType);
+    __PRINT2(_L("iFileSystemId:%d, iPartitionType:%d"), aCaps.iFileSystemId, aCaps.iPartitionType);
+    __PRINT2(_L("iHiddenSectors:%d, iEraseBlockSize:%d"), aCaps.iHiddenSectors, aCaps.iEraseBlockSize);
+    __PRINT4(_L("iExtraInfo:%d, iNumberOfSectors:%d, iSectorSizeInBytes:%d, iBlockSize:%d"), aCaps.iExtraInfo, aCaps.iNumberOfSectors, aCaps.iSectorSizeInBytes, aCaps.iBlockSize);
+    __PRINT(_L("-----"));
+#endif
+}
+
+
+//-------------------------------------------------------------------------------------------------------------------
 /**
     Initialize format data.
 */
@@ -154,6 +170,8 @@
     const TLocalDriveCapsV6& caps = capsBuf();
     User::LeaveIfError(LocalDrive()->Caps(capsBuf));
 
+    Dump_LocalDrvCaps(caps);
+
     iVariableSize   = (caps.iMediaAtt & KMediaAttVariableSize);
     iBytesPerSector=KDefaultSectorSize;
     iSectorSizeLog2 = Log2(iBytesPerSector);
@@ -166,7 +184,7 @@
     if (iVariableSize)
         {// Variable size implies ram disk
         iMaxDiskSectors=DiskSizeInSectorsL(GetRamDiskSizeInBytes());
-        nRes = ProcessVolParam_RamDisk();
+        nRes = ProcessVolParam_RamDisk(caps);
         }
     else
         {//-- fixed-size media
@@ -192,13 +210,13 @@
                 nRes = ProcessVolParam_User(caps);
             else if(bCustomFormat)
                 nRes = ProcessVolParam_Custom(caps);
-                else
+            else
                 nRes = ProcessVolParam_Default(caps); 
             }
         } //else(iVariableSize)
     
     if(nRes != KErrNone)
-    {
+        {
         __PRINT1(_L(" ::InitializeFormatDataL() err:%d"), nRes);
         User::Leave(nRes);
         }
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -600,6 +600,8 @@
     if(aOperation == RFs::EFinal_RO)
         SetReadOnly(ETrue);
 
+    (void)LocalDrive()->Finalise(ETrue);
+
     SetState(EFinalised);
     }
 
--- a/userlibandfileserver/fileserver/sfile/sf_thread.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_thread.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -858,15 +858,7 @@
 	TDrive& drive = TheDrives[self.iDriveNumber];
 	if(drive.IsMounted())
         {
-        if (drive.CurrentMount().LockStatus() == 0)
-            {
-            // Ignore the error here, as there's nothing we can do about it...
-            (void)drive.FinaliseMount(RFs::EFinal_RW);
-            }
-        else
-            {
-            self.StartFinalisationTimer();
-            }
+        (void)drive.FinaliseMount(RFs::EFinal_RW);
         }
 
 	return KErrNone;
--- a/userlibandfileserver/fileserver/sfsrv/cl_cli.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfsrv/cl_cli.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -1579,7 +1579,7 @@
              not specified here will be taken from the session path.
 			 The directory name shall not contain wild cards ('?' or '*' characters) 
 			 and illegal characters like '<', '>', ':', '"', '/', '|' and '\000'.
-			 The directory name containing only whilte space characters 
+			 The directory name containing only white space characters 
 			 (See TChar::IsSpace()) is also illegal. 
 
 @return KErrNone if successful, otherwise one of the other
--- a/userlibandfileserver/fileserver/sfsrv/cl_drive.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/sfsrv/cl_drive.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -125,3 +125,392 @@
 	return driveName;
 	}
 
+
+
+//-------------------------------------------------------------------------------------------------------------------
+
+/** 
+    internal class of the CFsMountHelper, provides the real implementation, It is not supposed to 
+    be instantiated by anyone except CFsMountHelper.
+*/
+class TFsMntHelperImpl
+    {
+    friend class CFsMountHelper;
+   
+ private:
+    
+    TFsMntHelperImpl(RFs& aFs, TInt aDrvNum);
+        
+    //------ 1:1 interface to the host CFsMountHelper class
+    void Init(); 
+    TInt GetMountProperties();
+    TInt MountFileSystem() const;
+    void DismountFileSystem(TRequestStatus& aStat, CFsMountHelper::TFsDismountMode aDismountMode) const;
+    //------
+    
+ private:
+    TBool DataValid() const {return iFsName.Length() >0;}
+    TBool operator==(const TFsMntHelperImpl& aRhs) const;
+
+    enum {KPrimExtIdx =0}; //-- index of the primary extension name in the iExtNames array
+
+    const TDesC& FSysName() const       {return iFsName;}
+    const TDesC& PrimaryExtName() const {return iExtNames[KPrimExtIdx];}
+
+    /** bits in a error bitmap that indicate some, potentially multiple, API failure reasons */
+    enum TErrorBits
+        {
+        Err_GetFsName       = 0x0001, ///< Error when trying to obtain FS name (possible reason: there is no FS at all on this drive)
+        Err_MountFs         = 0x0002, ///< Error when mounting the FS. (possible reason: the FS layout on the media is corrupt or not recognised)
+        Err_MountFsPrimExt  = 0x0004, ///< Error when mounting the FS with the primary extension
+        Err_MountSecExt     = 0x0008, ///< Error when mounting the secondary extension 
+        };
+
+        
+    void  AddErrorBit(TUint32 aFlag) const {ASSERT(aFlag); iErrorBitmap |= aFlag;}
+
+    /** panic codes */
+    enum TPanicCode
+        {
+        ENotInitialised,  ///< the instance of the implementation is not created
+        EDrvNumberInvalid,///< invalid drive number provided
+        ENotImplemented   ///< the functionality is not implemented
+        };
+
+    void Panic(TPanicCode aPanicCode) const;
+
+ private:
+        RFs&    iFs;                            ///< reference to the file server session
+        TInt    iDrvNum;                        ///< drive number
+        TFSName iFsName;                        ///< file system name.
+        TFSName iExtNames[KMaxExtensionCount];  ///< [0] is a primary ext. name + up to several secondary ones
+        TBool   iDrvSynch;                      ///< true if the drive is synchronous
+        mutable TUint32 iErrorBitmap;           ///< 32 bits indicating API call failures. '1' bit corresponds to some particular reason. See TErrorBits.  
+    };
+
+
+//-------------------------------------------------------------------------------------------------------------------
+
+void TFsMntHelperImpl::DismountFileSystem(TRequestStatus& aStat, CFsMountHelper::TFsDismountMode aDismountMode) const
+    {
+    if(!this)
+        Panic(ENotInitialised); 
+
+    TInt nRes;
+
+#ifdef _DEBUG
+    //-- consistency check (debug mode only). Check that we are dismounting file system with the same parameters
+    //-- since last GetMountProperties() call
+    TFsMntHelperImpl  currSnapshot(iFs, iDrvNum);
+    currSnapshot.GetMountProperties();
+    ASSERT(currSnapshot == *this);
+
+#endif //_DEBUG
+
+    
+    nRes = KErrArgument;
+    TRequestStatus* pStat = &aStat;
+
+    switch(aDismountMode)
+        {
+        case CFsMountHelper::ENormal:
+            //-- normal graceful dismounting. Will fail with KErrInUse if there are any opened objects, like files, directories etc.
+            //-- aStat is completed with the API return code. 
+            nRes = iFs.DismountFileSystem(iFsName, iDrvNum);
+            User::RequestComplete(pStat, nRes);
+        break;
+
+        case CFsMountHelper::EForceImmediate:
+            //-- immediate forced dismount. Don't pay attention to any opened objects. All handles will become invalid.
+            //-- The user should wait for aStat completion. Though it is very likely that it is completed immediately.
+            iFs.NotifyDismount(iDrvNum, aStat, EFsDismountForceDismount); 
+        break;
+
+     
+        case CFsMountHelper::ENotifyClients:
+            //-- attempt to dismount FS with notifying any interested clients.
+            iFs.NotifyDismount(iDrvNum, aStat, EFsDismountNotifyClients); 
+        break;
+
+        default:
+            ASSERT(0);
+            User::RequestComplete(pStat, KErrArgument);
+        break;
+        };
+
+    }
+
+
+//-------------------------------------------------------------------
+TInt TFsMntHelperImpl::GetMountProperties()
+    {
+    if(!this)
+        Panic(ENotInitialised); 
+    Init();
+
+    TInt nRes;
+
+    //-- 1. get file system name
+    nRes = iFs.FileSystemName(iFsName, iDrvNum);
+    if(nRes != KErrNone)
+        {
+        AddErrorBit(Err_GetFsName); //-- indicate an error 
+        return nRes;
+        }
+
+    //-- 2. find out if the drive sync/async
+    TPckgBuf<TBool> drvSyncBuf;
+    nRes = iFs.QueryVolumeInfoExt(iDrvNum, EIsDriveSync, drvSyncBuf);
+    if(nRes != KErrNone)
+        {//-- pretend that the drive is asynch. in the case of file system being corrupted. this is 99.9% true
+        iDrvSynch = EFalse;
+        }
+    else
+        {
+        iDrvSynch = drvSyncBuf();
+        }
+
+    //-- 3. find out extension names if there are any. Extension #0 is a primary one and up to several secondary ones
+    for(TInt i=0; i<KMaxExtensionCount; ++i)
+        {
+        nRes = iFs.ExtensionName(iExtNames[i], iDrvNum, i);
+        if(nRes != KErrNone)
+            {
+            iExtNames[i].Zero();
+            }
+        } 
+    
+   
+    return KErrNone;
+ 
+    }
+
+//-------------------------------------------------------------------
+TInt TFsMntHelperImpl::MountFileSystem() const
+    {
+    if(!this)
+        Panic(ENotInitialised); 
+    
+    ASSERT(DataValid());
+    
+    TInt nRes;
+    const TBool bPrimaryExtExists = (PrimaryExtName().Length() >0);
+
+    //-- all possible extensions that have existed before dismounting should be present in the file server context.
+    //-- anyway, it's impossible to load them here, because their file names are unknown 
+
+    if(bPrimaryExtExists)
+        {//-- there was a primary extension, use special mounting API
+        nRes = iFs.MountFileSystem(FSysName(), PrimaryExtName(), iDrvNum, iDrvSynch);
+        }
+    else
+        {
+        nRes = iFs.MountFileSystem(FSysName(), iDrvNum, iDrvSynch);
+        }
+
+    //-- actually, if nRes != KErrNone, it doesn't _necessarily_ mean that _mounting_ of the file system failed.
+    //-- for example, the FS can be bound to the drive OK, but the media can be corrupted. This can happen when the FS
+    //-- had been dismounted from such a corrupted media.
+    //-- opposite, KErrNotReady is very likely to mean that the removable media is not present.
+    
+    const TInt nFsMountRes = nRes;
+    if(nFsMountRes != KErrNone)
+        {
+        AddErrorBit(bPrimaryExtExists ?  Err_MountFsPrimExt : Err_MountFs);
+        }
+
+    //-- mount secondary extensions if there were any
+    TInt nExtMountRes = KErrNone;
+    for(TInt i=1; i<KMaxExtensionCount; ++i)
+        {
+        if(iExtNames[i].Length() >0)
+            {
+            nRes = iFs.MountExtension(iExtNames[i], iDrvNum);
+            if(nRes != KErrNone)
+                {//-- indicate that an error happened while installing some secondary extension 
+                AddErrorBit(Err_MountSecExt);    
+                nExtMountRes = nRes;
+                }
+            }
+        }
+
+    //-- return FS mounting error code if it wasn't OK, otherwise - extension mounting code.
+    //-- for more info see error bitmap
+    return (nFsMountRes != KErrNone) ? nFsMountRes : nExtMountRes;
+    }
+
+//-------------------------------------------------------------------
+void TFsMntHelperImpl::Init() 
+    {
+    if(!this)
+        Panic(ENotInitialised); 
+    
+    iDrvSynch = EFalse;
+    iFsName.Zero();
+    iErrorBitmap = 0;
+             
+    for(TInt i=0; i<KMaxExtensionCount; ++i) 
+        {
+        iExtNames[i].Zero();
+        }
+
+    }
+
+//-------------------------------------------------------------------
+/**
+    Panics.
+    @param aPanicCode   a panic code
+*/
+void TFsMntHelperImpl::Panic(TPanicCode aPanicCode) const
+    {
+    _LIT(KPanicCat,"CFsMountHelper");
+    User::Panic(KPanicCat, aPanicCode);
+    }
+
+TFsMntHelperImpl::TFsMntHelperImpl(RFs& aFs, TInt aDrvNum) 
+                 :iFs(aFs), iDrvNum(aDrvNum) 
+    {
+    if(aDrvNum < EDriveA || aDrvNum >EDriveZ)
+        Panic(EDrvNumberInvalid);
+
+    Init();
+    }
+
+/**
+    Debug only method. Compares 2 instances of the implementation
+*/
+TBool TFsMntHelperImpl::operator==(const TFsMntHelperImpl& aRhs) const
+    {
+    ASSERT(this != &aRhs);
+
+#ifdef _DEBUG
+    
+
+    if(iFsName.CompareF(aRhs.iFsName) !=0)
+        return EFalse;
+
+    for(TInt i=0; i<KMaxExtensionCount; ++i)
+        {
+        if(iExtNames[i].CompareF(aRhs.iExtNames[i]) !=0)
+        return EFalse;
+        }
+
+    if(!iDrvSynch != !aRhs.iDrvSynch)
+        return EFalse;
+
+    return ETrue;
+
+#else //_DEBUG
+    (void)aRhs;
+    Panic(ENotImplemented);
+    return EFalse;
+
+#endif// _DEBUG
+}
+
+
+
+
+//-------------------------------------------------------------------
+/**
+    Factory function. Produces an object of this class
+    
+    @param  aFs     file server session
+    @param  aDrvNum drive number
+
+    @return pointer to the constructed object or NULL on error.
+*/
+EXPORT_C CFsMountHelper* CFsMountHelper::New(RFs& aFs, TInt aDrvNum)
+{
+
+    CFsMountHelper* pSelf = new CFsMountHelper;
+    
+    if(pSelf)
+        {
+        pSelf->ipImpl = new TFsMntHelperImpl(aFs, aDrvNum);
+    
+        if(!pSelf->ipImpl)
+            {
+            delete pSelf;
+            pSelf = NULL;
+            }
+        }
+    
+    return pSelf;
+}
+
+//-------------------------------------------------------------------
+/** 
+    Closes the object, deletes the implementation
+*/
+EXPORT_C void CFsMountHelper::Close()
+{
+    delete ipImpl;
+    ipImpl = NULL;
+}
+
+
+//-------------------------------------------------------------------
+/** 
+    Acqires drive/mount/file system properties that will be used for mounting the file system back.
+    @return Standard Error code.
+*/
+EXPORT_C TInt CFsMountHelper::GetMountProperties()
+    {
+    return ipImpl->GetMountProperties();
+    }
+
+//-------------------------------------------------------------------
+/** 
+    Mount the file system onto the drive using properties previously acquired by GetMountProperties() call.
+    Note that the drive shouldn't have the file system mounted, this API call will fail in this case.
+
+    @return KErrNone if mounting file system + possible extensions was ok
+            the result of file system mounting if the file system mounting failed (e.g. because of the damaged media) 
+            the result of mounting secondary extension if file system mounted OK, but secondary extension mounting resulted in some error.
+*/
+EXPORT_C TInt CFsMountHelper::MountFileSystem() const
+    {
+    return ipImpl->MountFileSystem();
+    }
+
+//-------------------------------------------------------------------
+
+/**
+    An asynchronous API to dismount the file system on the specified drive.
+    Precondition: The drive / file system parameters at the time of this API call must be the same as acquired by the last call of GetMountProperties().
+                  This is checked in debug mode to prevent possible inconsistencied when mounting the file system back later.   
+                  This means that the GetMountProperties() should be called at least once before any attempt to dismount the file system.
+    
+    @param  aStat           request status. On completion will contain the dismounting result code.
+    @param  aDismountMode   describes the dismounting method. See TFsDismountMode.
+        
+
+*/
+EXPORT_C void CFsMountHelper::DismountFileSystem(TRequestStatus& aStat, TFsDismountMode aDismountMode/*=ENormal*/) const
+    {
+    ipImpl->DismountFileSystem(aStat, aDismountMode);
+    }
+
+
+//-------------------------------------------------------------------
+/**
+    A simplified synchronous version of the DismountFileSystem() API. 
+    Works absolutely the same as RFs::DismountFileSystem()
+    
+    @return RFs::DismountFileSystem() result code
+*/
+EXPORT_C TInt CFsMountHelper::DismountFileSystem() const
+    {
+    TRequestStatus stat;    
+    DismountFileSystem(stat, ENormal);
+    User::WaitForRequest(stat);
+    
+    return stat.Int();
+    }
+
+
+
+
+
+
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevice.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevice.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -160,7 +160,12 @@
 void CUsbHostMsDevice::SuspendLunL(TLun aLun)
 	{
     __MSFNLOG
-	iLuList.GetLuL(aLun).ReadyToSuspend();
+    if (IsSuspended())
+        {
+        return;
+        }
+
+    iLuList.GetLuL(aLun).ReadyToSuspend();
 
     // check whether all the luns are suspended, if so then request usb
     // interface suspension to the transport layer
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -173,11 +173,16 @@
         {
         if (iUsbHostMsDevice->IsSuspended())
             {
-            // request resume 
-            Unlock();
-            iUsbHostMsDevice->Resume(iStatus);
-            SetActive();
-            return;
+
+            RMessage2 msg = iRMessage2[iDequeueIndex];      
+            if (msg.Function() != EUsbHostMsSuspendLun)
+                {
+                // request resume 
+                Unlock();
+                iUsbHostMsDevice->Resume(iStatus);
+                SetActive();
+                return;
+                }            
             }
         }
 
@@ -309,8 +314,11 @@
 		return;
 	case EUsbHostMsUnRegisterInterface:
 		// Check whether all luns have got uninitialised. 
-		for(TInt i = 0, j = iUsbHostMsDevice->GetMaxLun(); i <= j; i++)
-			TRAP_IGNORE(iUsbHostMsDevice->RemoveLunL(i));
+        if (iUsbHostMsDevice)
+            {
+            for(TInt i = 0, j = iUsbHostMsDevice->GetMaxLun(); i <= j; i++)
+                TRAP_IGNORE(iUsbHostMsDevice->RemoveLunL(i));
+            }
 		TRAP(ret, UnRegisterInterfaceL(aMessage));
 		break;
 	case EUsbHostMsRegisterLun:
--- a/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp	Wed Sep 22 10:53:45 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"
@@ -114,8 +114,16 @@
 			return;
 			}
 		break;
-	case EUsbHostMsUnRegisterInterface:
-		iCleanupInProgress = ETrue;
+    case EUsbHostMsUnRegisterInterface:
+        if(iCleanupInProgress)
+            {
+            aMessage.Complete(KErrInUse);
+            return;
+            }
+        else
+            {
+            iCleanupInProgress = ETrue;
+            }
 		break;
 	/* If it is a cleanup then we need to delete the iDeviceThread */
 	case EUsbHostMsFinalCleanup:	
@@ -128,12 +136,17 @@
 		break;
 		}
 
-	if (iDeviceThread == NULL || iCleanupInProgress ) 
+	if (iDeviceThread == NULL) 
 		{
 		aMessage.Complete(KErrBadHandle);
 		return;
 		}
 
+    if (iCleanupInProgress && aMessage.Function() != EUsbHostMsUnRegisterInterface) 
+        {
+        aMessage.Complete(KErrBadHandle);
+        return;
+        }
 
 	r = iDeviceThread->QueueMsg(aMessage);
 	if (r != KErrNone)
@@ -174,7 +187,7 @@
         iDeviceThread = NULL;
 		User::Leave(r);
 		}
-	iThread.SetPriority(EPriorityAbsoluteBackgroundNormal);
+	iThread.SetPriority(EPriorityAbsoluteForeground);
 	TRequestStatus status;
 	iThread.Rendezvous(status);
 	iThread.Resume();
--- a/userlibandfileserver/fileserver/smassstorage/bld.inf	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/bld.inf	Wed Sep 22 10:53:45 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"
@@ -32,7 +32,5 @@
 
 
 PRJ_MMPFILES
-#if !defined(WINS) && !defined(GENERIC_X86)
 smassstorage
 smassstorage_db
-#endif
--- a/userlibandfileserver/fileserver/smassstorage/cbulkonlytransport.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/cbulkonlytransport.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -19,7 +19,9 @@
 */
 #include "cbulkonlytransport.h"
 #include "cbulkonlytransportusbcldd.h"
+#if !defined(__WINS__) && !defined(__X86__)
 #include "cbulkonlytransportusbcscldd.h"
+#endif
 #include "usbmsshared.h"
 #include "massstoragedebug.h"
 #include "cusbmassstorageserver.h"
@@ -52,7 +54,6 @@
  @return Error.
  */
 TInt TUsbRequestHdr::Decode(const TDesC8& aBuffer)
-
 	{
 	if (aBuffer.Length() < static_cast<TInt>(KRequestHdrSize))
 		{
@@ -113,19 +114,23 @@
 		User::Leave(KErrArgument);
 		}
 
+#if !defined(__WINS__) && !defined(__X86__)
 	CBulkOnlyTransportUsbcScLdd* scTransport;
+#endif
 	CBulkOnlyTransportUsbcLdd* nonscTransport;
 	switch (aTransportLddFlag)
 		{
 		case 1: 
-				nonscTransport = new(ELeave) CBulkOnlyTransportUsbcLdd(aNumDrives, aController);
-				return nonscTransport;
-
+			nonscTransport = new(ELeave) CBulkOnlyTransportUsbcLdd(aNumDrives, aController);
+			return nonscTransport;
+#if !defined(__WINS__) && !defined(__X86__)
 		case 2: 
-				scTransport = new(ELeave) CBulkOnlyTransportUsbcScLdd(aNumDrives, aController);
-				return scTransport;
-		default:
-				return NULL;
+			scTransport = new(ELeave) CBulkOnlyTransportUsbcScLdd(aNumDrives, aController);
+			return scTransport;
+#endif
+        default:
+            __ASSERT_DEBUG(EFalse, User::Panic(KUsbMsSvrPncCat, EMsCBulkOnlyTransportNull));		    
+			return NULL;
 
 		}
 	}
@@ -139,6 +144,7 @@
 	iController.GetTransport(transport);
 	switch (aTransportLddFlag)
 		{
+#if !defined(__WINS__) && !defined(__X86__)
 		case 2: 
 				ret = ((CBulkOnlyTransportUsbcScLdd*) transport)->Ldd().Open(0);
 				if (ret != KErrNone)
@@ -153,6 +159,7 @@
 					CleanupStack::Pop(transport);
 					return ret;
 					}
+#endif
 		case 1:
 				ret = ((CBulkOnlyTransportUsbcLdd*) transport)->Ldd().Open(0);
 				if (ret != KErrNone)
@@ -753,7 +760,7 @@
 	TInt8 lun = static_cast<TUint8>(iCbwBufPtr[KCbwLunOffset] & 0x0f);
 	if (iMaxLun < lun)
 		{
-		__PRINT1(_L("bad lun: %d"), lun);
+		RDebug::Print(_L("bad lun: %d"), lun);
 		return EFalse;
 		}
 
--- a/userlibandfileserver/fileserver/smassstorage/cbulkonlytransportusbcldd.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/cbulkonlytransportusbcldd.cpp	Wed Sep 22 10:53:45 2010 +0100
@@ -474,6 +474,7 @@
 
 void CBulkOnlyTransportUsbcLdd::ActivateDeviceStateNotifier()
 	{
+    __ASSERT_DEBUG(iDeviceStateNotifier, User::Panic(KUsbMsSvrPncCat, EMsCDeviceStateNotifierNull));
 	iDeviceStateNotifier->Activate();
 	}
 
--- a/userlibandfileserver/fileserver/smassstorage/cusbmassstoragecontroller.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/cusbmassstoragecontroller.cpp	Wed Sep 22 10:53:45 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"
@@ -44,7 +44,11 @@
 void CUsbMassStorageController::CreateL(RArray<TInt>& aDriveMapping)
 	{
 	__PRINT(_L("CUsbMassStorageController::CreateL In"));
+#if !defined(__WINS__) && !defined(__X86__)
 	iTransportLddFlag = EUsbcsc; // Create transport object using SC Ldd By default
+#else
+	iTransportLddFlag = EUsbc;
+#endif
 	//Save this value for use in the Reset method.
 	iMaxDrives = aDriveMapping.Count();
 	//Create and init drive manager
--- a/userlibandfileserver/fileserver/smassstorage/inc/cbulkonlytransport.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/inc/cbulkonlytransport.h	Wed Sep 22 10:53:45 2010 +0100
@@ -23,8 +23,10 @@
 #ifndef __CBULKONLYTRANSPORT_H__
 #define __CBULKONLYTRANSPORT_H__
 
-#include <e32std.h> 
+#include <e32std.h>
+#if !defined(__WINS__) && !defined(__X86__) 
 #include <d32usbcsc.h>
+#endif
 #include <d32usbc.h>
 #include "protocol.h"  
 #include "cusbmassstoragecontroller.h"
@@ -92,7 +94,7 @@
 	static CBulkOnlyTransport* NewL(TInt aNumDrives,CUsbMassStorageController& aController); 
 
 protected:
-    ~CBulkOnlyTransport() = 0;
+    ~CBulkOnlyTransport();
 	CBulkOnlyTransport(TInt aNumDrives,CUsbMassStorageController& aController);
 
 public:
--- a/userlibandfileserver/fileserver/smassstorage/inc/cusbmassstorageserver.h	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/inc/cusbmassstorageserver.h	Wed Sep 22 10:53:45 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"
@@ -30,6 +30,8 @@
 
 enum TUsbPanicServer
 	{
+    EMsCBulkOnlyTransportNull = 300,
+    EMsCDeviceStateNotifierNull,
 	EMsClientInvalidSessCount,
 	EMsControlInterfaceBadState,
 	EMsControlInterfaceStillActive,
--- a/userlibandfileserver/fileserver/smassstorage/inc/massstorageutil.h	Mon Sep 13 15:16:07 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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:
-// Utility functions for the Mass Storage file system.
-// 
-//
-
-/**
- @file
- @internalTechnology
- 
- Indicates if a number passed in is a power of two
- 
- @param aNum number to be tested
- @return Flag to indicate the result of the test
-*/
-GLREF_C TBool IsPowerOfTwo(TInt aNum);
-
-/**
-Calculates the log2 of a number
-
-@param aNum Number to calulate the log two of
-@return The log two of the number passed in
-*/
-GLREF_C TInt Log2(TInt aNum);
-
--- a/userlibandfileserver/fileserver/smassstorage/massstorageutil.cpp	Mon Sep 13 15:16:07 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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:
-// Utility functions for the Mass Storage file system.
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <e32std.h>
-#include <e32std_private.h>
-
-/**
-Returns ETrue if aNum is a power of two
-*/
-GLDEF_C TBool IsPowerOfTwo(TInt aNum)
-	{
-
-	if (aNum==0)
-		return(EFalse);
-
-	while(aNum)
-		{
-		if (aNum & 0x01)
-			{
-			if (aNum>>1) 
-				return EFalse;
-			break;
-			}
-		aNum>>=1;
-		}
-	return ETrue;
-	}
-
-/**
-Returns the position of the highest bit in aNum or -1 if aNum == 0
-*/
-GLDEF_C TInt Log2(TInt aNum)
-	{
-
-	TInt res=-1;
-	while(aNum)
-		{
-		res++;
-		aNum>>=1;
-		}
-	return(res);
-	}
-	
--- a/userlibandfileserver/fileserver/smassstorage/smassstorage.mmh	Mon Sep 13 15:16:07 2010 +0100
+++ b/userlibandfileserver/fileserver/smassstorage/smassstorage.mmh	Wed Sep 22 10:53:45 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"
@@ -33,7 +33,9 @@
 SOURCE		scsiprot.cpp
 SOURCE		cbulkonlytransport.cpp
 SOURCE		cbulkonlytransportusbcldd.cpp
+#if !defined(WINS) && !defined(GENERIC_X86)
 SOURCE		cbulkonlytransportusbcscldd.cpp
+#endif
 SOURCE		cactivedevicestatenotifierbase.cpp
 SOURCE		rwdrivethread.cpp
 SOURCE		cmassstoragefilesystem.cpp
@@ -41,11 +43,13 @@
 SOURCE		cusbmassstoragecontroller.cpp
 SOURCE		cusbmassstorageserver.cpp
 SOURCE		cusbmassstoragesession.cpp
-SOURCE		massstorageutil.cpp
 SOURCE		drivemanager.cpp
 SOURCE		drivepublisher.cpp
 
-LIBRARY		efile.lib efsrv.lib euser.lib usbcsc_bil.lib
+LIBRARY		efile.lib efsrv.lib euser.lib 
+#if !defined(WINS) && !defined(GENERIC_X86)
+LIBRARY	usbcsc_bil.lib
+#endif
 
 
 SOURCEPATH	.