201043_09
authorhgs
Tue, 02 Nov 2010 15:29:23 +0000
changeset 300 1d28c8722707
parent 293 0659d0e1a03c
child 301 172f33f13d7d
201043_09
kernel/eka/debug/crashMonitor/group/release.txt
kernel/eka/debug/crashMonitor/group/scmkern_lib.mmp
kernel/eka/debug/crashMonitor/group/scmlib.mmh
kernel/eka/debug/crashMonitor/group/scmonitor.mmp
kernel/eka/debug/crashMonitor/group/scmusr_lib.mmp
kernel/eka/debug/crashMonitor/inc/crashlogwalker.h
kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.h
kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.inl
kernel/eka/debug/crashMonitor/inc/scmconfig.h
kernel/eka/debug/crashMonitor/inc/scmconfigitem.h
kernel/eka/debug/crashMonitor/inc/scmdatasave.h
kernel/eka/debug/crashMonitor/inc/scmdatatypes.h
kernel/eka/debug/crashMonitor/inc/scmonitor.h
kernel/eka/debug/crashMonitor/inc/scmtrace.h
kernel/eka/debug/crashMonitor/src/arm/cscmdatasave.cpp
kernel/eka/debug/crashMonitor/src/crashlogwalker.cpp
kernel/eka/debug/crashMonitor/src/scmbytestreamutil.cpp
kernel/eka/debug/crashMonitor/src/scmchksum.cpp
kernel/eka/debug/crashMonitor/src/scmconfig.cpp
kernel/eka/debug/crashMonitor/src/scmconfigitem.cpp
kernel/eka/debug/crashMonitor/src/scmdatasave.cpp
kernel/eka/debug/crashMonitor/src/scmdatatypes.cpp
kernel/eka/debug/crashMonitor/src/scmlockdata.cpp
kernel/eka/debug/crashMonitor/src/scmmulticrashinfo.cpp
kernel/eka/debug/crashMonitor/src/scmonitor.cpp
kernel/eka/debug/crashMonitor/src/scmprocessdata.cpp
kernel/eka/debug/crashMonitor/src/scmromdata.cpp
kernel/eka/debug/crashMonitor/src/scmthreaddata.cpp
kernel/eka/debug/crashMonitor/src/scmvariantdata.cpp
kernel/eka/drivers/crashflash/crashflashnor.cpp
kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp
kernel/eka/drivers/debug/group/bld.inf
kernel/eka/drivers/locmedia/locmedia.cpp
kernel/eka/drivers/medmmc/bgahsmmcptn.cpp
kernel/eka/drivers/medmmc/bgahsmmcptn.h
kernel/eka/drivers/medmmc/medmmc.cpp
kernel/eka/drivers/medmmc/toc.h
kernel/eka/euser/epoc/up_lib.cpp
kernel/eka/euser/us_func.cpp
kernel/eka/euser/us_std.h
kernel/eka/include/e32def.h
kernel/eka/include/e32ldr_private.h
kernel/eka/include/e32ver.h
kernel/eka/include/kernel/kern_priv.h
kernel/eka/include/nkern/nklib.h
kernel/eka/include/u32std.h
kernel/eka/kernel/execs.txt
kernel/eka/kernel/scodeseg.cpp
kernel/eka/nkern/nkerns.cpp
kernel/eka/nkernsmp/nkerns.cpp
kernel/eka/release.txt
kernelhwsrv_info/doc_pub/Base_How_To_64bit_File_Server_Client_Porting_Guide.doc
kernelhwsrv_info/doc_pub/Base_How_To_64bit_File_Server_File_System_Plugin_Porting_Guide.doc
kernelhwsrv_info/doc_pub/Base_How_To_ARMv7_Cache_And_Access_Remapping_-_Design.doc
kernelhwsrv_info/doc_pub/Base_How_To_Align_Partitions_To_Media_Block_Boundaries_For_Optimised_Performance.doc
kernelhwsrv_info/doc_pub/Base_How_To_BTrace.doc
kernelhwsrv_info/doc_pub/Base_How_To_Configure_Domain_Manager_Policy_DLLs.doc
kernelhwsrv_info/doc_pub/Base_How_To_Configure_Platform_Security_Settings.doc
kernelhwsrv_info/doc_pub/Base_How_To_Crash_Logging.doc
kernelhwsrv_info/doc_pub/Base_How_To_Debug_NONXIP_Problems.doc
kernelhwsrv_info/doc_pub/Base_How_To_Estart.doc
kernelhwsrv_info/doc_pub/Base_How_To_File_Caching.doc
kernelhwsrv_info/doc_pub/Base_How_To_Handle_Sharing.doc
kernelhwsrv_info/doc_pub/Base_How_To_IPC.doc
kernelhwsrv_info/doc_pub/Base_How_To_Impacts_Of_Demand_Paging_On_Kernel-Side_Code.doc
kernelhwsrv_info/doc_pub/Base_How_To_MMC_Direct_Physical_Addressing.doc
kernelhwsrv_info/doc_pub/Base_How_To_MMC_Double_Buffering.doc
kernelhwsrv_info/doc_pub/Base_How_To_Message_Queues.doc
kernelhwsrv_info/doc_pub/Base_How_To_Migrate_Device_Drivers_to_Paging_Environment.doc
kernelhwsrv_info/doc_pub/Base_How_To_Migrate_Media_Drivers_To_Support_Demand_Paging.doc
kernelhwsrv_info/doc_pub/Base_How_To_Migrate_To_Client-Server_V2_APIs.doc
kernelhwsrv_info/doc_pub/Base_How_To_Persisting_a_Custom_Restart_Reason.doc
kernelhwsrv_info/doc_pub/Base_How_To_Port_SDIO_Controller_Supplement.doc
kernelhwsrv_info/doc_pub/Base_How_To_Publish_And_Subscribe.doc
kernelhwsrv_info/doc_pub/Base_How_To_Share_File_Handles.doc
kernelhwsrv_info/doc_pub/Base_How_To_USB_Client_Porting_and_Test.doc
kernelhwsrv_info/doc_pub/Base_How_To_USB_Mass_Storage_App.doc
kernelhwsrv_info/doc_pub/Base_How_To_USB_Mass_Storage_Double_Buffering.doc
kernelhwsrv_info/doc_pub/Base_How_To_Use_CFileMan_Test_Framework.doc
kernelhwsrv_info/doc_pub/Base_How_To_Use_DMA_For_SDIO_Data_Transfers.doc
kernelhwsrv_info/doc_pub/Base_How_To_VFP_Support.doc
kernelhwsrv_info/doc_pub/Base_How_to_Port_eMMC_Controller.doc
kernelhwsrv_info/doc_pub/Base_Migrating_Media_drivers_DMA.doc
kernelhwsrv_info/doc_pub/Base_SMP_Driver_Migration_Guide.doc
kerneltest/e32test/bmarm/d_lddns.def
kerneltest/e32test/bmarm/t_nestdll1.def
kerneltest/e32test/bmarm/t_nestdll2.def
kerneltest/e32test/bmarm/t_nestdll3.def
kerneltest/e32test/bmarm/t_nestdll4.def
kerneltest/e32test/bmarm/t_nestdll5.def
kerneltest/e32test/bmarm/t_nestdll6.def
kerneltest/e32test/bmarm/t_nestdll7.def
kerneltest/e32test/bwins/t_nestdll1.def
kerneltest/e32test/bwins/t_nestdll2.def
kerneltest/e32test/bwins/t_nestdll3.def
kerneltest/e32test/bwins/t_nestdll4.def
kerneltest/e32test/bwins/t_nestdll5.def
kerneltest/e32test/bwins/t_nestdll6.def
kerneltest/e32test/bwins/t_nestdll7.def
kerneltest/e32test/bx86/t_nestdll1.def
kerneltest/e32test/bx86/t_nestdll2.def
kerneltest/e32test/bx86/t_nestdll3.def
kerneltest/e32test/bx86/t_nestdll4.def
kerneltest/e32test/bx86/t_nestdll5.def
kerneltest/e32test/bx86/t_nestdll6.def
kerneltest/e32test/bx86/t_nestdll7.def
kerneltest/e32test/device/d_lddns.cpp
kerneltest/e32test/device/t_tldd.cpp
kerneltest/e32test/dll/t_nestdll.cpp
kerneltest/e32test/dll/t_nestedload.cpp
kerneltest/e32test/dll/t_tls.cpp
kerneltest/e32test/dma/t_dma.cpp
kerneltest/e32test/eabi/t_nestdll1.def
kerneltest/e32test/eabi/t_nestdll2.def
kerneltest/e32test/eabi/t_nestdll3.def
kerneltest/e32test/eabi/t_nestdll4.def
kerneltest/e32test/eabi/t_nestdll5.def
kerneltest/e32test/eabi/t_nestdll6.def
kerneltest/e32test/eabi/t_nestdll7.def
kerneltest/e32test/group/bld.inf
kerneltest/e32test/group/d_lddns.mmp
kerneltest/e32test/group/t_entropysources.mmp
kerneltest/e32test/group/t_halnandmedia.mmp
kerneltest/e32test/group/t_nestdll1.mmp
kerneltest/e32test/group/t_nestdll2.mmp
kerneltest/e32test/group/t_nestdll3.mmp
kerneltest/e32test/group/t_nestdll4.mmp
kerneltest/e32test/group/t_nestdll5.mmp
kerneltest/e32test/group/t_nestdll6.mmp
kerneltest/e32test/group/t_nestdll7.mmp
kerneltest/e32test/group/t_nestedload.mmp
kerneltest/e32test/misc/t_destruct_slave.cpp
kerneltest/e32test/misc/testexclusions.h
kerneltest/e32test/mmu/t_sharedio.cpp
kerneltest/e32test/pccd/t_halnandmedia.cpp
kerneltest/e32test/random/t_entropysources.cpp
kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.cpp
kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h
kerneltest/e32test/rm_debug/group/t_crashmonitor_lib.mmp
kerneltest/e32test/system/t_mstim.cpp
kerneltest/e32utils/group/usbmsapp.mmp
kerneltest/f32test/group/bld.inf
kerneltest/f32test/group/t_tfsys_notify.mmp
kerneltest/f32test/server/t_filecache.cpp
kerneltest/f32test/server/t_main.cpp
kerneltest/f32test/server/t_notifier.cpp
kerneltest/f32test/server/t_notify.cpp
kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.cpp
kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.mmp
kerneltest/f32test/shostmassstorage/msman/client/msmanclient.mmp
kerneltest/f32test/shostmassstorage/msman/client/rusbhostsession.cpp
kerneltest/f32test/shostmassstorage/msman/client/rusbotgsession.cpp
kerneltest/f32test/shostmassstorage/msman/server/cusbhostserver.cpp
kerneltest/f32test/shostmassstorage/msman/server/cusbhostsession.cpp
kerneltest/f32test/shostmassstorage/msman/server/cusbotgserver.cpp
kerneltest/f32test/shostmassstorage/msman/server/cusbotgsession.cpp
kerneltest/f32test/shostmassstorage/msman/server/usbhostserver.mmp
kerneltest/f32test/shostmassstorage/msman/server/usbotgserver.mmp
kerneltest/f32test/shostmassstorage/msman/shared/debug.h
kerneltest/f32test/shostmassstorage/msman/shared/tmslog.cpp
kerneltest/f32test/shostmassstorage/msman/shared/tmslog.h
kerneltest/f32test/shostmassstorage/msman/src/cusbhost.cpp
kerneltest/f32test/shostmassstorage/msman/src/cusbhostao.cpp
kerneltest/f32test/shostmassstorage/msman/src/cusbmsmountmanager.cpp
kerneltest/f32test/shostmassstorage/msman/src/cusbotg.cpp
kerneltest/f32test/shostmassstorage/msman/src/cusbotgwatcher.cpp
kerneltest/f32test/shostmassstorage/msman/src/rextfilesystem.cpp
kerneltest/f32test/shostmassstorage/msman/test/cblockdevicetester.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msblock.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msblock.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_msbot.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msbot.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_msformat.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msformat.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_msmain.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msman.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msman.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_msrmb.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msrmb.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_mssuspend.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_mssuspend.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_msvbus.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_msvbus.mmp
kerneltest/f32test/shostmassstorage/msman/test/t_mswrpr.cpp
kerneltest/f32test/shostmassstorage/msman/test/t_mswrpr.mmp
kerneltest/f32test/shostmassstorage/msman/test/ttestutils.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cmassstoragefilesystem.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cmassstoragemountcb.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cusbmassstoragecontroller.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cusbmassstoragesession.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/drivemanager.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/drivepublisher.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/debug.h
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/msdebug.h
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/msdebug.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/cscsiserverprotocol.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/tscsiservercmds.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/tscsiserverreq.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/botcontrolinterface.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/botmscserver.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/cbulkonlytransport.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/usbtestmsclient.mmh
kerneltest/f32test/testfsys/t_tfsys_notify.cpp
kerneltest/f32test/testfsys/t_tfsys_notify.h
userlibandfileserver/domainmgr/group/bld.inf
userlibandfileserver/fileserver/automounter/misc/FS_Automounter_HowTo.doc
userlibandfileserver/fileserver/bmarm/efileu.def
userlibandfileserver/fileserver/bmarm/efsrvu.def
userlibandfileserver/fileserver/bwins/efileu.def
userlibandfileserver/fileserver/bwins/efsrvu.def
userlibandfileserver/fileserver/bx86/efileu.def
userlibandfileserver/fileserver/bx86/efsrvu.def
userlibandfileserver/fileserver/eabi/efileu.def
userlibandfileserver/fileserver/eabi/efsrvu.def
userlibandfileserver/fileserver/group/f32caps.mmh
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/f32dbg.h
userlibandfileserver/fileserver/inc/f32fsys.h
userlibandfileserver/fileserver/inc/f32notification.h
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/sfile/efile.mmh
userlibandfileserver/fileserver/sfile/sf_cache_man.cpp
userlibandfileserver/fileserver/sfile/sf_cache_man.h
userlibandfileserver/fileserver/sfile/sf_dat.cpp
userlibandfileserver/fileserver/sfile/sf_debug.cpp
userlibandfileserver/fileserver/sfile/sf_dir.cpp
userlibandfileserver/fileserver/sfile/sf_drv.cpp
userlibandfileserver/fileserver/sfile/sf_file.cpp
userlibandfileserver/fileserver/sfile/sf_file_cache.cpp
userlibandfileserver/fileserver/sfile/sf_file_cache.h
userlibandfileserver/fileserver/sfile/sf_local.cpp
userlibandfileserver/fileserver/sfile/sf_main.cpp
userlibandfileserver/fileserver/sfile/sf_mnt.cpp
userlibandfileserver/fileserver/sfile/sf_nbs.cpp
userlibandfileserver/fileserver/sfile/sf_notifier.cpp
userlibandfileserver/fileserver/sfile/sf_notifier.h
userlibandfileserver/fileserver/sfile/sf_notifier_handlers.cpp
userlibandfileserver/fileserver/sfile/sf_notify.cpp
userlibandfileserver/fileserver/sfile/sf_ops.cpp
userlibandfileserver/fileserver/sfile/sf_ops.h
userlibandfileserver/fileserver/sfile/sf_pool.cpp
userlibandfileserver/fileserver/sfile/sf_pool.h
userlibandfileserver/fileserver/sfile/sf_request.cpp
userlibandfileserver/fileserver/sfile/sf_ses.cpp
userlibandfileserver/fileserver/sfile/sf_std.h
userlibandfileserver/fileserver/sfile/sf_svr.cpp
userlibandfileserver/fileserver/sfile/sf_utl.cpp
userlibandfileserver/fileserver/sfsrv/cl_notification.cpp
userlibandfileserver/fileserver/sfsrv/cl_notification.h
userlibandfileserver/fileserver/shostmassstorage/client/debug.h
userlibandfileserver/fileserver/shostmassstorage/client/hostmsclient.mmp
userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmsdevice.cpp
userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.cpp
userlibandfileserver/fileserver/shostmassstorage/client/traces/OstTraceDefinitions.h
userlibandfileserver/fileserver/shostmassstorage/msproxy/debug.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/debug.h
userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsfactory.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/susbhomsproxy.mmp
userlibandfileserver/fileserver/shostmassstorage/msproxy/tmbr.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/tmbr.h
userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl
userlibandfileserver/fileserver/shostmassstorage/msproxy/traces/OstTraceDefinitions.h
userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevice.cpp
userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp
userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmslogicalunit.cpp
userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbmssuspendresume.cpp
userlibandfileserver/fileserver/shostmassstorage/server/controller/tlogicalunitlist.cpp
userlibandfileserver/fileserver/shostmassstorage/server/hostmsserver.mmp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/cmassstoragefsm.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/cmassstoragefsm.inl
userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiblockcmds.inl
userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiclientreq.inl
userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiprimarycmds.inl
userlibandfileserver/fileserver/shostmassstorage/server/protocol/tblocktransfer.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/tsbcclientinterface.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiblockcmds.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiclientreq.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiprimarycmds.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/tspcclientinterface.cpp
userlibandfileserver/fileserver/shostmassstorage/server/shared/debug.h
userlibandfileserver/fileserver/shostmassstorage/server/shared/msdebug.cpp
userlibandfileserver/fileserver/shostmassstorage/server/shared/msdebug.h
userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmsserver.cpp
userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp
userlibandfileserver/fileserver/shostmassstorage/server/traces/OstTraceDefinitions.h
userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp
userlibandfileserver/fileserver/shostmassstorage/server/transport/cusbifacehandler.cpp
--- a/kernel/eka/debug/crashMonitor/group/release.txt	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-# Copyright (c) 2008-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:
-# Version information for crash monitor data
-#
-
-Version 1.00.002
-=================
-(Made by XXXX XXXX XX/06/2009)
-
-1.	OliverStuart
-	1.	MINOR CHANGE: CR1970: Adding missing S60 distribution files and correcting IDs.
-	2.	MINOR CHANGE: CR1994: Updating incorrect copyright headers.
-
-Version 1.00.001
-=================
-(Made by Vino Jose 09/06/2009)
-
-1.	OliverStuart
-	1.	MINOR CHANGE: CR1970: Setting correct IDs on S60 distribution policy files.
-	2.	MINOR CHANGE: CR1994: Replacing Symbian copyright notices with SF notices.
-
-Version 1.00.000
-=================
-
-(Made by stephenroberts 17/11/2008)
-
-1. stephenroberts
-	MILESTONE: Capari,GT0441,MS3.x,DSx: PREQ1700: Extend core dump server to capture system crash data
-	Initial release of PREQ1700. The System Crash Monitor and Crash Log Walker supports the following data types:
-		TCrashOffsetsHeader version 1
-		TCrashInfoHeader version 1
-		TRawData version 1
-		TThreadData version 1
-		TThreadStack version 1
-		TRegisterValue version 1
-		TRegisterSet version 1
-		TMemoryDump version 1
-		TCodeSegmentSet version 1
-		TCodeSegment version 1
-		TCodeSegment version 1
-		TVariantSpecificData version 1
-		TRomHeaderData version 1
-		TSCMLockData version 1
-		TScmChecksum version 1
\ No newline at end of file
--- a/kernel/eka/debug/crashMonitor/group/scmkern_lib.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// Copyright (c) 2008-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/kernel/scmlib.mmh
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-TARGET		  scmkern_lib.lib
-TARGETTYPE	  klib
-
-#include "scmlib.mmh"
\ No newline at end of file
--- a/kernel/eka/debug/crashMonitor/group/scmlib.mmh	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2008-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\kernel\scmlib.mmh
-// 
-//
-
-USERINCLUDE	 ../inc
-USERINCLUDE  ../../../include/nkern
-USERINCLUDE  ../../../include/kernel
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
-#endif
-
-SOURCEPATH	  ../src
-SOURCE			scmdatatypes.cpp
-SOURCE			scmbytestreamutil.cpp
-SOURCE			crashlogwalker.cpp
-SOURCE			scmconfigitem.cpp
-SOURCE 			scmconfig.cpp
-SOURCE			scmchksum.cpp 
-SOURCE 			scmthreaddata.cpp 
-SOURCE 			scmprocessdata.cpp
-SOURCE			scmlockdata.cpp
-SOURCE			scmvariantdata.cpp
-SOURCE			scmromdata.cpp
-SOURCE			scmmulticrashinfo.cpp
--- a/kernel/eka/debug/crashMonitor/group/scmonitor.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-// Copyright (c) 1998-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/kernel/scmonitor.mmp
-// 
-//
-
-#ifdef EPOC32
-
-#define INCLUDE_EKERN_LIB 
-#include "../../../kernel/kern_int.mmh" 
-
-
-targettype			kext
-
-#ifndef SMP
- 
-//userinclude		../../../include/drivers
-//userinclude 		../../../kernel
-//userinclude 		../inc
-
-
-sourcepath 			../src/arm
-source 				cscmdatasave.cpp
-
-sourcepath			../src
-source				scmdatasave.cpp
-source 				scmonitor.cpp	
-
-library 			exmoncommon.lib
-staticlibrary 		scmkern_lib.lib
-
-
-epocallowdlldata
-
-noexportlibrary
-
-linkas				scmonitor.dll
-
-#endif 	//SMP endif
-
-#endif  //EPOC32 endif
-
-
-//#define SCM_COMM_OUTPUT	 // use this define for writing debug data to comm port
-
--- a/kernel/eka/debug/crashMonitor/group/scmusr_lib.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// Copyright (c) 2008-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/kernel/scmlib.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-TARGET		  scmusr_lib.lib
-TARGETTYPE	  lib
-
-#include "scmlib.mmh"
\ No newline at end of file
--- a/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-// 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"
-// 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:
-// some utility classes for writing data to buffer
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-#ifndef __CRASH_LOG_WALKER_H_INCLUDED__
-#define __CRASH_LOG_WALKER_H_INCLUDED__
-
-#include <e32cmn.h> 
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	
-	/**
-	 * This class provides functionality to walk through a crash log in a data buffer
-	 * ensuring it is valid and getting the information we require back
-	 */
-	class TCrashLogWalker
-		{
-	public:
-		TCrashLogWalker(TDesC8& aBuffer);
-		
-		TInt ReadLogHeader(const TInt aStartPoint);		
-		TInt GetCrashSize() const;
-		TInt GetCrashId() const;
-		const TRmdArmExcInfo& GetCrashContext() const;		
-		const TCrashInfoHeader& GetCrashHeader() const;
-		const TCrashOffsetsHeader& GetOffsetsHeader() const;
-		
-#ifndef __KERNEL_MODE__		
-		MByteStreamSerializable*  GetNextDataTypeL(TInt& aPos, SCMStructId& aId, TInt& aBufferSize);
-		TRawData* GetRawDataTypeL(TInt& aPos, TInt& aBufferSize, TDes8& aRawBuf, TInt aStartRawPosition = 0);
-#endif
-		
-		void UpdateBuffer(TDesC8& aBuffer);
-		
-	private:
-		
-		void HelpAssignRegisterToContext(const TRegisterValue& aRegVal);
-		
-	private:
-		TDesC8& iBuffer;					//buffer containing data for the log we are walking - not all of it, just the bit of interest
-		TCrashInfoHeader iCrashHeader;		//Stores the header of the log we are walking
-		TCrashOffsetsHeader iOffsets;		//Stores the offsets header of the log we are walking
-		TRmdArmExcInfo iContext;			//Stores the register context of the log we are walking
-		
-		TByteStreamReader iReader;
-		
-	private:
-		TInt VerifyHeader();
-		
-		};
-	
-	}
-
-#endif // __CRASH_LOG_WALKER_H_INCLUDED__
--- a/kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-// Copyright (c) 2008-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:
-// some utility classes for writing data to buffer
-// 
-// 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
- @internalTechnology
-*/
-#ifndef __SCMBYTESTREAMUTIL_H_
-#define __SCMBYTESTREAMUTIL_H_
-
-#include <e32cmn.h> 
-#include <e32def.h>
-#include <e32const.h>
-
-
-namespace Debug 
-	{ 
-	/**
-	 * Base class for byte stream write - simply deals with the supplied buffer & position 
-	 */
-	class TByteStreamBase
-		{
-	public:
-		TByteStreamBase(TUint8* aBuffer);
-		virtual void SetPosition(TInt aPosition);
-		virtual TInt CurrentPosition() const;
-	
-	protected:	
-		
-		/**
-		 * Pointer to the buffer we will use to write/read to 
-		 */
-		TUint8* iBuffer;
-		
-		/**
-		 * Current position in buffer
-		 */
-		TInt iPos;	
-		};
-	
-	/**
-	 * Class for reading byte stream
-	 */
-	class TByteStreamReader : public TByteStreamBase		
-		{
-	public:
-		TByteStreamReader(TUint8* aBuffer);
-		inline virtual TUint8 ReadByte();
-		inline TUint16 ReadShort();
-		inline TUint32 ReadInt();
-		inline TUint64 ReadInt64();		
-		};	
-
-	/**
-	 * Class for writing byte stream
-	 */
-	class TByteStreamWriter : public TByteStreamBase		
-		{		
-	public:
-		TByteStreamWriter(TUint8* aBuffer, TBool aPhsEnabled = ETrue);	
-		virtual void WriteByte(TUint8 aValue);
-		inline void WriteShort(TUint16 aValue);
-		inline void WriteInt(TUint32 aValue);
-		inline void WriteInt64(TUint64 aValue);
-		inline virtual void EnablePhysicalWriting();
-		inline virtual void DisablePhysicalWriting();
-		inline virtual TBool PhysicalWritingEnabled() const {return iPhysEnabled;};
-		inline TInt GetBytesWritten() const {return iBytesWritten;};	
-		void ResetBytesWritten();
-		
-	protected:
-		
-		/** 
-		 * This records whether or not physical writing via DoPhysical write from set writer
-		 */
-		TBool iPhysEnabled;
-		
-		/**
-		 * Records the number of bytes we have written to our buffer
-		 */
-		TInt iBytesWritten;
-		};	
-		
-	/**
-	 * This is the interface to write to flash
-	 */
-	class MPhysicalWriterImpl 
-		{
-		public:			
-			virtual void DoPhysicalWrite(TAny* aData,TInt aPos, TInt aLen) = 0;
-		};
-	
-	
-	/**
-	 *Class for writing byte stream via cache 
-	 */
-	class TCachedByteStreamWriter : public TByteStreamWriter		
-		{		
-	public:
-			
-		TCachedByteStreamWriter(TUint8* aCacheBuffer, TInt aCacheSize,  TBool aPhysEnabled = ETrue);
-		virtual TInt CurrentPosition() const;
-		virtual void WriteByte(TUint8 aValue);
-		virtual TInt FlushCache();
-		void SetWriterImpl(MPhysicalWriterImpl* aPhysicalWriter);
-		TInt GetCacheSize() const  {return iCacheSize; };
-		
-	protected:		
-		TInt iCacheSize;
-		TUint8* iCacheBuffer;  			
-		MPhysicalWriterImpl* iPhysicalWriter;
-		};
-	
-	/**
-	 * Serialization implementation interface
-	 */
-	class MByteStreamSerializable
-		{
-	public:
-		virtual TInt Serialize(TByteStreamWriter& aWriter) = 0;
-		virtual TInt Deserialize(TByteStreamReader& aReader) = 0;
- 		virtual TInt GetSize() const = 0;
-		};
-	}
-
-
-#include <scmbytestreamutil.inl>
-
-
-
-#endif /*BYTESTREAMUTIL_H_*/
--- a/kernel/eka/debug/crashMonitor/inc/scmbytestreamutil.inl	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-// Copyright (c) 2008-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:
-//
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without noticed. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-#include <e32des8.h>
-
-namespace Debug 
-	{
-	/**
-	 * TByteStreamReader implementation
-	 */
-	
-	/**
-	 * Returns the next byte from the stream
-	 * @return TUint8 byte requested
-	 */
-	inline TUint8 TByteStreamReader::ReadByte()
-		{
-		return iBuffer[iPos++];		
-		}
-	
-	/**
-	 * Returns the next short from the stream
-	 * @return TUint16 short requested
-	 */	
-	inline TUint16 TByteStreamReader::ReadShort()
-		{
-		TUint8 b1 = ReadByte();
-		TUint8 b2 = ReadByte();	
-		return (TUint16)(b1 + (b2 << 8));	
-		}
-		
-	/**
-	 * Returns the next TUInt32 from the stream
-	 * @return TUInt32 TUInt32 requested
-	 */		
-	inline TUint32 TByteStreamReader::ReadInt()
-		{
-		TUint16 s1 = ReadShort();
-		TUint16 s2 = ReadShort();	
-		return s1 + (s2 << 16);		
-		}
-
-	/**
-	 * Returns the next TUInt64 from the stream
-	 * @return TUInt64 TUInt64 requested
-	 */		
-	inline TUint64 TByteStreamReader::ReadInt64()
-		{
-		TUint32 high = ReadInt();
-		TUint32 low = ReadInt();
-		return  MAKE_TUINT64(high, low) ;
-		}
-	
-	/**
-	 * TByteStreamWriter implementation
-	 */	
-
-	/**
-	 * Writes a short to the stream
-	 * @param aValue Value to write to stream
-	 */	
-	inline void TByteStreamWriter::WriteShort(TUint16 aValue)
-		{
-		WriteByte((TUint8) aValue);
-		WriteByte((TUint8) (aValue >> 8));		
-		}
-	
-	/**
-	 * Writes an int to the stream
-	 * @param aValue Value to write to stream
-	 */	
-	inline void TByteStreamWriter::WriteInt(TUint32 aValue)
-		{
-		WriteByte((TUint8)aValue);
-		WriteByte((TUint8) (aValue >> 8));		
-		WriteByte((TUint8) (aValue >> 16));		
-		WriteByte((TUint8) (aValue >> 24));				
-		}
-	
-	/**
-	 * Writes a 64 bit int to the stream
-	 * @param aValue Value to write to stream
-	 */		
-	inline void TByteStreamWriter::WriteInt64(TUint64 aValue)
-		{
-		WriteInt(I64HIGH(aValue));
-		WriteInt(I64LOW(aValue));			
-		}
-	
-	/**
-	 * Enables physical writing such that the physical writers DoPhysicalWrite
-	 * method will be invoked upon a write. This may write to a given media
-	 * as defined by the implementation of this method 
-	 */		
-	inline void TByteStreamWriter::EnablePhysicalWriting()
-		{
-		iPhysEnabled = ETrue;
-		}
-
-	/**
-	 * Disables physical writing such that the physical writers DoPhysicalWrite
-	 * method will not be invoked upon a write. 
-	 */	
-	inline void TByteStreamWriter::DisablePhysicalWriting()
-		{
-		iPhysEnabled = EFalse;
-		}
-	}
-
-
-//eof
--- a/kernel/eka/debug/crashMonitor/inc/scmconfig.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-
-// Copyright (c) 2008-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:
-//
-// 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
- @internalTechnology
-*/
-#ifndef __SCMCONFIG_H_INCLUDED__
-#define __SCMCONFIG_H_INCLUDED__
-
-
-#include <e32def.h>
-
-#include <scmbytestreamutil.h>
-#include <scmconfigitem.h>
-
-namespace Debug{
-	
-	//Note -- Changing the size of this requires a change in KScmConfigMaxSize
-    _LIT8(KScmConfigHeaderString, "SCMCONFIG");
-
-    /**
-     * This class handles the configuration section of the crash partition.
-     * It is responsible for reading and writing it
-     */
-	class SCMConfiguration : public MByteStreamSerializable
-		{
-		
-		public:
-			
-			//The 9 here refers to the size of KScmConfigHeaderString which is serialised
-			static const TInt KScmConfigMaxSize = TConfigItem::ELast * sizeof(TConfigItem) + 9;
-			
-			SCMConfiguration();		
-			virtual ~SCMConfiguration();
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-		 	virtual TInt GetSize() const;
-			
-		 	TConfigItem* GetNextItem();
-			TInt SetDefaultConfig();
-						
-			TInt CreateConfigItem(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority, const TInt32 aSizeToDump);
-			TInt ModifyConfigItemPriority(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority);
-			
-			void ResetToHighestPriority();
-			
-		 	TBool operator == (const SCMConfiguration& aOther) const;
-			
-		 	TConfigItem* ConfigList() const;
-			TInt InsertToList(TConfigItem* aItem);
-			void ClearList(); 		
-		 	
-		private:	
-			
-			/**
-			 * This is an ordered linked list of TConfigItems. The first is the highest priority and so on until the lowest priority 
-			 */			
-			TConfigItem* iConfigList;
-			
-			/**
-			 * Everytime GetNextItemToDump is called this moves down along the list 
-			 */
-			TConfigItem* iNextItem;   
-			
-		private:	
-			TInt RemoveFromList(TConfigItem* aItem);
-			
-							
-		};
-	}
-
-#endif /*__SCMCONFIG_H_INCLUDED__*/
--- a/kernel/eka/debug/crashMonitor/inc/scmconfigitem.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-// Copyright (c) 2008-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:
-// some utility classes for writing data to flash buffer
-// 
-// 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
- @internalTechnology
-*/
-
-#ifndef __SCMCONFIGITEM_H_INCLUDED__
-#define __SCMCONFIGITEM_H_INCLUDED__
-
-
-#include <e32def.h>
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#endif // ! __KERNEL_MODE__
-
-#include <scmbytestreamutil.h>
-
-
-namespace Debug
-	{ 	
-	/**
-	 * This object represents a data type to dump
-	 */
-	class TConfigItem : public MByteStreamSerializable
-		{
-		public:
-			enum TSCMDataType
-				{				
-				EExceptionStacks,			/**< Dumps exception stacks */
-				EVariantSpecificData,		/**< Dumps Variant Specific data */
-				ERomInfo,					/**< Dumps ROM Build Info */
-				ELocks,						/**< Dumps Kernel Lock Info */
-				EKernelHeap,				/**< Dumps the Kernel Heap */
-				ETraceData,					/**< Dumps any trace data we find */
-				EProcessCodeSegs,			/**< Dumps System wide Code Segments for each Process */
-				EThreadsUsrStack,			/**< Dumps System wide User Stacks for each thread */
-				EThreadsSvrStack,			/**< Dumps System wide Supervisor Stacks for each thread */
-				EThreadsUsrRegisters,		/**< Dumps User Registers available for every thread in the System */
-				EThreadsSvrRegisters,		/**< Dumps Supervisor Registers available for every thread in the System */ 
-				EProcessMetaData,			/**< Dumps the Process List */
-				EThreadsMetaData,			/**< Dumps the Thread List */
-				ECrashedProcessCodeSegs,    /**< Dumps the Code Segments for the process that has crashed */
-				ECrashedProcessUsrStacks,	/**< Dumps the User stacks for each thread in the process that has crashed */
-				ECrashedProcessSvrStacks,	/**< Dumps the Supervisor stacks for each thread in the process that has crashed */
-				ECrashedProcessMetaData,	/**< Dumps Info about the process that has crashed */
-				ECrashedThreadMetaData,		/**< Dumps Info about the Thread that has crashed */				
-				ELast						/**< End Marker */
-				};
-			
-			TConfigItem();
-			TConfigItem(TSCMDataType aDataType,  TUint8 aPriority, TInt32 aSizeToDump);
-	
-			TSCMDataType GetDataType() const;
-			TInt GetPriority() const;
-			TInt GetSizeToDump() const;
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-		 	virtual TInt GetSize() const;
-		 	
-		 	void SetSpaceRequired(TUint aSpaceReq);
-		 	TUint GetSpaceRequired();
-		 	
-		 	void Print() const;
-		 	TBool operator == (const TConfigItem& aOther) const;
-		 	TConfigItem* Next() const;
-
-#ifndef __KERNEL_MODE__		 	
-		 	 static const TDesC& GetSCMConfigOptionText(TConfigItem::TSCMDataType aType);
-#endif // ! __KERNEL_MODE__
-		 	 
-		private:
-			TSCMDataType iDataType;		/** The type this data represents */
-			TUint iSizeToDump;			/** the size of the data to dump */
-			TUint iSpaceRequiredToDump;	/** If known, this will contain the size of the data we need to dump */
-			TUint8  iPriority;			/** Priority of this data (0 is not required) */
-			TConfigItem* iNext;	 		/** Next config item in list */
-			
-			friend class SCMConfiguration;
-			
-		};			
-	}
-
-
-#endif //  __SCMCONFIGITEM_H_INCLUDED__
--- a/kernel/eka/debug/crashMonitor/inc/scmdatasave.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-// Copyright (c) 2008-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\kernel\scmdatasave.h
-// Kernel System crash data save header file
-// 
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without notice. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-#ifndef SCMDATASAVE_H
-#define SCMDATASAVE_H
-
-/**
- @file
- @internalComponent
- */
-
-#include <plat_priv.h>
-#include <kernel/monitor.h>
-#include <e32des8.h>	
-#include <arm.h>
-#include <crashflash.h>
-
-#include <scmdatatypes.h>
-#include <scmbytestreamutil.h>
-#include <scmconfig.h>
-
-using namespace Debug;
-
-IMPORT_C TInt64 CrashTime();
-
-
-_LIT8(KKernelHeapChunkName, "ekern.exe::SvHeap");
-_LIT8(KKernelProcessName, "ekern.exe");
-
-
-/**
- * This class handles gathering of the kernel data and writing it to flash
- * 
- */
-class SCMDataSave : MPhysicalWriterImpl
-	{	
-	public:	
-	    enum TRegisterSetType
-	        {
-	        EUserRegisters = 0,
-	        ESupervisorRegisters = 1,
-	        EFullCPURegisters = 2,
-	        ERegSetNone = 3,
-	        ERegLast
-	        }; 
-	    
-	    enum TStackType
-	    	{
-	    	EUsrStack = 0,
-	    	ESvrStack = 1,
-	    	EStackTypeNone = 2,
-	    	EStackLast
-	    	};
-	    
-	    enum TDumpScope
-	    	{
-	    	EThreadSpecific = 0,
-	    	EProcessSpecific = 1,
-	    	ESystemWide = 2,
-	    	EDumpLast
-	    	};
-	    
-	    /**
-	     * This structure defines the type of data we wish to dump for a given kernel object
-	     */
-	    struct TDataToDump
-	    	{
-	    	TBool iMetaData;   		/**< Dump meta data about object */
-	    	TBool iCodeSegs;   		/**< Dump DProcess code segs (ignored for other objects) */
-	    	TStackType iStk;   		/**< Dump this stack type */
-	    	TRegisterSetType iReg;  /**< Dump this register set */
-	    		    	
-	    	TDataToDump()
-	    		{
-	    		//upon construction, nothing is set to be dumped
-	    		iMetaData = EFalse;
-	    		iCodeSegs = EFalse;
-	    		iStk = EStackTypeNone;
-	    		iReg = ERegSetNone;
-	    		}
-	    	
-	    	};
-	    
-		enum TWriteSelect
-			{ 
-			EWriteFlash = 0, /**< write data to flash */
-			EWriteComm =1,   /**< write data to comm port */
-			ELast
-			};
-    
-	public:
-		
-		IMPORT_C SCMDataSave(Monitor* aMonitor, CrashFlash* aFlash);
-		virtual ~SCMDataSave();
-
-		
-		TInt LogCrashHeader(const TDesC8& aCategory, TInt aReason, TInt aCrashId, TUint& aSizeDumped);
-		TInt LogThreadData(DThread* aThread, TUint& aSizeDumped);
-		TInt LogProcessData(DProcess* aProcess, TUint& aSizeDumped);
-		TInt LogCodeSegments(DProcess* aProcess, TUint& aSizeDumped);
-				
-		TInt LogThreadUserStack(DThread* aThread, TBool aFullStack, TUint& aSizeDumped);
-		TInt LogThreadSupervisorStack(DThread* aThread, TBool aFullStack, TUint& aSizeDumped);		
-						
-		TInt LogRegisters(DThread* aThread, const TRegisterSetType& aRegType, TUint& aSizeDumped);	
-		TInt LogCPURegisters(TUint& aSizeDumped);
-		TInt ReadUserRegisters(DThread* aThread, TArmRegSet& aRegs, TUint32& aAvailableRegs);
-		TInt ReadSystemRegisters(DThread* aThread, TArmRegSet& aRegs, TUint32& aAvailableRegs);
-		void ReadCPURegisters(SFullArmRegSet& aRegs);
-		
-		TInt LogMemory(const TUint8* aStartAddress, TInt aLength, const DThread* aThread, TUint& aSizeDumped);	
-		TInt LogExceptionStacks(TUint& aSizeDumped);	
-		TInt LogTraceBuffer(TInt aSizeToDump, TUint& aSizeDumped);
-		TInt LogLocks(TUint& aSizeDumped);		
-		TInt LogRawData(const TDesC8& aData, TUint& aSizeDumped);
-		TInt LogVariantSpecificData(TUint& aSizeDumped);
-		TInt LogRomInfo(TUint& aSizeDumped);
-		
-		TInt LogKernelHeap(TUint& aSizeDumped);		
-		TInt FindKernelHeap(TInt32& aHeapLocation, TInt32& aHeapSize);
-		
-		TInt LogConfig(SCMConfiguration& aConfig);
-		TInt ReadConfig(SCMConfiguration& aScmConfig);
-		
-		
-		void Write(const TAny* aSomething, TInt aSize);
-		static void WriteUart(const TUint8* aData, TInt aSize);			
-		static void WriteUart(const TDesC8& aDes);
-		virtual void DoPhysicalWrite(TAny* aData, TInt aPos, TInt aLen);
-				
-		void WriteCrashFlash(TInt aPos, TInt& aSize, const TDesC8& aBuffer);
-				
-		TInt GetRegisterType(const TRegisterSetType& aSetType, TInt32& aRegNumber, TUint32& aRegisterType);
-		TInt GetByteCount();
-		void SetByteCount(TInt aByte);
-		
-		
-		TWriteSelect GetWriteSelect();
-		void SetWriteSelect(TWriteSelect aWriteSelect);
-	
-		TUint SpaceRemaining();
-		TUint MaxLogSize();
-		
-		void SetCrashStartingPoint(TUint32 aStart);
-		TUint32 GetCrashStartingPoint() {return iStartingPointForCrash;}
-		
-	public:
-		
-		/** Offsets header to assist parsing */		
-		TCrashOffsetsHeader 	iHdr;		  	
-		
-		/** Basic crash info */
-		TCrashInfoHeader		iCrashInf;   	
-		
-		/** Writer for physical writing */
-		TCachedByteStreamWriter* iWriter;		
-		
-	private:				
-		Monitor* iMonitor; //need to use this to map memory and things like that
-		CrashFlash* iFlash;
-		TTraceDump iTrace;
-		
-		TInt iByteCount;
-		
-		//This is a pointer to memory on the heap we can use that is the same size as iFlash.GetFlashBlockSize()
-		HBuf8* iFlashCache;
-				
-		TWriteSelect iWriteSelect;
-		TBool iPerformChecksum;
-		TScmChecksum iChecksum;	
-
-		TUint32 iStartingPointForCrash;	
-	};
-
-#endif /*SCMDATASAVE_H*/
--- a/kernel/eka/debug/crashMonitor/inc/scmdatatypes.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,804 +0,0 @@
-// Copyright (c) 2008-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:
-// Definitions for the data types the SCM stores to flash
-// 
-// WARNING: This file contains some APIs which are internal and are subject
-//          to change without notice. Such APIs should therefore not be used
-//          outside the Kernel and Hardware Services package.
-//
-
-
-#ifndef __SCMDATATYPES_H_INCLUDED__
-#define __SCMDATATYPES_H_INCLUDED__
-
-
-#include <e32rom.h>
-
-#include <scmbytestreamutil.h>
-#include <scmtrace.h>
-
-/**
- @file
- @internalComponent
- */
-
-namespace Debug 
-{
-	/** SCM Data Types Major Number */
-	static const TInt KSCMDataTypesMajorVersion = 1;
-	
-	/** SCM Data Types Minor Number */
-	static const TInt KSCMDataTypesMinorVersion = 0;
-	
-	/** SCM Data Types Build Number */
-	static const TInt KSCMDataTypesBuildNumber = 0;
-
-	/**
-	  Specifies the type of a code segment.
-	  @see TCodeSegListEntry
-	  */
-	enum TCodeSegType
-	    {
-	    EUnknownCodeSegType = 0, /**< Signifies an unknown code segment type. */
-	    EExeCodeSegType = 1,     /**< Signifies a code segment belonging to an executable. */
-	    EDllCodeSegType = 2      /**< Signifies a code segment belonging to a library. */
-	    };
-	
-	
-	/**
-	  Used for storing the contents of a 32 bit register
-	  */
-	typedef TUint32 TRegisterValue32;
-	
-	/**
-	  Structure containing information about the state of the registers when a
-	  hardware exception occurred
-	  */
-	class TRmdArmExcInfo
-	    {
-	public:
-	    /** Enumeration detailing the types of exception which may occur. */
-	    enum TExceptionType
-	        {
-	        /** Enumerator signifying that a prefetch abort error has occurred. */
-	        EPrefetchAbort = 0,
-	        /** Enumerator signifying that a data abort error has occurred. */
-	        EDataAbort = 1,
-	        /** Enumerator signifying that an undefined instruction error has occurred. */
-	        EUndef =2
-	        };
-
-	    /** Value of CPSR. */
-	    TRegisterValue32 iCpsr;
-	    /** Type of exception which has occurred. */
-	    TExceptionType iExcCode;
-	    /** Value of R13 supervisor mode banked register. */
-	    TRegisterValue32 iR13Svc;
-	    /** Value of user mode register R4. */
-	    TRegisterValue32 iR4;
-	    /** Value of user mode register R5. */
-	    TRegisterValue32 iR5;
-	    /** Value of user mode register R6. */
-	    TRegisterValue32 iR6;
-	    /** Value of user mode register R7. */
-	    TRegisterValue32 iR7;
-	    /** Value of user mode register R8. */
-	    TRegisterValue32 iR8;
-	    /** Value of user mode register R9. */
-	    TRegisterValue32 iR9;
-	    /** Value of user mode register R10. */
-	    TRegisterValue32 iR10;
-	    /** Value of user mode register R11. */
-	    TRegisterValue32 iR11;
-	    /** Value of R14 supervisor mode banked register. */
-	    TRegisterValue32 iR14Svc;
-	    /** Address which caused exception (System Control Coprocessor Fault Address Register) */
-	    TRegisterValue32 iFaultAddress;
-	    /** Value of System Control Coprocessor Fault Status Register. */
-	    TRegisterValue32 iFaultStatus;
-	    /** Value of SPSR supervisor mode banked register. */
-	    TRegisterValue32 iSpsrSvc;
-	    /** Value of user mode register R13. */
-	    TRegisterValue32 iR13;
-	    /** Value of user mode register R14. */
-	    TRegisterValue32 iR14;
-	    /** Value of user mode register R0. */
-	    TRegisterValue32 iR0;
-	    /** Value of user mode register R1. */
-	    TRegisterValue32 iR1;
-	    /** Value of user mode register R2. */
-	    TRegisterValue32 iR2;
-	    /** Value of user mode register R3. */
-	    TRegisterValue32 iR3;
-	    /** Value of user mode register R12. */
-	    TRegisterValue32 iR12;
-	    /** Value of user mode register R15, points to instruction which caused exception. */
-	    TRegisterValue32 iR15;
-	    };
-	/**
-	 * This enum defines the type of struct we are dealing with when we
-	 * are serialising/deserialising
-	 */
-	enum SCMStructId
-		{
-		ESCMFirst,		
-		ESCMOffsetsHeader,
-		ESCMTCrashInfo,
-		ESCMProcessData,
-		ESCMThreadData,
-		ESCMThreadStack,
-		ESCMRegisterValue,
-		ESCMRegisterSet,
-		ESCMMemory,
-		ESCMCodeSegSet,
-		ESCMCodeSeg,
-		ESCMRawData,
-		ESCMTraceData,
-		ESCMLocks,
-		ESCMKernelHeap,
-		ESCMVariantData,
-		ESCMRomHeader,
-		ESCMLast
-		};
-
-	/**
-	 * This class represents the header at the start of a crash log
-	 * describing the size of the crash log and minimal location 
-	 * information
-	 */
-	class TCrashOffsetsHeader : public MByteStreamSerializable
-		{
-		public:
-			
-			static const TInt KSCMCrashOffsetsMaxSize = 20 * sizeof(TUint32) + sizeof(TUint16);
-			
-			enum TCrashHeaderVersion 
-				{ 
-				EChVersion1 = 1 
-				};
-			
-			TCrashOffsetsHeader();
-			
-			//From MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			TBool operator == (const TCrashOffsetsHeader& aOther) const;
-				
-			SCMStructId iId;
-			TCrashHeaderVersion iVersion;		
-			
-			//These next members are offsets to the crash data in the log
-			TUint32 iCTFullRegOffset; 
-			TUint32 iCTUsrStkOffset;
-			TUint32 iCTSvrStkOffset;
-			TUint32 iCPMetaOffset;
-			TUint32 iCTMetaOffset;		
-			TUint32 iCPCodeSegOffset;
-			TUint32 iSysUsrStkOffset;
-			TUint32 iSysSvrStkOffset;
-			TUint32 iSysUsrRegOffset;
-			TUint32 iSysSvrRegOffset;
-			TUint32 iTLstOffset;
-			TUint32 iPLstOffset;
-			TUint32 iSysCodeSegOffset;
-			TUint32 iExcStkOffset;
-			TUint32 iTraceOffset;
-			TUint32 iScmLocksOffset;
-			TUint32 iKernelHeapOffset;
-			TUint32 iVarSpecInfOffset;
-			TUint32 iRomInfoOffset;
-			
-			TUint32 iSpare1;
-			TUint32 iSpare2;
-			TUint32 iSpare3;
-			TUint32 iSpare4;
-			TUint32 iSpare5;
-			TUint32 iSpare6;				
-			
-		};
-
-	/**
-	 * This class stores meta data for a given crash
-	 */
-	class TCrashInfoHeader : public MByteStreamSerializable
-		{
-		public:				
-			
-			static const TInt KMaxCatSize = 80;
-			static const TInt KSCMCrashInfoMaxSize = 76 + KMaxCatSize;
-			
-			enum TCrashInfoHeaderVersion { ECiVersion1 = 1 };
-			TCrashInfoHeader();
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			TBool operator == (const TCrashInfoHeader& aOther) const;	
-		
-			
-			SCMStructId iId;
-			TCrashInfoHeaderVersion iVersion;
-			TInt32 iLogSize;	
-			TInt32 iFlashAlign;
-			TInt32 iCachedWriterSize;
-			TUint64 iPid;
-			TUint64 iTid;
-			TInt32 iExitType;
-			TInt32 iExitReason;	
-			TInt32 iExcCode;
-			TInt64 iCrashTime;	
-			TInt32 iCrashId;
-			TInt32 iFlashBlockSize;
-			TInt32 iFlashPartitionSize;			
-			TVersion iSCMDataTypesVersion;
-			TUint32 iCategorySize;
-			TBuf8<KMaxCatSize> iCategory;	
-			
-			TInt32 iSpare1;
-			TInt32 iSpare2;
-		};
-	
-	/**
-	 * This class is used for a raw memory dump. It will always be preceded by a TMemoryDump.
-	 * 
-	 * Note: This class contains a TPtr8 to store the data
-	 * name. Due to us not being able to allocate memory when the system
-	 * is down, we assume that the memory to which this points is owned 
-	 * by someone else. It is constructed to point to NULL. To make use
-	 * of this, before serialising the data, ensure to set it to point to
-	 * the location required. Equally, when derserialising, ensure to allocate
-	 * a descriptor of required bytes (determined from TMemoryDump) and set it to iData, otherwise
-	 * the name will be ignored upon reading. 
-	 */
-	class TRawData : public MByteStreamSerializable
-		{		
-		public:
-			
-			//Note this doesnt include the data, as this number is not determinable
-			static const TInt KSCMRawDataMaxSize = 2 * sizeof(TUint32) + sizeof(TUint16);    
-			
-			enum TTRawDataVersion { ETRawData1 = 1 };
-			TRawData();
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			TInt Deserialize(TInt aStartPos, TByteStreamReader& aReader);
-		
-			SCMStructId iId;
-			TTRawDataVersion iVersion;
-			
-			TInt32 iLength;
-			TPtr8 iData;
-		
-		};
-		
-	/**
-	 * This class stores meta data for a given process
-	 */
-	class TProcessData : public MByteStreamSerializable
-		{
-		public:
-			
-			static const TInt KSCMProcessDataMaxSize = sizeof(TUint16) + sizeof(TUint64) + 2 * sizeof(TUint32) + KMaxProcessName;
-			
-			enum TProcessDataVersion { EProcData1 = 1 };
-			TProcessData();
-						
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;
-			TProcessDataVersion iVersion;				
-					
-			TUint64 iPid;			
-			TUint32 iNamesize; //Length of process filename in bytes
-			TInt32 iPriority;
-			
-			TBuf8<KMaxProcessName> iName;
-			
-			TInt32 iSpare1;
-			TInt32 iSpare2;	
-			TInt32 iSpare3;	
-		};
-	
-	/**
-	 * This class stores meta data for a given thread
-	 */
-	class TThreadData : public MByteStreamSerializable
-		{
-		public:
-			
-			static const TInt KMaxThreadName = KMaxProcessName;					
-			static const TInt KSCMThreadDataMaxSize = sizeof(TUint32) + sizeof(TUint16) + 11 * sizeof(TUint32) + 2 * sizeof(TUint64) + KMaxThreadName;
-			
-			enum TThreadDataVersion { EThreadData1 = 1 };
-			TThreadData();
-						
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;
-			TInt32 iVersion;
-			TInt32 iPriority;
-			TUint64 iTid;
-			TUint64 iOwnerId;
-			TInt32 iSvcSP;
-			TInt32 iSvcStack;
-			TInt32 iSvcStacksize;
-			TInt32 iUsrSP;
-			TInt32 iUsrStack;
-			TInt32 iUsrStacksize;
-			TUint32 iNamesize;
-			TUint32 iLastCpu;
-			TInt32 iSvcHeap;
-			TInt32 iSvcHeapSize;
-			
-			TBuf8<KMaxThreadName> iName;
-			
-			TInt32 iSpare1;
-			TInt32 iSpare2;		
-		};
-	
-	/**
-	 * This class stores the stack for a given thread. The type (user or supervisor) is given
-	 * by iStackType. It will be followed by a TMemoryDump containing the stack
-	 */
-	class TThreadStack : public MByteStreamSerializable	
-		{
-		public:
-						
-			static const TInt KSCMThreadStackMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint32) + sizeof(TUint64);
-			
-			enum TThreadStackVersion { EStackVersion1 = 1 };
-			
-			enum TThreadStackType
-				{
-				EUsrStack,
-				ESvrStack,
-				EIRQStack,
-				EFIQStack,
-				ELast
-				};
-			
-			TThreadStack();
-						
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const; 
-			
-			SCMStructId iId;
-			TThreadStackVersion iVersion;
-			TThreadStackType iStackType; 
-			TUint64 iThreadId;				
-			TUint32 iStackSize;
-			
-			TInt32 iSpare1;
-			TInt32 iSpare2;
-		};
-	
-	/**
-	 * Stores the value of a given register and tells you its type
-	 */
-	class TRegisterValue : public MByteStreamSerializable 
-		{
-		public:
-			
-			static const TInt KSCMRegisterValueMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint8) + sizeof(TUint16) + sizeof(TUint32) + 2 * sizeof(TUint64);
-			
-			TRegisterValue();
-			
-			enum TRegisterValueVersion { ERegisterValueVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;
-			TRegisterValueVersion iVersion;		
-			TInt64 iOwnId;  
-			
-	        /** 
-	         * Same as Sym32_reginfod::rd_id
-	         *  if rid_class == ESYM_REG_CORE
-	         *  	rd_id is one of rm_debug_api.h::TFunctionalityRegister
-	         *	else
-	         *		rd_id is CoProcessor number, eg 15 for ARM CP15  
-	         */	           	      	     	       
-			TUint32 iType;
-			
-			TUint8 iClass; //Same as Sym32_reginfod::rid_class
-			TUint16	iSubId; //used for coprocessors
-			
-			/** 
-			 * Same as Sym32_reginfod::rd_repre
-			 * 		ESYM_REG_8 == 0, 
-			 * 		ESYM_REG_16 == 1, 
-			 * 		ESYM_REG_32 == 2, 
-			 * 		ESYM_REG_64 == 3 
-			 */				
-			TUint8	iSize; //register size
-			
-			// Register value			   
-			union
-			{
-				// Value of an 8 bit register 
-				TUint8		iValue8;
-	
-				// Value of a 16 bit register  
-				TUint16		iValue16;
-	
-				// Value of a 32 bit register 
-				TUint32		iValue32;
-	
-				// Value of a 64 bit register 
-				TUint64		iValue64;
-			};
-		
-
-		};
-	
-	/**
-	 * This class is a header for our register set. 
-	 */
-	class TRegisterSet : public MByteStreamSerializable	
-		{
-		public:
-			
-			static const TInt KSCMRegisterSetMaxSize = sizeof(TUint32) + sizeof(TUint16) + sizeof(TUint32);
-			
-			TRegisterSet();
-			
-			enum TRegisterSetVersion { ETRegisterSetVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			TRegisterSetVersion iVersion;
-			SCMStructId iId;
-			TInt32 iNumRegisters;
-		};
-	
-	/**
-	 * This class describes a memory dump and will be followed by a TRawData 
-	 */
-	class TMemoryDump : public MByteStreamSerializable
-		{
-		public:			
-						
-			static const TInt KSCMMemDumpMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint32) + sizeof(TUint64);
-			
-			enum TMemDumpVersionVersion {	EMemDumpVersion1 = 1	};
-			
-			TMemoryDump();
-			
-			//From MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;	
-			TMemDumpVersionVersion iVersion; 
-			TUint32 iStartAddress;
-			
-			TInt64 iPid;			
-			TInt32 iLength;
-		};
-		
-	/**
-	 * class to represent a set of code segs corrosponding to a given process
-	 */
-	class TCodeSegmentSet : public MByteStreamSerializable
-		{
-		public:
-			
-			static const TInt KSCMCodeSegSetMaxSize = KMaxProcessName;
-			
-			TCodeSegmentSet();
-			
-			enum TCodeSegmentSetVersion { ETCodeSegmentSetVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;		
-		
-			TInt GetMaxSize() const;
-			
-			SCMStructId iId;								/**< Id that uniquely identifies this data */
-			TCodeSegmentSetVersion iVersion;		/**< Version of this data */
-			TInt32 iNumSegs;   						/**< The number of code segments following this struct that relate to this process ID */			
-			TInt64 iPid;							/**< Process Id that owns the following code segments */		
-		};
-	
-	/**
-	 * class to represent a code segment in the SCM Log
-	 */
-	class TCodeSegment : public MByteStreamSerializable
-		{
-		public:			
-			
-			static const TInt KMaxSegmentNameSize = KMaxProcessName;
-			
-			//50 is the sum of the size of members that get serialised
-			static const TInt KSCMCodeSegMaxSize = 50 + KMaxSegmentNameSize;
-			
-			TCodeSegment();
-			
-			enum TCodeSegmentVersion { ETCodeSegmentVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;	
-			
-			TInt GetMaxSize() const;			
-		
-			SCMStructId iId;								/**< Id that uniquely identifies this data */
-			TCodeSegmentVersion iVersion;			/**< Version of this data */		
-			TCodeSegType iCodeSegType;				/**< @see TCodeSegType */
-			TModuleMemoryInfo iCodeSegMemInfo;      /**< holds the memory info for this code segment (8 TUint32's)*/			
-			TBool  iXip;							/**< If this code segment is XIP */
-			TInt32 iNameLength;						/**< Length of the name of this code segment name */		
-			TBuf8<KMaxSegmentNameSize> iName;				/**< Name of this code segment */
-		
-		};
-	
-	/**
-	 * This class represents a trace dump in the crash log. It will be immediately followed
-	 * in the crash log by a TRawData structure
-	 */
-	class TTraceDump : public MByteStreamSerializable
-		{
-		public:
-					
-			static const TInt KSCMTraceDumpMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint32);
-			
-			TTraceDump();
-			
-			enum TTraceDumpVersion { ETraceDumpVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;						/**< Id that uniquely identifies this data */
-			TTraceDumpVersion iVersion;		/**< Version of this data */	
-			TInt32 iSizeOfMemory;			/**< Size of the trace data that will be dumped in the following Memory Dump */
-			TInt32 iNumberOfParts;			/**< Number of TRawData structs that will follow */
-			
-		};
-
-	/**
-	 * This represents variant specific data in the crash log. It will be followed
-	 * immediately by a TRawData that contains the data
-	 */
-	class TVariantSpecificData : public MByteStreamSerializable
-		{
-		public:
-			
-			//sizeof(TUint32) + sizeof(TUint16) + sizeof(TUint32)
-			static const TInt KSCMVarSpecMaxSize = 10;
-			
-			TVariantSpecificData();
-			
-			enum TVariantSpecificDataVersion { EVariantSpecificDataVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;						/**< Id that uniquely identifies this data */
-			TVariantSpecificDataVersion iVersion;		/**< Version of this data */
-			TUint32 iSize;				/**< Size of the raw data (ie the var spec info) that will follow */
-		};
-	
-	/**
-	 * This represents the Rom Header Data in the crash Log
-	 */
-	class TRomHeaderData : public MByteStreamSerializable
-		{
-		public:
-						
-			static const TInt KSCMRomHdrMaxSize = sizeof(TUint32) + sizeof(TUint16) + sizeof(TUint64) + 2 * sizeof(TUint8) +sizeof(TUint16);
-			
-			TRomHeaderData();
-			
-			enum TRomHeaderDataVersion { ERomHeaderDataVersion1 = 1 };
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);
-			virtual TInt GetSize() const;
-			
-			SCMStructId iId;							/**< Id that uniquely identifies this data */
-			TRomHeaderDataVersion iVersion;			/**< Version of this data */
-			TUint8 iMajorVersion;					/**< Major Version of ROM build */
-			TUint8 iMinorVersion;					/**< Minor Version of ROM build */			
-			TUint16 iBuildNumber;					/**< ROM build number */
-			TUint64 iTime;							/**< Build time of ROM in miliseconds */
-		};	
-
-	/**
-	 * This represents the kernel lock info in the crash log
-	 */
-	class TSCMLockData : public MByteStreamSerializable
-		{
-		public:
-			
-			static const TInt KSCMLockDataMaxSize = sizeof(TUint32) + 3 * sizeof(TUint16);
-			
-			TSCMLockData();
-			
-			// from MByteStreamSerializable
-			virtual TInt Serialize(TByteStreamWriter& aWriter);
-			virtual TInt Deserialize(TByteStreamReader& aReader);			
-			virtual TInt GetSize() const;
-						
-			TInt MutexHoldCount() const;
-			void SetMutexHoldCount(TInt aMutexHoldCount);
-			
-			TInt MutexThreadWaitCount() const;			
-			void SetMutexThreadWaitCount(TInt aMutexThreadWaitCount);
-			
-			TInt LockCount() const;
-			void SetLockCount(TInt aLockCount);
-			
-			TBool operator == (const TSCMLockData& aOther) const;
-			TBool operator != (const TSCMLockData& aOther) const;				
-
-		private:		
-			SCMStructId iId;  
-			TInt iMutexHoldCount;			// if mutex is valid number of holds on the mutex from current thread
-			TInt iMutexThreadWaitCount;		// if mutex is valid number of threads waiting on the mutex
-			TInt iLockCount; 	
-			
-		};
-		
-	/**
-	 * TScmChecksum class is used to provide a level of sanity checking for the data it processes
-	 * the check sum produced is not intended to be computationally unique
-	 * This implementation has been chosen as there are restrictions in the data may only be available 
-	 * in small chunks and the entire data may not be unable to be read (ie comm port implementation)
-	 * These restrictions rule out the use of more sophisticated checksums that produce a checksum value for 
-	 * an entire block of data 
-	 */
-	class TScmChecksum : MByteStreamSerializable
-		{
-	public:
-		TScmChecksum();
-		
-		void ChecksumBlock(const TUint8* aData, TUint aLen);
-		void ChecksumBlock(const TDesC8& aDes);		
-		TBool operator == (const TScmChecksum& aOther) const;
-		TBool operator != (const TScmChecksum& aOther) const;
-		void Reset();
-		
-		// from MByteStreamSerializable
-		TInt Serialize(TByteStreamWriter& aWriter);
-		TInt Deserialize(TByteStreamReader& aReader);
-	 	TInt GetSize() const;
-		
-	private:
-		/** Total length of all data in bytes*/
-		TUint32 iLength;	
-		/** Sum of all bytes*/
-		TUint32 iSum;
-		/** Count of Bytes with value 0*/
-		TUint32 iZeroCount;
-		
-		};
-	
-	/** class to describe a flash block */
-	class SCMCrashBlockEntry
-		{
-	public:
-		
-		SCMCrashBlockEntry()
-			: iBlockNumber(0)
-			, iBlockOffset(0)
-			, iBlockSize(0) 
-			, iNext(NULL)
-			{
-		
-			}
-		
-		SCMCrashBlockEntry(TInt aBlockNumber, TInt aBlockOffset, TInt aBlockSize)
-			: iBlockNumber(aBlockNumber)
-			, iBlockOffset(aBlockOffset)
-			, iBlockSize(aBlockSize) 
-			, iNext(NULL)
-			{
-		
-			}
-
-		/** The offset in bytes to this block from start of flash*/
-		TInt iBlockNumber;
-		/** The offset in bytes to this block from start of flash*/
-		TInt iBlockOffset;
-		/** the size of the flash block in bytes */
-		TInt iBlockSize;	
-		/** pointer to next in list*/
-		SCMCrashBlockEntry* iNext;
-		
-		};
-
-	/** Because of limitations in flash memory driver available to the 
-	 *  system crash monitor - this class is used to describe the locations
-	 *  on flash where crashes will be stored
-	 *  we store 1 crash per block of flash ! This eliminates the 
-	 *  need to for the scmonitor to hold memory required for bufering write data to flash
-	 * 	class used to describe locations (typically in flash) 
-	 * 	where
-	 * 	holds a linked list of SCMCrashBlockEntry which describe an area we can write to
-	 */
-	class SCMMultiCrashInfo
-		{
-	public:
-
-		/** constructor */
-		SCMMultiCrashInfo();
-		
-		/** destructor */
-		~SCMMultiCrashInfo();
-		
-		/** add a pointer to a block to the list - takes ownership of block */ 
-		void AddBlock(SCMCrashBlockEntry* aBlockEntry);
-		
-		/** GetNextBlock returns NULL when no more blocks */
-		SCMCrashBlockEntry* GetNextBlock();
-		
-		/** sets current block to first in list */
-		void Reset();
-		
-		/** clear all entries in the list */
-		void ClearList();
-		
-		
-	private:
-		SCMCrashBlockEntry* iFirstBlock; 
-		SCMCrashBlockEntry* iCurrentBlock;
-		TInt iSpare;
-		};
-	
-	/**
-	 * This constant gives us the maximum size of the Core Crash Header which consists of the Crash Info, the Offsets
-	 * Header and the Core Registers
-	 */
-	static const TInt KMaxCoreHeaderSize = TCrashInfoHeader::KSCMCrashInfoMaxSize 					//Crash Info - always there
-										+ TCrashOffsetsHeader::KSCMCrashOffsetsMaxSize				//offsets header - optional
-										+ TRegisterSet::KSCMRegisterSetMaxSize					//The crash context - always there
-										+ TRegisterValue::KSCMRegisterValueMaxSize * 37;			//could be up to 37 register values
-
-	}
-
-#endif		//__SCMDATATYPES_H_INCLUDED__
-
-//eof scmdatatypes.h
--- a/kernel/eka/debug/crashMonitor/inc/scmonitor.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-// Copyright (c) 2008-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\kernel\scmonitor.h
-// Kernel System crash monitor header file
-// 
-// 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
- @internalComponent
-*/
-
-#ifndef __SCMONITOR_H__
-#define __SCMONITOR_H__
-
-#include <plat_priv.h>
-#include <kernel/monitor.h>
-#include <e32des8.h>	
-#include <arm.h>
-#include <variant_norflash_layout.h>
-
-#include <scmdatatypes.h>
-#include <scmbytestreamutil.h>
-#include <scmconfig.h>
-#include <scmdatasave.h>
-
-using namespace Debug;
-
-class CrashFlash;
-
-const TInt KFlashAlignment = sizeof(TInt32);
-
-const TInt KFlashEraseAttempts = 10;
-/**
- * System crash monitor responsible for writing crash data to flash in 
- * the event of a crash
- */
-class SCMonitor: public Monitor
-	{
-	public:
-		SCMonitor();	
-		~SCMonitor();
-		
-		virtual void Print(const TDesC8& aDes);				
-		virtual TInt Init2(TAny* aCategory, TInt aReason);
-	
-		void VariantInit();
-		TInt InitFlash();
-		
-		void StableConstruction(); 		
-		
-	public:		
-		CrashFlash* iFlash;		
-			
-	protected:	
-		void DumpVariantSpecific();
-	
-		enum TSysCrashLogState
-			{
-			EUndefined = 0
-			};
-		
-		
-	private:	
-		TInt ProcessCrash(const SCMCrashBlockEntry& aBlockEntry, const TUint aCrashId, TBool aCommit);
-		TInt LogProcessMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const;
-		TInt LogThreadMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const;
-		TInt LogObjectContainers(TObjectType aObjectType, SCMDataSave::TDumpScope aDumpScope, const SCMDataSave::TDataToDump& aDataToDump, TUint& aSizeDumped) const;
-		TInt GetNextCrashStartPoint(SCMCrashBlockEntry& aBlockEntry);
-		void DoCrash(TAny* aCategory, TInt aReason);
-		
-	private:
-		TInt HelpDumpStacks(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped, SCMDataSave::TStackType aStkType) const;
-		TInt HelpDumpMetaData(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped) const;
-		TInt EraseFlashBlock(const SCMCrashBlockEntry& aBlock);
-		TInt EraseEntireFlashPartition();
-		
-	private:		
-		SCMDataSave* iDataSave;
-		Debug::SCMConfiguration* iScmConfig;
-		SCMMultiCrashInfo* iMultiCrashInfo;
-	};
-
-
-	
-#endif //__SCMONITOR_H__
-//EOF scmonitor.h
--- a/kernel/eka/debug/crashMonitor/inc/scmtrace.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2008-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:
-// scmdatatypes.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.
-//
-
-
-#ifndef __SCMTRACE_H_INCLUDED__
-#define __SCMTRACE_H_INCLUDED__
-
-#ifdef _DEBUG	
-	#define __SCMFUNCTIONLOGGING __PRETTY_FUNCTION__ 
-#else
-	#define __SCMFUNCTIONLOGGING ""
-#endif
-
-// logger macro
-#ifdef __KERNEL_MODE__
-
-#include <kernel/kernel.h>
-#include <nk_trace.h>
-
-#define LOG_CONTEXT //__KTRACE_OPT(KALWAYS, Kern::Printf("Context --> <%s>", __SCMFUNCTIONLOGGING));
-#define CLTRACE(s) __KTRACE_OPT(KDEBUGGER, Kern::Printf(s));
-#define CLTRACE1(s, p1) __KTRACE_OPT(KDEBUGGER, Kern::Printf(s, p1));
-#define CLTRACE2(s, p1, p2)  __KTRACE_OPT(KDEBUGGER, Kern::Printf(s, p1, p2));
-#define CLTRACE3(s, p1, p2, p3) __KTRACE_OPT(KDEBUGGER, Kern::Printf(s, p1, p2, p3));
-#define CLTRACE4(s, p1, p2, p3, p4) __KTRACE_OPT(KDEBUGGER, Kern::Printf(s, p1, p2, p3, p4));
-#define CLTRACE5(s, p1, p2, p3, p4, p5) __KTRACE_OPT(KDEBUGGER, Kern::Printf(s, p1, p2, p3, p4, p5));
-
-#else
-
-#include <e32debug.h>
-
-#define LOG_CONTEXT RDebug::Printf("Context --> <%s>", __SCMFUNCTIONLOGGING);
-#define CLTRACE(s)  RDebug::Printf(s) ;
-#define CLTRACE1(s, p1) RDebug::Printf(s, p1) ;
-#define CLTRACE2(s, p1, p2) RDebug::Printf(s, p1, p2) ;
-#define CLTRACE3(s, p1, p2, p3) RDebug::Printf(s, p1, p2, p3);
-#define CLTRACE4(s, p1, p2, p3, p4) RDebug::Printf(s, p1, p2, p3, p4);
-#define CLTRACE5(s, p1, p2, p3, p4, p5) RDebug::Printf(s, p1, p2, p3, p4, p5);
-
-
-#endif
-
-
-#endif /*__SCMTRACE_H_INCLUDED__*/
--- a/kernel/eka/debug/crashMonitor/src/arm/cscmdatasave.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-// Copyright (c) 2008-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\kernel\arm\cscmdatasave.cpp
-// SCM - Arm portion
-// 
-//
-
-#define __INCLUDE_REG_OFFSETS__  // for SP_R13U in nk_plat.h
-
-
-#include "arm_mem.h"
-#include "nk_plat.h"
-#include <scmdatatypes.h>
-#include <scmdatasave.h>
-
-
-/**
- * Reads the CPU registers at the time of the crash
- * @param aRegs struct to store the resulting CPU registers
- */
-void SCMDataSave::ReadCPURegisters(SFullArmRegSet& aRegs)
-	{
-	aRegs =*(SFullArmRegSet*)iMonitor->iRegs;
-	}
-
-/**
- * Reads the user registers for a given thread - may not be the current thread
- * @param aThread thread whose registers we want to read
- * @param aRegs registers will be written here if available
- * @return KErrArgument if aThread is the current thread or any of the system wide error codes
- */
-TInt SCMDataSave::ReadUserRegisters(DThread* aThread, TArmRegSet& aRegs, TUint32& aAvailableRegs)
-	{
-	TFileName filename;
-	aThread->TraceAppendFullName(filename, EFalse);	
-	
-	//we retrieve the registers differently for the current thread
-	if(aThread == &Kern::CurrentThread())
-		{
-		return KErrArgument;
-		}
-	
-	TUint32* stackPointer = (TUint32*)aThread->iNThread.iSavedSP; //Still need to check pointer somehow
-	TUint32* stackTop = (TUint32*)((TUint32)aThread->iNThread.iStackBase +(TUint32)aThread->iNThread.iStackSize);
-	TArmReg* out = (TArmReg*)(&aRegs);		
-	
-	//Get a pointer to this threads context table
-	NThread::TUserContextType type = aThread->iNThread.UserContextType();
-	const TArmContextElement* table = aThread->iNThread.UserContextTables()[type];
-	
-	aAvailableRegs = 0;
-	for(TInt i = 0; i<KArmRegisterCount; ++i)
-		{
-		TInt value = table[i].iValue;
-		TInt type = table[i].iType;
-		
-		if(type == TArmContextElement::EOffsetFromSp)
-			{
-			value = stackPointer[value];	
-			aAvailableRegs |= (1<<i);
-			}
-		else if(type == TArmContextElement::EOffsetFromStackTop)
-			{
-			value = stackTop[-value];
-			aAvailableRegs |= (1<<i);
-			}
-		else if(type == TArmContextElement::ESpPlusOffset)
-			{
-			value = (TInt)(stackPointer + value);
-			aAvailableRegs |= (1<<i);
-			}
-		
-		out[i] = value;
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * Reads the system registers for a given thread
- * Can not be used on the current thread
- * @param aThread
- * @param aRegs
- * @param aAvailableRegs
- * @return KErrArgument if aThread is the current thread or any of the system wide error codes
- */
-TInt SCMDataSave::ReadSystemRegisters(DThread* aThread, TArmRegSet& aRegs, TUint32& aAvailableRegs)
-	{	
-	if(aThread == &Kern::CurrentThread())
-		{
-		return KErrArgument;
-		}
-	
-	TFileName filename;
-	aThread->TraceAppendFullName(filename, EFalse);
-	
-	TUint32* stackPointer = (TUint32*)aThread->iNThread.iSavedSP;
-	TUint32* stackTop = (TUint32*)((TUint32)aThread->iNThread.iStackBase +(TUint32)aThread->iNThread.iStackSize);
-	TArmReg* out = (TArmReg*)(&aRegs);		
-	
-	//Get a pointer to this threads context table
-	const TArmContextElement* table = aThread->iNThread.UserContextTables()[NThread::EContextKernel];
-	
-	aAvailableRegs = 0;
-	for(TInt i = 0; i<KArmRegisterCount; ++i)
-		{
-		TInt value = table[i].iValue;
-		TInt type = table[i].iType;
-		
-		if(type == TArmContextElement::EOffsetFromSp)
-			{
-			//ensure we are still on the stack
-			if(stackPointer + value >= stackTop)
-				continue;
-				
-			value = stackPointer[value];	
-			aAvailableRegs |= (1<<i);
-			}
-		else if(type == TArmContextElement::EOffsetFromStackTop)
-			{
-			//ensure we are still on the stack
-			if(stackTop - value < (TUint32*)aThread->iNThread.iStackBase)
-				continue;
-			
-			value = stackTop[-value];
-			aAvailableRegs |= (1<<i);
-			}
-		else if(type == TArmContextElement::ESpPlusOffset)
-			{
-			value = (TInt)(stackPointer + value);
-			aAvailableRegs |= (1<<i);
-			}
-		
-		out[i] = value;
-		}	
-	
-	return KErrNone;
-	}
-
-//EOF
-
--- a/kernel/eka/debug/crashMonitor/src/crashlogwalker.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,535 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\crashlogwalker.cpp
-// Class to allow us to traverse the crash log generated by System Crash Monitor
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#ifndef __KERNEL_MODE__
-#include <e32std.h>
-#include <e32std_private.h> 
-#include <e32base.h>
-#include <e32base_private.h> 
-#endif
-
-#include "scmtrace.h"
-#include "crashlogwalker.h"
-
-namespace Debug
-	{	
-	/**
-	 * Constructor for log walker
-	 * @param aBuffer The buffer containing the crash data
-	 */
-	TCrashLogWalker::TCrashLogWalker(TDesC8& aBuffer) : 
-		iBuffer(aBuffer),
-		iReader(const_cast<TUint8*>(iBuffer.Ptr()))
-		{
-		}
-	
-	/**
-	 * This reads in the crash header from the buffer from the given start point
-	 * @param aStartPoint Point to begin reading in buffer
-	 * @return One of the OS wide codes
-	 */
-	TInt TCrashLogWalker::ReadLogHeader(const TInt aStartPoint)
-		{		
-		iReader.SetPosition(aStartPoint);
-		
-		TInt err = iCrashHeader.Deserialize(iReader);
-		if(err != KErrNone)
-			{
-			CLTRACE("(TCrashLogWalker::ReadLogHeader) - failed to read crash header");
-			return KErrCorrupt;
-			}
-		
-		err = iOffsets.Deserialize(iReader);
-		if(err != KErrNone)
-			{
-			CLTRACE("(TCrashLogWalker::ReadLogHeader) - failed to read offsets");
-			return KErrCorrupt;
-			}
-		
-		TRegisterSet set;
-		err = set.Deserialize(iReader);
-		if(err != KErrNone)
-			{
-			CLTRACE("(TCrashLogWalker::ReadLogHeader) - failed to read register set");
-			return KErrCorrupt;
-			}
-		
-		for(TInt cnt = 0; cnt < set.iNumRegisters; cnt++)
-			{
-			TRegisterValue val;
-			err = val.Deserialize(iReader);
-			if(err != KErrNone)
-				{
-				CLTRACE1("(TCrashLogWalker::ReadLogHeader) - failed to read TRegisterValue cnt = %d", cnt);
-				return KErrCorrupt;
-				}
-						
-			HelpAssignRegisterToContext(val);
-			}
-		
-		return VerifyHeader();
-		}
-	
-	/**
-	 * Getter for the crash context - This is the CPU register set at the time of crash
-	 * @return Crash Context
-	 */
-	const TRmdArmExcInfo& TCrashLogWalker::GetCrashContext() const
-		{
-		return iContext;
-		}
-	
-	/**
-	 * Returns the crash size for the crash that has just been read, provided the
-	 * reading of the header was succesful. 
-	 * @see ReadLogHeader
-	 * @return Crash Log size
-	 */
-	TInt TCrashLogWalker::GetCrashSize() const
-		{
-		return iCrashHeader.iLogSize;
-		}
-	
-	/**
-	 * Returns the crash ID for the crash that has just been read, provided the
-	 * reading of the header was succesful. 
-	 * @see ReadLogHeader
-	 * @return Crash Log ID
-	 */
-	TInt TCrashLogWalker::GetCrashId() const
-		{
-		return iCrashHeader.iCrashId;
-		}
-	
-	/**
-	 * Looks at the member crash log header and checks that it is valid.
-	 * @see ReadLogHeader 
-	 * @return one of the OS wide codes
-	 */
-	TInt TCrashLogWalker::VerifyHeader()
-		{
-		if(iCrashHeader.iId == ESCMTCrashInfo)
-			{			
-			CLTRACE("TCrashLogWalker::VerifyHeader() OK");
-			return KErrNone;
-			}
-		else
-			{
-			CLTRACE("TCrashLogWalker::VerifyHeader() FAILED");
-			return KErrCorrupt;
-			}
-		}
-	
-	/**
-	 * Updates the buffer being used by the crash walker and resets reader to use 
-	 * the beginning of this
-	 * @param aBuffer New buffer
-	 */
-	void TCrashLogWalker::UpdateBuffer(TDesC8& aBuffer)
-		{
-		iBuffer = aBuffer;		
-		
-		//Read from start of this buffer		
-		iReader = TByteStreamReader(const_cast<TUint8*>(aBuffer.Ptr()));
-		}
-	
-#ifndef __KERNEL_MODE__
-	/**
-	 * Gets the next data type from the buffer. If this is NULL it means the buffer was too small.
-	 * Call again with a larger buffer. It assumes the buffer contains valid data and leaves with KErrCorrupt 
-	 * if it isnt. Note for raw data types, the data will be empty. This should be read with GetRawDataTypeL after reseting the reader to the 
-	 * correct position. If you just want to skip a raw data type, move the buffer along the size of (contained in the returned struct)
-	 * 
-	 * @see GetRawDataTypeL
-	 * @see UpdateBuffer
-	 * @param aPos Next position that will be read. If we return NULL, this is the position the next buffer should
-	 * 			begin from
-	 * @param aId ID of the MByteStreamSerializable returned	 
-	 * @param buffer size to be used the next time. Unchanged if the current buffer is ok
-	 * @return MByteStreamSerializable pointer. Ownership is passed to caller. NULL if failed
-	 * @leave KErrCorrupt if the buffer cant be read
-	 */
-	MByteStreamSerializable* TCrashLogWalker::GetNextDataTypeL(TInt& aPos, SCMStructId& aId, TInt& aBufferSize)
-		{
-		MByteStreamSerializable* data = NULL;
-		
-		TInt roomInBuffer = iBuffer.Length() - iReader.CurrentPosition();
-		//make sure we have at LEAST 4 bytes in the buffer
-		if(roomInBuffer < (TInt)(sizeof(TInt)))
-			{
-			aBufferSize = sizeof(TInt);
-			return NULL;
-			}
-		
-		//this stores the required size in which to deserialize a structure - to make sure 
-		//there is room in the buffer
-		TInt maxSize = 0;
-		aPos = iReader.CurrentPosition();
-		aBufferSize = iBuffer.Length();		
-		
-		//all these data types are defined by their first byte
-		aId = (SCMStructId)iBuffer.Ptr()[iReader.CurrentPosition()];		
-		
-		//ensure we have a valid structure found
-		if(aId <= 0 || aId >= ESCMLast)
-			{
-			//oddness is afoot and the mist of corruption reigns thick
-			User::Leave(KErrCorrupt);
-			}					
-		
-		switch(aId)
-			{
-			case ESCMOffsetsHeader:
-				{
-				data = new TCrashOffsetsHeader();	
-				maxSize = TCrashOffsetsHeader::KSCMCrashOffsetsMaxSize;
-				break;
-				}
-			case ESCMTCrashInfo:
-				{
-				data = new TCrashInfoHeader();
-				maxSize = TCrashInfoHeader::KSCMCrashInfoMaxSize;
-				break;
-				}
-			case ESCMProcessData:
-				{
-				data = new TProcessData();
-				maxSize = TProcessData::KSCMProcessDataMaxSize;
-				break;
-				}
-			case ESCMThreadData:
-				{
-				data = new TThreadData();
-				maxSize = TThreadData::KSCMThreadDataMaxSize;
-				break;
-				}
-			case ESCMThreadStack:
-				{
-				data = new TThreadStack();
-				maxSize = TThreadStack::KSCMThreadStackMaxSize;
-				break;
-				}
-			case ESCMRegisterValue:
-				{
-				data = new TRegisterValue();
-				maxSize = TRegisterValue::KSCMRegisterValueMaxSize;
-				break;
-				}
-			case ESCMRegisterSet:
-				{
-				data = new TRegisterSet();
-				maxSize = TRegisterSet::KSCMRegisterSetMaxSize;
-				break;
-				}
-			case ESCMMemory:
-				{
-				data = new TMemoryDump();
-				maxSize = TMemoryDump::KSCMMemDumpMaxSize;
-				break;
-				}
-			case ESCMCodeSegSet:
-				{
-				data = new TCodeSegmentSet();
-				maxSize = TCodeSegmentSet::KSCMCodeSegSetMaxSize;
-				break;
-				}
-			case ESCMCodeSeg:
-				{
-				data = new TCodeSegment();
-				maxSize = TCodeSegment::KMaxSegmentNameSize;
-				break;
-				}	
-			case ESCMLocks:
-				{
-				data = new TSCMLockData();
-				maxSize = TSCMLockData::KSCMLockDataMaxSize;	
-				break;
-				}
-			case ESCMVariantData:
-				{
-				data = new TVariantSpecificData();
-				maxSize = TVariantSpecificData::KSCMVarSpecMaxSize;	
-				break;
-				}				
-			case ESCMRomHeader:
-				{
-				data = new TRomHeaderData();
-				maxSize = TRomHeaderData::KSCMRomHdrMaxSize;	
-				break;
-				}				
-			case ESCMRawData:
-				{
-				data = new TRawData();
-				
-				//This is a special case. The data in here can be any length, so we need to deserialise it
-				//to find this length out. The MAX_SIZE of this class is the max size minus data
-				//which is fine if we dont assign the TPtr8.				
-				if(TRawData::KSCMRawDataMaxSize > roomInBuffer )
-					{					
-					aBufferSize = (maxSize > aBufferSize) ? maxSize : aBufferSize;
-					
-					if(data)
-						delete data;
-					
-					return NULL;
-					}
-				else
-					{
-					data->Deserialize(iReader);
-					maxSize = data->GetSize();
-					
-					aPos = iReader.CurrentPosition();
-					return data;
-					}
-				}
-			case ESCMTraceData:
-				{
-				data = new TTraceDump();
-				maxSize = TTraceDump::KSCMTraceDumpMaxSize;
-				break;
-				}
-			default :
-				{
-				User::Panic(_L("Unexpected Null. Unrecognised Data type from crash log."), KErrGeneral); //Programming error				
-				}							
-			}
-		
-		__ASSERT_ALWAYS((data != NULL), User::Panic(_L("Unexpected Null"), KErrGeneral));
-		
-		if(maxSize > roomInBuffer )
-			{
-			//Not enough room in buffer to read this. Tell caller where in the current buffer
-			//we were via aPos, and what minimum size buffer should be used next time to allow reading
-			aBufferSize = maxSize;
-			if(data)
-				{
-				delete data;
-				}
-			
-			return NULL;
-			}
-		
-		if(!data)
-			{
-			CLTRACE("Unable to create data structure");
-			User::Leave(KErrAbort);
-			}
-		
-		data->Deserialize(iReader);			
-		aPos = iReader.CurrentPosition();
-		
-		return data;
-		}
-	
-	/**
-	 * Assuming the next type in the buffer is a TRawData type, this will return the TRawData
-	 * types data pointer pointing to the buffer passed via aRawBuf.
-	 *  
-	 * The difference between this call and GetNextDataTypeL is that GetNextDataTypeL only lets you move along the buffer
-	 * it doesnt allow you to specify a buffer in which to store the raw data.
-	 * 
-	 * @see GetNextDataTypeL
-	 * @return TRawData* This is the TRawData object that holds the data via the buffer passed in. Ownership is passed to the caller
-	 * @param aPos position in buffer its been found. If we return NULL, this is the position the next buffer should
-	 * 			begin from
-	 * @param aBufferSize Should we return NULL, that means the descriptor passed in was not big enough and should be of at least aBufferSize bytes
-	 * @param aRawBuf The buffer to store the data refered to by the TRawData returned
-	 * @param aStartRawPosition The point in the raw data at which we will start to put it into the buffer
-	 * @leave One of the OS wide codes
-	 */
-	TRawData* TCrashLogWalker::GetRawDataTypeL(TInt& aPos, TInt& aBufferSize, TDes8& aRawBuf, TInt aStartRawPosition)
-		{								
-		//make sure we have at LEAST the size of the struct in the buffer
-		if(iBuffer.Length() < TRawData::KSCMRawDataMaxSize)
-			{
-			aBufferSize = TRawData::KSCMRawDataMaxSize;
-			return NULL;
-			}
-		
-		//this stores the required size in which to deserialize a structure - to make sure 
-		//there is room in the buffer
-		aPos = iReader.CurrentPosition();
-		aBufferSize = iBuffer.Length();
-		
-		//all these data types are defined by their first byte
-		TInt id = (SCMStructId)iBuffer.Ptr()[iReader.CurrentPosition()];
-		if(id != ESCMRawData)
-			{
-			User::Leave(KErrCorrupt);
-			}		
-		
-		//Deserialise once to get the length (this will ignore the data in the absence of a Tptr)
-		TRawData* data = new TRawData();
-		data->Deserialize(iReader);
-		
-		//reset reader to where the raw data starts again
-		iReader.SetPosition(aPos);
-		
-		//now we know we have room, deserialize into this descriptor	
-		aRawBuf.SetMax();	
-		data->iData.Set(aRawBuf.MidTPtr(0));
-		User::LeaveIfError(data->Deserialize(aStartRawPosition, iReader));
-		
-		return data;
-		}
-	
-#endif
-	
-	/**
-	 * This is a helper function to convert between the two formats of register
-	 * @param aRegVal Resulting register values
-	 */
-	void TCrashLogWalker::HelpAssignRegisterToContext(const TRegisterValue& aRegVal)
-		{
-		//only interested in core registers at the moment
-		if(aRegVal.iClass != 0 || aRegVal.iSize != 2)
-			{
-			return;
-			}
-		
-		//Is there a cleverer way to do this with bitmasks and FOFF ?
-		switch(aRegVal.iType)
-			{
-			case 0x0 :
-				{
-				iContext.iR0 = aRegVal.iValue32;
-				break;
-				}
-			case 0x100 :
-				{
-				iContext.iR1 = aRegVal.iValue32;
-				break;
-				}
-			case 0x200 :
-				{
-				iContext.iR2 = aRegVal.iValue32;
-				break;
-				}
-			case 0x300 :
-				{
-				iContext.iR3 = aRegVal.iValue32;
-				break;
-				}
-			case 0x400 :
-				{
-				iContext.iR4 = aRegVal.iValue32;
-				break;
-				}
-			case 0x500 :
-				{
-				iContext.iR5 = aRegVal.iValue32;
-				break;
-				}
-			case 0x600 :
-				{
-				iContext.iR6 = aRegVal.iValue32;
-				break;
-				}
-			case 0x700 :
-				{
-				iContext.iR7 = aRegVal.iValue32;
-				break;
-				}
-			case 0x800 :
-				{
-				iContext.iR8 = aRegVal.iValue32;
-				break;
-				}
-			case 0x900 :
-				{
-				iContext.iR9 = aRegVal.iValue32;
-				break;
-				}
-			case 0xa00 :
-				{
-				iContext.iR10 = aRegVal.iValue32;
-				break;
-				}
-			case 0xb00 :
-				{
-				iContext.iR11 = aRegVal.iValue32;
-				break;
-				}
-			case 0xc00 :
-				{
-				iContext.iR12 = aRegVal.iValue32;
-				break;
-				}
-			case 0xd00 :
-				{
-				iContext.iR13 = aRegVal.iValue32;				
-				break;
-				}
-			case 0xe00 :
-				{
-				iContext.iR14 = aRegVal.iValue32;
-				break;
-				}
-			case 0xf00 :
-				{
-				iContext.iR15 = aRegVal.iValue32;
-				break;
-				}
-			case 0x1000 :
-				{
-				iContext.iCpsr = aRegVal.iValue32;
-				break;
-				}
-			case 0x1100 :
-				{
-				iContext.iR13Svc = aRegVal.iValue32;
-				break;
-				}
-			case 0x1200 :
-				{
-				iContext.iR14Svc = aRegVal.iValue32;
-				break;
-				}
-			default :
-				{
-				return;
-				}				
-			}
-		}
-	
-	/**
-	 * Getter for crash header
-	 * @return header
-	 */
-	const TCrashInfoHeader& TCrashLogWalker::GetCrashHeader() const
-		{
-		return iCrashHeader;
-		}
-	
-	/**
-	 * Getter for crash offsets header
-	 * @return header
-	 */
-	const TCrashOffsetsHeader& TCrashLogWalker::GetOffsetsHeader() const
-		{
-		return iOffsets;
-		}			
-		
-	}
-//eof
-
--- a/kernel/eka/debug/crashMonitor/src/scmbytestreamutil.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmbytestreamutil.cpp
-// some utility classes for writing data to flash buffer
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-
-#include "scmbytestreamutil.h"
-#include "scmtrace.h"
-
-
-
-namespace Debug 
-	{
-	/**
-	 * TByteStreamBase Constructor 
-	 * @param aBuffer - pointer to buffer that this utility will use
-	 */	
-	TByteStreamBase::TByteStreamBase(TUint8* aBuffer) 
-		: iBuffer(aBuffer)
-		, iPos(0) 
-		{
-		}
-			
-	/**
-	 * SetPosition
-	 * @param aBuffer - Sets iPos
-	 * @return void
-	 */	
-	void TByteStreamBase::SetPosition(TInt aPos)
-		{
-		iPos = aPos;
-		}
-	
-	/**
-	 * CurrentPosition
-	 * @param aBuffer - Returns the current value of iPos
-	 * @return Tint
-	 */	
-	TInt TByteStreamBase::CurrentPosition() const
-		{
-		return iPos;
-		}
-	
-	/**
-	 * TByteStreamReader Constructor 
-	 * @param aBuffer - pointer to buffer that this utility will use
-	 */	
-	TByteStreamReader::TByteStreamReader(TUint8* aBuffer) 
-		: TByteStreamBase(aBuffer)
-		{	
-		}
-	
-	
-	/**
-	 * Constructor for TByteStreamWriter
-	 * @param aBuffer buffer for writing
-	 * @param aPhysEnabled whether or not physical writing to another media is enabled
-	 */
-	TByteStreamWriter::TByteStreamWriter(TUint8* aBuffer, TBool aPhysEnabled) 
-		: TByteStreamBase(aBuffer)
-		, iPhysEnabled(aPhysEnabled)
-		, iBytesWritten(0)
-		{			
-		}
-
-	/**
-	 * Writes a byte to the buffer
-	 * @param aValue Byte to write
-	 */
-	void TByteStreamWriter::WriteByte(TUint8 aValue)
-		{
-		if(iBuffer)
-			{
-			iBuffer[iPos++] = aValue;
-			++iBytesWritten;
-			}
-		}
-	
-	/**
-	 * Resets the byte counter back to zero
-	 */
-	void TByteStreamWriter::ResetBytesWritten()
-		{
-		iBytesWritten = 0;
-		}
-	
-	/**
-	 * TCachedByteStreamWriter Constructor 
-	 * @param aBuffer - pointer to buffer that this utility will use
-	 * @param aCacheSize - suggested length of cache to use if greater than EMaxCache
-	 * 					cache length of EMaxCache will be used
-	 */
-	TCachedByteStreamWriter::TCachedByteStreamWriter(TUint8* aCacheBuffer, TInt aCacheSize, TBool aPhysEnabled) 
-		: TByteStreamWriter(NULL, aPhysEnabled)
-		, iCacheSize(aCacheSize)
-		, iCacheBuffer(aCacheBuffer)
-		, iPhysicalWriter(NULL)
-		{
-		}
-	
-	
-	/**
-	 * FlushCache 
-	 * Writes the contents of the cache to buffer amd/or to physical writer implementation
-	 * if one is currently set
-	 * @return void
-	 */	
-	TInt TCachedByteStreamWriter::FlushCache()
-		{			
-		TInt padCount = iCacheSize - iPos;
-		if(padCount > 0)
-			{		
-			for(TInt i=0;i<padCount;i++)
-				{
-				iCacheBuffer[iPos++] = 0;
-				}		
-			}
-				
-		if(iPhysEnabled)
-			{
-			if(iPhysicalWriter) // do we have a writer to send the cache data to
-				{
-				iPhysicalWriter->DoPhysicalWrite(iCacheBuffer, iBytesWritten, iPos);
-				}
-			}
-		
-		iPos = 0;
-		return KErrNone;
-		}
-	
-	/**
-	 * Writes a byte to the cached buffer
-	 * @param aValue Byte to write
-	 */
-	void TCachedByteStreamWriter::WriteByte(TUint8 aValue)
-		{
-		if(iPos == iCacheSize)
-			{
-			FlushCache();
-			}		
-		iCacheBuffer[iPos++] = aValue;	
-		++iBytesWritten;
-		}
-	
-	/**
-	 * CurrentPosition
-	 * @param aBuffer -  need to return the position in buffer plus the write pos into cache
-	 * @return Tint
-	 */	
-	TInt TCachedByteStreamWriter::CurrentPosition() const
-		{
-		return iBytesWritten;	
-		}
-
-	/**
-	 * SetWriterImpl
-	 * @param aPhysicalWriter - sets the physical writer implementation to be used when the cache is flushed
-	 * 							pass NULL to remove a previous writer implementation
-	 * @return void
-	 */	
-	void TCachedByteStreamWriter::SetWriterImpl(MPhysicalWriterImpl* aPhysicalWriter)
-		{
-		iPhysicalWriter = aPhysicalWriter;
-		}	
-	}
-
-//eof
-
--- a/kernel/eka/debug/crashMonitor/src/scmchksum.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmchksum.cpp
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{	
-	/**
-	 * Constructor
-	 */
-	TScmChecksum::TScmChecksum()
-	: iLength(0)	
-	, iSum(0)
-	, iZeroCount(0)
-		{	
-		}
-	
-	/**
-	 * ChecksumBlock - calculate checksum values for given data
-	 * @param aData - the data to checksum
-	 * @param aLen - the length of the data to checksum
-	 * @return void
-	 */
-	void TScmChecksum::ChecksumBlock(const TUint8* aData, TUint aLen)
-		{		
-		/**
-		 * 
-		 * Note there is Symbian CRC implementation to be found in the following
-		 * \src\cedar\generic\tools\e32tools\elf2e32\source\checksum.h
-		 * \src\cedar\generic\tools\e32tools\elf2e32\source\checksum.cpp
-		 * this however may be no good to us
-		 * as we need to produce a single checksum even though the entire data may be
-		 * read in different size blocks - and the entire data may not be available
-		 * (the comm port requirement is for read only )
-		 * If we do however want to use the CRC then this is the place to insert the code
-		 */		
-		if(!aData)
-			{
-			return;
-			}
-			
-		for(TUint i=0;i<aLen;i++)
-			{
-			TUint8 val = *(aData+i);
-			
-			iLength++;
-			if(val == 0)
-				{
-				iZeroCount++;
-				}
-			else
-				{
-				iSum += val;
-				}			
-			}		
-		}
-	
-	/**
-	 * ChecksumBlock - calculate checksum values for given data
-	 * @param aData - descriptor containing the data to checksum
-	 * @return void
-	 */
-	void TScmChecksum::ChecksumBlock(const TDesC8& aDes)
-		{
-		ChecksumBlock(aDes.Ptr(), aDes.Length());
-		}
-	
-	/**
-	 * ChecksumBlock - operator ==
-	 * @param aOther - the TScmChecksum to compare too
-	 * @return ETrue is objects match - otherwise EFalse
-	 */
-	TBool TScmChecksum::operator == (const TScmChecksum& aOther) const
-		{
-		return (iLength == aOther.iLength && iSum == aOther.iSum && iZeroCount == aOther.iZeroCount);
-		}
-
-	/**
-	 * ChecksumBlock - operator !=
-	 * @param aOther - the TScmChecksum to compare too
-	 * @return EFalse if objects match - otherwise ETrue
-	 */
-	TBool TScmChecksum::operator != (const TScmChecksum& aOther) const
-		{
-		return !(*this == aOther);
-		}
-	
-	/**
-	 * GetSize 
-	 * @return size of this object when streamed in bytes
-	 */
-	TInt TScmChecksum::GetSize() const
- 		{
- 		return 12;
- 		}
-	
-	/**
-	 * Serialize - writes this object to the supplied byte stream
-	 * @param aItem -  aWriter - the TByteStreamWriter that will be written to
-	 * @return One of the OS wide codes
-	 */
-	TInt TScmChecksum::Serialize(TByteStreamWriter& aWriter)
-		{	
-		TInt startPos = aWriter.CurrentPosition();
-		aWriter.WriteInt(iLength);
-		aWriter.WriteInt(iSum);
-		aWriter.WriteInt(iZeroCount);
-		TInt sizeWritten = aWriter.CurrentPosition() - startPos;
-		if(sizeWritten != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TScmChecksum serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-
-	/**
-	 * Deserialize - read this objects state from the supplied byte stream
-	 * @param aItem -  aReader - the TByteStreamReader that will be read from
-	 * @return One of the OS wide codes
-	 */
-	TInt TScmChecksum::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		// do we need a version check here - will it change ?
-		iLength = aReader.ReadInt();	
-		iSum = aReader.ReadInt();
-		iZeroCount = aReader.ReadInt();	
-
-		TInt sizeRead = aReader.CurrentPosition() - startPos;
-		if(sizeRead != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TScmChecksum Deserialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrCorrupt;
-		}
-	
-	
-	void TScmChecksum::Reset()
-		{
-		iLength = iSum = iZeroCount = 0;	
-		}		
-	}
-//eof
-
--- a/kernel/eka/debug/crashMonitor/src/scmconfig.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,458 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmconfig.cpp
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <e32err.h>
-#include <e32const.h>
-#include <e32const_private.h>
-
-#include <scmconfig.h>
-#include <scmconfigitem.h>
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	/**
-	 * SCMConfiguration constructor
-	 * Initialises the configuration object to default values
-	 */
-	SCMConfiguration::SCMConfiguration() 
-	: iConfigList(NULL)
-		{
-		}
-	
-	/**
-	 * SCMConfiguration destructor
-	 */
-	SCMConfiguration::~SCMConfiguration()
-		{	
-		ClearList();	
-		}
-
-	/**
-	 * Goes to the flash and reads the configuration block and populates the object state
-	 * accordingly
-	 * @return one of the system wide error codes
-	 */
-	TInt SCMConfiguration::Deserialize(TByteStreamReader& aReader)
-		{		
-		if( !iConfigList)
-			{
-			// we need to set up a default configuration to load the data into
-			TInt err = SetDefaultConfig();
-			if(err != KErrNone)
-				{
-				CLTRACE1("SCMConfiguration::Deserialize SetDefaultConfig failed err = %d", err);
-				return err;
-				}
-			}
-		
-		TInt startPos = aReader.CurrentPosition();		
-		
-		TBuf8<10> magicNumbers;
-		// try and read the magic numbers - if they dont exist then 
-		// there is not an scm config there
-		const TInt KLen = KScmConfigHeaderString().Length();
-		for(TInt i=0;i<KLen;i++)
-			{
-			TUint8 b = aReader.ReadByte();			
-			magicNumbers.Append(TChar(b));	
-			}
-		
-		if(magicNumbers.Compare(KScmConfigHeaderString()) != 0)
-			{
-			CLTRACE("No scm, config to read !");
-			return KErrNotReady;
-			}
-				
-		TConfigItem* item = iConfigList;
-		while(item)
-			{
-			item->Deserialize(aReader);
-			item = item->iNext;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("SCMConfiguration::Deserialize size error");	
-			return KErrCorrupt;
-			}			
-		return KErrNone;			
-		}
-	
-	/**
-	 * This writes the current configuration object state to flash. This configuration will be used on the next crash
-	 * @return one of the system wide error codes
-	 */
-	TInt SCMConfiguration::Serialize(TByteStreamWriter& aWriter)	
-		{		
-		if( !iConfigList)
-			{
-			CLTRACE("SCMConfiguration::Serialize ERROR - NO LIST!!");
-			return KErrNotReady;
-			}
-		
-		TInt startPos = aWriter.CurrentPosition();
-		
-		// write the number of crashes and magic numbers
-		
-		// try and read the magic numbers - if they dont exist then 
-		// there is not an scm config there
-		const TInt KLen = KScmConfigHeaderString().Length();
-		const TDesC8& des = KScmConfigHeaderString();
-		for(TInt i=0;i<KLen;i++)
-			{
-			aWriter.WriteByte(des[i]);
-			}				
-		
-		TConfigItem* item = iConfigList;
-		while(item)
-			{
-			item->Serialize(aWriter);
-			item = item->iNext;
-			}
-
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("SCMConfiguration::Serialize size error");	
-			return KErrCorrupt;
-			}						
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns entire size of the SCMConfiguration block
-	 * @return Size
-	 */
-	TInt SCMConfiguration::GetSize() const
-		{
-		// returns the size of all the config items when serialized to disk / flash
-		return (TConfigItem::ELast * iConfigList->GetSize()) + KScmConfigHeaderString().Length();
-		}
-	
-	/** 
-	 * This will return, one at a time, the highest priority. 
-	 * @see ResetToHighestPriority()
-	 * @param aSizeToDump this will contain the size in bytes of data to dump for this type - 0 means dump all
-	 * @return Data type to dump 
-	 */
-	TConfigItem* SCMConfiguration::GetNextItem()
-		{
-		if(!iNextItem)
-			{
-			return NULL;
-			}
-			
-		//get the values we need
-		TConfigItem* item  = iNextItem;	
-		
-		//Now move iNextItem to be next in the list
-		iNextItem = iNextItem->iNext;			
-		return item;
-		}	
-	
-	/**
-	 * Deletes the linked list
-	 * @return system wide OS code
-	 */
-	void SCMConfiguration::ClearList()
-		{
-		if(!iConfigList)
-			{
-			return;
-			}
-		
-		//all we need to do in here is delete the members of our linked list
-		TConfigItem* item = iConfigList;
-		
-		do{			
-			TConfigItem* tmp = item->iNext;
-			delete item;		
-			item = tmp;		
-		}
-		while(item != NULL);
-		
-		iConfigList = NULL;
-		}
-	
-	/**
-	 * Rather than reading the configuration from the flash, this method sets up the configuration object
-	 * to a default configuration type
-	 * @return one of the system wide error codes
-	 */ 
-	TInt SCMConfiguration::SetDefaultConfig()
-		{
-		//flush the object first
-		ClearList();
-	
-		//This is a predefined default config - in the future we may have multiple defaults based on use case
-		// currently however we use a fixed size list of config items of size TConfigItem::ELast		
-		// also the TSCMDataType of each item must be unique				
-		
-		for(TInt cnt = TConfigItem::ELast - 1; cnt >= 0; cnt --)
-			{			
-			TInt priority = cnt + 1; 
-			
-			//Lets not do these by default
-			if((TConfigItem::TSCMDataType)cnt == TConfigItem::EThreadsUsrStack || (TConfigItem::TSCMDataType)cnt == TConfigItem::EThreadsSvrStack)
-				{
-				priority = 0;
-				}
-			
-			//set it with the priority of its enum (ie. assume that the enum is listed in its priority - it is)
-			//by default dump everything until we run out of space
-			TInt err = CreateConfigItem((TConfigItem::TSCMDataType)cnt, priority, 0);
-			if(KErrNone != err)
-				{
-				return err;
-				}
-			}
-		
-		return KErrNone;		
-		}
-		
-	/**
-	 * This configures the required data for a given configuration item
-	 * Note that aSizeToDump is only used in the case of memory dumps such as stacks
-	 * @param aDataType - Type of data to dump
-	 * @param aPriority - its priority 0-256. 0 Means do not dump and 256 is highest priority
-	 * @param aSizeToDump - amount in bytes to dump. Only relevant for memory dumps and ignored when aPriority is 0
-	 * @return one of the OS wide return codes
-	 */
-	TInt SCMConfiguration::CreateConfigItem(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority, const TInt32 aSizeToDump)
-		{
-		//create the config item
-		TConfigItem* item = new TConfigItem(aDataType, aPriority, aSizeToDump);
-		
-		//insert to priority list
-		return InsertToList(item);		
-		}
-		
-	
-	/**
-	 * ModifyConfigItemPriority - modifies prioity for a given configuration item
-	 * @param aDataType - The unique type of the config item
-	 * @param aPriority - its priority 0-256. 0 Means do not dump and 256 is highest priority
-	 * @return one of the OS wide return codes
-	 */
-	TInt  SCMConfiguration::ModifyConfigItemPriority(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority)
-		{
-
-		// find the item with the matching data type
-		TConfigItem* item = iConfigList;		
-		while(item)
-			{
-			if(item->iDataType == aDataType)
-				{
-				break;
-				}
-			item = item->iNext;			
-			}
-	
-		if(!item)
-			{
-			return KErrNotFound;
-			}
-		
-		item->iPriority = aPriority;
-		
-		// now reorder the list according to new priority
-		TInt err = RemoveFromList(item);
-		if(err != KErrNone)
-			{
-			return err;
-			}
-		
-		err = InsertToList(item);
-
-		if(err != KErrNone)
-			{
-			return err;
-			}
-		
-		return KErrNone;
-		}
-
-/**
- * Removes item from the linked list
- * @param aItem - item to remove
- * @return OS code
- */
-TInt SCMConfiguration::RemoveFromList(TConfigItem* aItem)
-		{
-		if(!aItem)
-			{
-			return KErrArgument;
-			}
-		
-		if(!iConfigList)
-			{
-			return KErrCorrupt;  // oops no list to remove
-			}
-		
-		
-		if(aItem == iConfigList)
-			{
-			// special case remove from beginning of list
-			iConfigList = iConfigList->iNext;
-			return KErrNone;
-			}
-		
-		TConfigItem* item = iConfigList; 
-		while(item)
-			{
-			// is the next item the match ?
-			if(item->iNext == aItem)
-				{
-				item->iNext = aItem->iNext;
-				return KErrNone;
-				}		
-			item = item->iNext;	
-			}
-		
-		return KErrNotFound;	
-		}
-
-/**
- * Inserts a priority item into the linked list in its correct location
- * @param aItem - item to insert
- * @return OS code
- */
-TInt SCMConfiguration::InsertToList(TConfigItem* aItem)
-	{ 	
-	
-	//if the list is empty, then this is the only item
-	if(!iConfigList)
-		{
-		iConfigList = aItem;			
-		return KErrNone;
-		}
-	
-	//should it go at the start? special case not covered by while loop
-	TConfigItem* temp;
-	
-	if(aItem->iPriority >= iConfigList->iPriority)
-		{
-		temp = iConfigList;
-		iConfigList = aItem;
-		aItem->iNext = temp;
-		return KErrNone;
-		}
-	
-	TConfigItem* item = iConfigList;
-	
-	do{		
-		//if we get to the end of the list and the item still hasnt been assigned then it must be lowest priority
-		if(item->iNext == NULL)
-			{
-			item->iNext = aItem;
-			return KErrNone;
-			}
-		
-		//check if its priority is between these
-		if(aItem->iPriority < item->iPriority && aItem->iPriority >= item->iNext->iPriority)
-			{
-			//insert between these nodes
-			temp = item->iNext;
-			item->iNext = aItem;
-			aItem->iNext = temp;
-			return KErrNone;
-			}
-	
-		item = item->iNext;	
-	}
-	while(item != NULL);	
-	
-	//should never get here
-	return KErrUnknown;
-	}
-	
-/**
- * This resets the next item counter back to the highest priority item in the list
- */
-void SCMConfiguration::ResetToHighestPriority()
-	{
-	//set the next item counter back to the head of the list
-	iNextItem = iConfigList;
-	}
-
-/**
- * Overloaded == operator
- * @param aOther Item to compare
- * @return
- */
-TBool SCMConfiguration::operator == (const SCMConfiguration& aOther) const
-	{
-	
-	if(!iConfigList && !aOther.iConfigList)
-		{
-		return ETrue;
-		}
-	 		
-	if((!iConfigList && aOther.iConfigList) || (iConfigList && !aOther.iConfigList))
-		{
-		return EFalse;
-		}
-	
-	
-	TConfigItem* item1 = iConfigList;
-	TConfigItem* item2 = aOther.iConfigList;
-	
-	while(item1 && item2)
-		{
-		if(!(*item1 == *item2))
-			{
-			return EFalse;
-			}
-		
-		item1 = item1->iNext;			
-		item2 = item2->iNext;			
-		}
-
-	if( item1 != item2)  // both should now be null - if not then lists were different lengths
-		{
-		return EFalse;
-		}
-		
-	return ETrue;
-	
-	}
- 	
-/**
- * Getter for the head of the SCMConfig list
- * @return Head of List
- */	
-TConfigItem* SCMConfiguration::ConfigList() const
-	{
-	// returns the head of the list	
-	return iConfigList;
-	} 
-} //End of debug namespace
-
-//eof
-
-
-
-
--- a/kernel/eka/debug/crashMonitor/src/scmconfigitem.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +0,0 @@
-// Copyright (c) 1994-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\debug\crashMonitor\src\scmconfigitem.cpp
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-#include <e32def.h>
-#include <e32def_private.h>
-
-#include <scmconfigitem.h>
-#include <scmdatatypes.h>
-#include <scmtrace.h>
-
-namespace Debug
-	{	
-	
-/**
- * TConfigItem constructor
- */
-TConfigItem::TConfigItem() 
-: iDataType(ELast)
-, iSizeToDump(0)
-, iSpaceRequiredToDump(0)
-, iPriority(0)
-, iNext(NULL)
-	{
-	}
-
-/**
- * TConfigItem constructor
- * @param aDataType - data type id
- * @param aSizeToDump - size of the config data 
- * @param aPriority - priority of this data type (if 0 then not used)
- */	
-TConfigItem::TConfigItem(TSCMDataType aDataType,  TUint8 aPriority, TInt32 aSizeToDump)
-: iDataType(aDataType)
-, iSizeToDump(aSizeToDump)
-, iPriority(aPriority)
-, iNext(NULL)
-	{	
-	}
-	
-/**
- * Serialize - writes this object to the supplied byte stream
- * @param aItem -  aWriter - the TByteStreamWriter that will be written to
- * @return one of the OS wide codes
- */
-TInt TConfigItem::Serialize(TByteStreamWriter& aWriter)
-	{	
-	TInt startPos = aWriter.CurrentPosition();
-	
-	aWriter.WriteByte((TUint8)iDataType);
-	aWriter.WriteInt(iSizeToDump);
-	aWriter.WriteByte(iPriority);				
-
-	TInt sizeWritten = aWriter.CurrentPosition() - startPos;
-	if(sizeWritten != GetSize())
-		{
-		// error between actual size & real size in data
-		CLTRACE2("TConfigItem serialization size error sizeWritten %d GetSize() %d", sizeWritten, GetSize());
-		return KErrCorrupt;
-		}
-	
-	return KErrNone;
-	}
-	
-
-/**
- * Deserialize - read this objects state from the supplied byte stream
- * @param aItem -  aReader - the TByteStreamReader that will be read from
- * @return One of the OS wide codes
- */
-TInt TConfigItem::Deserialize(TByteStreamReader& aReader)
-	{
-	TInt startPos = aReader.CurrentPosition();
-
-	iDataType = (TSCMDataType) aReader.ReadByte();	
-	iSizeToDump = aReader.ReadInt();
-	iPriority = aReader.ReadByte();	
-	
-	TInt sizeRead = aReader.CurrentPosition() - startPos;
-	if(sizeRead != GetSize())
-		{
-		// error between actual size & real size in data
-		CLTRACE("(TConfigItem::Deserialize) ERROR size error");
-		return KErrCorrupt;
-		}				
-	
-	return KErrNone;
-	}
-
-
-/**
- * GetDataType 
- * @return data type of this config item
- */
- TConfigItem::TSCMDataType TConfigItem::GetDataType() const
-	{
-	return iDataType;
-	}
-
-/**
- * GetPriority 
- * @return priority of this config item (0-255)
- */ 
-TInt TConfigItem::GetPriority() const
-	{
-	return iPriority;
-	}
-
-/**
- * GetSize 
- * @return size to dump in bytes
- */
-TInt TConfigItem::GetSizeToDump() const
-	{
-	return iSizeToDump;
-	}
-
-/**
- * GetSize 
- * @return size of this object when streamed in bytes
- */
-TInt TConfigItem::GetSize() const
-	{
-	return 6;
-	}
-
-
-
-/**
- * Returns next item
- * @return Next item
- */
-TConfigItem* TConfigItem::Next() const
-	{
-	return iNext;
-	}
-
-	/**
-	 * Print - displays info about this TConfigItem 
-	 * @return void
-	 */
- 	void TConfigItem::Print() const 
- 		{
- 		CLTRACE3( "(TConfigItem::Print) iDataType = %d iPriority = %d iSizeToDump = %d"
- 				, iDataType, iPriority, iSizeToDump);
- 		}
- 	
- 	TBool TConfigItem::operator == (const TConfigItem& aOther) const
- 		{
- 		return (iDataType == aOther.iDataType && iSizeToDump == aOther.iSizeToDump && iPriority == aOther.iPriority);
- 		}
-
-/**
- * Sets the space required parameter for this config item
- * @param aSpaceReq Space required
- */
-void TConfigItem::SetSpaceRequired(TUint aSpaceReq)
-	{
-	iSpaceRequiredToDump = aSpaceReq;
-	}
-
-/**
- * Gets the space required to store this config item
- * @return
- */
-TUint TConfigItem::GetSpaceRequired()
-	{
-	return iSpaceRequiredToDump;
-	}
-
-#ifndef __KERNEL_MODE__
-
-// human readable strings for TSCMDataType
-_LIT(KExceptionStacks, "Exception Stacks");
-_LIT(KTraceData, "Trace data");
-_LIT(KProcessCodeSegs, "ProcessCodeSegs");
-_LIT(KThreadsUsrStack, "Threads UserStack");
-_LIT(KThreadsSvrStack, "Threads Supervisor Stack");
-_LIT(KKernelHeap, "Kernel Heap");
-_LIT(KThreadsUsrRegisters, "Threads User Registers");
-_LIT(KThreadsSvrRegisters, "Threads Supervisor Registers");
-_LIT(KProcessMetaData, "Process Meta Data");
-_LIT(KThreadsMetaData, "Threads Meta Data");
-_LIT(KCrashedProcessCodeSegs, "Crashed Process Code Segs");
-_LIT(KCrashedProcessUsrStacks, "Crashed Process' User Stack's");
-_LIT(KCrashedProcessSvrStacks, "Crashed Process' Supervisor Stack's");
-_LIT(KCrashedProcessMetaData, "Crashed Process Meta Data");
-_LIT(KCrashedThreadMetaData, "Crashed Thread Meta Data");				
-_LIT(KLocks, "SCM Locks");
-_LIT(KVariantSpecific, "Variant Specific Data");
-_LIT(KRomInfo, "ROM Info");
-_LIT(KUnknown,  "Unknown");
-
-/**
- * helper function for converting TSCMDataType enul to human readable form
- */
- const TDesC& TConfigItem::GetSCMConfigOptionText(TConfigItem::TSCMDataType aType)
- 		{
- 		switch (aType)
- 			{
- 			case TConfigItem::EExceptionStacks:
- 				return KExceptionStacks;
- 			case TConfigItem::ETraceData:
- 				return KTraceData;
- 			case TConfigItem::EProcessCodeSegs:
- 				return KProcessCodeSegs();
- 			case TConfigItem::EThreadsUsrStack:
- 				return KThreadsUsrStack();
- 			case TConfigItem::EThreadsSvrStack:
- 				return KThreadsSvrStack;
- 			case TConfigItem::EThreadsUsrRegisters:
- 				return KThreadsUsrRegisters();
- 			case TConfigItem::EThreadsSvrRegisters:
- 				return KThreadsSvrRegisters();
- 			case TConfigItem::EProcessMetaData:
- 				return KProcessMetaData();
- 			case TConfigItem::EThreadsMetaData:
- 				return KThreadsMetaData();
- 			case TConfigItem::ECrashedProcessCodeSegs:
- 				return KCrashedProcessCodeSegs();
- 			case TConfigItem::ECrashedProcessUsrStacks:
- 				return KCrashedProcessUsrStacks();
- 			case TConfigItem::ECrashedProcessSvrStacks:
- 				return KCrashedProcessSvrStacks();
- 			case TConfigItem::ECrashedProcessMetaData:
- 				return KCrashedProcessMetaData();
- 			case TConfigItem::ECrashedThreadMetaData:						
- 				return KCrashedThreadMetaData();
- 			case TConfigItem::ELocks:						
- 				return KLocks();
- 			case TConfigItem::EKernelHeap:
- 				return KKernelHeap();
- 			case TConfigItem::EVariantSpecificData:
- 				return KVariantSpecific();
- 			case TConfigItem::ERomInfo:
- 				return KRomInfo();	
-			case TConfigItem::ELast:
- 			default:
- 				return KUnknown();
- 			}
- 		}
-#endif // ! __KERNEL_MODE__
-}
-
-//eof
-
-
--- a/kernel/eka/debug/crashMonitor/src/scmdatasave.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1266 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmdatasave.cpp
-// 
-//
-
-#define __INCLUDE_REG_OFFSETS__  // for SP_R13U in nk_plat.h
-
-#include <omap_dbg.h>
-#include "arm_mem.h"
-#include "nk_plat.h"
-#include <omap_assp.h>
-#include <scmonitor.h>
-#include <scmdatasave.h> 
-
-/**
- * @file
- * @internal technology
- */
-
-/**
- * SCMDataSave constructor
- * @param aMonitor - the monitor which has caught the syetem crash this object is saving data for 
- * @param aFlash - the flash memory data will be written to, note the CrashFlash interface is
- * 				   rather limited and does not support partial block writes
- * @param aFlashInfo - data describing the structure of the flash data
- */
-EXPORT_C SCMDataSave::SCMDataSave(Monitor* aMonitor, CrashFlash* aFlash)
-	: iMonitor(aMonitor)
-		,iFlash(aFlash)
-		,iByteCount(0)	
-#ifdef SCM_COMM_OUTPUT	
-		,iWriteSelect(EWriteComm)  // write data to debug port	
-#else	
-		,iWriteSelect(EWriteFlash)  // write data to flash
-#endif
-		,iPerformChecksum(ETrue)			 // checksum data 
-		,iStartingPointForCrash(0)
-	{  		
-	const TInt KCacheSize = 128;
-	iFlashCache = HBuf8::New(KCacheSize);
-	CLTRACE1("(SCMDataSave) Creating writer with cache size = %d", KCacheSize);
-	iWriter = new TCachedByteStreamWriter(const_cast<TUint8*>(iFlashCache->Ptr()), KCacheSize);
-	iWriter->SetWriterImpl(this);
-	}
-
-/**
- * Destructor
- */
-SCMDataSave::~SCMDataSave()
-	{
-	delete iFlashCache;
-	}
-
-/**
- * Getter for the current byte count. This is the amount of data that has currently 
- * been written to given media for this crash log
- * @return The number of bytes written already to given media
- */
-TInt SCMDataSave::GetByteCount()
-	{
-	return iByteCount;
-	}
-
-/**
- * Logs the user stack for a given DThread object if it is available
- * @param aThread - thread whose stack we wish to log
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the OS codes
- */
-TInt SCMDataSave::LogThreadUserStack(DThread* aThread, TBool aFullStack, TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	TUint memDumped = 0;	
-	
-	TUint svSp, usrSp;
-	iMonitor->GetStackPointers(&(aThread->iNThread), svSp, usrSp );	
-	
-	//first we check for a user stack...
-	if (aThread->iUserStackRunAddress && aThread->iUserStackSize)
-		{		
-		//Get data together
-		TThreadStack usrStack;
-		usrStack.iStackType = TThreadStack::EUsrStack;
-		usrStack.iThreadId = (TUint64)aThread->iId;					
-				
-		//map in the user stack
-		TUint8* usrStart = (TUint8*)iMonitor->MapAndLocateUserStack(aThread); //What about Demand paging??
-		TUint8* usrEnd = (TUint8*)(usrStart + aThread->iUserStackSize);
-		if(usrStart) 
-			{
-			TUint8* stackPointer = (TUint8*)usrSp;			
-			
-			//check the stack pointer is in the range of the stack...
-			if (stackPointer < usrStart || stackPointer >= usrEnd)
-				{
-				stackPointer = usrStart;
-				}
-			
-			//log the size of the stack we are dumping
-			usrStack.iStackSize = aFullStack || (stackPointer == usrStart) ? usrEnd - usrStart : usrEnd - stackPointer;
-			TUint8* dumpFrom = aFullStack ? usrStart : stackPointer;
-			
-			//write the stack
-			aSizeDumped+= usrStack.GetSize();
-			usrStack.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?
-			//-1 because we dont want to write the byte at usrEnd			
-			MTRAPD(memErr, LogMemory(dumpFrom, usrStack.iStackSize, aThread, memDumped));			
-			if(KErrNone != memErr)
-				{
-				CLTRACE("Failed to log usr stack");
-				}
-			
-			aSizeDumped+= memDumped;					
-			}
-		else
-			{
-			//write the struct
-			aSizeDumped+=usrStack.GetSize();
-			usrStack.Serialize(*iWriter);
-			}
-		}	
-	return KErrNone;
-	}
-
-/**
- * Logs the supervisor stack for a given DThread object
- * @param aThread - thread whose stack we wish to log
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the system wide codes
- */
-TInt SCMDataSave::LogThreadSupervisorStack(DThread* aThread, TBool aFullStack, TUint& aSizeDumped)
-	{	
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	TUint memDumped = 0;
-	
-	TUint svSp, usrSp;
-	iMonitor->GetStackPointers(&(aThread->iNThread), svSp, usrSp );
-	
-	//now we dump the supervisor stack
-	TThreadStack svrStack;
-	svrStack.iStackType = TThreadStack::ESvrStack;
-	svrStack.iThreadId = (TUint64)aThread->iId;
-	
-	if (aThread->iSupervisorStack && aThread->iSupervisorStackSize)
-		{
-		TUint8* svrStart = (TUint8*)aThread->iSupervisorStack;
-		TUint8* svrEnd = (TUint8*)(svrStart + aThread->iSupervisorStackSize);
-		TUint8* svrStackPointer = (TUint8*)svSp;
-		
-		//size of stack we are to dump
-		svrStack.iStackSize = aFullStack ? svrEnd - svrStart  : svrEnd - svrStackPointer;					
-		
-		if(svrStart)
-			{
-			//check the stack pointer is in the range of the stack...
-			if (svrStackPointer < svrStart || svrStackPointer >= svrEnd)
-				{
-				svrStackPointer = svrStart;
-				}
-
-			//write struct to flash
-			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;
-			
-			if(KErrNone != memErr)
-				{
-				CLTRACE("Failed to log supervisor stack");
-				}						
-			}
-		else
-			{
-			//write the struct
-			aSizeDumped += svrStack.GetSize();
-			svrStack.Serialize(*iWriter);
-			}
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * Takes a DProcess kernel object and logs its corrosponding code segments
- * @param aProcess
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the OS wide error codes
- */
-TInt SCMDataSave::LogCodeSegments(DProcess* aProc, TUint& aSizeDumped)
-	{	
-	LOG_CONTEXT
-	aSizeDumped = 0;	
-	
-	//the code segment set for this process
-	TCodeSegmentSet segSet;
-	segSet.iPid = (TUint64)aProc->iId;
-	
-	//make sure list mutex is ok
-	if(Kern::CodeSegLock()->iHoldCount)
-		{
-		return KErrCorrupt;
-		}
-	
-	//get code seg list
-	SDblQue queue;		
-	aProc->TraverseCodeSegs(&queue, NULL, DCodeSeg::EMarkDebug, DProcess::ETraverseFlagAdd);
-	
-	//iterate through the list
-	TInt codeSegCnt = 0;
-	for(SDblQueLink* codeSegPtr= queue.First(); codeSegPtr!=(SDblQueLink*) (&queue); codeSegPtr=codeSegPtr->iNext)
-		{
-		//get the code seg
-		DEpocCodeSeg* codeSeg = (DEpocCodeSeg*)_LOFF(codeSegPtr,DCodeSeg, iTempLink);
-		
-		if(codeSeg)
-			{
-			codeSegCnt++;
-			}
-		}
-	
-	if(codeSegCnt == 0)
-		{
-		return KErrNone;
-		}	
-	
-	segSet.iNumSegs = codeSegCnt;
-	segSet.Serialize(*iWriter);	
-	aSizeDumped+=segSet.GetSize();
-	
-	TModuleMemoryInfo memoryInfo;
-	
-	//now we write each code segment
-	for(SDblQueLink* codeSegPtr= queue.First(); codeSegPtr!=(SDblQueLink*) (&queue); codeSegPtr=codeSegPtr->iNext)
-		{
-		//get the code seg
-		DEpocCodeSeg* codeSeg = (DEpocCodeSeg*)_LOFF(codeSegPtr,DCodeSeg, iTempLink);
-		
-		if(codeSeg)
-			{			
-			TCodeSegment seg;									
-			seg.iXip = (codeSeg->iXIP) ? ETrue : EFalse;
-			
-			//Get the code seg type
-			if(codeSeg->IsExe())
-				{
-				seg.iCodeSegType = EExeCodeSegType;
-				}
-			else if(codeSeg->IsDll())
-				{
-				seg.iCodeSegType = EDllCodeSegType;
-				}
-			
-			TInt err = codeSeg->GetMemoryInfo(memoryInfo, NULL);
-			if(KErrNone == err)
-				{
-				seg.iCodeSegMemInfo = memoryInfo;
-				}
-			else
-				{
-				seg.iCodeSegMemInfo.iCodeSize = 0; 
-
-				// Still need to indicate it wasnt available somehow
-				}
-			
-			//Get filename			
-			seg.iNameLength = codeSeg->iFileName->Length();
-			seg.iName = *(codeSeg->iFileName);
-			
-			aSizeDumped+=seg.GetSize();
-			seg.Serialize(*iWriter);						
-			}
-		}
-	
-	//Empty this queue and clear marks
-	DCodeSeg::EmptyQueue(queue, DCodeSeg::EMarkDebug);
-	
-	return KErrNone;
-	}
-
-/**
- * This logs the rom version and header information to the crash media
- * @param aSizeDumped amount of data occupied
- * @return one of the OS wide codes
- */
-TInt SCMDataSave::LogRomInfo(TUint& aSizeDumped)	
-	{
-	aSizeDumped = 0;
-	
-	TRomHeaderData romData;
-	
-	TRomHeader rHdr = Epoc::RomHeader();
-	
-	romData.iMajorVersion = rHdr.iVersion.iMajor;
-	romData.iMinorVersion = rHdr.iVersion.iMinor;
-	romData.iBuildNumber = rHdr.iVersion.iBuild;
-	romData.iTime = rHdr.iTime;
-	
-	TInt err = romData.Serialize(*iWriter);
-	if(KErrNone != err)
-		{
-		return err;
-		}
-	
-	aSizeDumped += romData.GetSize();
-	
-	return KErrNone;
-	}
-
-/**
- * Takes a DProcess kernel object and logs to flash
- * @param aProc
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the OS wide error codes
- */
-TInt SCMDataSave::LogProcessData(DProcess* aProc, TUint& aSizeDumped)
-	{	
-	LOG_CONTEXT
-	aSizeDumped = 0;	
-	
-	TProcessData procData;
-	DCodeSeg* codeSeg = aProc->iCodeSeg;
-
-	procData.iPriority = aProc->iPriority;
-	procData.iPid = (TUint64)aProc->iId;
-	
-	//the code segment is not always available
-	if(codeSeg)
-		{
-		procData.iNamesize = codeSeg->iFileName->Length();
-		procData.iName = *(codeSeg->iFileName);
-		}
-	
-	aSizeDumped += procData.GetSize();
-	procData.Serialize(*iWriter);
-	
-	return KErrNone;
-	}
-
-/**
- * Creates meta data about the crash such as time of crash, exit reason etc. to be logged
- * later on when we have log size.
- * @param aCategory - crash category
- * @param aReason - crash reason
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the OS wide codes
- */
-TInt SCMDataSave::LogCrashHeader(const TDesC8& aCategory, TInt aReason, TInt aCrashId, TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	
-	//the thread that crashed is the context in which we are running
-	DThread* crashedThread = &Kern::CurrentThread();
-	
-	iCrashInf.iPid = crashedThread->iOwningProcess->iId; 
-	iCrashInf.iTid = crashedThread->iId;
-	iCrashInf.iCrashTime = CrashTime();
-	iCrashInf.iExitType = 0; // Not yet done: Exception or Fault - should be in category
-	iCrashInf.iExitReason = aReason;
-	iCrashInf.iFlashAlign = KFlashAlignment; //record the flash alignment (word aligned for now)
-	iCrashInf.iCachedWriterSize = iWriter->GetCacheSize();
-	
-	iCrashInf.iCategorySize = aCategory.Length();
-	iCrashInf.iCategory = aCategory;	
-	iCrashInf.iCrashId = aCrashId;
-	
-	iCrashInf.iFlashBlockSize = KCrashLogBlockSize;;
-	iCrashInf.iFlashPartitionSize = KCrashLogSize;;
-	
-	TSuperPage& sp=Kern::SuperPage();
-	iCrashInf.iExcCode = sp.iKernelExcId;
-
-	//These will be updated with more info at end of crash
-	aSizeDumped+=iCrashInf.GetSize();
-	iCrashInf.Serialize(*iWriter);
-	
-	aSizeDumped+=iHdr.GetSize();
-	iHdr.Serialize(*iWriter);		
-
-	CLTRACE1("(SCMDataSave::LogCrashHeader) finished bytes written= %d", iWriter->GetBytesWritten());
-	return KErrNone;
-	}
-
-/**
- * Logs meta data about a given DThread object
- * @param aThread Thread to dump
- * @param aSizeDumped Holds the size of the data dumped
- * @return
- */
-TInt SCMDataSave::LogThreadData(DThread* aThread, TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;	
-	
-	//struct to hold data that gets written to flash
-	TThreadData threadData;
-	
-	threadData.iTid = (TUint64)aThread->iId;
-	threadData.iOwnerId = (TUint64)aThread->iOwningProcess->iId;
-	threadData.iPriority = aThread->iThreadPriority;
-	
-	//Get the stack pointers	
-	TUint svSp, usrSp;
-	iMonitor->GetStackPointers(&(aThread->iNThread), svSp, usrSp );
-	threadData.iUsrSP = usrSp;
-	threadData.iSvcSP = svSp;
-		
-	//supervisor and user stack details
-	threadData.iSvcStack = (TInt32)aThread->iSupervisorStack;
-	threadData.iSvcStacksize = aThread->iSupervisorStackSize;
-	threadData.iUsrStack = aThread->iUserStackRunAddress;
-	threadData.iUsrStacksize = aThread->iUserStackSize;	
-	
-	//currently we can only get the kernels heap
-	if(aThread == &Kern::CurrentThread())
-		{
-		TInt32 heapLoc = 0;
-		TInt32 heapSz = 0;
-		TInt err = FindKernelHeap(heapLoc,heapSz);
-		if(KErrNone == err)
-			{
-			threadData.iSvcHeap = heapLoc;
-			threadData.iSvcHeapSize = heapSz;
-			}
-		else
-			{
-			CLTRACE("\tError: Unable to get kernel heap");
-			}
-		}	
-	
-	//get filename	
-	TFileName filename;
-	aThread->TraceAppendFullName(filename, EFalse);
-	
-	threadData.iName.Copy(filename);
-	threadData.iNamesize = threadData.iName.Length();
-	
-		
-#ifdef __INCLUDE_NTHREADBASE_DEFINES__
-	threadData.iLastCpu = aThread->iNThread.iLastCpu;
-#else	
-	threadData.iLastCpu = aThread->iNThread.iSpare3;	
-#endif	
-	
-	threadData.Serialize(*iWriter);
-	aSizeDumped+=threadData.GetSize();
-	
-	return KErrNone;
-	}
-
-/**
- * Logs the arm exception stacks 
- * @param aSizeDumped Holds the size of the data dumped 
- * @return one of the OS wide codes
- */
-TInt SCMDataSave::LogExceptionStacks(TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	TUint memDumped = 0;
-	
-	#if defined(__EPOC32__) && !defined(__CPU_X86)
-
-	TStackInfo& stackInfo = Kern::SuperPage().iStackInfo;
-
-	TThreadStack irqStack;
-	irqStack.iStackType = TThreadStack::EIRQStack;
-	irqStack.iStackSize = stackInfo.iIrqStackSize;
-	
-	aSizeDumped+=irqStack.GetSize();
-	irqStack.Serialize(*iWriter);
-	
-	//now dump the IRQ memory - not much we can do in the event of an error
-	MTRAPD(irqErr, LogMemory((TUint8*)stackInfo.iIrqStackBase, stackInfo.iIrqStackSize, &Kern::CurrentThread(), memDumped));	
-	
-	if(KErrNone != irqErr)
-		{
-		CLTRACE("*****Failed to log IRQ stack");
-		}
-	aSizeDumped+=memDumped;
-	
-	//Next, we do the FIQ stack
-	TThreadStack fiqStack;
-	fiqStack.iStackType = TThreadStack::EFIQStack;
-	fiqStack.iStackSize = stackInfo.iFiqStackSize;
-	
-	aSizeDumped+=fiqStack.GetSize();
-	fiqStack.Serialize(*iWriter);
-	
-	//Now dump the stack itself
-	MTRAPD(fiqErr, LogMemory((TUint8*)stackInfo.iFiqStackBase, stackInfo.iFiqStackSize, &Kern::CurrentThread(), memDumped));
-	
-	if(KErrNone != fiqErr )
-		{
-		CLTRACE("*****Failed to log FIQ stack");
-		}
-	aSizeDumped+=memDumped;
-
-	#endif
-	
-	return KErrNone;
-	}
-
-/**
- * Logs the CPU Registers at the time of crash
- * @param aSizeDumped Holds the size of the data dumped
- * @return system wide OS code
- */
-TInt SCMDataSave::LogCPURegisters(TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	
-	TInt32 fullSet = 37;
-	
-	//meta data about the thread set
-	TRegisterSet threadSet;
-	threadSet.iNumRegisters = fullSet;
-	
-	aSizeDumped+=threadSet.GetSize();
-	threadSet.Serialize(*iWriter);
-		
-	SFullArmRegSet regSet;
-	ReadCPURegisters(regSet);
-	TArmReg* regs = (TArmReg*)&regSet;
-		
-	TInt32 cnt = 0;
-	for(cnt = 0; cnt < fullSet; cnt++)
-		{			
-		//this is the struct to store the register value in
-		TRegisterValue regVal;
-		regVal.iType = cnt * 0x100;
-		regVal.iValue32 = regs[cnt];
-		regVal.iOwnId = Kern::CurrentThread().iId;
-		
-		aSizeDumped+=regVal.GetSize();
-		regVal.Serialize(*iWriter);
-		}
-
-	return KErrNone;	
-	}
-
-/**
- * This logs the registers for a given thread to the flash memory
- * @param aThread - thread whose registers we want
- * @param aRegType - type of register set required such as user, supervisor etc
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the OS return codes
- */
-TInt SCMDataSave::LogRegisters(DThread* aThread, const TRegisterSetType& aRegType, TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	
-	TArmRegSet regs;
-	TUint32 availableRegs;
-	TInt err;
-	
-	//for the current thread we do things differently
-	if(aThread == &Kern::CurrentThread() && aRegType == EFullCPURegisters)
-		{
-		err = LogCPURegisters(aSizeDumped);
-		return err;
-		} 
-	else if(aThread == &Kern::CurrentThread())
-		{
-		//only do full cpu reg for the current thread
-		return KErrNotSupported;
-		}
-	
-	//Read the appropriate registers
-	switch(aRegType)
-		{
-		case EUserRegisters :
-			{
-			err = ReadUserRegisters(aThread, regs, availableRegs);
-			break;
-			}
-		case ESupervisorRegisters :
-			{
-			err = ReadSystemRegisters(aThread, regs, availableRegs);
-			break;			
-			}
-		default : return KErrNotSupported;
-		}
-	
-	if(err != KErrNone)
-		{
-		return err;
-		}	
-		
-	//meta data about the thread set
-	TRegisterSet threadSet;
-	
-	//to get the number of registers in advance, we need to count the number of times 1 is set in the bit field of availableRegs
-	TUint numR = 0;
-	for(TInt cnt =0; cnt< 8*sizeof(availableRegs); cnt++) //cycle through 1 bit at a time
-		{
-		if(0x1 & (availableRegs>>cnt))
-			numR++;
-		}
-	
-	threadSet.iNumRegisters = numR;
-	
-	if(numR == 0)
-		return KErrNone;
-	
-	threadSet.Serialize(*iWriter);
-	aSizeDumped += threadSet.GetSize();
-	
-	TInt32 currentRegister = 1;
-	TArmReg* reg = (TArmReg*)(&regs);	
-	
-	for(TInt32 cnt = 0; cnt < KArmRegisterCount; cnt++)
-		{		
-		//look at the unavailable bitmask to see current register is available
-		//only write the registers we have values for
-		if(currentRegister & availableRegs)
-			{
-			//this is the struct to store the register value in
-			TRegisterValue regVal;
-						
-			//get register type as per symbian elf docs
-			TUint32 registerType;
-			err = GetRegisterType(aRegType, cnt, registerType);
-			if(err != KErrNone)
-				{
-				continue;
-				}
-			regVal.iType = registerType;
-			regVal.iOwnId = aThread->iId;
-			
-			//set value
-			regVal.iValue32 = reg[cnt];
-			
-			aSizeDumped+=regVal.GetSize();
-			regVal.Serialize(*iWriter);
-			}
-		
-		currentRegister<<=1; 
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * This logs memory in the specified area
- * @param aStartAddress - address to start from
- * @param aEndAddress - address to finish
- * @param aThread - process whose memory this is in
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the system wide codes
- */
-TInt SCMDataSave::LogMemory(const TUint8* aStartAddress, TInt aLength, const DThread* aThread, TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;	
-	
-	if(aThread->iOwningProcess != &Kern::CurrentProcess())
-		{
-		TInt err = iMonitor->SwitchAddressSpace(aThread->iOwningProcess, ETrue);
-		if(KErrNone != err)
-			{
-			return err;
-			}
-		}
-	
-	TMemoryDump memDump;
-	memDump.iStartAddress = (TUint32)aStartAddress;
-	memDump.iLength = aLength;
-	memDump.iPid = aThread->iOwningProcess->iId;
-	
-	aSizeDumped+=memDump.GetSize();
-	memDump.Serialize(*iWriter);	
-	
-	if(!aStartAddress)
-		{
-		return KErrArgument;
-		}
-	
-	TRawData theMemory;
-	theMemory.iData.Set(const_cast<TUint8*>(aStartAddress), aLength, aLength);
-	
-	theMemory.Serialize(*iWriter);
-	aSizeDumped+=theMemory.GetSize();
-	
-	return KErrNone;	
-	}
-
-/**
- * This logs the locks held by system at time of crash
- * @param aSizeDumped Holds the size of the data dumped
- * @return one of the system wide codes
- */
-TInt SCMDataSave::LogLocks(TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	
-	// get the mutex logs & waits & log via a TLockData object		
-	TSCMLockData lockData;
-
-	const TInt KMaxLockCheck = 20; // so no possibility of infinite loop
-		
-	TInt lockCount = 0;
-	// check for kernel locks - 	
-	for(TInt i=0;i<KMaxLockCheck;i++)
-		{		
-		TBool locked = NKern::KernelLocked(i);	
-		if(!locked)
-			{
-			lockData.SetLockCount(lockCount);
-			break;		
-			}
-		// found a valid lock for value i increment the clock counter
-		lockCount++;
-		}
-	
-	// now mutexes
-	DMutex* mutex = Kern::CodeSegLock();
-	if(mutex)
-		{
-		lockData.SetMutexHoldCount(mutex->iHoldCount);
-		lockData.SetMutexThreadWaitCount(mutex->iWaitCount);
-		}
-	else
-		{
-		// no mutex held set to -1
-		lockData.SetMutexHoldCount(0);
-		lockData.SetMutexThreadWaitCount(0);		
-		}
-
-	aSizeDumped+=lockData.GetSize();
-	TInt err = lockData.Serialize(*iWriter);
-	
-	return err;
-	}
-
-/**
- * Writes the SCM Configuration to the start of the media
- * @param aScmConfig Configuration to write
- * @return one of the system wide codes
- */
-TInt SCMDataSave::LogConfig(SCMConfiguration& aScmConfig)
-	{
-	iWriter->SetPosition(0);
-	
-	TInt err = aScmConfig.Serialize(*iWriter);
-	
-	if( err != KErrNone)
-		{
-		CLTRACE1("SCMDataSave::LogConfig failed err = %d", err);
-		}
-
-	return err;
-	}
-
-/**
- * Reads the SCM Configuration from the media
- * @param aScmConfig
- * @return one of the system wide codes
- */
-TInt SCMDataSave::ReadConfig(SCMConfiguration& aScmConfig)
-	{		
-	const TInt KBufSize = 135; //Not yet done: Put in header, beside config defn
-
-	if( KBufSize < aScmConfig.GetSize())
-		{
-		CLTRACE2("(SCMDataSave::ReadConfig) ** ERROR Inadequate buffer actual = %d req = %d"
-				, KBufSize,  aScmConfig.GetSize());	
-		}
-	
-	// try and read the configuration
-	TBuf8<KBufSize> buf;
-	buf.SetLength(KBufSize);
-		
-	iFlash->SetReadPos(0); // config always at 0
-	iFlash->Read(buf);
-	 
-	TByteStreamReader reader(const_cast<TUint8*>(buf.Ptr()));		
-	TInt err = aScmConfig.Deserialize(reader);	
-	if(err == KErrNotReady)
-		{
-		CLTRACE("(SCMDataSave::ReadConfig) no config saved - use default");
-		}	
-	else if(err == KErrNone)	
-		{
-		CLTRACE("(SCMDataSave::ReadConfig) Config read ok"); 		
-		}
-	else
-		{
-		CLTRACE1("(SCMDataSave::ReadConfig) error reading config err = %d", err); 
-		}
-	
-	return err;
-	}
-
-/**
- * This is a look up table to map the register type and number to the symbian elf definition 
- * of register type
- * @param aSetType this is the register set type - user, supervisor etc
- * @param aRegNumber this is the number of the register as per TArmRegisters in arm_types.h
- * @param aSizeDumped Holds the size of the data dumped
- * @return One of the OS wide codes
- */
-TInt SCMDataSave::GetRegisterType(const TRegisterSetType& aSetType, TInt32& aRegNumber, TUint32& aRegisterType)
-	{	
-	//validate arguments
-	if(aRegNumber < EArmR0 || aRegNumber > EArmFlags)
-		{
-		return KErrArgument;
-		}
-	
-	//look at what type we are using
-	switch(aSetType)
-		{
-		case EUserRegisters :
-			{
-			aRegisterType = aRegNumber * 0x100; //for R0 to R16 (CPSR) it just increments in 0x100 from 0x0 to 0x1000
-			break;
-			}
-		case ESupervisorRegisters :
-			{
-			//same as EUserRegisters except R13 and R14 are different
-			if(aRegNumber == EArmSp)
-				{
-				aRegisterType = 0x1100;
-				break;
-				}
-			else if(aRegNumber == EArmLr)
-				{
-				aRegisterType = 0x1200;
-				break;
-				}
-			else
-				{
-				aRegisterType = aRegNumber * 0x100;
-				break;
-				}		
-			}
-		default : return KErrNotSupported;
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * Writes the trace buffer to the crash log. 
- * @param aSizeToDump Number of bytes to dump. If this is zero we attempt to write the entire buffer
- * @param aSizeDumped Holds the size of the data dumped
- * @return One of the OS wide codes
- */
-TInt SCMDataSave::LogTraceBuffer(TInt aSizeToDump, TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	aSizeDumped = 0;
-	TUint memDumped = 0;
-	
-	TBool dumpAll = (aSizeToDump == 0) ? ETrue : EFalse;
-	
-	//Because the btrace buffer is a circular one, we need to save it in two parts
-	//this corrosponds to how we read it	
-	TUint8* data;
-	TUint sizeOfPartRead;
-	TInt spaceRemaining = aSizeToDump;
-	
-	//This structure will be filled after the first pass and cached so by the time we ARE writing it will
-	//contain the data we want 
-	aSizeDumped+=iTrace.GetSize();
-	iTrace.Serialize(*iWriter);
-	
-	//read first part
-	TInt err = BTrace::Control(BTrace::ECtrlCrashReadFirst,&data,&sizeOfPartRead);
-	
-	while(KErrNone == err && sizeOfPartRead > 0)
-		{
-		TUint rawSize = 0; //how much of this read data want we to dump
-		
-		if(dumpAll)
-			{
-			rawSize = sizeOfPartRead;
-			}
-		else	//Otherwise see what room is left for dumpage
-			{
-			rawSize  = ((sizeOfPartRead + iTrace.iSizeOfMemory) > aSizeToDump) ? spaceRemaining : sizeOfPartRead;
-			}		
-		
-		//Only relevant if restricting the dump
-		if(spaceRemaining <= 0 && !dumpAll)
-			break;
-		
-		TPtrC8 ptr(data, rawSize);
-		err = LogRawData(ptr, memDumped);
-		if(KErrNone != err)
-			{
-			CLTRACE1("Logging Raw data failed - [%d]", err);
-			err = BTrace::Control(BTrace::ECtrlCrashReadNext,&data,&sizeOfPartRead);
-			continue;
-			}
-		
-		aSizeDumped+=memDumped;
-		
-		iTrace.iSizeOfMemory += rawSize;
-		iTrace.iNumberOfParts++;
-		spaceRemaining -= rawSize;		
-		
-		err = BTrace::Control(BTrace::ECtrlCrashReadNext,&data,&sizeOfPartRead);
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * Logs the data in a TRawData struct
- * @param aData 
- * @param aSizeDumped Holds the size of the data dumped
- * @return One of the OS wide codes
- */
-TInt SCMDataSave::LogRawData(const TDesC8& aData, TUint& aSizeDumped)
-	{
-	TRawData theData;
-	theData.iLength = aData.Length();
-	theData.iData.Set(const_cast<TUint8*>(aData.Ptr()), aData.Length(), aData.Length());
-	
-	aSizeDumped+=theData.GetSize();
-	return theData.Serialize(*iWriter);	
-	}
-
-
-/**
- * Logs the kernels heap and returns the size dumped via aSizeDumped
- * @param aSizeDumped Holds the size of the data dumped
- * @return
- */
-TInt SCMDataSave::LogKernelHeap(TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	
-	TInt32 heapLoc = 0;
-	TInt32 heapSize = 0;
-	TInt32 err = FindKernelHeap(heapLoc, heapSize);
-	if(KErrNone == err)
-		{
-		return LogMemory((TUint8*)heapLoc, heapSize, &Kern::CurrentThread(), aSizeDumped);
-		}
-	
-	CLTRACE1("\tCouldnt find the kernel heap: [%d]", err);
-	return err;
-	}
-
-/**
- * Iterates the object containers and finds the kernel heap
- * @param aHeapLocation Contains the memory location of the kernel heap
- * @param aHeapSize Contains the size of the Heap
- * @return One of the OS wide codes
- */
-TInt SCMDataSave::FindKernelHeap(TInt32& aHeapLocation, TInt32& aHeapSize)
-	{
-	LOG_CONTEXT
-	
-	//Get process object container
-	DObjectCon* objectContainer = Kern::Containers()[EProcess];
-	if(objectContainer == NULL)
-		{		
-		CLTRACE("\tFailed to get object container for the processes");
-		return KErrNotFound;
-		}
-	
-	//Must check the mutex on this is ok otherwise the data will be in an inconsistent state
-	if(objectContainer->Lock()->iHoldCount)
-		{
-		CLTRACE("\tChunk Container is in an inconsistant state");
-		return KErrCorrupt;
-		}
-	
-	TInt numObjects = objectContainer->Count();	
-	
-	DProcess* kernelProcess = NULL;
-	for(TInt cnt = 0; cnt < numObjects; cnt ++)
-		{		
-		DProcess* candidateProcess = (DProcess*)(*objectContainer)[cnt];
-		
-		//Get the objects name
-		TBuf8<KMaxKernelName> name;
-		candidateProcess->TraceAppendFullName(name,EFalse);		
-		if(name == KKernelProcessName)
-			{
-			kernelProcess = candidateProcess;
-			}
-		}
-	if (!kernelProcess)
-		return KErrNotFound;
-
-	//Get chunk object container
-	objectContainer = Kern::Containers()[EChunk];
-	if(objectContainer == NULL)
-		{		
-		CLTRACE("\tFailed to get object container for the chunks");
-		return KErrNotFound;
-		}
-	
-	//Must check the mutex on this is ok otherwise the data will be in an inconsistent state
-	if(objectContainer->Lock()->iHoldCount)
-		{
-		CLTRACE("\tChunk Container is in an inconsistant state");
-		return KErrCorrupt;
-		}	
-	
-	numObjects = objectContainer->Count();
-	for(TInt cnt = 0; cnt < numObjects; cnt ++)
-		{		
-		DChunk* candidateHeapChunk = (DChunk*)(*objectContainer)[cnt];
-		
-		//Get the objects name
-		TBuf8<KMaxKernelName> name;
-		candidateHeapChunk->TraceAppendFullName(name,EFalse);
-		
-		if(name == KKernelHeapChunkName)
-			{
-			aHeapLocation = (TInt32)candidateHeapChunk->Base(kernelProcess);
-			aHeapSize = candidateHeapChunk->iSize;
-			return KErrNone;
-			}
-		}
-	
-	return KErrNotFound;
-	}
-
-/**
- * This logs the variant specific descriptor data to the crash log
- * @param aSizeDumped records how much was dumped by this function
- * @return one of the OS wide codes
- */
-TInt SCMDataSave::LogVariantSpecificData(TUint& aSizeDumped)
-	{
-	LOG_CONTEXT
-	
-	aSizeDumped = 0;
-	
-	//Change this descriptor as required for your needs
-	_LIT(KVariantSpecificData, "This is the variant specific data. Put your own here");
-	
-	TVariantSpecificData varData;
-	varData.iSize = KVariantSpecificData().Size(); 
-	
-	TInt err = varData.Serialize(*iWriter);
-	if(KErrNone != err)
-		{
-		CLTRACE1("\tLogging variant specific data failed with code [%d]", err);
-		return err;
-		}
-	aSizeDumped+=varData.GetSize();
-	
-	TUint rawDataSize = 0;
-	err = LogRawData(KVariantSpecificData(), rawDataSize);
-	if(KErrNone != err)
-		{
-		CLTRACE1("\tLogging variant specific data failed with code [%d]", err);
-		return err;
-		}
-	
-	aSizeDumped+=rawDataSize;
-	
-	return KErrNone;
-	}
-
-
-/**
- * This method is the callback used by MPhysicalWriterImpl interface
- * if the TCachedByteStreamWriter is configured to use this interface
- * the callback avoids the need for temp buffers & can interface directly with the
- * flash writer methods
- * @param aData - data to write
- * @param aLen	- length of data to write
- * @param aPos  - writers internal position   
- */
-void SCMDataSave::DoPhysicalWrite(TAny* aData, TInt aPos, TInt aLen)
-	{	
-	if(iPerformChecksum)
-		{
-		iChecksum.ChecksumBlock((TUint8*)aData, aLen);
-		}
-	
-	if( this->iWriteSelect == EWriteComm)
-		{	
-		WriteUart((TUint8*)aData, aLen);		
-		}
-	else  // EWriteFlash
-		{			
-		Write(aData, aLen);
-		}
-	}
-
-/**
- * Writes data to Flash
- * @param aSomething Pointer to the data
- * @param aSize Size of the data
- */
-void SCMDataSave::Write(const TAny* aSomething, TInt aSize)
-	{		
-	TPtrC8 data((const TUint8 *)aSomething, aSize);
-	
-	TInt written = 0;
-	
-	WriteCrashFlash(iByteCount, written, data);
-	iByteCount+= written;	
-	}
-
-/**
- * Writes a descriptor to the crash flash
- * @param aPos Position in flash to write
- * @param aSize Holds the size of the data written after the call
- * @param aBuffer Descriptor to write
- */
-void SCMDataSave::WriteCrashFlash(TInt aPos, TInt& aSize, const TDesC8& aBuffer)
-	{	
-	//Set write position in the flash
-	iFlash->SetWritePos(aPos);	
-	iFlash->Write(aBuffer);
-	
-	//get bytes written
-	aSize += iFlash->BytesWritten();
-	
-	if(aSize != aBuffer.Length())
-		{
-		CLTRACE2("(SCMDataSave::WriteCrashFlash) Over the limit aSize = %d aBuffer.Length() = %d",
-				aSize,  aBuffer.Length());
-		}
-	}
-	
-/**
- * Writes a descriptor via serial
- * @param aDes Descriptor to write
- */
-void SCMDataSave::WriteUart(const TDesC8& aDes)
-	{
-	WriteUart(aDes.Ptr(), aDes.Length());	
-	}
-
-/**
- * Writes data via serial
- * @param aData Data to write
- * @param aSize Size of data to write
- */
-void SCMDataSave::WriteUart(const TUint8* aData, TInt aSize)
-	{
-	OMAP* assp = ((OMAP*)Arch::TheAsic());
-	TOmapDbgPrt* dbg = assp->DebugPort();
-		
-	if (dbg)
-		{
-		for(TInt i=0;i<aSize;i++)
-			{
-			dbg->DebugOutput(*(aData+i));			
-			}
-		}
-	else
-		{
-		CLTRACE("SCMDataSave::WriteUart ERROR - dbg was null");		
-		}
-	}
-
-/**
- * Setter for the current number of bytes written for this crash log
- * If aByte is not word aligned, it will be rounded up to be so
- * @param aByte Current bytes written
- */
-void SCMDataSave::SetByteCount(TInt aByte)
-	{
-	//ensure aligned
-	if(aByte % iWriter->GetCacheSize() == 0)
-		{
-		iByteCount = aByte;
-		}
-	else
-		{
-		iByteCount = aByte + (iWriter->GetCacheSize() - (aByte % iWriter->GetCacheSize()));
-		}		
-	}
-
-/**
- * Gets the output target selection
- * @return TScmWriteSelect output target selection
- * @param void
- */	
-SCMDataSave::TWriteSelect SCMDataSave::GetWriteSelect()
-	{
-	return iWriteSelect;
-	}
-
-/**
- * Sets the output target selection
- * @return void
- * @param TScmWriteSelect aWriteSelect output target selection
- */
-void SCMDataSave::SetWriteSelect(SCMDataSave::TWriteSelect aWriteSelect)
-	{
-	iWriteSelect = aWriteSelect;
-	}
-
-/**
- * Gets the amount of space remaining for the media of choice
- * @return
- */
-TUint SCMDataSave::SpaceRemaining()
-	{
-	TInt currentPosition = iWriter->GetBytesWritten() + iStartingPointForCrash;
-	
-	return MaxLogSize() - currentPosition; 
-	}
-
-/**
- * To find the max size of a log for a given media
- * @return the max size of a log for a given media
- */
-TUint SCMDataSave::MaxLogSize()
-	{
-	//see what write media is being used
-	switch(GetWriteSelect())
-		{
-		case EWriteFlash:
-			{
-			return KMaxCrashLogSize; 
-			}
-		case EWriteComm:
-			{
-			return 0xFFFFFFFF;
-			}
-		default:
-			{
-			return 0;
-			}
-		} 
-	}
-
-/**
- * Records the offset in the flash partition where this crash begins
- * @param aStart Offset in flash
- */
-void SCMDataSave::SetCrashStartingPoint(TUint32 aStart)
-	{
-	iStartingPointForCrash = aStart;
-	}
-
-//eof
-
--- a/kernel/eka/debug/crashMonitor/src/scmdatatypes.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1618 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmdatatypes.cpp
-// Core dump server - Data Types for System Crash
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-#include <scmtrace.h>
-#include <scmdatatypes.h>
-#include <scmbytestreamutil.h>
-
-namespace Debug 
-	{	
-	/**
-	 * TCrashOffsetsHeader implementation
-	 * @internal technology
-	 */
-
-	/**
-	 * TCrashOffsetsHeader Constructor
-	 */
-	TCrashOffsetsHeader::TCrashOffsetsHeader():
-		iId(ESCMOffsetsHeader),	
-		iVersion(EChVersion1),	
-		iCTFullRegOffset(0),
-		iCTUsrStkOffset(0),
-		iCTSvrStkOffset(0),
-		iCPMetaOffset(0),
-		iCTMetaOffset(0),
-		iCPCodeSegOffset(0),
-		iSysUsrStkOffset(0),
-		iSysSvrStkOffset(0),
-		iSysUsrRegOffset(0),
-		iSysSvrRegOffset(0),
-		iTLstOffset(0),
-		iPLstOffset(0),	
-		iSysCodeSegOffset(0),
-		iExcStkOffset(0),		
-		iTraceOffset(0),
-		iScmLocksOffset(0),
-		iKernelHeapOffset(0),
-		iVarSpecInfOffset(0),
-		iRomInfoOffset(0),	
-		iSpare1(0),
-		iSpare2(0),
-		iSpare3(0),
-		iSpare4(0),	
-		iSpare5(0),	
-		iSpare6(0)
-		{	
-		}	
-
-	/**
-	 * Writes this class to the specified byte stream
-	 * @param aWriter Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCrashOffsetsHeader::Serialize(TByteStreamWriter& aWriter)
-		{						
-		TInt startPos = aWriter.CurrentPosition();
-		
-		if(iId != ESCMOffsetsHeader)
-			{
-			CLTRACE("TCrashOffsetsHeader::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				// 4		
-		aWriter.WriteShort((TUint16) iVersion);		// 2
-
-		if(iVersion == EChVersion1)
-			{
-			// write data v1 format	
-			aWriter.WriteInt(iCTFullRegOffset); 	// 4 
-			aWriter.WriteInt(iCTUsrStkOffset);  	// 4
-			aWriter.WriteInt(iCTSvrStkOffset);  	// 4		
-			aWriter.WriteInt(iCPMetaOffset);	   	// 4
-			aWriter.WriteInt(iCTMetaOffset);		// 4
-			aWriter.WriteInt(iCPCodeSegOffset);	// 4
-			aWriter.WriteInt(iSysUsrStkOffset);	// 4
-			aWriter.WriteInt(iSysSvrStkOffset);	// 4
-			aWriter.WriteInt(iSysUsrRegOffset);	// 4
-			aWriter.WriteInt(iSysSvrRegOffset);	// 4
-			aWriter.WriteInt(iTLstOffset);		// 4
-			aWriter.WriteInt(iPLstOffset);		// 4
-			aWriter.WriteInt(iSysCodeSegOffset);	// 4
-			aWriter.WriteInt(iExcStkOffset);		// 4
-			aWriter.WriteInt(iTraceOffset);		// 4
-			aWriter.WriteInt(iScmLocksOffset);	// 4
-			aWriter.WriteInt(iKernelHeapOffset);		// 4			
-			aWriter.WriteInt(iVarSpecInfOffset);		// 4
-			aWriter.WriteInt(iRomInfoOffset);		// 4	
-			}
-		else
-			{
-			CLTRACE("TCrashOffsetsHeader::Serialize Unsupported version");
-			}
-		
-		TInt sizeWritten = aWriter.CurrentPosition() - startPos;
-		if(sizeWritten != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TCrashOffsetsHeader serialization size error");	
-			return KErrCorrupt;
-			}
-
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCrashOffsetsHeader::Deserialize(TByteStreamReader& aReader)	
-		{		
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();	// 4
-		if(iId != ESCMOffsetsHeader)
-			{
-			CLTRACE("TCrashOffsetsHeader::Deserialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TCrashHeaderVersion)aReader.ReadShort();  //2
-		
-		if(iVersion == EChVersion1)
-			{	
-			iCTFullRegOffset = aReader.ReadInt(); // 4
-			iCTUsrStkOffset = aReader.ReadInt();	// 4
-			iCTSvrStkOffset = aReader.ReadInt();	// 4
-			iCPMetaOffset = aReader.ReadInt();	// 4		
-			iCTMetaOffset = aReader.ReadInt();	// 4
-			iCPCodeSegOffset = aReader.ReadInt();	// 4
-			iSysUsrStkOffset = aReader.ReadInt(); // 4
-			iSysSvrStkOffset = aReader.ReadInt(); // 4
-			iSysUsrRegOffset = aReader.ReadInt(); // 4
-			iSysSvrRegOffset = aReader.ReadInt(); // 4
-			iTLstOffset = aReader.ReadInt();		// 4
-			iPLstOffset = aReader.ReadInt();		// 4
-			iSysCodeSegOffset = aReader.ReadInt();// 4
-			iExcStkOffset = aReader.ReadInt();	// 4
-			iTraceOffset = aReader.ReadInt();		// 4
-			iScmLocksOffset = aReader.ReadInt();	// 4			
-			iKernelHeapOffset = aReader.ReadInt();		// 4
-			iVarSpecInfOffset = aReader.ReadInt();		// 4
-			iRomInfoOffset = aReader.ReadInt();		// 4						
-			}
-		else
-			{
-			CLTRACE("TCrashOffsetsHeader::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TCrashOffsetsHeader deserialization size error");		
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-
-	/**
-	 * Get the externalised size of this class
-	 * @return TInt the Size
-	 */
-	TInt TCrashOffsetsHeader::GetSize() const
-		{
-		// return the size in bytes that this struct uses to serialize - deserialize itself
-		if(iVersion == EChVersion1)
-			{
-			return 82;
-			}
-		else
-			{
-			CLTRACE("TCrashOffsetsHeader::GetSize Unsupported version");			
-			return KErrNotSupported;
-			}
-		}
-	
-	TBool TCrashOffsetsHeader::operator == (const TCrashOffsetsHeader& aOther) const
-		{
-		return (iId ==  aOther.iId && 	
-				iVersion == aOther.iVersion &&	
-				iCTFullRegOffset == aOther.iCTFullRegOffset &&			
-				iCTUsrStkOffset == aOther.iCTUsrStkOffset &&
-				iCTSvrStkOffset == aOther.iCTSvrStkOffset &&
-				iCPMetaOffset == aOther.iCPMetaOffset &&
-				iCTMetaOffset == aOther.iCTMetaOffset &&		
-				iSysUsrStkOffset == aOther.iSysUsrStkOffset &&
-				iSysSvrStkOffset == aOther.iSysSvrStkOffset &&
-				iSysUsrRegOffset == aOther.iSysUsrRegOffset &&
-				iSysSvrRegOffset == aOther.iSysSvrRegOffset &&
-				iTLstOffset == aOther.iTLstOffset &&
-				iPLstOffset == aOther.iPLstOffset &&	
-				iExcStkOffset == aOther.iExcStkOffset &&	
-				iCPCodeSegOffset == aOther.iCPCodeSegOffset &&
-				iSysCodeSegOffset == aOther.iSysCodeSegOffset &&
-				iTraceOffset == aOther.iTraceOffset &&
-				iScmLocksOffset == aOther.iScmLocksOffset &&
-				iVarSpecInfOffset == aOther.iVarSpecInfOffset &&
-				iKernelHeapOffset == aOther.iKernelHeapOffset &&
-				iRomInfoOffset == aOther.iRomInfoOffset);
-		}
-	
-	
-	/**
-	 * TCrashInfoHeader implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TCrashInfoHeader constructor
-	 */
-	TCrashInfoHeader::TCrashInfoHeader():
-		iId(ESCMTCrashInfo),
-		iVersion(ECiVersion1),
-		iLogSize(0),
-		iFlashAlign(0),
-		iCachedWriterSize(0),
-		iPid(0),
-		iTid(0),
-		iExitType(0),
-		iExitReason(0),
-		iExcCode(0),	
-		iCrashTime(0),
-		iCrashId(0),
-		iFlashBlockSize(0),
-		iFlashPartitionSize(0),
-		iCategorySize(0),
-		iSpare1(0),
-		iSpare2(0)
-		{		
-		TVersion ver(KSCMDataTypesMajorVersion, KSCMDataTypesMinorVersion, KSCMDataTypesBuildNumber);
-		iSCMDataTypesVersion = ver;
-		}
-
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCrashInfoHeader::Serialize(TByteStreamWriter& aWriter)
-		{	
-		
-		//CLTRACE("TCrashInfoHeader::Serialize");
-		TInt startPos = aWriter.CurrentPosition();
-		
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				// 4		
-		if(iId != ESCMTCrashInfo)
-			{
-			CLTRACE("TCrashInfoHeader::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == ECiVersion1)
-			{
-			// write data v1 format
-			aWriter.WriteInt(iLogSize);					// 4
-			aWriter.WriteByte((TUint8)iFlashAlign);  	// 1
-			aWriter.WriteByte((TUint8)iCachedWriterSize);		// 1		
-			aWriter.WriteInt64(iPid);					// 8
-			aWriter.WriteInt64(iTid);					// 8
-			aWriter.WriteInt(iExitType);				// 4
-			aWriter.WriteInt(iExitReason);				// 4
-			aWriter.WriteInt(iExcCode);					// 4
-			aWriter.WriteInt64(iCrashTime);				// 8
-			aWriter.WriteInt(iCrashId);					// 4
-			aWriter.WriteInt(iFlashBlockSize);			// 4
-			aWriter.WriteInt(iFlashPartitionSize);			// 4
-			aWriter.WriteInt(iSCMDataTypesVersion.iMajor);  // 4
-			aWriter.WriteInt(iSCMDataTypesVersion.iMinor);  // 4
-			aWriter.WriteInt(iSCMDataTypesVersion.iBuild);  // 4
-			
-			if(iCategory.Ptr())
-				{
-				aWriter.WriteInt(iCategory.Length());	// 4		
-				for(TInt cnt = 0; cnt < iCategory.Length(); cnt++)
-					{
-					aWriter.WriteByte(iCategory[cnt]);  //iCategorySize bytes
-					}
-				}
-			else
-				{
-				aWriter.WriteInt(0);
-				}
-			}
-		else
-			{
-			CLTRACE("TCrashInfoHeader::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE2("TCrashInfoHeader::Serialize serialization size error. Wrote [%d] but expected [%d]", endPos - startPos, GetSize());
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCrashInfoHeader::Deserialize(TByteStreamReader& aReader)	
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();
-		if(iId != ESCMTCrashInfo)
-			{
-			CLTRACE("TCrashInfoHeader::Deserialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TCrashInfoHeaderVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ECiVersion1)
-			{
-			// read data v1 format
-			iLogSize = aReader.ReadInt(); 			 	    // 4
-			iFlashAlign = aReader.ReadByte();  				// 1
-			iCachedWriterSize = aReader.ReadByte();			// 1
-			iPid = aReader.ReadInt64();						// 8
-			iTid = aReader.ReadInt64();						// 8
-			iExitType = aReader.ReadInt();					// 4
-			iExitReason = aReader.ReadInt();				// 4
-			iExcCode = aReader.ReadInt();					// 4
-			iCrashTime = aReader.ReadInt64();				// 8
-			iCrashId = aReader.ReadInt();					// 4
-			iFlashBlockSize = aReader.ReadInt(); 			// 4	
-			iFlashPartitionSize = aReader.ReadInt(); 		// 4
-			iSCMDataTypesVersion.iMajor = aReader.ReadInt(); 		// 4
-			iSCMDataTypesVersion.iMinor = aReader.ReadInt(); 		// 4
-			iSCMDataTypesVersion.iBuild = aReader.ReadInt(); 		// 4			
-			
-
-			iCategorySize = aReader.ReadInt(); 				// 4
-			
-			if(iCategory.MaxLength() >= (TInt)iCategorySize)
-				{
-				iCategory.SetLength(0);
-				
-				for(TUint cnt = 0; cnt < iCategorySize; cnt++)
-					{
-					iCategory.Append(aReader.ReadByte());		//iCategorySize bytes
-					} 
-				}
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TCrashInfoHeader::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{					
-			// error between actual size & real size in data
-			CLTRACE2("TCrashInfoHeader::Deserialize serialization size error. Read [%d] but expected [%d]", endPos - startPos, GetSize());			
-			iId = ESCMLast;	//unrecognised header
-			
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TCrashInfoHeader::GetSize() const
-		{
-		if(iVersion == ECiVersion1)
-			{
-			return 76 + iCategory.Length();
-			}
-		else
-			{
-			CLTRACE("TCrashInfoHeader::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-		
-	TBool TCrashInfoHeader::operator == (const TCrashInfoHeader& aOther) const
-		{
-		return (
-			iId == aOther.iId &&
-			iVersion == aOther.iVersion &&
-			iLogSize == aOther.iLogSize &&	
-			iFlashAlign == aOther.iFlashAlign &&
-			iCachedWriterSize == aOther.iCachedWriterSize &&
-			iPid == aOther.iPid &&
-			iTid == aOther.iTid &&
-			iExitType == aOther.iExitType &&
-			iExitReason == aOther.iExitReason &&
-			iCrashTime == aOther.iCrashTime &&
-			iCategorySize == aOther.iCategorySize &&
-			iCategory == aOther.iCategory &&
-			iSCMDataTypesVersion.iMajor == aOther.iSCMDataTypesVersion.iMajor &&
-			iSCMDataTypesVersion.iMinor == aOther.iSCMDataTypesVersion.iMinor &&
-			iSCMDataTypesVersion.iBuild == aOther.iSCMDataTypesVersion.iBuild);
-		}	
-
-	/**
-	 * TThreadStack implementation
-	 * @internal technology
-	 */
-	
-	
-	/**
-	 * TThreadStack Constructor
-	 */
-	TThreadStack::TThreadStack():
-		iId(ESCMThreadStack),
-		iVersion(EStackVersion1),
-		iStackType(ELast),
-		iThreadId(0),
-		iStackSize(0),		
-		iSpare1(0),
-		iSpare2(0)
-		{		
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TThreadStack::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-		
-		if(iId != ESCMThreadStack)
-			{
-			CLTRACE("TThreadStack::Serialize failed - corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteInt(iId);							// 4		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == EStackVersion1)
-			{
-			// write data v1 format	
-			aWriter.WriteInt(iStackType);		 		// 4		
-			aWriter.WriteInt64(iThreadId); 			 	// 8
-			aWriter.WriteInt(iStackSize);  				// 4
-			}
-		else
-			{
-			CLTRACE("TThreadStack::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TThreadStack::Serialize serialization size error");
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TThreadStack::GetSize() const
-		{
-		if(iVersion == EStackVersion1)
-			{
-			return 22;
-			}
-		else
-			{
-			CLTRACE("TThreadStack::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TThreadStack::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();			// 4
-		if(iId != ESCMThreadStack)
-			{
-			CLTRACE("TThreadStack::Deserialize failed Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TThreadStackVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == EStackVersion1)
-			{
-			// read data v1 format	
-			iStackType = (TThreadStackType)aReader.ReadInt();		// 4
-			iThreadId = aReader.ReadInt64();	// 8
-			iStackSize = aReader.ReadInt();		// 4
-
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TThreadStack::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TThreadStack::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * TRegisterValue implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TRegisterValue Constructor
-	 */
-	TRegisterValue::TRegisterValue():
-		iId(ESCMRegisterValue),
-		iVersion(ERegisterValueVersion1),
-		iOwnId(0),
-		iType(0),
-		iClass(0), //core reg by default
-		iSubId(0),		
-		iSize(2) //default for core registers
-		{
-		}
-	
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */	 
-	TInt TRegisterValue::GetSize() const
-		{
-		if(iVersion == ERegisterValueVersion1)
-			{
-			TInt baseSize = 22;
-			
-			//variant for union
-			if(iSize == 0)
-				{
-				return baseSize + 1;
-				}
-			else if(iSize == 1)
-				{
-				return baseSize + 2;
-				}
-			else if(iSize == 2)
-				{
-				return baseSize + 4;
-				}
-			else if(iSize == 3)
-				{
-				return baseSize + 8;
-				}
-			else
-				{
-				CLTRACE("TRegisterValue::GetSize() Corrupt size");
-				return 0;
-				}
-			}
-		else
-			{
-			CLTRACE("TRegisterValue::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream 
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */	 
-	TInt TRegisterValue::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-				
-		// ID saved first
-		if(iId != ESCMRegisterValue)
-			{
-			CLTRACE("TRegisterValue::Serialize Error - Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteInt(iId);							// 4
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == ERegisterValueVersion1)
-			{
-			// write data v1 format	
-			aWriter.WriteInt64(iOwnId);		 				// 8
-			aWriter.WriteInt(iType);						// 4
-			aWriter.WriteByte(iClass);						// 1
-			aWriter.WriteShort(iSubId);						// 2
-			aWriter.WriteByte(iSize);						// 1
-			
-			//variant for union
-			if(iSize == 0)
-				{
-				aWriter.WriteByte(iValue8);
-				}
-			else if(iSize == 1)
-				{
-				aWriter.WriteShort(iValue16);
-				}
-			else if(iSize == 2)
-				{
-				aWriter.WriteInt(iValue32);
-				}
-			else if(iSize == 3)
-				{
-				aWriter.WriteInt64(iValue64);
-				}
-			else
-				{
-				CLTRACE("TRegisterValue::Serialize() Corrupt size");
-				return KErrCorrupt;
-				}
-			}
-		else
-			{
-			CLTRACE("TRegisterValue::Serialize Unsupported version");
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TRegisterValue::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */	 
-	TInt TRegisterValue::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();
-		if(iId != ESCMRegisterValue)
-			{
-			CLTRACE("TRegisterValue::Deserialize() ERROR Corrupt ID");			
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TRegisterValueVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ERegisterValueVersion1)
-			{
-			// read data v1 format	
-			iOwnId = aReader.ReadInt64();		 				// 8
-			iType = aReader.ReadInt();  						// 4
-			iClass = aReader.ReadByte();						// 1
-			iSubId = aReader.ReadShort();						// 2
-			iSize = aReader.ReadByte();							// 1
-			
-			//variant for union
-			if(iSize == 0)
-				{
-				iValue8 = aReader.ReadByte();				
-				}
-			else if(iSize == 1)
-				{
-				iValue16 = aReader.ReadShort();				
-				}
-			else if(iSize == 2)
-				{
-				iValue32 = aReader.ReadInt();
-				}
-			else if(iSize == 3)
-				{
-				iValue64 = aReader.ReadInt64();
-				}
-			else
-				{
-				CLTRACE("TRegisterValue::Serialize() Corrupt size");
-				return KErrCorrupt;
-				}
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TRegisterValue::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TRegisterValue::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * TRegisterSet implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TRegisterSet Constructor
-	 */
-	TRegisterSet::TRegisterSet():
-		iVersion(ETRegisterSetVersion1),
-		iId(ESCMRegisterSet),		
-		iNumRegisters(0)
-		{
-
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TRegisterSet::GetSize() const
-		{
-		if(iVersion == ETRegisterSetVersion1)
-			{
-			return 10;
-			}
-		else
-			{
-			CLTRACE("TRegisterSet::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TRegisterSet::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-				
-		// ID saved first
-		if(iId != ESCMRegisterSet)
-			{
-			CLTRACE("TRegisterSet::Serialize Error - Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteInt(iId);							// 4
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == ETRegisterSetVersion1)
-			{
-			// write data v1 format
-			aWriter.WriteInt(iNumRegisters);				// 4
-			}
-		else
-			{
-			CLTRACE("TRegisterSet::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TRegisterSet::Serialize serialization size error");
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TRegisterSet::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();
-		if(iId != ESCMRegisterSet)
-			{
-			CLTRACE("TRegisterSet::Deserialize() ERROR Corrupt ID");			
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TRegisterSetVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ETRegisterSetVersion1)
-			{
-			// read data v1 format	
-			iNumRegisters = aReader.ReadInt();		 				// 8
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TRegisterSet::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TRegisterSet::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * TCodeSegmentSet implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TCodeSegmentSet Constructor
-	 */
-	TCodeSegmentSet::TCodeSegmentSet():
-		iId(ESCMCodeSegSet),
-		iVersion(ETCodeSegmentSetVersion1),
-		iNumSegs(0),
-		iPid(0)		
-		{
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TCodeSegmentSet::GetSize() const
-		{
-		if(iVersion == ETCodeSegmentSetVersion1)
-			{
-			return 18;
-			}
-		else
-			{
-			CLTRACE("TCodeSegmentSet::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * This returns the largest size this class can be
-	 */
-	TInt TCodeSegmentSet::GetMaxSize() const
-		{
-		return 18;
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCodeSegmentSet::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-				
-		// ID saved first
-		if(iId != ESCMCodeSegSet)
-			{
-			CLTRACE("TCodeSegmentSet::Serialize Error - Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteInt(iId);							// 4
-		if(iId != ESCMCodeSegSet)
-			{
-			CLTRACE("TCodeSegmentSet::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == ETCodeSegmentSetVersion1)
-			{
-			// write data v1 format
-			aWriter.WriteInt(iNumSegs);				// 4
-			aWriter.WriteInt64(iPid);				// 8
-			}
-		else
-			{
-			CLTRACE("TCodeSegmentSet::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TCodeSegmentSet::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCodeSegmentSet::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();
-		if(iId != ESCMCodeSegSet)
-			{
-			CLTRACE("TCodeSegmentSet::Deserialize() ERROR Corrupt ID");			
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TCodeSegmentSetVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ETCodeSegmentSetVersion1)
-			{
-			// read data v1 format	
-			iNumSegs = aReader.ReadInt();    				// 4
-			iPid = aReader.ReadInt64();		 				// 8
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TRegisterSet::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TRegisterSet::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}	
-	
-	
-	/**
-	 * TCodeSegment implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TCodeSegment constructor
-	 */
-	TCodeSegment::TCodeSegment():
-		iId(ESCMCodeSeg),
-		iVersion(ETCodeSegmentVersion1),			
-		iCodeSegType(EUnknownCodeSegType),		
-		iXip(0),					
-		iNameLength(0)		
-		{
-		}
-
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCodeSegment::Serialize(TByteStreamWriter& aWriter)
-		{	
-		TInt startPos = aWriter.CurrentPosition();
-		
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				// 4		
-		if(iId != ESCMCodeSeg)
-			{
-			CLTRACE("TCodeSegment::Serialize Error - Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == ETCodeSegmentVersion1)
-			{
-			// write data v1 format
-			aWriter.WriteInt(iCodeSegType);
-			aWriter.WriteInt(iCodeSegMemInfo.iCodeBase);
-			aWriter.WriteInt(iCodeSegMemInfo.iCodeSize);
-			aWriter.WriteInt(iCodeSegMemInfo.iConstDataBase);
-			aWriter.WriteInt(iCodeSegMemInfo.iConstDataSize);
-			aWriter.WriteInt(iCodeSegMemInfo.iInitialisedDataBase);
-			aWriter.WriteInt(iCodeSegMemInfo.iInitialisedDataSize);
-			aWriter.WriteInt(iCodeSegMemInfo.iUninitialisedDataBase);
-			aWriter.WriteInt(iCodeSegMemInfo.iUninitialisedDataSize);
-			aWriter.WriteInt(iXip);
-			
-			if(iName.Ptr())
-				{
-				aWriter.WriteInt(iName.Length());	// 4		
-				for(TInt cnt = 0; cnt < iName.Length(); cnt++)
-					{
-					aWriter.WriteByte(iName[cnt]);  //iCategorySize bytes
-					}
-				}
-			else
-				{
-				aWriter.WriteInt(0);
-				}
-			}
-		else
-			{
-			CLTRACE("TCodeSegment::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE2("TCodeSegment::Serialize serialization size error. Wrote [%d] but expected [%d]", endPos - startPos, GetSize());
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TCodeSegment::Deserialize(TByteStreamReader& aReader)	
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();
-		if(iId != ESCMCodeSeg)
-			{
-			CLTRACE("TCodeSegment::Deserialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TCodeSegmentVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ETCodeSegmentVersion1)
-			{
-			// read data v1 format			
-			iCodeSegType = (TCodeSegType)aReader.ReadInt();
-			iCodeSegMemInfo.iCodeBase = aReader.ReadInt();
-			iCodeSegMemInfo.iCodeSize = aReader.ReadInt();
-			iCodeSegMemInfo.iConstDataBase = aReader.ReadInt();
-			iCodeSegMemInfo.iConstDataSize = aReader.ReadInt();
-			iCodeSegMemInfo.iInitialisedDataBase = aReader.ReadInt();
-			iCodeSegMemInfo.iInitialisedDataSize = aReader.ReadInt();
-			iCodeSegMemInfo.iUninitialisedDataBase = aReader.ReadInt();
-			iCodeSegMemInfo.iUninitialisedDataSize = aReader.ReadInt();
-			iXip = aReader.ReadInt();
-			iNameLength = aReader.ReadInt(); 				// 4
-			
-			if(iName.Ptr() && iName.MaxLength() >= iNameLength)
-				{
-				iName.SetLength(0);
-				
-				for(TInt cnt = 0; cnt < iNameLength; cnt++)
-					{
-					iName.Append(aReader.ReadByte());		//iCategorySize bytes
-					} 
-				}
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TCodeSegment::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{					
-			// error between actual size & real size in data
-			CLTRACE2("TCodeSegment::Deserialize serialization size error. Read [%d] but expected [%d]", endPos - startPos, GetSize());			
-			iId = ESCMLast;	//unrecognised header
-			
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TCodeSegment::GetSize() const
-		{
-		if(iVersion == ETCodeSegmentVersion1)
-			{
-			return 50 + iName.Length();
-			}
-		else
-			{
-			CLTRACE("TCodeSegment::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * This returns the largest size this class can be
-	 */
-	TInt TCodeSegment::GetMaxSize() const
-		{
-		return 50 + KMaxSegmentNameSize;
-		}
-	/**
-	 * TRawData implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TRawData constructor
-	 */
-	TRawData::TRawData():		
-		iId(ESCMRawData),
-		iVersion(ETRawData1),	
-		iLength(0),
-		iData(NULL, 0)
-		{	
-		}
-
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TRawData::Serialize(TByteStreamWriter& aWriter)
-		{	
-		TInt startPos = aWriter.CurrentPosition();
-		
-		// ID saved first 
-		aWriter.WriteInt(iId);		 							// 4		
-		if(iId != ESCMRawData)
-			{
-			CLTRACE("TRawData::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);					// 2
-
-		if(iVersion == ETRawData1)
-			{	
-			if(iData.Ptr())
-				{
-				aWriter.WriteInt(iData.Length());				// 4
-				iLength = iData.Length();
-				
-				for(TInt cnt = 0; cnt < iData.Length(); cnt++)
-					{
-					//Kern::Printf("cnt = %d \t\t\t0x%X", cnt, cnt);
-					aWriter.WriteByte(iData[cnt]);  			//iLength bytes
-					}
-				}
-			else
-				{
-				aWriter.WriteInt(0);
-				}
-			}
-		else
-			{
-			CLTRACE("TRawData::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE2("TRawData::Serialize serialization size error. Wrote [%d] but expected [%d]", endPos - startPos, GetSize());
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TRawData::Deserialize(TByteStreamReader& aReader)	
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();						// 4
-		if(iId != ESCMRawData)
-			{
-			CLTRACE("TRawData::Deserialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TTRawDataVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ETRawData1)
-			{
-			iLength = aReader.ReadInt(); 							// 4			
-			
-			if(iData.Ptr())
-				{
-				//Deserialise as much as we can into this buffer - it may be that the caller doesnt want all of it
-				iData.SetLength(0);
-				TUint amtToRead = (iData.MaxLength() >= iLength) ? iLength : iData.MaxLength();
-				
-				for(TUint cnt = 0; cnt < amtToRead; cnt++)
-					{
-					iData.Append(aReader.ReadByte());		//iCategorySize bytes
-					} 
-				
-				//move reader along what we havent read
-				aReader.SetPosition(aReader.CurrentPosition() + (iLength - amtToRead));
-				}
-			else
-				{
-				aReader.SetPosition(aReader.CurrentPosition() + iLength);
-				}
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TRawData::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{					
-			// error between actual size & real size in data
-			CLTRACE2("TRawData::Deserialize serialization size error. Read [%d] but expected [%d]", endPos - startPos, GetSize());			
-			iId = ESCMLast;	//unrecognised header
-			
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Same as Deserialise except it only starts copying data into the buffer
-	 * when it reaches aStartPos bytes into the data
-	 * @param aStartPos
-	 * @param aReader
-	 * @return
-	 */
-	TInt TRawData::Deserialize(TInt aStartPos, TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();						// 4
-		if(iId != ESCMRawData)
-			{
-			CLTRACE("TRawData::Deserialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TTRawDataVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ETRawData1)
-			{
-			iLength = aReader.ReadInt(); 							// 4			
-			
-			if(iData.Ptr())
-				{
-				//Deserialise as much as we can into this buffer - it may be that the caller doesnt want all of it
-				iData.SetLength(0);
-				aReader.SetPosition(aReader.CurrentPosition() + aStartPos);
-				
-				TUint amtToRead = (iData.MaxLength() >= iLength) ? iLength : iData.MaxLength();
-				
-				for(TUint cnt = 0; cnt < amtToRead; cnt++)
-					{
-					iData.Append(aReader.ReadByte());		//iCategorySize bytes
-					} 
-				
-				//move reader along what we havent read
-				aReader.SetPosition(aReader.CurrentPosition() + (iLength - (amtToRead + aStartPos)));
-				}
-			else
-				{
-				aReader.SetPosition(aReader.CurrentPosition() + iLength);
-				}
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TRawData::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{					
-			// error between actual size & real size in data
-			CLTRACE2("TRawData::Deserialize serialization size error. Read [%d] but expected [%d]", endPos - startPos, GetSize());			
-			iId = ESCMLast;	//unrecognised header
-			
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TRawData::GetSize() const
-		{
-		if(iVersion == ETRawData1)
-			{
-			return 10 + iLength;
-			}
-		else
-			{
-			CLTRACE("TRawData::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	
-	/**
-	 * TMemoryDump implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TMemoryDump Constructor
-	 */
-	TMemoryDump::TMemoryDump():
-		iId(ESCMMemory),
-		iVersion(EMemDumpVersion1),		
-		iStartAddress(0),
-		iPid(0),
-		iLength(0)
-		{
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TMemoryDump::GetSize() const
-		{
-		if(iVersion == EMemDumpVersion1)
-			{
-			return 22;
-			}
-		else
-			{
-			CLTRACE("TMemoryDump::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TMemoryDump::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-				
-		// ID saved first		
-		aWriter.WriteInt(iId);								// 4
-		if(iId != ESCMMemory)
-			{
-			CLTRACE("TMemoryDump::Serialize Error - Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);				// 2
-
-		if(iVersion == EMemDumpVersion1)
-			{
-			// write data v1 format
-			aWriter.WriteInt(iStartAddress);				// 4
-			aWriter.WriteInt64(iPid);						// 8
-			aWriter.WriteInt(iLength);						// 4
-			}
-		else
-			{
-			CLTRACE("TMemoryDump::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TMemoryDump::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TMemoryDump::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();										// 4
-		if(iId != ESCMMemory)
-			{
-			CLTRACE("TMemoryDump::Deserialize() ERROR Corrupt ID");			
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TMemDumpVersionVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == EMemDumpVersion1)
-			{
-			// read data v1 format	
-			iStartAddress = aReader.ReadInt();    						// 4
-			iPid = aReader.ReadInt64();		 							// 8
-			iLength = aReader.ReadInt();								// 4
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TMemoryDump::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TMemoryDump::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}	
-	
-	/**
-	 * TTraceDump implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TTraceDump Constructor
-	 */
-	TTraceDump::TTraceDump():
-		iId(ESCMTraceData),
-		iVersion(ETraceDumpVersion1),
-		iSizeOfMemory(0),
-		iNumberOfParts(0)
-		{
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TTraceDump::GetSize() const
-		{
-		if(iVersion == ETraceDumpVersion1)
-			{
-			return 14;
-			}
-		else
-			{
-			CLTRACE("TTraceDump::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TTraceDump::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-				
-		// ID saved first		
-		aWriter.WriteInt(iId);								// 4
-		if(iId != ESCMTraceData)
-			{
-			CLTRACE("TTraceDump::Serialize Error - Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);				// 2
-
-		if(iVersion == ETraceDumpVersion1)
-			{
-			// write data v1 format
-			aWriter.WriteInt(iSizeOfMemory);				// 4
-			aWriter.WriteInt(iNumberOfParts);				// 4
-			}
-		else
-			{
-			CLTRACE("TTraceDump::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TTraceDump::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TTraceDump::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();										// 4
-		if(iId != ESCMTraceData)
-			{
-			CLTRACE("TTraceDump::Deserialize() Error: Corrupt ID");			
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TTraceDumpVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ETraceDumpVersion1)
-			{
-			// read data v1 format	
-			iSizeOfMemory = aReader.ReadInt();    						// 4
-			iNumberOfParts = aReader.ReadInt();    						// 4
-			
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TTraceDump::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TTraceDump::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}	
-	}
-
-//eof
--- a/kernel/eka/debug/crashMonitor/src/scmlockdata.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmlockdata.cpp
-// some utility classes for writing data to flash buffer
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	
-	/**
-	 * TSCMLockData constructor
-	 * @param none
-	*/
-	TSCMLockData::TSCMLockData()
-	: iId(ESCMLocks)
-	, iMutexHoldCount(-1)
-	, iMutexThreadWaitCount(-1)		
-		{	
-		}
-
-	/**
-	 * TSCMLockData Serialize 
-	 * @param aWriter byte stream to use
-	 * @return N/A
-	*/
-	TInt TSCMLockData::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-			
-		// ID saved first 
-		if(iId != ESCMLocks)
-			{
-			CLTRACE("TSCMLockData::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		// write id first
-		aWriter.WriteInt(iId);		 				    // 4		
-		// 2 counts written as shorts (should be enough range!)
-		aWriter.WriteShort((TInt16) iMutexHoldCount);			// 2
-		aWriter.WriteShort((TInt16) iMutexThreadWaitCount);      // 2
-		aWriter.WriteShort((TInt16) iLockCount);      // 2
-		
-			
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TSCMLockData::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return void
-	 */
-	TInt TSCMLockData::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();					// 4
-		if(iId != ESCMLocks)
-			{
-			CLTRACE("TSCMLockData::Deserialize Corrupt ID read");
-			return KErrCorrupt;
-			}
-		
-		iMutexHoldCount = (TInt) aReader.ReadShort();
-		iMutexThreadWaitCount = (TInt) aReader.ReadShort();
-		iLockCount =  (TInt) aReader.ReadShort();
-		
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{			
-			CLTRACE("TSCMLockData::Deserialize size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TSCMLockData::GetSize() const
-		{
-		return KSCMLockDataMaxSize;		
-		}
-		
-	/**
-	 * MutexHoldCount
-	 * @param none
-	 * @return mutex hold count
-	*/
-	TInt TSCMLockData::MutexHoldCount() const
-		{
-		return iMutexHoldCount;
-		}
-	
-	/**
-	 * SetMutexHoldCount
-	 * @param 
-	 * @return 
-	*/
-	void TSCMLockData::SetMutexHoldCount(TInt aMutexHoldCount)
-		{
-		iMutexHoldCount = aMutexHoldCount;
-		}
-	
-	/**
-	 * MutexThreadWaitCount
-	 * @param none
-	 * @return number of threads waiting on held mutex - will only be valid if
-	 * MutexHoldCount > 0
-	*/
-	TInt TSCMLockData::MutexThreadWaitCount() const
-		{
-		return iMutexThreadWaitCount;
-		}
-	
-	/**
-	 * SetMutexThreadWaitCount
-	 * @param TInt - number of threads waiting on held mutex(es)
-	 * @return void
-	*/
-	void TSCMLockData::SetMutexThreadWaitCount(TInt aMutexThreadWaitCount)
-		{
-		iMutexThreadWaitCount = aMutexThreadWaitCount;
-		}		
-	
-	/**
-	 * LockCount
-	 * @param none
-	 * @return TIOnt - the lock count
-	*/
-	TInt TSCMLockData::LockCount() const
-		{
-		return iLockCount;
-		}
-		
-	/**
-	 * SetLockCount
-	 * @param TInt - number of locks held
-	 * @return void
-	*/
-	void TSCMLockData::SetLockCount(TInt aLockCount)
-		{
-		iLockCount = aLockCount;
-		}
-
-	TBool TSCMLockData::operator == (const TSCMLockData& aOther) const
-		{
-		return ( iId == aOther.iId &&  
-				 iMutexHoldCount == aOther.iMutexHoldCount &&			 
-				 iMutexThreadWaitCount == aOther.iMutexThreadWaitCount &&
-				 iLockCount == aOther.iLockCount ); 	
-		}
-	
-	TBool TSCMLockData::operator != (const TSCMLockData& aOther) const
-		{
-		return !(*this == aOther);
-		}
-	}
-
-
--- a/kernel/eka/debug/crashMonitor/src/scmmulticrashinfo.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmmulticrashinfo.cpp
-// Class to store info about the crash flash to enable multiple crashes
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	/**
-	 * constructor
-	 */
-	SCMMultiCrashInfo::SCMMultiCrashInfo()
-		: iFirstBlock(NULL)
-		, iCurrentBlock(NULL)
-		{	
-		}
-		
-	/** 
-	 * destructor 
-	 */
-	SCMMultiCrashInfo::~SCMMultiCrashInfo()
-		{
-		ClearList();
-		}
-		
-	/** add a pointer to a block to the list - takes ownership of block
-	 * @param SCMCrashBlockEntry* aBlockEntry block to add
-	 */ 
-	void SCMMultiCrashInfo::AddBlock(SCMCrashBlockEntry* aBlockEntry)
-		{	
-		if(aBlockEntry)
-			{
-			CLTRACE4("SCMMultiCrashInfo::AddBlock iBlockOffset = [%d] [0x%X] iBlockSize = [%d] [0x%X]"
-				, aBlockEntry->iBlockOffset,aBlockEntry->iBlockOffset, aBlockEntry->iBlockSize, aBlockEntry->iBlockSize);
-			if(!iFirstBlock)
-				{
-				// adding to empty list
-				iFirstBlock = aBlockEntry;
-				iCurrentBlock = iFirstBlock;
-				}
-			else
-				{
-				SCMCrashBlockEntry* p = iFirstBlock;	
-				while(p->iNext)
-					{
-					p = p->iNext;
-					}
-				p->iNext = aBlockEntry;
-				}
-			}
-		else
-			{
-			CLTRACE("SCMMultiCrashInfo::AddBlock Adding a NULL block !");	
-			}
-		}
-		
-	
-	/** add a pointer to a block to the list - takes ownership of block 
-	 * @return SCMCrashBlockEntry* returns NULL when no more blocks
-	 * @param none
-	 */ 
-	SCMCrashBlockEntry* SCMMultiCrashInfo::GetNextBlock()
-		{
-		SCMCrashBlockEntry* p = iCurrentBlock;
-		if(iCurrentBlock)
-			{
-			iCurrentBlock = iCurrentBlock->iNext;
-			}
-		return p; 
-		}
-	
-	/** 
-	 * sets current block to first in list 
-	 */
-	void SCMMultiCrashInfo::Reset()
-		{
-		iCurrentBlock = iFirstBlock;
-		}
-		
-	/**
-	 * Clears all entries in the list 
-	 */
-	void SCMMultiCrashInfo::ClearList()
-		{
-		SCMCrashBlockEntry* p = iFirstBlock;
-			
-		while(p)
-			{
-			SCMCrashBlockEntry* tmp = p;
-			p = p->iNext;
-			delete tmp;
-			}
-		
-		iFirstBlock = iCurrentBlock = NULL;
-		}
-	}
-
-//eof
-
--- a/kernel/eka/debug/crashMonitor/src/scmonitor.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1032 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmonitor.cpp
-// Core dump server - Kernel side crash monitor
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <scmonitor.h>
-#include <kernel/monitor.h>
-#include <assp.h>
-#include <drivers/crashflash.h>
-#include <kernel/klib.h>
-#include <crashlogwalker.h>
-#include <scmconfigitem.h>
-
-#include "scmdatasave.h"
-
-GLDEF_D SCMonitor TheSCMonitor; //global definition of SCMonitor
-
-//keep things 4 byte aligned
-const TInt KRestartType = SCMonitor::ESoftRestart;
-
-/**
-SCMonitor constructor
-*/
-SCMonitor::SCMonitor()
-	: iMultiCrashInfo(NULL)
-	{
-	}
-
-SCMonitor::~SCMonitor()
-	{
-	delete iMultiCrashInfo;
-	}
-
-/**
- Print data to the corresponding output channel. Derived from monitor
- @param aDes the buffer containing the data
- */
-void SCMonitor::Print (const TDesC8& aDes )
-	{
-	//intended to do nothing
-	}
-
-/**
- * Allocates resources for SCMonitor
- * cant fully construct in constructor as we are a kernel extension and resources are limited when we are created
- */
-void SCMonitor::StableConstruction()
-	{
-	LOG_CONTEXT
-	iDataSave = new SCMDataSave(this, TheSCMonitor.iFlash);	
-	
-	//Configuration object for use upon crash
-	iScmConfig = new SCMConfiguration();
-	TInt err = iScmConfig->SetDefaultConfig();	
-	if(KErrNone != err)
-		{
-		CLTRACE1("SCMonitor::StableConstruction - Unable to set default config err = %d", err);
-		}
-	
-	
-#ifdef NO_MULTICRASHINFO	
-	iMultiCrashInfo = NULL;
-#else	
-
-	//We need to take a look at the flash map from variant_norflash_layout.h
-	iMultiCrashInfo = new SCMMultiCrashInfo();
-
-	TUint numberBlocks = KCrashLogSize / KCrashLogBlockSize;
-	for(TUint32 cnt = 0; cnt < numberBlocks; cnt++)
-		{
-		iMultiCrashInfo->AddBlock(new SCMCrashBlockEntry(cnt, cnt * KCrashLogBlockSize, KCrashLogBlockSize));
-		}
-#endif
-	}
-
-/**
- * Start a secondary DFC queue for the Flash and Init the flash in the variant(h4)
- * @param aAny
- */
-void StartSecondary (TAny* )
-	{
-	LOG_CONTEXT
-	//InitFlash is implemented in the variant as it creates a variant
-	//specific derived CrashFlash
-	TheSCMonitor.InitFlash ( );
-	TheSCMonitor.StableConstruction();
-	}
-
-/**
- * Global method to create a dfc queue
- * @param Method to intialise the flash.
- * @param Null
- * @param Gets the address of the supervisor thread DFC queue
- * @param TDfcQ priority number
- * @return a DFC object
- */
-GLDEF_C TDfc StartSecondaryDfc(&StartSecondary, NULL, Kern::SvMsgQue(), KMaxDfcPriority-1);
-
-/**
- * Kernel Main module entry - Own implementation( similar to crash logger)
- * @param aReason reason to enter to the method
- * @return One of the system wide codes
- */
-GLDEF_C TInt KernelModuleEntry(TInt aReason)
-	{	
-	if(aReason==KModuleEntryReasonVariantInit0)
-		{
-		new(&TheSCMonitor) SCMonitor;
-		// We are going to register the system Crash monitor here so that the order
-		// the monitor modules are placed in rom is preserved.  
-		// The monitor is not fully intialised here.
-		//the variant target is missing as we still have to finalise on the crash flash 
-		//implementation. H2 & H4 doesnt support currently.
-		LOG_CONTEXT		
-		CLTRACE("Installing System Crash Monitor");
-		Monitor::RegisterMonitorImpl (&TheSCMonitor );
-		return KErrNone;
-		}
-	else if (aReason==KModuleEntryReasonExtensionInit0 )
-		{
-		return KErrNone;
-		}
-	else if (aReason==KModuleEntryReasonExtensionInit1 )
-		{
-		LOG_CONTEXT
-		CLTRACE("Enqueing dfc to init crash flash for System Crash Monitor after all modules loaded");
-		StartSecondaryDfc.Enque ( );
-		return KErrNone;
-		}
-	return KErrArgument;
-	}
-
-/**
- Method to intialize the system crash monitor
- @param aCategory the fault category type
- @param aReason the reason for crash
- @return restart type
- */
-TInt SCMonitor::Init2 (TAny* aCategory, TInt aReason )
-	{
-	LOG_CONTEXT
-	__KTRACE_OPT(KALWAYS, Kern::Printf("\n\nSystem Crash Monitor Launched: To Analyse Crash Produced Use Core Dump Server\n"));
-
-	//Start logging the data:	
-	//Need to lock kernel to access object containers (it technically is anyway, but flag isnt set)
-	NKern::Lock();
-	DoCrash(aCategory, aReason);	
-	NKern::Unlock();		
-		
-	__KTRACE_OPT(KALWAYS, Kern::Printf("System Crash Monitor Finished: Log Size = [%d]\n", iDataSave->iCrashInf.iLogSize));
-	
-	return KRestartType;
-	}
-
-/**
- * This is responsible for setting up any structures required for processing of the crash
- * @param aCategory the fault category type
- * @param aReason 
- */
-void SCMonitor::DoCrash(TAny* aCategory, TInt aReason )
-	{
-	// get debug mask
-	TInt dbgMask = Kern::SuperPage().iDebugMask[0];
-	
-	// if we are writing to the comm port then we need to turn off other debug messages
-	if( iDataSave->GetWriteSelect() == SCMDataSave::EWriteComm)
-		{
-		Kern::SuperPage().iDebugMask[0] = 0;
-		}
-	
-	if(!aCategory)
-		{
-		CLTRACE("\tNULL category retrieved and returning");
-		TheSCMonitor.iFlash->EndTransaction();
-		return;
-		}
-
-	iFrame = NULL;
-	
-	CLTRACE("\tAbout to set category -- note: can occasionaly crash board");	
-	iFaultCategory = *(const TDesC8*)aCategory;  // this crashes the board sometimes		
-	iFaultReason = aReason;
-	Epoc::SetMonitorExceptionHandler ((TLinAddr)HandleException );
-	
-	// get the first start block
-	// will retieve start of flash by default
-	SCMCrashBlockEntry block;
-	TInt err = GetNextCrashStartPoint(block);  // will also attempt to read iScmConfig
-
-	if(KErrNone == err)
-		{
-		CLTRACE2("SCMonitor::DoCrash next crash will be written at blocknumber = %d offset  %d"
-				, block.iBlockNumber, block.iBlockOffset);
-		}
-	else
-		{
-		CLTRACE1("SCMonitor::DoCrash Failed to find a valid block to write to, can not continue. err = [%d]", err);
-		return;
-		}
-	
-	TUint crashId = block.iBlockNumber;	
-	iDataSave->iWriter->ResetBytesWritten();		
-	
-	//Write the crash (1st pass is to gather header data)
-	TInt spaceRequired = ProcessCrash(block, crashId, EFalse);					
-	
-	// now do the real write	
-	// prepare flash for data	
-	TheSCMonitor.iFlash->StartTransaction();	
-	TheSCMonitor.iFlash->SetWritePos(block.iBlockOffset);
-
-	//write the crash this time
-	ProcessCrash(block, crashId, ETrue);
-	
-	TheSCMonitor.iFlash->EndTransaction();	
-	
-	// restore debug mask
-	Kern::SuperPage().iDebugMask[0] = dbgMask;
-	}
-
-
-/**
- * This walks the existing crash log and finds out where current crashes finish
- * @param aBlockEntry Block to use. Only valid if KErrNone is returned.
- * @return One of the OS wide codes
- */
-TInt SCMonitor::GetNextCrashStartPoint(SCMCrashBlockEntry& aBlockEntry)
-	{
-	LOG_CONTEXT	
-	
-	//First thing is to try and read the config
-	TBool configFound = (iDataSave->ReadConfig(*iScmConfig) == KErrNone);
-	
-	if( iMultiCrashInfo)	
-		{				
-		/**
-		 * data save has been configured to use multicrash info to find the next block we are on we need to scan each
-		 * block to see if it contains a valid header. if we find an empty block in our block list then that is the
-		 * one we will use if we find no empty blocks then we have no room left	
-		 */
-		iMultiCrashInfo->Reset();
-		SCMCrashBlockEntry* block = iMultiCrashInfo->GetNextBlock();
-		TBool blockFound = EFalse;				
-		
-		//For any crashes in flash, we need to record where they end, so that we can then go to the next
-		//block after the one in which it ends
-		TInt crashEndPoint = 0;		
-		
-		while(block)
-			{	
-			CLTRACE1("SCMonitor::GetNextCrashStartPoint Processing block number %d", block->iBlockNumber );			
-			
-			//If we have already found our block, we should erase subsequent ones for use
-			if(blockFound)
-				{
-				TInt err = EraseFlashBlock(*block);
-				if(err != KErrNone)
-					{					
-					return err;
-					}
-				
-				block = iMultiCrashInfo->GetNextBlock(); 
-				continue;
-				}	
-			
-			//is this block before a crash end? if it is, we cant use it as a crash can span multiple blocks
-			if(block->iBlockOffset >= crashEndPoint)
-				{
-				//special condition if we have a config
-				TUint startPos = block->iBlockOffset;
-				TUint skipBytes = 0;
-				if(configFound && block->iBlockOffset == 0)
-					{
-					startPos+=iScmConfig->GetSize();
-					
-					//must align to flash for read
-					skipBytes = startPos % KFlashAlignment;	
-					startPos -= skipBytes;
-					}
-				
-				// try and read an info header at these flash coords
-				TBuf8<TCrashInfoHeader::KSCMCrashInfoMaxSize + KFlashAlignment> buf;
-				buf.SetLength(TCrashInfoHeader::KSCMCrashInfoMaxSize + KFlashAlignment);
-	
-				CLTRACE1("(SCMonitor::GetNextCrashStartPoint) reading at offset %d", block->iBlockOffset);
-				
-				TheSCMonitor.iFlash->SetReadPos(startPos);
-				TheSCMonitor.iFlash->Read(buf);
-				
-				// create the buffer applying the offset of bytes skipped
-				TByteStreamReader reader(const_cast<TUint8*> (buf.Ptr() + skipBytes));
-				
-				TCrashInfoHeader header;								
-				TInt err = header.Deserialize(reader);
-				
-				if(err == KErrCorrupt)
-					{
-					CLTRACE2("(SCMonitor::GetNextCrashStartPoint) Found empty block blocknumber %d blockoffset = %d"
-							, block->iBlockNumber, block->iBlockOffset);
-										
-					blockFound = ETrue;
-					aBlockEntry = *block;
-					
-					continue; //Dont get next block, as next run will erase this current block for use
-					}
-				else
-					{					
-					crashEndPoint = header.iLogSize + startPos;
-					CLTRACE3("(SCMonitor::GetNextCrashStartPoint) In block [%d] we found a valid crash header. This crash finishes at [%d] [0x%X]", block->iBlockNumber, crashEndPoint, crashEndPoint);
-					}
-				}
-			
-			block = iMultiCrashInfo->GetNextBlock();
-			}									
-			
-		if(blockFound)
-			{
-			return KErrNone;
-			}
-		else
-			{
-			//CLTRACE("(SCMonitor::GetNextCrashStartPoint) No available blocks TREATING as NO MULTICRASH INFO will write to default block");
-			//In this case should we just overwrite old crashes and return the first block as the comment above suggests
-			//return blockFound;
-			}
-		}
-
-	// no multi crash info supplied - use default first block settings
-	TInt err = EraseEntireFlashPartition();
-	if(err != KErrNone)
-		{
-		CLTRACE1("Unable to delete area required to log to flash. Aborting. Error - [%d]", err);
-		return err;
-		}
-	
-	aBlockEntry = SCMCrashBlockEntry(0,0,0);
-	return KErrNone;
-	}
-
-/**
- * Handles the processing of the crash
- * @return The size of the crash log (including header) that has been/will be written
- */
-TInt SCMonitor::ProcessCrash(const SCMCrashBlockEntry& aBlock, TUint aCrashId, TBool aCommit)
-	{	
-	LOG_CONTEXT
-	CLTRACE5("aBlock.iBlockOffset = [%d]  [0x%X] aBlock.iBlockNumber = %d aBlock.iBlockSize = [%d]  [0x%X]",
-			aBlock.iBlockOffset, aBlock.iBlockOffset, aBlock.iBlockNumber, aBlock.iBlockSize, aBlock.iBlockSize);		
-	
-	// reset writer for start of each crash
-	iDataSave->iWriter->ResetBytesWritten();
-	TInt logLevel = 0;
-
-	if(aCommit)
-		{
-		logLevel = KALWAYS;
-		iDataSave->iWriter->EnablePhysicalWriting();	
-		}
-	else
-		{
-#if defined(_DEBUG)
-		logLevel = KDEBUGGER;
-#else
-		logLevel = KALWAYS; //Doesnt matter, KTRACE OPT is empty for rel builds 
-		if(logLevel != KALWAYS)
-			{
-			//This is to avoid warning
-			}
-#endif
-		
-		iDataSave->iWriter->DisablePhysicalWriting();	
-		}
-	
-	iDataSave->SetByteCount(aBlock.iBlockOffset);	
-	if(aBlock.iBlockOffset == 0 && aBlock.iBlockNumber == 0)
-		{	
-		// this is the first crash - we need to save the config here first
-		CLTRACE("(SCMonitor::ProcessCrash) - this is block 0 - WRITING CONFIG");
-		iDataSave->LogConfig(*iScmConfig);	
-		
-		//Config is not part of crash so reset bytes written			
-		iDataSave->SetCrashStartingPoint(iDataSave->iWriter->GetBytesWritten());		
-		}	
-	else
-		{
-		iDataSave->SetCrashStartingPoint(aBlock.iBlockOffset);
-		}	
-	
-	iDataSave->iWriter->ResetBytesWritten();
-	
-	TUint32 logSize = 0;
-	TUint sizeOfObjectDumped = 0;
-		
-	TInt err = iDataSave->LogCrashHeader(iFaultCategory, iFaultReason, aCrashId, sizeOfObjectDumped);		
-	if(KErrNone != err)
-		{
-		CLTRACE("System Crash Monitor: Failed to create crash info header - (TCrashInfo)"); 
-		return KRestartType;
-		}	
-	
-	logSize += sizeOfObjectDumped;
-	
-	//Now we must read the configuration to use. This is held at the start of our flash partition
-	//and managed by the iConfig object
-	iScmConfig->ResetToHighestPriority();	
-		
-	//Always want the crash context
-	iDataSave->iHdr.iCTFullRegOffset = logSize + iDataSave->GetCrashStartingPoint();
-	
-	err = iDataSave->LogCPURegisters(sizeOfObjectDumped);
-	if(KErrNone != err)
-		{
-		CLTRACE1("\tError logging full registers = %d", err);
-		}	
-	
-	logSize += sizeOfObjectDumped;
-	
-	CLTRACE("\tAbout to enter processing loop");		
-	SCMDataSave::TDataToDump dump;
-		
-	for(;;)		
-		{		
-		//now we get each item by priority from the configuration
-		TConfigItem* configItem = iScmConfig->GetNextItem();
-
-		if(!configItem)
-			{
-			// end of list
-			break;
-			}
-		
-		CLTRACE1("\nLooking at item type [%d]", configItem->GetDataType());
-		if(configItem->GetSpaceRequired() > iDataSave->SpaceRemaining())
-			{
-			__KTRACE_OPT(logLevel, Kern::Printf("\t\tFor Item Type [%d]: Unable to log [0x%X] [%d] bytes because we only have [0x%X] [%d] bytes left", configItem->GetDataType(), configItem->GetSpaceRequired(), configItem->GetSpaceRequired(), iDataSave->SpaceRemaining(), iDataSave->SpaceRemaining()));
-			continue;
-			}
-		else
-			{
-			CLTRACE1("Will require [%d] bytes for this item", configItem->GetSpaceRequired());
-			}
-		
-		// only interested in logging items with priority > 0
-		if( configItem->GetPriority() <= 0)
-			{
-			CLTRACE1("\tIgnored config item type %d priority 0", configItem->GetDataType());
-			continue;
-			}
-			
-		//there are a lot of TUints in the hdr to record where we wrote this item. 
-		//This will point to the one of interest for this configItem
-		TUint32* offsetPointer = NULL;				
-		
-		//now we check the type of data we wish to dump
-		switch(configItem->GetDataType())
-			{
-			case TConfigItem::ECrashedThreadMetaData:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ECrashedThreadMetaData at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-				
-				err = LogThreadMetaData(SCMDataSave::EThreadSpecific, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iCTMetaOffset);
-				
-				break;
-				}
-			case TConfigItem::EThreadsMetaData:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EThreadsMetaData at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-				
-				//record location we are writing to in the header
-				iDataSave->iHdr.iTLstOffset = iDataSave->iWriter->GetBytesWritten();
-				err = LogThreadMetaData(SCMDataSave::ESystemWide, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iTLstOffset);
-				
-				break;
-				}
-			case TConfigItem::ECrashedProcessMetaData:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ECrashedProcessMetaData at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-					
-				err = LogProcessMetaData(SCMDataSave::EProcessSpecific, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iCPMetaOffset);
-				
-				break;
-				}
-			case TConfigItem::EProcessMetaData:		
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EProcessMetaData at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				err = LogProcessMetaData(SCMDataSave::ESystemWide, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iPLstOffset);
-				
-				break;
-				}
-			case TConfigItem::ECrashedProcessUsrStacks:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ECrashedProcessUsrStacks at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = EFalse;
-				dump.iStk = SCMDataSave::EUsrStack;
-				dump.iReg = SCMDataSave::ERegSetNone;	
-				err = LogObjectContainers(EThread, SCMDataSave::EProcessSpecific, dump, sizeOfObjectDumped);	
-				offsetPointer = &(iDataSave->iHdr.iCTUsrStkOffset);
-				
-				break;
-				}
-			case TConfigItem::EThreadsUsrStack:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EThreadsUsrStack at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-				
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = EFalse;
-				dump.iStk = SCMDataSave::EUsrStack;
-				dump.iReg = SCMDataSave::ERegSetNone;
-
-				err = LogObjectContainers(EThread, SCMDataSave::ESystemWide, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iSysSvrStkOffset);
-				
-				break;
-				}
-			case TConfigItem::ECrashedProcessSvrStacks:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ECrashedProcessSvrStacks at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = EFalse;
-				dump.iStk = SCMDataSave::ESvrStack;
-				dump.iReg = SCMDataSave::ERegSetNone;
-				
-				err = LogObjectContainers(EThread, SCMDataSave::EProcessSpecific, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iCTSvrStkOffset);
-				
-				break;
-				}
-			case TConfigItem::EThreadsSvrStack:			
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EThreadsSvrStack at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = EFalse;
-				dump.iStk = SCMDataSave::ESvrStack;
-				dump.iReg = SCMDataSave::ERegSetNone;
-				
-				err = LogObjectContainers(EThread, SCMDataSave::ESystemWide, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iSysSvrStkOffset);
-				
-				break;
-				}
-			case TConfigItem::EThreadsUsrRegisters:		
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EThreadsUsrRegisters at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = EFalse;
-				dump.iStk = SCMDataSave::EStackTypeNone;
-				dump.iReg = SCMDataSave::EUserRegisters;
-				
-				err = LogObjectContainers(EThread, SCMDataSave::ESystemWide, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iSysUsrRegOffset);
-				
-				break;
-				}
-			case TConfigItem::EThreadsSvrRegisters:		
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EThreadsSvrRegisters at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = EFalse;
-				dump.iStk = SCMDataSave::EStackTypeNone;
-				dump.iReg = SCMDataSave::ESupervisorRegisters;
-				
-				err = LogObjectContainers(EThread, SCMDataSave::ESystemWide, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iSysSvrRegOffset);
-				
-				break;
-				}
-			case TConfigItem::EExceptionStacks:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EExceptionStacks at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-							
-				err = iDataSave->LogExceptionStacks(sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iExcStkOffset);
-				
-				break;
-				}
-			case TConfigItem::ECrashedProcessCodeSegs:
-				{	
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ECrashedProcessCodeSegs at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = ETrue;
-				dump.iStk = SCMDataSave::EStackTypeNone;
-				dump.iReg = SCMDataSave::ERegSetNone;				
-				
-				err = LogObjectContainers(EProcess, SCMDataSave::EProcessSpecific, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iCPCodeSegOffset);
-				
-				break;
-				}
-			case TConfigItem::EProcessCodeSegs:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EProcessCodeSegs at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-								
-				//define what we wish to dump
-				dump.iMetaData = EFalse;
-				dump.iCodeSegs = ETrue;
-				dump.iStk = SCMDataSave::EStackTypeNone;
-				dump.iReg = SCMDataSave::ERegSetNone;
-				err = LogObjectContainers(EProcess, SCMDataSave::ESystemWide, dump, sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iSysCodeSegOffset);
-				
-				break;
-				}
-			case TConfigItem::ETraceData:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ETraceData at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-									
-				err = iDataSave->LogTraceBuffer(configItem->GetSizeToDump(), sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iTraceOffset);
-				
-				break;
-				}		
-			case TConfigItem::ELocks:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ELocks at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));	
-					
-				err = iDataSave->LogLocks(sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iScmLocksOffset);
-				
-				break;
-				}
-			case TConfigItem::EKernelHeap:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EKernelHeap at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-				
-				err = iDataSave->LogKernelHeap(sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iKernelHeapOffset);
-				
-				break;
-				}
-			case TConfigItem::EVariantSpecificData:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: EVariantSpecificData at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-				
-				err = iDataSave->LogVariantSpecificData(sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iVarSpecInfOffset);
-				
-				break;
-				}
-			case TConfigItem::ERomInfo:
-				{
-				__KTRACE_OPT(logLevel, Kern::Printf("\tDoing: ERomInfo at [%d] offset from [%d]", iDataSave->iWriter->GetBytesWritten(), iDataSave->GetCrashStartingPoint()));
-				
-				err = iDataSave->LogRomInfo(sizeOfObjectDumped);
-				offsetPointer = &(iDataSave->iHdr.iRomInfoOffset);
-				
-				break;
-				}
-			//unknown configuration type - something bad is going on
-			default: return 0;			
-			}				
-		
-		if(KErrNone != err)
-			{
-			__KTRACE_OPT(logLevel, Kern::Printf("\tError logging data: [%d]   Type = [%d]", err, aBlock.iBlockOffset));
-			continue;
-			}
-		
-		//Set the space required so next time around we will know in advance how much space we need
-		configItem->SetSpaceRequired(sizeOfObjectDumped);		
-		
-		//Note: the following steps are only required for the first time we call process crash. The second time,
-		//when physical writing is enabled, these will have been written already and so they dont matter
-		
-		//update the offset and logsize if we are going to dump this item
-		TUint32 absoluteLogPos = logSize + iDataSave->GetCrashStartingPoint();
-		if(absoluteLogPos+sizeOfObjectDumped < iDataSave->MaxLogSize())
-			{
-			//now, we must record where in the crash log this item will be dumped
-			*offsetPointer = absoluteLogPos;
-			logSize += sizeOfObjectDumped;
-			}
-		}
-	
-	iDataSave->iCrashInf.iLogSize = logSize;	
-	iDataSave->iWriter->FlushCache();		
-	
-	return iDataSave->iCrashInf.iLogSize;
-	}
-
-/**
- * Logs the meta data for processes
- * @param aCurrentProcess - scope to dump
- * @return one of the OS wide codes
- */
-TInt SCMonitor::LogProcessMetaData(SCMDataSave::TDumpScope aScope, TUint& aSizeDumped) const
-	{
-	LOG_CONTEXT
-	
-	SCMDataSave::TDataToDump dump;
-	dump.iMetaData = ETrue;
-	
-	return LogObjectContainers(EProcess, aScope, dump, aSizeDumped);
-	}
-
-/**
- * 
- * @param aCurrentThread -  to only do the current (crashed thread) or to do all the others
- * @return one of the OS wide codes
- */
-TInt SCMonitor::LogThreadMetaData(SCMDataSave::TDumpScope aScope, TUint& aSizeDumped) const
-	{
-	LOG_CONTEXT
-	
-	SCMDataSave::TDataToDump dump; 
-	dump.iMetaData = ETrue;
-	
-	return LogObjectContainers(EThread, aScope, dump, aSizeDumped);
-	}
-
-/**
- * Generic method that looks at all kernel objects of aObjectType
- * @param aObjectType
- * @param aDumpScope - if you wish to dump for the the current process, current thread or entire system
- * @param aDataToDump - data you wish to dump
- * @param aSizeDumped - records how much was dumped
- * @return
- */
-TInt SCMonitor::LogObjectContainers(TObjectType aObjectType, SCMDataSave::TDumpScope aDumpScope, const SCMDataSave::TDataToDump& aDataToDump, TUint& aSizeDumped) const
-	{
-	aSizeDumped = 0;
-	
-	if(aObjectType >= ENumObjectTypes)
-		{
-		return KErrArgument;
-		}
-	
-	//Get the object container for the given object type
-	DObjectCon* objectContainer = Kern::Containers()[aObjectType];
-	if(objectContainer == NULL)
-		{		
-		CLTRACE("tFailed to get object container");
-		return KErrNotFound;
-		}
-	
-	//Must check the mutex on this is ok otherwise the data will be in an inconsistent state
-	if(objectContainer->iMutex->iHoldCount)
-		{
-		CLTRACE("\tObject Container is in an inconsistant state");
-		return KErrCorrupt;
-		}
-	
-	TInt numObjects = objectContainer->Count();
-	TInt err = KErrNone;	
-	
-	for(TInt cnt = 0; cnt< numObjects; cnt ++)
-		{	
-		DObject* object = (*objectContainer)[cnt];
-		
-		//Are we interested in the object? scope only relevant for thread and process objects, for others, the scope is implicit
-		if(aObjectType == EThread)			
-			{
-			switch(aDumpScope)
-				{
-				case SCMDataSave::EThreadSpecific :
-					{
-					//if we are interested in the current thread and this is not it, continue
-					if(((DThread*)object) != &Kern::CurrentThread())
-						continue;
-					break;
-					}
-				case SCMDataSave::EProcessSpecific :
-					{
-					//if we are interested in the current proc and this is not it, continue
-					if(((DThread*)object)->iOwningProcess != &Kern::CurrentProcess())
-						continue;					
-					break;
-					}
-				case SCMDataSave::ESystemWide :
-				default: 
-					break;
-				}
-			}
-		else if(aObjectType == EProcess)
-			{
-			switch(aDumpScope)
-				{
-				case SCMDataSave::EProcessSpecific :
-					{
-					if((DProcess*)object != &Kern::CurrentProcess())
-						continue;
-					break;
-					}
-				case SCMDataSave::EThreadSpecific :  //thread specific process doesnt make sense
-					return KErrArgument;				
-				case SCMDataSave::ESystemWide :
-				default:
-					break;
-				}
-			}
-		
-		//Now we look at the data we have been asked to dump
-		if(aDataToDump.iMetaData)
-			{
-			TUint dumped = 0;
-			err = HelpDumpMetaData(object, aObjectType, dumped);
-			if(KErrNone != err)
-				{
-				CLTRACE1("Failed to meta data: [%d]", err);
-				return err;
-				}
-			aSizeDumped += dumped;
-			}
-		
-		if(aDataToDump.iCodeSegs)
-			{
-			if(aObjectType != EProcess)
-				{
-				return KErrArgument;
-				}
-			
-			TUint dumped = 0;
-			err = iDataSave->LogCodeSegments((DProcess*)object, dumped);
-			if(KErrNone != err)
-				{
-				CLTRACE1("Failed to log code segments: [%d]", err);
-				return err;
-				}
-			aSizeDumped += dumped;
-			}
-		
-		if(aDataToDump.iStk != SCMDataSave::EStackTypeNone)
-			{
-			TUint dumped = 0;
-			err = HelpDumpStacks(object, aObjectType, dumped, aDataToDump.iStk);
-			if(KErrNone != err)
-				{
-				CLTRACE1("Failed to log stacks: [%d]", err);
-				return err;
-				}
-			aSizeDumped += dumped;
-			}
-		
-		if(aDataToDump.iReg != SCMDataSave::ERegSetNone)
-			{			
-			if(aObjectType != EThread)
-				{
-				return KErrArgument;
-				}
-			TUint dumped = 0;
-			err = iDataSave->LogRegisters((DThread*)object, aDataToDump.iReg, dumped);	
-			if(KErrNone != err && KErrNotSupported !=err)  //we expect to send down a KErrNotSupported when we ask for Full CPU set for the non crashed thread - thats fine
-				{
-				CLTRACE1("Failed to log registers: [%d]", err);
-				return err;
-				}
-			aSizeDumped += dumped;
-			}
-		}
-	
-	return KErrNone;
-	}
-
-/**
- * Helper method for dumping stacks. Looks to see what type of stack we want and then calls
- * appropriate method
- * @param aObject The DThread object whose stack we want
- * @param aObjectType The object type of this aObject. Anything other than EThread will give KErrArgument
- * @param aSizeDumped Holds the size of the stack dumped after processing 
- * @param aStkType The type of stack to be dumped
- * @see TObjectType
- * @see SCMDataSave::TStackType
- * @return One of the system wide codes
- */
-TInt SCMonitor::HelpDumpStacks(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped, SCMDataSave::TStackType aStkType) const
-	{
-	//verify args
-	if(aObjectType != EThread)
-		{
-		return KErrArgument;
-		}
-	
-	switch(aStkType)
-		{
-		case SCMDataSave::EUsrStack:
-			{
-			return iDataSave->LogThreadUserStack((DThread*)aObject, ETrue, aSizeDumped);
-			}
-		case SCMDataSave::ESvrStack:
-			{
-			return iDataSave->LogThreadSupervisorStack((DThread*)aObject, ETrue, aSizeDumped);
-			}
-		default: return KErrArgument;
-		}
-	}
-
-/**
- * Helper method to dump meta data about a DThread or a DProcess object
- * @param aObject DObject to use
- * @param aObjectType Type of DObject. Must be EThread or EProcess
- * @param aSizeDumped Holds the size of the stack dumped after processing 
- * @return
- */
-TInt SCMonitor::HelpDumpMetaData(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped) const
-	{
-	aSizeDumped = 0;
-	
-	switch(aObjectType)
-		{
-		case EThread:
-			{
-			return iDataSave->LogThreadData((DThread*)aObject, aSizeDumped);	 
-			}
-		case EProcess:
-			{
-			return iDataSave->LogProcessData((DProcess*)aObject, aSizeDumped);
-			}
-		default: return KErrArgument;
-		}
-	}
-
-/**
- * Wrapper method around the flash erase block fundtion to determine if the erase was succesful.
- * If the erase was not succesful we can't continue as we cannot write.
- * @param aBlockOffset Block to erase
- * @return One of the OS wide codes
- */
-TInt SCMonitor::EraseFlashBlock(const SCMCrashBlockEntry& aBlock)
-	{	
-	iFlash->StartTransaction();
-	
-	TInt numAttempts = 0;
-	while(numAttempts < KFlashEraseAttempts)
-		{
-		iFlash->SetWritePos(aBlock.iBlockOffset);
-		iFlash->EraseFlashBlock(aBlock.iBlockOffset);
-		
-		//we will read the flash to make sure that it set the block to all 1's (well not all, just the start)
-		TBuf8<sizeof(TUint32)> buf;
-		buf.SetLength(sizeof(TUint32));
-				
-		iFlash->SetReadPos(aBlock.iBlockOffset);
-		iFlash->Read(buf);
-		
-		volatile TUint32* result = (TUint32*)buf.Ptr();
-		if(*result == 0xFFFFFFFF)
-			{			
-			__KTRACE_OPT(KALWAYS, Kern::Printf("Erase of block [0x%X] succesful after [%d] attempts", aBlock.iBlockOffset, numAttempts+1))			
-			iFlash->EndTransaction();			
-			return KErrNone;
-			}
-		
-		numAttempts++;
-		
-		//Sometimes a write to the block helps the next erase
-		TUint32 bytesWritten = 0;		
-		while(bytesWritten < aBlock.iBlockSize)
-			{
-			TBuf8<sizeof(TUint8)> num;
-			num.Append(0x0);
-			iFlash->Write(num);
-			bytesWritten++;
-			}
-		}		
-
-	__KTRACE_OPT(KALWAYS, Kern::Printf("After %d attempts, we were unable to erase the flash block at [0x%X]. This could be because "
-			"the driver is defective or because the flash has gone past its lifetime. Whatever it is though, "
-			"we cannot continue.", KFlashEraseAttempts, aBlock.iBlockOffset));
-	
-	iFlash->EndTransaction();
-	return KErrAbort;
-	}
-
-/**
- * This erases each block in the flash partition
- * @return One of the system wide codes
- */
-TInt SCMonitor::EraseEntireFlashPartition()
-	{
-	if(iMultiCrashInfo)
-		{
-		iMultiCrashInfo->Reset();
-		
-		SCMCrashBlockEntry* block = iMultiCrashInfo->GetNextBlock();
-		while(block)
-			{
-			TInt err = EraseFlashBlock(*block);
-			if(KErrNone != err)
-				{
-				return err;
-				}
-			
-			block = iMultiCrashInfo->GetNextBlock();
-			}
-		
-		return KErrNone;
-		}
-	
-	CLTRACE("SCMonitor::EraseEntireFlashPartition() -- No Flash MAP available, trying to use the raw driver to delete.");
-	TheSCMonitor.iFlash->EraseLogArea();
-	
-	return KErrNone;
-	}
-
-//eof scmonitor.cpp
-
--- a/kernel/eka/debug/crashMonitor/src/scmprocessdata.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmprocessdata.cpp
-// Core dump server - Process Data for System Crash
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	/**
-	 * TProcessData implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TProcessData constructor
-	 */
-	TProcessData::TProcessData()
-		:iId(ESCMProcessData)
-		,iVersion(EProcData1)				
-		,iPid(0)
-		,iNamesize(0)
-		,iPriority(0)
-		,iSpare1(0)
-		,iSpare2(0)	
-		,iSpare3(0)
-		{
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return One of the OS wide codes
-	 */	 
-	TInt TProcessData::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-		
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				// 4
-		
-		if(iId != ESCMProcessData)
-			{
-			CLTRACE("TProcessData::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == EProcData1)
-			{
-			// write data v1 format				
-			aWriter.WriteInt(iPriority); 			 	// 4
-			aWriter.WriteInt64(iPid);  					// 8
-			if(iName.Ptr())
-				{
-				aWriter.WriteInt(iName.Length());		// 4
-				for(TInt cnt = 0; cnt < iName.Length(); cnt++)
-					{
-					aWriter.WriteByte(iName[cnt]);
-					}
-				}
-			else
-				{
-				aWriter.WriteInt(0);
-				}
-
-
-			}
-		else
-			{
-			CLTRACE("TProcessData::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE2("TProcessData::Serialize serialization size error. Wrote [%d] but expected [%d]", endPos - startPos, GetSize());
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}				
-		
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return One of the OS wide codes
-	 */
-	TInt TProcessData::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();		 				// 4
-		if(iId != ESCMProcessData)
-			{
-			CLTRACE("TProcessData::Deserialize failed - Read corrupt ID");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TProcessDataVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == EProcData1)
-			{
-			// read data v1 format						
-			iPriority = aReader.ReadInt(); 			 	    // 4		
-			iPid = aReader.ReadInt64();						// 8
-			
-			iNamesize = aReader.ReadInt();					// 4			
-			
-			if(iName.Ptr() && iName.MaxLength() >= (TInt)iNamesize)
-				{
-				iName.SetLength(0);
-				
-				for(TUint cnt = 0; cnt < iNamesize; cnt++)
-					{
-					iName.Append(aReader.ReadByte());		//iCategorySize bytes
-					} 
-				}
-			
-
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TProcessData::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TProcessData::Deserialize serialization size error");
-			return KErrCorrupt;			
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TProcessData::GetSize() const
-		{
-		if(iVersion == EProcData1)
-			{
-			return 22 + iName.Length();
-			}
-		else
-			{
-			CLTRACE("TProcessData::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	}
--- a/kernel/eka/debug/crashMonitor/src/scmromdata.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmromdata.cpp
-// Core dump server - ROM Data for System Crash
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	/**
-	 * TRomHeaderData implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TRomHeaderData constructor
-	 */
-	TRomHeaderData::TRomHeaderData():
-		iId(ESCMRomHeader),
-		iVersion(ERomHeaderDataVersion1),
-		iMajorVersion(0),
-		iMinorVersion(0),
-		iBuildNumber(0),
-		iTime(0)
-		{			
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return void
-	 */	
-	TInt TRomHeaderData::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-		
-		if(iId != ESCMRomHeader)
-			{
-			CLTRACE("TRomHeaderData::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				    // 4		
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == ERomHeaderDataVersion1)
-			{
-			//ROM time
-			aWriter.WriteInt64(iTime);					// 8
-			
-			//Now the ROM version
-			aWriter.WriteByte(iMajorVersion);				// 1
-			aWriter.WriteByte(iMinorVersion);				// 1
-			aWriter.WriteShort(iBuildNumber);				// 2			
-			}
-		else
-			{
-			CLTRACE("TRomHeaderData::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt pos1 = aWriter.CurrentPosition();
-		if( pos1 - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TRomHeaderData::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return void
-	 */
-	TInt TRomHeaderData::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();					// 4
-		if(iId != ESCMRomHeader)
-			{
-			CLTRACE("TRomHeaderData::Deserialize Corrupt ID read");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TRomHeaderDataVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == ERomHeaderDataVersion1)
-			{			
-			//ROM time
-			iTime = aReader.ReadInt64();					// 8
-			
-			//Now the ROM version
-			iMajorVersion = aReader.ReadByte();				// 1
-			iMinorVersion = aReader.ReadByte();				// 1
-			iBuildNumber = aReader.ReadShort();				// 2
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TRomHeaderData::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt pos1 = aReader.CurrentPosition();
-		if( pos1 - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TRomHeaderData::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TRomHeaderData::GetSize() const
-		{
-		if(iVersion == ERomHeaderDataVersion1)
-			{
-			return 18;
-			}
-		else
-			{
-			CLTRACE("ERomHeaderDataVersion1::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	}
--- a/kernel/eka/debug/crashMonitor/src/scmthreaddata.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-// Copyright (c) 2008-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\debug\crashMonitor\src\scmthreaddata.cpp
-// Core dump server - Thread Data for System Crash
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	/**
-	 * TThreadData implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TThreadData constructor
-	 */
-	TThreadData::TThreadData()
-	: iId(ESCMThreadData)
-		,iVersion(EThreadData1)
-		,iPriority(0)
-		,iTid(0)
-		,iOwnerId(0)
-		,iSvcSP(0)
-		,iSvcStack(0)
-		,iSvcStacksize(0)
-		,iUsrSP(0)
-		,iUsrStack(0)
-		,iUsrStacksize(0)
-		,iNamesize(0)
-		,iLastCpu(0)
-		,iSvcHeap(0)
-		,iSvcHeapSize(0)
-		{			
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return void
-	 */	
-	TInt TThreadData::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-		
-		if(iId != ESCMThreadData)
-			{
-			CLTRACE("TThreadData::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				    // 4		
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == EThreadData1)
-			{
-			// write data v1 format					
-			aWriter.WriteInt(iPriority); 			 	// 4
-			aWriter.WriteInt64(iTid);  					// 8
-			aWriter.WriteInt64(iOwnerId);				// 8
-			aWriter.WriteInt(iSvcSP); 			 		// 4
-			aWriter.WriteInt(iSvcStack); 			 	// 4
-			aWriter.WriteInt(iSvcStacksize); 			 	// 4
-			aWriter.WriteInt(iUsrSP); 			 		// 4
-			aWriter.WriteInt(iUsrStack); 			 	// 4
-			aWriter.WriteInt(iUsrStacksize); 			 	// 4			
-			aWriter.WriteInt(iLastCpu); 			 	// 4
-			aWriter.WriteInt(iSvcHeap); 			 		// 4
-			aWriter.WriteInt(iSvcHeapSize); 			 	// 4
-			if(iName.Ptr())
-				{
-				aWriter.WriteInt(iName.Length());		// 4		
-				for(TInt cnt = 0; cnt < iName.Length(); cnt++)
-					{
-					aWriter.WriteByte(iName[cnt]);
-					}
-				}
-			else
-				{
-				aWriter.WriteInt(0);
-				}
-			}
-		else
-			{
-			CLTRACE("TThreadData::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TThreadData::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return void
-	 */
-	TInt TThreadData::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();					// 4
-		if(iId != ESCMThreadData)
-			{
-			CLTRACE("TThreadData::Deserialize Corrupt ID read");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TThreadDataVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == EThreadData1)
-			{
-			// read data v1 format	
-			iPriority = aReader.ReadInt();		 				// 4		
-			iTid = aReader.ReadInt64(); 			 	    	// 8		
-			iOwnerId = aReader.ReadInt64();						// 8
-			iSvcSP = aReader.ReadInt();							// 4
-			iSvcStack = aReader.ReadInt();						// 4
-			iSvcStacksize = aReader.ReadInt();					// 4
-			iUsrSP = aReader.ReadInt();							// 4
-			iUsrStack = aReader.ReadInt();						// 4
-			iUsrStacksize = aReader.ReadInt();					// 4
-			iLastCpu = aReader.ReadInt();						// 4
-			iSvcHeap = aReader.ReadInt();	 			 		// 4
-			iSvcHeapSize = aReader.ReadInt();	 			 		// 4
-			
-			iNamesize = aReader.ReadInt();						// 4
-						
-			if(iName.Ptr() && iName.MaxLength() >= (TInt)iNamesize)
-				{
-				iName.SetLength(0);
-				
-				for(TUint cnt = 0; cnt < iNamesize; cnt++)
-					{
-					iName.Append(aReader.ReadByte());		//iNamesize bytes
-					} 
-				}	
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TThreadData::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TThreadData::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TThreadData::GetSize() const
-		{
-		if(iVersion == EThreadData1)
-			{
-			return 66 + iName.Length();
-			}
-		else
-			{
-			CLTRACE("TThreadData::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	}
--- a/kernel/eka/debug/crashMonitor/src/scmvariantdata.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-// Copyright (c) 2008-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\kernel\scmvariantdata.cpp
-// Core dump server - Variant Data for System Crash
-// 
-//
-
-#include <scmdatatypes.h>
-
-namespace Debug
-	{
-	/**
-	 * TVariantSpecificData implementation
-	 * @internal technology
-	 */
-	
-	/**
-	 * TVariantSpecificData constructor
-	 */
-	TVariantSpecificData::TVariantSpecificData() :
-		iId(ESCMVariantData)
-		,iVersion(EVariantSpecificDataVersion1)
-		,iSize(0)
-		{			
-		}
-	
-	/**
-	 * Writes this classes data to the specified byte stream
-	 * @param aWriter byte stream to use
-	 * @return void
-	 */	
-	TInt TVariantSpecificData::Serialize(TByteStreamWriter& aWriter)
-		{
-		TInt startPos = aWriter.CurrentPosition();
-		
-		if(iId != ESCMVariantData)
-			{
-			CLTRACE("TVariantSpecificData::Serialize Corrupt ID");
-			return KErrCorrupt;
-			}
-
-		// ID saved first 
-		aWriter.WriteInt(iId);		 				    // 4		
-		
-		aWriter.WriteShort((TUint16) iVersion);			// 2
-
-		if(iVersion == EVariantSpecificDataVersion1)
-			{
-			// write data v1 format					
-			aWriter.WriteInt(iSize); 			 	// 4
-			}
-		else
-			{
-			CLTRACE("TVariantSpecificData::Serialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aWriter.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			// error between actual size & real size in data
-			CLTRACE("TVariantSpecificData::Serialize serialization size error");	
-			return KErrCorrupt;
-			}
-		
-		return KErrNone;
-		}
-	
-	/**
-	 * Reads the classes data from the specified byte stream
-	 * @param aReader Byte stream to use
-	 * @return void
-	 */
-	TInt TVariantSpecificData::Deserialize(TByteStreamReader& aReader)
-		{
-		TInt startPos = aReader.CurrentPosition();
-		
-		iId = (SCMStructId)aReader.ReadInt();					// 4
-		if(iId != ESCMVariantData)
-			{
-			CLTRACE("TVariantSpecificData::Deserialize Corrupt ID read");
-			return KErrCorrupt;
-			}
-		
-		iVersion = (TVariantSpecificDataVersion)aReader.ReadShort();			// 2
-
-		if(iVersion == EVariantSpecificDataVersion1)
-			{
-			// read data v1 format	
-			iSize = aReader.ReadInt();		 				// 4
-			}
-		else
-			{
-			iId = ESCMLast;	//unrecognised header
-			CLTRACE("TVariantSpecificData::Deserialize Unsupported version");
-			return KErrCorrupt;
-			}
-		
-		TInt endPos = aReader.CurrentPosition();
-		if( endPos - startPos != GetSize())
-			{
-			iId = ESCMLast;	//unrecognised header
-			
-			// error between actual size & real size in data
-			CLTRACE("TVariantSpecificData::Deserialize serialization size error");	
-			return KErrCorrupt;
-			}
-		return KErrNone;
-		}
-	
-	/**
-	 * Returns the externalised size of this class
-	 * @return TInt size
-	 */
-	TInt TVariantSpecificData::GetSize() const
-		{
-		if(iVersion == EVariantSpecificDataVersion1)
-			{
-			return 10;
-			}
-		else
-			{
-			CLTRACE("TThreadData::GetSize Unsupported version");			
-			return KErrNotSupported;		
-			}
-		}
-	
-	}
--- a/kernel/eka/drivers/crashflash/crashflashnor.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/crashflash/crashflashnor.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -64,13 +64,8 @@
 		return ret;
 		}
 	// start writing after the crash log header	
-	
-#ifdef CDS_CRASH_LOGGER
-	iWritePos = 0;
-#else
 	iWritePos = KCrashLogHeaderSize;
-#endif //CDS_CRASH_LOGGER
-	
+
 	SetReadPos(0);
 	iWriteTotal = 0;
 
--- a/kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/debug/group/base_e32_drivers_debug.mrp	Tue Nov 02 15:29:23 2010 +0000
@@ -3,7 +3,6 @@
 component	base_e32_drivers_debug
 
 source	\sf\os\kernelhwsrv\kernel\eka\debug
-source	\sf\os\kernelhwsrv\kernel\eka\debug\crashMonitor
 source	\sf\os\kernelhwsrv\kernel\eka\drivers\debug
 
 binary	\sf\os\kernelhwsrv\kernel\eka\drivers\debug\group all
--- a/kernel/eka/drivers/debug/group/bld.inf	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/debug/group/bld.inf	Tue Nov 02 15:29:23 2010 +0000
@@ -25,18 +25,6 @@
 
 BASEDEFAULT
 
-PRJ_EXPORTS
-
-../../../debug/crashMonitor/inc/scmonitor.h              SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmonitor.h)				
-../../../debug/crashMonitor/inc/scmdatatypes.h           SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmdatatypes.h)
-../../../debug/crashMonitor/inc/scmbytestreamutil.h      SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmbytestreamutil.h)
-../../../debug/crashMonitor/inc/scmbytestreamutil.inl    SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmbytestreamutil.inl)
-../../../debug/crashMonitor/inc/crashlogwalker.h         SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(crashlogwalker.h)
-../../../debug/crashMonitor/inc/scmconfig.h              SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmconfig.h)
-../../../debug/crashMonitor/inc/scmconfigitem.h          SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmconfigitem.h)
-../../../debug/crashMonitor/inc/scmdatasave.h            SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmdatasave.h)
-../../../debug/crashMonitor/inc/scmtrace.h               SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(scmtrace.h)
-
 PRJ_MMPFILES
 
 ../../../debug/trkdummyapp/group/trkdummyapp
@@ -53,11 +41,6 @@
 
 sm_debug_kerneldriver
 
-#if defined(GENERIC_MARM) 
-../../../debug/crashMonitor/group/scmusr_lib
-../../../debug/crashMonitor/group/scmkern_lib
-#endif
-
 #endif
 
 #endif
--- a/kernel/eka/drivers/locmedia/locmedia.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/locmedia/locmedia.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -553,6 +553,26 @@
 #endif
 
 /*
+Acquires ownership of the (already opened) client thread object stored in TheCurrentThread::iExtTempObj
+by retrieving and then clearing iExtTempObj
+
+On exit TheCurrentThread::iExtTempObj should be NULL
+
+@see EControlSetMountInfo
+*/
+DThread* AcquireRemoteThread()
+	{
+	NKern::ThreadEnterCS();
+
+	DThread& t = Kern::CurrentThread();
+	DThread* remoteThread = (DThread*)__e32_atomic_swp_ord_ptr(&t.iExtTempObj, 0);
+
+	NKern::ThreadLeaveCS();
+	
+	return remoteThread;
+	}
+
+/*
  * Requests are passed in message as follows:
  * iValue	= request ID
  * iArg[0,1]= Position
@@ -744,6 +764,11 @@
 			if(!pM || r!=KErrNone)
 				break;
 
+#ifdef __DEMAND_PAGING__
+			// Clear existing mount info
+			UnlockMountInfo(*pM);
+#endif
+			
 			if (pM->iMountInfo.iThread)
 				{
 				NKern::ThreadEnterCS();
@@ -758,17 +783,11 @@
 						break;
 #endif
 					pM->iMountInfo.iInfo=(TDesC8*)m.RemoteDes();
-					pM->iMountInfo.iThread=m.RemoteThread();
+					pM->iMountInfo.iThread = AcquireRemoteThread();
 					}
 				else
 					{
-					//Clear existing mount info and close setting thread
-
-#ifdef __DEMAND_PAGING__
-					// unlock the mount info if this is a data paging media
-					UnlockMountInfo(*pM);
-#endif
-
+					// Close setting thread
 					pM->iMountInfo.iInfo=NULL;
 					pM->iMountInfo.iThread=NULL;
 					m.CloseRemoteThread();
@@ -794,7 +813,8 @@
 #endif
 
 				pM->iMountInfo.iInfo=(TDesC8*)m.RemoteDes();
-				pM->iMountInfo.iThread=m.RemoteThread();
+				pM->iMountInfo.iThread = AcquireRemoteThread();
+
 				NKern::ThreadLeaveCS();
 				r=KErrNone;
 				}
--- a/kernel/eka/drivers/medmmc/bgahsmmcptn.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/medmmc/bgahsmmcptn.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -34,20 +34,36 @@
 	virtual TInt Initialise(DMediaDriver* aDriver);
 	virtual TInt PartitionInfo(TPartitionInfo& anInfo, const TMMCCallBack& aCallBack);
 	virtual TInt PartitionCaps(TLocDrv& aDrive, TDes8& aInfo);
-
+	TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2);
+	
 protected:
 	void SetPartitionEntry(TPartitionEntry* aEntry, TUint aFirstSector, TUint aNumSectors);
 
 private:
 	virtual TInt ReadPartition(TUint32 aPtOffset);
+	virtual TInt ReadPartition(TUint32 aPtOffset, TUint aNumBlocks);
 	static void SessionEndCallBack(TAny* aSelf);
 	void DoSessionEndCallBack();
-	virtual TInt DecodePartitionInfo();
+	TInt DecodeTOCPartitionInfo();
+	TInt DecodeBB5PartitionInfo();
+	TInt CheckPartitionBoundaries(TInt aStart, TInt aEnd);
 	TInt GetPartitionSizeInSectors(TUint aPartition, TUint32& aSize);
 	TInt GetPartitionOffset(TUint32& aPtOffset);
 	TInt SelectNextPartition();
+	TInt ReadTOCVersionInfo(TUint32& aOffset);
+	void DecodeVersionInfo();
 
+private:	
+	enum TMediaRequest
+	    {
+        EIdle                    = 0x00,
+        EDecodeBB5PartitionInfo  = 0x01,
+        EDecodeTOCPartitionInfo  = 0x02,        
+        EReadImageVersionInfo    = 0x03,	    
+	    };
+	
 protected:
+		
 	DMediaDriver*	iDriver;
 	TPartitionInfo* iPartitionInfo;
 	TMMCCallBack	iSessionEndCallBack;
@@ -59,17 +75,61 @@
 	TBool           iCheckTOC;
 	Toc*            iTocPtr;
 	TUint32			iSelectedPartition;	
+	TMediaRequest   iMedReq;
+	
+// Version Info Stuff	
+	TBool            iVersionInfoRead;    
+    TUint32          iVersionInfoItems; /** Amount of version info items */
+    TVersionInfoItem iVersionInfo[KMaxSectionItems]; /** Array for keep whole Version Info structures */
+    TUint32          iTocCount;
 	};
 
+/*****************************************************************************/
+/*                                                                           */
+/* NAME                                                                      */
+/*      halFunction                                                          */
+/* DESCRIPTION                                                               */
+/*      This function gets HAL queries via EHalGroupMedia device 1           */
+/*      This function is registered in the end of DoCreate                   */
+/* PARAMETERS                                                                */
+/*      TAny* aPtr      pointer to DMediaDriverNand object                   */
+/*      TInt  aFunction requested function:                                  */
+/*            1 - NAND block size                                            */
+/*            2 - Is separate erase command supported  ETrue/EFalse          */
+/*      TAny* a1        address to user side variable, block size is saved   */
+/*                      to this address                                      */
+/*      TAny* a2        not used                                             */
+/* RETURN VALUES                                                             */
+/*      KErrNone                                                             */
+/* NOTES                                                                     */
+/*                                                                           */
+/*****************************************************************************/
+LOCAL_C TInt halFunction(TAny* aPtr, TInt aFunction, TAny* a1, TAny* a2)
+    {
+    DBB5PartitionInfo* pI = (DBB5PartitionInfo*)aPtr;
+    return pI->HalFunction(aFunction,a1,a2);
+    }
+
 DBB5PartitionInfo::DBB5PartitionInfo()
   : iSessionEndCallBack(DBB5PartitionInfo::SessionEndCallBack, this),
-    iCheckTOC(EFalse)
+    iCheckTOC(EFalse),iMedReq(EIdle),iVersionInfoItems(0)
 	{
 	}
 
 DBB5PartitionInfo::~DBB5PartitionInfo()
 	{
 	delete iSession;
+	if (iVersionInfoRead)
+	    {
+	    TInt r = Kern::RemoveHalEntry(EHalGroupNandMedia,ENandMediaDevice1);
+	    __KTRACE_OPT(KPBUSDRV, Kern::Printf("~DBB5PartitionInfo: Removed HAL Entry %d",r));
+	    r = r; //get rid of warning, nothing we can do with the warning
+	    }
+	
+	if (iTocPtr)
+	    {
+	    delete iTocPtr;
+	    }
 	}
 
 TInt DBB5PartitionInfo::Initialise(DMediaDriver* aDriver)
@@ -96,22 +156,26 @@
 
 	iSelectedPartition = TExtendedCSD::ESelectUserArea;
 	
+	iTocPtr = new Toc();
+	
 	return(KErrNone);
 	}
 
 TInt DBB5PartitionInfo::PartitionInfo(TPartitionInfo& aInfo, const TMMCCallBack& aCallBack)
 	{
+    __KTRACE_OPT(KPBUSDRV,Kern::Printf(">DBB5PartitionInfo:PartitionInfo"));
 	iPartitionInfo = &aInfo;
 	iPartitionInfo->iPartitionCount = 0;
 	iCallBack = aCallBack;
+	iVersionInfoRead = EFalse;
 
 	// Always check the user partition first
 	iSelectedPartition = TExtendedCSD::ESelectUserArea;
 	iSession->SetPartition(iSelectedPartition);
 
 	// Preferred partition scheme is BB5, which is located in the last block of the media.
-    TUint32 ptiOffset;
-    TInt r;
+    TUint32 ptiOffset = 0;
+    TInt r = KErrNone;
     do
     	{
 	    r = GetPartitionOffset(ptiOffset);
@@ -119,23 +183,25 @@
 	    if(r == KErrNone)
 	    	{
 		    r = ReadPartition(ptiOffset);
-		    return r;
+		    iMedReq = (KErrNone==r) ? EDecodeBB5PartitionInfo : EIdle;
+		    break;
 	    	}
 
 	    r = SelectNextPartition();
     	}
-    while(r != KErrNotFound);
-
+    while(r != KErrNotFound);    
+    
+    __KTRACE_OPT(KPBUSDRV,Kern::Printf("<DBB5PartitionInfo::PartitionInfo(%d)",r));
 	return r;
 	}
 	
 // retrieves size in terms of sectors
 TInt DBB5PartitionInfo::GetPartitionSizeInSectors(TUint aPartition, TUint32& aSize)
 	{
+    __KTRACE_OPT(KPBUSDRV,Kern::Printf(">DBB5PartitionInfo: GetPartitionSizeInSectors(%d)",aPartition));
+    
 	TInt r = KErrNone;
-	
 	TUint32 size = 0;
-	
 	const TExtendedCSD& extCsd = iCard->ExtendedCSD();
 	
 	switch(aPartition)
@@ -189,6 +255,7 @@
 			break;
 		}
 
+	__KTRACE_OPT(KPBUSDRV,Kern::Printf("<DBB5PartitionInfo: GetPartitionSizeInSectors(size %d, r %d)",size,r));
 	aSize = size;	
 	return r;
 	}
@@ -213,6 +280,7 @@
 	
 TInt DBB5PartitionInfo::SelectNextPartition()
 	{
+    __KTRACE_OPT(KPBUSDRV,Kern::Printf(">DBB5PartitionInfo: SelectNextPartition (%d)",iSelectedPartition));
 	TExtendedCSD extCsd = iCard->ExtendedCSD();
 	TUint maxPartition = TExtendedCSD::ESelectUserArea;
 	
@@ -228,7 +296,7 @@
 		maxPartition = TExtendedCSD::ESelectBootPartition2;
 		}
 #endif // EMMC_BOOT_PARTITION_ACCESS_ENABLED
-
+	
 	++iSelectedPartition;
 	
 	// skip through to GPAP1 if either the currently selected partition is RPMB or
@@ -252,18 +320,33 @@
 		{
 		iSession->SetPartition(iSelectedPartition);
 		}
-		
+
+	__KTRACE_OPT(KPBUSDRV,Kern::Printf("<DBB5PartitionInfo: SelectNextPartition (%d) err (%d)",iSelectedPartition, r));
+	        
 	return r;	
 	}	
-	
-// returns KErrCompletion on success after having checked all partitions
+
 TInt DBB5PartitionInfo::ReadPartition(TUint32 aPtOffset)
     {
+    return ReadPartition(aPtOffset,1);
+    }
+
+// returns KErrCompletion on success after having checked all partitions
+TInt DBB5PartitionInfo::ReadPartition(TUint32 aPtOffset, TUint aNumBlocks)
+    {
+    __ASSERT_ALWAYS(aNumBlocks > 0,Kern::Fault("DBB5PartitionInfo:RP aNumBlocks = 0", __LINE__));
 	// If media driver is persistent (see EMediaDriverPersistent)
 	// the card may have changed since last power down, so reset CID
 	iSession->SetCard(iCard);
 
-	iSession->SetupCIMReadBlock(aPtOffset, iIntBuf);
+	if (aNumBlocks == 1)
+	    {
+	    iSession->SetupCIMReadBlock(aPtOffset, iIntBuf);
+	    }
+	else
+	    {
+	    iSession->SetupCIMReadBlock(aPtOffset, iIntBuf,aNumBlocks);	    
+	    }
 	
 	TInt r = iDriver->InCritical();
 	if (r == KErrNone)
@@ -321,25 +404,94 @@
 	{
 	iDriver->EndInCritical();
 
+	__KTRACE_OPT(KPBUSDRV,Kern::Printf(">DBB5PartitionInfo:DoSessionEndCallBack (%d)",iMedReq));
+	
 	TInt r = iSession->EpocErrorCode();
-
 	
-	TInt& partitionCount = iPartitionInfo->iPartitionCount;
-
-	if (r == KErrNone)
-		r = DecodePartitionInfo();
-
-	if (iCheckTOC)
-		{
-		//BB5 table not found need to check for TOC in this partition before continuing
-		if (r!=KErrNone)
-			{
-			iDriver->PartitionInfoComplete(KErrNotReady);
-			}
-		return;
-		}
-
-
+	if (KErrNone == r)
+	    {
+	    switch (iMedReq)
+	        {
+	        case EDecodeBB5PartitionInfo   : 
+	            {
+                r = DecodeBB5PartitionInfo();
+                if (r == KErrNotFound)
+                    {
+                    // Check for TOC in this partition instead
+                    TUint32 size = 0;
+                    r = GetPartitionSizeInSectors(iSelectedPartition,size);
+                    if ((KErrNone == r) && (size >= KTocStartSector+1))
+                        {
+                        //Check partition size to see if TOC could be read (i.e. might be too small)
+                        r = ReadPartition(KTocStartSector);
+                        iMedReq = (KErrNone==r) ? EDecodeTOCPartitionInfo : EIdle;
+                        return;
+                        }                    
+                    }
+                // else - found BB5 check if next phys partition has anything to read...
+                break;
+	            }
+	        case EDecodeTOCPartitionInfo   :
+	            {
+	            r = DecodeTOCPartitionInfo();
+	            if (r == KErrNone)
+	                {
+	                //Found a TOC, read version info if available
+	                TUint32 versOffset = 0;
+	                iTocCount = 0; //Reset Toc entry counter
+	                r = ReadTOCVersionInfo(versOffset);	                
+	                if (r == KErrNotFound)
+	                    {
+	                    // No valid partitions present
+	                    iMedReq = EIdle;
+                        r = KErrNone;
+	                    }
+	                else
+	                    {
+	                    // Found something to read...
+	                    r = ReadPartition(versOffset, 2);
+	                    iMedReq = (KErrNone==r) ? EReadImageVersionInfo : EIdle;
+	                    return;
+	                    }
+	                }
+	            else
+	                {
+	                // TOC not found move on to next phys partition
+	                iMedReq = EIdle;
+	                r = KErrNone;
+	                }
+	            break;
+	            }
+	        case EReadImageVersionInfo     :
+	            {	            
+                DecodeVersionInfo();
+                TUint32 versOffset = 0;
+                iTocCount++;
+                r = ReadTOCVersionInfo(versOffset);
+                if (r == KErrNotFound)
+                    {
+                    //Finished parsing the current TOC                                 
+                    //Mark version info as being read in order to report when finished later
+                    iVersionInfoRead = ETrue;
+                    iMedReq = EIdle;
+                    r=KErrNone;
+                    }
+                else if (r==KErrNone)
+                    {
+                    // more partitions to read
+                    r = ReadPartition(versOffset, 2);
+                    iMedReq = (KErrNone==r) ? EReadImageVersionInfo : EIdle;
+                    return;
+                    }
+                break;
+	            }
+	            
+	        default : Kern::Fault("DBB5PartitionInfo unknown request type", __LINE__);
+	        }
+	    }
+	
+	// Next physical partition will be search for if
+	// BB5 entry was found, no TOC entry was found or no Version Information was found
 	if(r == KErrNone)
 		{
 		// check next partition(s) for BB5
@@ -354,10 +506,10 @@
 			if(r == KErrNone)
 				{
 				r = ReadPartition(ptiOffset);
+				iMedReq = (KErrNone==r) ? EDecodeBB5PartitionInfo : EIdle;
 				if(r != KErrNone)
 					break;
 
-
 				return;
 				}
 
@@ -371,7 +523,7 @@
 			__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc:dsc: ReadPartition() failed r=%d!", r));
 			r = KErrCorrupt;
 			}
-		else if(partitionCount == 0)
+		else if(iPartitionInfo->iPartitionCount == 0)
 			{
 			__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc:dsc: No supported partitions found!"));
 			r = KErrCorrupt;
@@ -379,6 +531,19 @@
 		else
 			r = KErrCompletion;
 		}
+	
+	
+	if (iVersionInfoRead)
+	    {
+	    __KTRACE_OPT(KPBUSDRV, Kern::Printf("%d Version Headers - Register HAL entry", iVersionInfoItems ));
+	    //finished parsing the TOC register HAL function            
+	    r = Kern::AddHalEntry(EHalGroupNandMedia, halFunction, this, ENandMediaDevice1);
+	    if (r==KErrNone)
+	        {	        
+	        __KTRACE_OPT(KPBUSDRV,Kern::Printf("DBB5PartitionInfo:Added HAL Entry %d",r));
+	        r = KErrCompletion; //re-mark as completed
+	        }
+	    }
 
 	// Notify medmmc that partitioninfo is complete
 	iCallBack.CallBack();
@@ -386,256 +551,403 @@
 	// All potential partitions checked - KErrCompletion
 	// indicates that there are no more partitions to check
 	r = (r == KErrCompletion) ? KErrNone : KErrNotReady;
+	__KTRACE_OPT(KPBUSDRV,Kern::Printf("<DBB5PartitionInfo:PartitionInfo Complete %d",r));
 	iDriver->PartitionInfoComplete(r);
 	}
 
+TInt DBB5PartitionInfo::CheckPartitionBoundaries(TInt aStart, TInt aEnd)
+    {
+    __ASSERT_ALWAYS(aStart >= 0,Kern::Fault("DBB5PartitionInfo:CPB aStart <0", __LINE__));
+    __ASSERT_ALWAYS(aEnd > 0,Kern::Fault("DBB5PartitionInfo:CPB aEnd <=0", __LINE__));
+    
+    // Validate partition address boundaries
+    TUint32 eMmcPartitionSizeInSectors = 0;
+    TInt r = KErrNone;
+    
+    if (aStart != aEnd)
+        {
+        // At least one entry for a supported partition found
+        r = GetPartitionSizeInSectors(iSelectedPartition, eMmcPartitionSizeInSectors);
+        
+        if(r != KErrNone)
+            {
+            __KTRACE_OPT(KPBUSDRV, Kern::Printf("DBB5PartitionInfo:CPB: Could not retrieve size for eMMC partition 0x%02X", iSelectedPartition));
+            r = KErrCorrupt;
+            }
+        
+    
+        // Check that the eMmcPartition address space boundary is not exceeded by the last partition
+        if(r == KErrNone)
+            {
+            TUint64 eMmcPartitionSize = eMmcPartitionSizeInSectors * KSectorSize;
+            
+            TPartitionEntry& part = iPartitionInfo->iEntry[aEnd - 1];
+                
+            if(((TUint64)(part.iPartitionBaseAddr + part.iPartitionLen)) > eMmcPartitionSize)
+                {
+                __KTRACE_OPT(KPBUSDRV, Kern::Printf("DBB5PartitionInfo:CPB: Partition #%d exceeds eMmc address space", aEnd));
+                r = KErrCorrupt;
+                }
+            }
+            
+        if(r == KErrNone)
+            {
+            // Go through all BB5 partition entries on this eMMC partition and check boundaries
+            for(TInt i = aEnd - 1; i > aStart; i--)
+                {
+                const TPartitionEntry& curr = iPartitionInfo->iEntry[i];
+                TPartitionEntry& prev = iPartitionInfo->iEntry[i-1];
+    
+                // Check if partitions overlap
+                if(curr.iPartitionBaseAddr < (prev.iPartitionBaseAddr + prev.iPartitionLen))
+                    {
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("DBB5PartitionInfo:CPB: Overlapping partitions - check #%d", i));
+                    r = KErrCorrupt;
+                    }
+                }
+            }
+        }
+    
+    return r;
+    }
 
-TInt DBB5PartitionInfo::DecodePartitionInfo()
+TInt DBB5PartitionInfo::DecodeBB5PartitionInfo()
+//
+// Decode partition info that was read into internal buffer
+//
+    {
+    __KTRACE_OPT(KPBUSDRV, Kern::Printf(">DBB5PartitionInfo: DecodeBB5PartitionInfo(%d)",iPartitionInfo->iPartitionCount));
+    TInt partitionCount = iPartitionInfo->iPartitionCount;
+    TInt r = KErrNotFound;
+        
+#ifdef __PRINT_RAW_ENTRIES
+    Kern::Printf("BB5 Entry");
+    for (TUint i = 0; i < 512; i+=8)
+        {
+        Kern::Printf("%02x %02x %02x %02x   %02x %02x %02x %02x", iIntBuf[i],iIntBuf[i+1],iIntBuf[i+2],iIntBuf[i+3],iIntBuf[i+4],iIntBuf[i+5],iIntBuf[i+6],iIntBuf[i+7]);
+        }
+#endif    
+    
+    // Try utilising the BB5 partitioning scheme    
+    BGAHSMMCPTN_PI_STR *partitionTable = (BGAHSMMCPTN_PI_STR*)(&iIntBuf[0]);
+
+    // Verify that this is the BB5 partition table
+    if( memcompare( (TUint8*)&(partitionTable->iId[0]), sizeof(BGAHSMMCPTN_PI_ID), (TUint8*)BGAHSMMCPTN_PI_ID, sizeof(BGAHSMMCPTN_PI_ID)) == 0 )
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("Nokia partition structure found"));
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->id..............: %s", partitionTable->iId ));
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->sector_size.....: %d = 0x%x", partitionTable->iSector_size, partitionTable->iSector_size));
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->major_ver.......: %d", partitionTable->iMajor_ver));
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->minor_ver.......: %d", partitionTable->iMinor_ver));
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->partition_amount: %d", partitionTable->iPartition_amount));
+        
+        TUint8 partitionType = 0;       
+        // Check Supported Version is present
+        if (partitionTable->iMajor_ver <= BGAHSMMCPTN_PI_VER_MAJOR)
+            {
+            for( TUint8 index = 0; (index < partitionTable->iPartition_amount) && (index < BGAHSMMCPTN_LAST_DRIVE); index++ )
+                {
+                if (partitionTable->iMinor_ver >= BGAHSMMCPTN_PART_TYPE_SUPP_VER_MINOR)
+                    partitionType = partitionTable->iPartitions[index].iPartition_type;
+                else                    
+                    partitionType = partitionTable->iPartitions[index].iPartition_id;
+            
+                // FAT/PMM/CPS/SWAP/CORE/ROFS/CRASH
+                if( (partitionTable->iPartitions[index].iSize > 0) &&
+                    ( PartitionIsFAT(partitionType) ||
+                      PartitionIsFAT32(partitionType) ||
+                     (KPartitionTypeSymbianCrashLog == partitionType) ||
+                     (KPartitionTypePartitionMagic == partitionType) || //CPS/PMM
+                     (KPartitionTypeRofs == partitionType) || 
+                     (KPartitionTypeEmpty == partitionType) ||
+                     (KPartitionTypeROM == partitionType) ||
+                     (KPartitionTypePagedData == partitionType) ) )
+                    {                   
+                    iPartitionInfo->iEntry[partitionCount].iPartitionType     = partitionType;
+                    iPartitionAttributes[partitionCount]                      = partitionTable->iPartitions[index].iPartition_attributes;
+                    static_cast<DMmcMediaDriverFlash *>(iDriver)->SetEMmcPartitionMapping(partitionCount, iSelectedPartition);
+                    // ROM/ROFS partitions have a BB5 checksum header that must be offset for the Symbian OS.
+                    const TUint32 KStartOffset = ((KPartitionTypeROM == partitionType) || (KPartitionTypeRofs == partitionType) || (KPartitionTypeEmpty == partitionType)) ? KBB5HeaderSizeInSectors : 0;
+                    
+                    iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = ((Int64) partitionTable->iPartitions[index].iStart_sector + KStartOffset) << KDiskSectorShift;
+                    iPartitionInfo->iEntry[partitionCount].iPartitionLen      = ((Int64) partitionTable->iPartitions[index].iSize - KStartOffset) << KDiskSectorShift;
+    
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("Registering partition #%d:", partitionCount));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionCount....: %d", partitionCount));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("startSector.......: 0x%x", partitionTable->iPartitions[index].iStart_sector ));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr >> KDiskSectorShift)));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("size..............: 0x%lx", partitionTable->iPartitions[index].iSize ));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionLen, iPartitionInfo->iEntry[partitionCount].iPartitionLen >> KDiskSectorShift));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[partitionCount].iPartitionType));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[partitionCount]));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionMapping.: 0x%x", static_cast<DMmcMediaDriverFlash *>(iDriver)->GetEMmcPartitionMapping(partitionCount)));
+                    __KTRACE_OPT(KPBUSDRV, Kern::Printf(" "));
+    
+                    partitionCount++;
+                    r = KErrNone;
+                    }
+                }
+            }
+        
+        if(partitionCount > iPartitionInfo->iPartitionCount)
+            {
+            __KTRACE_OPT(KPBUSDRV, Kern::Printf("DBB5PartitionInfo: New BB5 partitions found"));
+#ifdef __DEBUG_CHECK_PARTITION_         
+            r = CheckPartitionBoundaries(iPartitionInfo->iPartitionCount,partitionCount);        
+            if (r == KErrNone)
+#endif // __DEBUG_CHECK_PARTITION_             
+                {
+                //Update master partition count
+                iPartitionInfo->iPartitionCount = partitionCount;
+                iPartitionInfo->iMediaSizeInBytes = iCard->DeviceSize64();
+                }                
+            }
+        }
+    
+    __KTRACE_OPT(KPBUSDRV, Kern::Printf("< DBB5PartitionInfo: DecodeBB5PartitionInfo(%d)",r));
+    return r;
+    }
+
+
+TInt DBB5PartitionInfo::DecodeTOCPartitionInfo()
 //
 // Decode partition info that was read into internal buffer
 //
-	{
-	__KTRACE_OPT(KPBUSDRV, Kern::Printf(">Mmc:PartitionInfo()"));
-	TInt& partitionCount = iPartitionInfo->iPartitionCount;
+    {
+    __KTRACE_OPT(KPBUSDRV, Kern::Printf(">DBB5PartitionInfo: DecodeTOCPartitionInfo(%d)",iPartitionInfo->iPartitionCount));
+    TInt partitionCount = iPartitionInfo->iPartitionCount;
     TInt r = KErrNone;
 
-	if (iCheckTOC)
-	    {
-        // Try utilising the TOC (Table Of Contents) partitioning scheme 
-        const TText8* KRofsNames[KNoOfROFSPartitions] = { KTocRofs1Generic,
-                                                          KTocRofs2Generic,
-                                                          KTocRofs3Generic,
-                                                          KTocRofs4Generic,
-                                                          KTocRofs5Generic,                                                            
-                                                          KTocRofs6Generic,                                                            
-                                                          };
-                                        
-        STocItem item;
-        iTocPtr = reinterpret_cast<Toc*>(&iIntBuf[0]);
-        iTocPtr->iTocStartSector = KTocStartSector;
+    // Try utilising the TOC (Table Of Contents) partitioning scheme 
+    const TText8* KRofsNames[KNoOfROFSPartitions] = { KTocRofs1Generic,
+                                                      KTocRofs2Generic,
+                                                      KTocRofs3Generic,
+                                                      KTocRofs4Generic,
+                                                      KTocRofs5Generic,                                                            
+                                                      KTocRofs6Generic,                                                            
+                                                      };
+                                    
+    STocItem item;    
+    memcpy( iTocPtr, &iIntBuf[0], sizeof(Toc));
+
+#ifdef __PRINT_RAW_ENTRIES
+    Kern::Printf("TOC Entry");
+    for (TUint i = 0; i < 512; i+=8)
+        {
+        Kern::Printf("%02x %02x %02x %02x   %02x %02x %02x %02x", iIntBuf[i],iIntBuf[i+1],iIntBuf[i+2],iIntBuf[i+3],iIntBuf[i+4],iIntBuf[i+5],iIntBuf[i+6],iIntBuf[i+7]);
+        }
+#endif   
+        
+    iTocPtr->iTocStartSector = KTocStartSector;
 
 // USER Drive - Only 1        
-        r = iTocPtr->GetItemByName(KTocUserName, item); 
-        if (KErrNone == r)
+    r = iTocPtr->GetItemByName(KTocUserName, item); 
+    if (KErrNone == r)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
+        iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeFAT16;           
+        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64)item.iStart;                         
+        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64)item.iSize;
+        iPartitionAttributes[partitionCount] = 0; // No Additional Attributes required.           
+        partitionCount++;
+        }   
+    
+// ROM Drive        
+    r = iTocPtr->GetItemByName(KTocRomGeneric, item); 
+    if (KErrNone == r)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%x  Size = 0x%x", item.iFileName, item.iStart, item.iSize));
+        iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeROM;           
+        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart + (KBB5HeaderSizeInSectors << KDiskSectorShift);                         
+        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize - (KBB5HeaderSizeInSectors << KDiskSectorShift);          
+        partitionCount++;
+        }
+    
+// ROFS            
+    for (TUint i = 0; i < KNoOfROFSPartitions; i++)
+        {
+        /* Search ROFSn item */            
+        r = iTocPtr->GetItemByName(KRofsNames[i], item);
+        if (r == KErrNone)
             {
             __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeFAT16;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64)item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64)item.iSize;
-            iPartitionAttributes[partitionCount] = 0; // No Additional Attributes required.           
-            partitionCount++;
-            }   
-        
-// ROM Drive        
-        r = iTocPtr->GetItemByName(KTocRomGeneric, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%x  Size = 0x%x", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeROM;           
+            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeRofs;           
             iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart + (KBB5HeaderSizeInSectors << KDiskSectorShift);                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize - (KBB5HeaderSizeInSectors << KDiskSectorShift);          
+            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize - (KBB5HeaderSizeInSectors << KDiskSectorShift);
             partitionCount++;
             }
-        
-// ROFS            
-        for (TUint i = 0; i < KNoOfROFSPartitions; i++)
-            {
-            /* Search ROFSn item */            
-            r = iTocPtr->GetItemByName(KRofsNames[i], item);
-            if (r == KErrNone)
-                {
-                __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-                iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeRofs;           
-                iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart + (KBB5HeaderSizeInSectors << KDiskSectorShift);                         
-                iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize - (KBB5HeaderSizeInSectors << KDiskSectorShift);
-                partitionCount++;
-                }
-            }         
+        }         
 
 // CPS Drive - Only 1        
-        r = iTocPtr->GetItemByName(KTocCps, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypePartitionMagic;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
-            partitionCount++;
-            }
-        
+    r = iTocPtr->GetItemByName(KTocCps, item); 
+    if (KErrNone == r)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
+        iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypePartitionMagic;           
+        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
+        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
+        partitionCount++;
+        }
+    
 // CRASH Drive - Only 1        
-        r = iTocPtr->GetItemByName(KTocCrashLog, item); 
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeSymbianCrashLog;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
-            partitionCount++;
-            }
-        
+    r = iTocPtr->GetItemByName(KTocCrashLog, item); 
+    if (KErrNone == r)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
+        iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypeSymbianCrashLog;           
+        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
+        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
+        partitionCount++;
+        }
+    
 // SWAP Partition - Only 1        
-        r = iTocPtr->GetItemByName(KTocSwap, item);
-        if (KErrNone == r)
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
-            iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypePagedData;           
-            iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
-            iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
-            partitionCount++;
-            }                
+    r = iTocPtr->GetItemByName(KTocSwap, item);
+    if (KErrNone == r)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("[MD  :   ] (%11s) in TOC found : Start addr = 0x%X  Size = 0x%X", item.iFileName, item.iStart, item.iSize));
+        iPartitionInfo->iEntry[partitionCount].iPartitionType     = KPartitionTypePagedData;           
+        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = (Int64) item.iStart;                         
+        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = (Int64) item.iSize;
+        partitionCount++;
+        }                
 
 #ifdef __DEBUG_PARTITIONS_
-        for (TInt i = 0; i<partitionCount; i++)
-            {
-            Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[i].iPartitionType);                
-            Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[i].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[i].iPartitionBaseAddr >> KDiskSectorShift));                
-            Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[i].iPartitionLen, iPartitionInfo->iEntry[i].iPartitionLen >> KDiskSectorShift);
-            Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[i]);
-            Kern::Printf(" ");
-            }
+    for (TInt i = 0; i<partitionCount; i++)
+        {
+        Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[i].iPartitionType);                
+        Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[i].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[i].iPartitionBaseAddr >> KDiskSectorShift));                
+        Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[i].iPartitionLen, iPartitionInfo->iEntry[i].iPartitionLen >> KDiskSectorShift);
+        Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[i]);
+        Kern::Printf(" ");
+        }
 #endif //__DEBUG_PARTITIONS_
-        
-		r = KErrNone;
-        iCheckTOC = EFalse;
-	    }
-	else
-	    {
-        // Try utilising the BB5 partitioning scheme	
-        BGAHSMMCPTN_PI_STR *partitionTable = (BGAHSMMCPTN_PI_STR*)(&iIntBuf[0]);
     
-        // Verify that this is the Nokia partition table
-        if( memcompare( (TUint8*)&(partitionTable->iId[0]), sizeof(BGAHSMMCPTN_PI_ID), (TUint8*)BGAHSMMCPTN_PI_ID, sizeof(BGAHSMMCPTN_PI_ID)) == 0 )
+    if(partitionCount > iPartitionInfo->iPartitionCount)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc: New supported partitions found!"));
+#ifdef __DEBUG_CHECK_PARTITION_         
+        r = CheckPartitionBoundaries(iPartitionInfo->iPartitionCount,partitionCount);        
+        if (r == KErrNone)
+#endif // __DEBUG_CHECK_PARTITION_             
             {
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("Nokia partition structure found"));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->id..............: %s", partitionTable->iId ));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->sector_size.....: %d = 0x%x", partitionTable->iSector_size, partitionTable->iSector_size));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->major_ver.......: %d", partitionTable->iMajor_ver));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->minor_ver.......: %d", partitionTable->iMinor_ver));
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionTable->partition_amount: %d", partitionTable->iPartition_amount));
-            
-            TUint8 partitionType = 0;		
-            // Check Supported Version is present
-            if (partitionTable->iMajor_ver <= BGAHSMMCPTN_PI_VER_MAJOR)
-                {
-                for( TUint8 index = 0; (index < partitionTable->iPartition_amount) && (index < BGAHSMMCPTN_LAST_DRIVE); index++ )
-                    {
-                    if (partitionTable->iMinor_ver >= BGAHSMMCPTN_PART_TYPE_SUPP_VER_MINOR)
-                        partitionType = partitionTable->iPartitions[index].iPartition_type;
-                    else                    
-                        partitionType = partitionTable->iPartitions[index].iPartition_id;
-                
-                    // FAT/PMM/CPS/SWAP/CORE/ROFS/CRASH
-                    if( (partitionTable->iPartitions[index].iSize > 0) &&
-                        ( PartitionIsFAT(partitionType) ||
-                          PartitionIsFAT32(partitionType) ||
-                         (KPartitionTypeSymbianCrashLog == partitionType) ||
-                         (KPartitionTypePartitionMagic == partitionType) || //CPS/PMM
-                         (KPartitionTypeRofs == partitionType) || 
-                         (KPartitionTypeEmpty == partitionType) ||
-                         (KPartitionTypeROM == partitionType) ||
-                         (KPartitionTypePagedData == partitionType) ) )
-                        {                   
-                        iPartitionInfo->iEntry[partitionCount].iPartitionType	  = partitionType;
-                        iPartitionAttributes[partitionCount]                      = partitionTable->iPartitions[index].iPartition_attributes;
-	                    static_cast<DMmcMediaDriverFlash *>(iDriver)->SetEMmcPartitionMapping(partitionCount, iSelectedPartition);
-                        // ROM/ROFS partitions have a BB5 checksum header that must be offset for the Symbian OS.
-						const TUint32 KStartOffset = ((KPartitionTypeROM == partitionType) || (KPartitionTypeRofs == partitionType) || (KPartitionTypeEmpty == partitionType)) ? KBB5HeaderSizeInSectors : 0;
-                        
-                        iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr = ((Int64) partitionTable->iPartitions[index].iStart_sector + KStartOffset) << KDiskSectorShift;
-                        iPartitionInfo->iEntry[partitionCount].iPartitionLen      = ((Int64) partitionTable->iPartitions[index].iSize - KStartOffset) << KDiskSectorShift;
-        
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("Registering partition #%d:", partitionCount));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("partitionCount....: %d", partitionCount));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("startSector.......: 0x%x", partitionTable->iPartitions[index].iStart_sector ));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionBaseAddr: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr, (TUint32)(iPartitionInfo->iEntry[partitionCount].iPartitionBaseAddr >> KDiskSectorShift)));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("size..............: 0x%lx", partitionTable->iPartitions[index].iSize ));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionLen.....: 0x%lx (sectors: %d)", iPartitionInfo->iEntry[partitionCount].iPartitionLen, iPartitionInfo->iEntry[partitionCount].iPartitionLen >> KDiskSectorShift));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionType....: %d", iPartitionInfo->iEntry[partitionCount].iPartitionType));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionAttribs.: 0x%x", iPartitionAttributes[partitionCount]));
-						__KTRACE_OPT(KPBUSDRV, Kern::Printf("iPartitionMapping.: 0x%x", static_cast<DMmcMediaDriverFlash *>(iDriver)->GetEMmcPartitionMapping(partitionCount)));
-                    	__KTRACE_OPT(KPBUSDRV, Kern::Printf(" "));
-        
-                        partitionCount++;
-                        }
-                    }
-                } 
+            //Update master partition count
+            iPartitionInfo->iPartitionCount = partitionCount;
+            iPartitionInfo->iMediaSizeInBytes = iCard->DeviceSize64();
+            r = KErrNone;
+            }                
+        }
+    else
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("<DBB5PartitionInfo: No New Partitions found - TOC"));
+        r = KErrNotFound;
+        }
+    
+    __KTRACE_OPT(KPBUSDRV, Kern::Printf("<DBB5PartitionInfo: DecodeTOCPartitionInfo(%d)",r));
+    return r;
+    }
+
+
+// Version Info Support
+TInt DBB5PartitionInfo::HalFunction(TInt aFunction, TAny* a1, TAny* /*a2*/)
+    {
+    TInt ret = KErrGeneral;  
+
+    __KTRACE_OPT(KPBUSDRV, Kern::Printf(">DBB5PartitionInfo::HalFunction"));
+    
+    if (aFunction == EGetVersionInfoItems)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf(">DBB5PartitionInfo::EGetVersionInfoItems %d Version Headers",iVersionInfoItems ));
+        kumemput32(a1, &iVersionInfoItems, sizeof(TUint32));
+        ret = KErrNone;
+        }
+    else if (aFunction == EGetVersionInfo)
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf(">DBB5PartitionInfo::EGetVersionInfo"));
+        kumemput32(a1, &iVersionInfo[0], sizeof(TVersionInfoItem)*iVersionInfoItems);
+        ret = KErrNone;
+        }
+
+    __KTRACE_OPT(KPBUSDRV, Kern::Printf("<DBB5PartitionInfo::HalFunction"));
+    
+    return ret;
+    }
+
+// returns KErrNotfound if reached the end of the toc
+TInt DBB5PartitionInfo::ReadTOCVersionInfo(TUint32& aOffset)
+    {
+    TInt r = KErrNotFound;
+    for (; iTocCount < KMaxNbrOfTocItems; iTocCount++ )
+        {
+        __KTRACE_OPT(KPBUSDRV, Kern::Printf("ReadTOCVersionInfo: Find next usable TOC entry (%d)",iTocCount));
+        // Iterate through the partition info table looking for valid partition headers
+        if ( iTocPtr->iTOC[iTocCount].iStart == KEndOfToc ) 
+            {
+            __KTRACE_OPT(KPBUSDRV, Kern::Printf("ReadTOCVersionInfo: End of the TOC"));
+            break;
+            }    
+        else if ( iTocPtr->iTOC[iTocCount].iStart & 0x80000000 )             
+            {
+            __KTRACE_OPT(KPBUSDRV, Kern::Printf("ReadTOCVersionInfo: Image has negative offset"));
+            continue;
+            }    
+        else if ( iTocPtr->iTOC[iTocCount].iSize <= 1024 ) 
+            {
+            __KTRACE_OPT(KPBUSDRV, Kern::Printf("ReadTOCVersionInfo: entry is less than 2 sectors in size"));
+            continue;
             }
-        else
-            {
-            __KTRACE_OPT(KPBUSDRV, Kern::Printf("BGAHSMMC signature not found - try TOC layout"));
-            iCheckTOC = ETrue;
-            
-            TInt r = ReadPartition(KTocStartSector);
-            return r;
-            }
-	    }
-	
-	
-	// Validate partition address boundaries
-	if(partitionCount == 0)
-		{
-		__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc: No supported partitions found!"));
-		// No Supported partitions found on this physical partition
-		return KErrNone;
-		}
-		
-#ifdef __DEBUG_CHECK_PARTITION_			
-	// Validate partition address boundaries
-	TUint32 eMmcPartitionSizeInSectors = 0;
-	if(r == KErrNone)
-		{
-		// At least one entry for a supported partition found
-		r = GetPartitionSizeInSectors(iSelectedPartition, eMmcPartitionSizeInSectors);
-		
-		if(r != KErrNone)
-			{
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc: Could not retrieve size for eMMC partition 0x%02X", iSelectedPartition));
-			r = KErrCorrupt;
-			}
-		}
-		
-	if(r == KErrNone)
-		{
-		TUint64 eMmcPartitionSize = eMmcPartitionSizeInSectors * KSectorSize;
-		
-		TPartitionEntry& part = iPartitionInfo->iEntry[partitionCount - 1];
-	
-		// Check that the eMmcPartition address space boundary is not exceeded by the last partition
-		if(part.iPartitionBaseAddr + part.iPartitionLen > eMmcPartitionSize)
-			{
-			__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc: Partition #%d exceeds eMmc address space", partitionCount));
-			r = KErrCorrupt;
-			}
-		}
-		
-	if(r == KErrNone)
-		{
-		// Go through all BB5 partition entries on this eMMC partition and check boundaries
-		for(TInt i = partitionCount - 1; i > iPartitionInfo->iPartitionCount; i--)
-			{
-			const TPartitionEntry& curr = iPartitionInfo->iEntry[i];
-			TPartitionEntry& prev = iPartitionInfo->iEntry[i-1];
+        
+        r = KErrNone;
+        break;
+        } 
+    
+    if (r == KErrNone)
+        {
+        aOffset = ((iTocPtr->iTOC[iTocCount].iStart) >> KSectorShift) + (iTocPtr->iTocStartSector);
+        }
+    
+    return r;
+    }
 
-			// Check if partitions overlap
-			if(curr.iPartitionBaseAddr < (prev.iPartitionBaseAddr + prev.iPartitionLen))
-				{
-				__KTRACE_OPT(KPBUSDRV, Kern::Printf("Mmc: Overlapping partitions - check #%d", i));
-				r = KErrCorrupt;
-				}
-			}
-		}
-#endif // _DEBUG_CHECK_PARTITION_
-		
-	if(r == KErrNone)
-		{
-		iPartitionInfo->iPartitionCount = partitionCount;
-		iPartitionInfo->iMediaSizeInBytes = iCard->DeviceSize64();
-		}
-
-	__KTRACE_OPT(KPBUSDRV, Kern::Printf("<Mmc:PartitionInfo (C:%d)", partitionCount));
-	return r;
-	}
+void DBB5PartitionInfo::DecodeVersionInfo()
+    {    
+    __KTRACE_OPT(KPBUSDRV,Kern::Printf(">Decode Version Info (%d)",iVersionInfoItems));
+    
+#ifdef __PRINT_RAW_ENTRIES
+    Kern::Printf("Version Info:");
+    for (TUint i = 0; i < 1024; i+=8)
+        {
+        Kern::Printf("%02x %02x %02x %02x   %02x %02x %02x %02x", iIntBuf[i],iIntBuf[i+1],iIntBuf[i+2],iIntBuf[i+3],iIntBuf[i+4],iIntBuf[i+5],iIntBuf[i+6],iIntBuf[i+7]);
+        }
+#endif
+    
+    // check BB5 common header and image header
+    if ( *(TUint32*)&iIntBuf[0]                  == KBB5_CommonHeaderMagic || 
+         *(TUint32*)&iIntBuf[KImageHeaderOffset] == KImageHeaderMagic )       
+        {
+        // pick up required info from TOC
+        TVersionInfoItem *vinfo = (TVersionInfoItem *)&iVersionInfo[iVersionInfoItems];
+        vinfo->iSectionMaxSize = iTocPtr->iTOC[iTocCount].iSize;
+        memcpy( &vinfo->iSectionName[0], &iTocPtr->iTOC[iTocCount].iFileName[0], KMaxSectionNameLen);
+        
+        // pick up required info from image header
+        TImageHeader *himage = (TImageHeader *)&iIntBuf[KImageHeaderOffset];
+        vinfo->iImageCompressedSize = himage->iImageCompressedSize;
+        vinfo->iImageSize = himage->iImageSize;
+        memcpy( &vinfo->iVersion[0], &himage->iVersion[0], KMaxVersionInfoLen);
+        
+        
+        __KTRACE_OPT(KPBUSDRV,Kern::Printf("Section Name (%11s)",vinfo->iSectionName));
+        __KTRACE_OPT(KPBUSDRV,Kern::Printf("Section size (%d)",vinfo->iSectionMaxSize));
+        __KTRACE_OPT(KPBUSDRV,Kern::Printf("Compressed Size %d", vinfo->iImageCompressedSize));
+        __KTRACE_OPT(KPBUSDRV,Kern::Printf("Image Size %d", vinfo->iImageSize));
+        __KTRACE_OPT(KPBUSDRV,Kern::Printf("VersionInfo (%11s)",vinfo->iVersion));
+        
+        iVersionInfoItems++;
+        }
+    
+    __KTRACE_OPT(KPBUSDRV,Kern::Printf("<Decode Version Info (%d)",iVersionInfoItems));
+    return;
+    }
 
 
 // End - DBB5PartitionInfo
--- a/kernel/eka/drivers/medmmc/bgahsmmcptn.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/medmmc/bgahsmmcptn.h	Tue Nov 02 15:29:23 2010 +0000
@@ -65,4 +65,14 @@
 const TUint32 KBB5HeaderSizeInSectors   = 8;
 const TUint32 KPIOffsetFromMediaEnd     = 1;
 
+// magic value of BB5_COMMON header
+const TUint32 KBB5_CommonHeaderMagic    = 0x809795A3UL;
+ 
+// size of aligned header for NCPx.XX
+const TUint32 KBB5_CommonHeaderSize     = 0x1000; //real size is 0x3d0;
+ 
+// size of aligned header for NCPX.XX in case of DP usage
+const TUint32 KBB5_CommonHeaderSizeDp   = 0x1000; //real size is 0x3d0;
+
+
 #endif /*BGAHSMMCPTN_H*/
--- a/kernel/eka/drivers/medmmc/medmmc.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/medmmc/medmmc.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1610,6 +1610,7 @@
 
 #ifdef _DEBUG
 	TMBRPartitionEntry cPe;
+	memclr(&cPe, sizeof(cPe));
 	if(GetDefaultPartitionInfo(cPe) == KErrNone)
 		{
 		pe = (TMBRPartitionEntry*)(&iIntBuf[0]);
--- a/kernel/eka/drivers/medmmc/toc.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/drivers/medmmc/toc.h	Tue Nov 02 15:29:23 2010 +0000
@@ -65,6 +65,73 @@
 const TUint   KNoOfROFSPartitions   = 6;
 
 const TInt    KSectorShift          = 9;
+
+// Version Info const and enums
+
+enum
+     {
+     EHalGroupNandMedia = 28
+     };
+ 
+ 
+ /**
+     The number of nand media attributes.
+ 
+     It is simply defined by its position in the enumeration.
+ */ 
+ enum TNandMediaHalFunction
+     {
+     EEraseBlockSize=1,           /// nand device block size
+     EIsEraseNeedBeforeWrite,     /// erase command is mandatory before write
+     EAtomicWriteSize,            /// minimal size of data what can be written
+     
+     EGetVersionInfoItems=0x10,   ///  total amount of items in version info structure
+     EGetVersionInfo              ///  get version info structure array from media driver
+     };
+ 
+ 
+ /**
+     The nand media devices enumeration.
+ 
+ */ 
+ enum 
+     {
+     ENandMediaDevice1=1          /// nand device1
+     };
+
+
+const TUint8  KMaxSectionItems     = 32;
+const TUint8  KMaxSectionNameLen   = 12;
+const TUint8  KMaxVersionInfoLen   = 28;
+
+const TUint32 KImageHeaderMagic    = 0x31DEEAE8UL;
+
+// Image header always located after BB5_CommonHeader
+const TUint32  KImageHeaderOffset  = 0x3D0;
+
+struct TVersionInfoItem
+     {
+     TText8  iSectionName[KMaxSectionNameLen];
+     TUint32 iSectionMaxSize;
+     TUint32 iImageCompressedSize;
+     TUint32 iImageSize;
+     TText8  iVersion[KMaxVersionInfoLen];
+     };
+
+
+// Image header
+// It is added after BB5_Common_Header
+struct TImageHeader
+     {
+     TUint32 iMagic;
+     TUint32 iImageCompressedSize;
+     TUint32 iImageSize;
+     TUint32 iLoadAddress;
+     TUint32 iReserved;
+     TText8  iVersion[KMaxVersionInfoLen];
+     };
+
+
 /**
 TOC access for kernel side clients.
 */
--- a/kernel/eka/euser/epoc/up_lib.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/euser/epoc/up_lib.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -15,6 +15,7 @@
 // 
 //
 
+#include "us_std.h"
 #include "up_std.h"
 #include <e32uid.h>
 #include "u32std.h"
@@ -230,19 +231,14 @@
 // Initialise any static data following a DLL load
 //
 	{
-	TLinAddr ep[KMaxLibraryEntryPoints];
-	TInt numEps=KMaxLibraryEntryPoints;
-	E32Loader::LibraryAttach(iHandle, numEps, ep);
-	if (numEps==0)
+	TEntryPointList eplist;
+	eplist.iNumEPs=KMaxLibraryEntryPoints;
+	E32Loader::LibraryAttach(iHandle, eplist.iNumEPs, eplist.iEPs);
+	if (eplist.iNumEPs==0)
 		return KErrNone;
-	TInt i;
-	for (i=0; i<numEps; ++i)
-		{
-		TLibraryEntry f=(TLibraryEntry)ep[i];
-		TInt r = (*f)(KModuleEntryReasonProcessAttach);
-		if (r != KErrNone)
-			return r;
-		}
+	TInt r = eplist.CallEPs();
+	if (r != KErrNone)
+		return r;
 	return E32Loader::LibraryAttached(iHandle);
 	}
 
--- a/kernel/eka/euser/us_func.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/euser/us_func.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -744,26 +744,96 @@
 
 
 
+TBool TEntryPointList::AlreadyCalled(TLinAddr aEP)
+	{
+	TInt i;
+
+	// if we find it in the list before the current one
+	// then it was already called, return true
+	for (i=0; i<iCurrentEP; ++i)
+		if (iEPs[i] == aEP)
+			return ETrue;
+
+	// if it *is* the current one (i==iCurrentEP here)
+	// then we're in some kind of hideous cycle. There is no
+	// way to resolve this that isn't wrong, but some people
+	// may depend on it anyway. The safest thing to do is to
+	// just claim the EP is already called and hope that
+	// the constructors aren't actually dependent on each other.
+	if (iEPs[i] == aEP)
+		return ETrue;
+		
+	// if we find it *after* the current one then it's not
+	// already been called, but we need to call it now
+	// rather than when we get that far back up the stack,
+	// so set that copy to -1.
+	for (++i; i<iNumEPs; ++i)
+		if (iEPs[i] == aEP)
+			iEPs[i] = 0xFFFFFFFFU;
+
+	// if this is not the top of the stack recurse, otherwise
+	// return false so the current load will call it
+	if (iPrevList)
+		return iPrevList->AlreadyCalled(aEP);
+	else
+		return EFalse;
+	}
+
+
+TInt TEntryPointList::CallEPs()
+	{
+	// The TLS entry for KNestedEntryPointCallKey is the head
+	// of a linked list of TEntryPointList objects. Add this one
+	// to the front of the list. iPrevList will end up NULL if
+	// there is no nested load yet.
+	// Only one thread per process can be doing a load at a time
+	// because of the DLL lock, so using TLS for this is fine.
+	iPrevList=(TEntryPointList*)UserSvr::DllTls(KNestedEntryPointCallKey, KDllUid_Special);
+	TInt r=UserSvr::DllSetTls(KNestedEntryPointCallKey, KDllUid_Special, this);
+	if (r != KErrNone)
+		return r;
+
+	// call each entry point unless it's already been called higher
+	// in the nested loading process, or it's been set to -1 because
+	// it was called lower in the nested load.
+	for (iCurrentEP=0; iCurrentEP<iNumEPs; ++iCurrentEP)
+		{
+		TLinAddr ep=iEPs[iCurrentEP];
+		if (ep != 0xFFFFFFFFU && (!iPrevList || !iPrevList->AlreadyCalled(ep)))
+			{
+			TLibraryEntry f=(TLibraryEntry)ep;
+			r = (*f)(KModuleEntryReasonProcessAttach);
+			if (r != KErrNone)
+				break;
+			}
+		}
+
+	// Take this object off the list before returning
+	UserSvr::DllSetTls(KNestedEntryPointCallKey, KDllUid_Special, iPrevList);
+
+	return r;
+	}
+
+
+
+
 void CallStaticEntryPoints(TBool aInit)
 	{
-	TLinAddr ep[KMaxLibraryEntryPoints];
-	TInt numEps=KMaxLibraryEntryPoints;
-	TInt r=E32Loader::StaticCallList(numEps, ep);
+	TEntryPointList eplist;
+	eplist.iNumEPs=KMaxLibraryEntryPoints;
+	TInt r=E32Loader::StaticCallList(eplist.iNumEPs, eplist.iEPs);
 	if (r!=KErrNone)
 		return;
+	eplist.iNumEPs -= 1; // last EP is always process entry point
 	if (aInit)
 		{
-		for (TInt i=0; i<numEps-1; ++i)	// last EP is always process entry point
-			{
-			TLibraryEntry f=(TLibraryEntry)ep[i];
-			(*f)(KModuleEntryReasonProcessAttach);
-			}
+		eplist.CallEPs();
 		}
 	else
 		{
-		for (TInt i=numEps-2; i>=0; --i)	// last EP is always process entry point
+		for (TInt i=eplist.iNumEPs-1; i>=0; --i)
 			{
-			TLibraryEntry f=(TLibraryEntry)ep[i];
+			TLibraryEntry f=(TLibraryEntry)eplist.iEPs[i];
 			(*f)(KModuleEntryReasonProcessDetach);
 			}
 		}
@@ -778,6 +848,7 @@
 */
 	{
 	CallStaticEntryPoints(ETrue);
+	E32Loader::StaticCallsDone();
 	}
 
 
@@ -2017,13 +2088,6 @@
 	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
 	};
 
-/* RVCT 3.1 and 4.0 read past the end of arrays when unrolling loops.
- * This only happens when using -O3 -Otime, so force to -O2.
- */
-#if __ARMCC_VERSION >= 310000 
-#pragma push
-#pragma O2
-#endif
 
 /**
 Performs a CCITT CRC-32 checksum on the specified data.
@@ -2044,6 +2108,3 @@
 		crc = (crc >> 8) ^ CrcTab32[(crc ^ *p++) & 0xff];
 	aCrc = crc;
 	}
-#if __ARMCC_VERSION >= 310000 
-#pragma pop
-#endif
--- a/kernel/eka/euser/us_std.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/euser/us_std.h	Tue Nov 02 15:29:23 2010 +0000
@@ -15,6 +15,9 @@
 // 
 //
 
+#ifndef __US_STD_H__
+#define __US_STD_H__
+
 #include <e32std.h>
 #include <e32std_private.h>
 #include <e32base.h>
@@ -31,3 +34,18 @@
 
 
 GLREF_C void Panic(TCdtPanic aPanic);
+
+
+class TEntryPointList
+	{
+public:
+	TInt CallEPs();
+	TBool AlreadyCalled(TLinAddr aEP);
+
+	TEntryPointList* iPrevList;
+	TInt iCurrentEP;
+	TInt iNumEPs;
+	TLinAddr iEPs[KMaxLibraryEntryPoints];
+	};
+
+#endif
--- a/kernel/eka/include/e32def.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/include/e32def.h	Tue Nov 02 15:29:23 2010 +0000
@@ -13,9 +13,8 @@
 *
 * Description:
 * e32\include\e32def.h
+*
 * NOTE: THIS FILE SHOULD BE ACCEPTABLE TO A C COMPILER
-* 
-*
 */
 
 
@@ -23,6 +22,7 @@
 #ifndef __E32DEF_H__
 #define __E32DEF_H__
 
+
 /*
  * __LEAVE_EQUALS_THROW__ requires the compiler to support C++ exceptions
  */
@@ -31,6 +31,15 @@
 #endif
 
 
+/*
+ * RVCT 3.1 and 4.0 read past the end of arrays when the optimiser rotates loops.
+ * This only happens when using -O3 -Otime, so force to -O2.
+ */
+#if __ARMCC_VERSION >= 310000 && !defined(_DEBUG) && !defined(ARMCC_LOOP_ROTATE_DISABLED)
+#pragma O2
+#endif
+
+
 #if defined(__VC32__)
 /**
 @publishedAll
--- a/kernel/eka/include/e32ldr_private.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/include/e32ldr_private.h	Tue Nov 02 15:29:23 2010 +0000
@@ -354,6 +354,7 @@
 	static TInt LibraryAttach(TInt aHandle, TInt& aNumEps, TLinAddr* aEpList);
 	static TInt LibraryAttached(TInt aHandle);
 	static TInt StaticCallList(TInt& aNumEps, TLinAddr* aEpList);
+	static void StaticCallsDone();
 	static TInt LibraryDetach(TInt& aNumEps, TLinAddr* aEpList);
 	static TInt LibraryDetached();
 	};
--- a/kernel/eka/include/e32ver.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/include/e32ver.h	Tue Nov 02 15:29:23 2010 +0000
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=4012;
+const TInt KE32BuildVersionNumber=4015;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/kernel/kern_priv.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/include/kernel/kern_priv.h	Tue Nov 02 15:29:23 2010 +0000
@@ -471,6 +471,8 @@
 public:
 	friend class Monitor;
 	friend class Debugger;
+	// Although SCMonitor is outside of the kernel sources, this friend declaration is still required 
+	// so that SCMonitor can collect kernel data at crash time
 	friend class SCMonitor;
 	friend class Debug::StopModeDebug;
 	};
@@ -1694,10 +1696,11 @@
 public:
 	enum TProcessAttributes	{
 							EPrivate		= 0x00000002,
-							ESupervisor		= (TInt)0x80000000,
+							EDataPaged 		= 0x00000004,	// Set when the process is data paged
+							EStaticCallsDone= 0x00000010,   // Set after static constructors are called
+							EResumed		= 0x00010000,
 							EBeingLoaded	= 0x08000000,
-							EResumed		= 0x00010000,
-							EDataPaged 		= 0x00000004,	// Set when the process is data paged
+							ESupervisor		= (TInt)0x80000000,
 							};
 	TInt iAttributes;
 	TLinAddr iDataBssRunAddress;
--- a/kernel/eka/include/nkern/nklib.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/include/nkern/nklib.h	Tue Nov 02 15:29:23 2010 +0000
@@ -1024,7 +1024,7 @@
 	@return True, if all lists are empty
 	*/
 	inline TBool IsEmpty() const
-		{ return !iPresent[0] && !iPresent[1]; }
+		{ return !NonEmpty();  }
 		
 	/**
 	Tests whether any linked list with priority greater than p is non-empty.
--- a/kernel/eka/include/u32std.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/include/u32std.h	Tue Nov 02 15:29:23 2010 +0000
@@ -543,6 +543,7 @@
 
 // This must not conflict with any possible valid TLS keys
 const TInt KGlobalDestructorTlsKey = -1;
+const TInt KNestedEntryPointCallKey = -2;
 
 GLREF_C void ExitCurrentThread(TExitType, TInt, const TDesC8*);
 
--- a/kernel/eka/kernel/execs.txt	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/kernel/execs.txt	Tue Nov 02 15:29:23 2010 +0000
@@ -2444,6 +2444,11 @@
 	handle = timer
 }
 
+slow {
+	name = StaticCallsDone
+	user = E32Loader
+}
+
 
 /******************************************************************************
  * End of normal executive functions
--- a/kernel/eka/kernel/scodeseg.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/kernel/scodeseg.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1038,11 +1038,21 @@
 		DCodeSeg* pS=(i<0)?iCodeSeg:iDynamicCode[i].iSeg;
 		if (pS && pS!=aExclude)
 			{
-			if ((aFlags & ETraverseFlagRestrict) && i>=0)
+			if (aFlags & ETraverseFlagRestrict)
 				{
-				DLibrary* pL=iDynamicCode[i].iLib;
-				if (pL && pL->iState!=DLibrary::EAttached)
-					continue;
+				if (i>=0)
+					{
+					// Codeseg is a dynamic dependency
+					DLibrary* pL=iDynamicCode[i].iLib;
+					if (pL && pL->iState!=DLibrary::EAttached)
+						continue;
+					}
+				else
+					{
+					// Static dependencies of process
+					if (!(iAttributes&EStaticCallsDone))
+						continue;
+					}
 				}
 			if (aFlags & ETraverseFlagAdd)
 				n+=pS->ListDeps(aQ,aMark);
@@ -2078,6 +2088,18 @@
 	return KErrNone;
 	}
 
+// Mark the process after implicit DLL entry points have been called
+void ExecHandler::StaticCallsDone()
+	{
+	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf(">Exec::StaticCallsDone"));
+	DThread& t=*TheCurrentThread;
+	DProcess& p=*t.iOwningProcess;
+	NKern::LockSystem();
+	p.iAttributes|=DProcess::EStaticCallsDone;
+	NKern::UnlockSystem();
+	__KTRACE_OPT2(KEXEC,KDLL,Kern::Printf("<Exec::StaticCallsDone"));
+	}
+
 // Extract a list of DLL entry points for a closing DLL
 TInt ExecHandler::LibraryDetach(TInt& aNumEps, TLinAddr* aEpList)
 	{
--- a/kernel/eka/nkern/nkerns.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/nkern/nkerns.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -331,7 +331,7 @@
  */
 EXPORT_C TPriListBase::TPriListBase(TInt aNumPriorities)
 	{
-	memclr(this, sizeof(TPriListBase)+(aNumPriorities-1)*sizeof(SDblQueLink*) );
+	memclr(this, _FOFF(TPriListBase,iQueue[0])+aNumPriorities*sizeof(SDblQueLink*));
 	}
 
 
--- a/kernel/eka/nkernsmp/nkerns.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/nkernsmp/nkerns.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -415,7 +415,7 @@
  */
 EXPORT_C TPriListBase::TPriListBase(TInt aNumPriorities)
 	{
-	memclr(this, sizeof(TPriListBase)+(aNumPriorities-1)*sizeof(SDblQueLink*) );
+	memclr(this, _FOFF(TPriListBase,iQueue[0])+aNumPriorities*sizeof(SDblQueLink*));
 	}
 
 
--- a/kernel/eka/release.txt	Wed Oct 20 13:58:28 2010 +0100
+++ b/kernel/eka/release.txt	Tue Nov 02 15:29:23 2010 +0000
@@ -1,3 +1,61 @@
+Version 2.00.4015
+=================
+(Made by fadhliM 27/10/2010)
+
+1.	tocosgro
+	1.	ou1cimx1#632070 Workaround required for RVCT3.1/4 compiler optimiser bug
+
+2.	gcochran
+	1.	ou1cimx1#609783 Incompatibility between sizeof and memory allocation in TPriListBase
+
+3.	davegord
+	1.	ou1cimx1#598182 ENV T_TLDD requires building invalid LDD which Raptor does not support
+
+
+Version 2.00.4014
+=================
+(Made by fadhliM 25/10/2010)
+
+1.	niccox
+	1.	ou1cimx1#624302 Change USBMSAPP default configuration to VASCO
+
+2.	mipetzol
+	1.	ou1cimx1#624343 ENV : T_DMAINV Fails TestStreaming() at Line 943
+
+3.	gcochran
+	1.	ou1cimx1#626945 MCL 10.1 Sirocco - File Base_How_To_Configure_Domain_Manager_Policy_DLLs.doc has the old Symbian Foundation License
+
+4.	ricoles
+	1.	ou1cimx1#614099 [mcl] Keep track of which constructors have been called to allow for nested library loading
+
+5.	necliffo
+	1.	ou1cimx1#625724 EHALNANDMEDIA support is missing from Bridge platform
+
+6.	lanerobe
+	1.	ou1cimx1#619956 ENV t_sharedio alloc fail calls do not match on urel
+
+7.	marisood
+	1.	ou1cimx1#623764 ENV t_destruct hangs on Bridge
+
+8.	fagortz
+	1.	ou1cimx1#513437 Coverity errors - media
+
+9.	mmoate
+	1.	ou1cimx1#605561 [mcl]t_entropysources no longer looks for entropy source in MiniBSP
+
+
+Version 2.00.4013
+=================
+(Made by fadhliM 20/10/2010)
+
+1.	lanerobe
+	1.	ou1cimx1#605369 ENV Reduce T_MSTIM output under SMP
+	2.	ou1cimx1#603584 ENV Fix T_TLS heap handling
+
+2.	ferporta
+	1.	ou1cimx1#605542 MCL REQ 428-444, SUB417-65117 SCM outputs RnD system crash Data (MCv1 Data Set) via Kern:Printf on HW110
+
+
 Version 2.00.4012
 =================
 (Made by fadhliM 19/10/2010)
Binary file kernelhwsrv_info/doc_pub/Base_How_To_64bit_File_Server_Client_Porting_Guide.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_64bit_File_Server_File_System_Plugin_Porting_Guide.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_ARMv7_Cache_And_Access_Remapping_-_Design.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Align_Partitions_To_Media_Block_Boundaries_For_Optimised_Performance.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_BTrace.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Configure_Domain_Manager_Policy_DLLs.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Configure_Platform_Security_Settings.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Crash_Logging.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Debug_NONXIP_Problems.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Estart.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_File_Caching.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Handle_Sharing.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_IPC.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Impacts_Of_Demand_Paging_On_Kernel-Side_Code.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_MMC_Direct_Physical_Addressing.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_MMC_Double_Buffering.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Message_Queues.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Migrate_Device_Drivers_to_Paging_Environment.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Migrate_Media_Drivers_To_Support_Demand_Paging.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Migrate_To_Client-Server_V2_APIs.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Persisting_a_Custom_Restart_Reason.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Port_SDIO_Controller_Supplement.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Publish_And_Subscribe.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Share_File_Handles.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_USB_Client_Porting_and_Test.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_USB_Mass_Storage_App.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_USB_Mass_Storage_Double_Buffering.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Use_CFileMan_Test_Framework.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_Use_DMA_For_SDIO_Data_Transfers.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_To_VFP_Support.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_How_to_Port_eMMC_Controller.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_Migrating_Media_drivers_DMA.doc has changed
Binary file kernelhwsrv_info/doc_pub/Base_SMP_Driver_Migration_Guide.doc has changed
--- a/kerneltest/e32test/bmarm/d_lddns.def	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	CreateLogicalDevice__Fv @ 1 NONAME
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll1.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL1__Fv @ 1 NONAME R3UNUSED ; DataForDLL1(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll2.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL2__Fv @ 1 NONAME R3UNUSED ; DataForDLL2(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll3.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL3__Fv @ 1 NONAME R3UNUSED ; DataForDLL3(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll4.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL4__Fv @ 1 NONAME R3UNUSED ; DataForDLL4(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll5.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL5__Fv @ 1 NONAME R3UNUSED ; DataForDLL5(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll6.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL6__Fv @ 1 NONAME R3UNUSED ; DataForDLL6(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bmarm/t_nestdll7.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	DataForDLL7__Fv @ 1 NONAME R3UNUSED ; DataForDLL7(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll1.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL1@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL1(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll2.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL2@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL2(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll3.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL3@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL3(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll4.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL4@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL4(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll5.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL5@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL5(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll6.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL6@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL6(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bwins/t_nestdll7.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL7@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL7(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll1.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL1@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL1(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll2.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL2@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL2(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll3.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL3@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL3(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll4.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL4@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL4(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll5.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL5@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL5(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll6.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL6@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL6(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/bx86/t_nestdll7.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	?DataForDLL7@@YAHXZ @ 1 NONAME ; int __cdecl DataForDLL7(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/device/d_lddns.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test\device\d_lddns.cpp
+// 
+//
+// This dummy driver is built for a negative test: although the name
+// suggests it's an LDD, it's actually a PDD; then, the test program
+// checks that it CANNOT actually be loaded as an LDD.
+
+
+#include <e32def.h>
+#include <kernel/kernel.h>
+
+DECLARE_STANDARD_PDD()
+	{
+	return NULL;
+	}
+
--- a/kerneltest/e32test/device/t_tldd.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/device/t_tldd.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -54,7 +54,7 @@
 #include "d_ldd.h"
 
 _LIT(KLddFileName, "D_LDD.LDD");
-_LIT(KLddFileNameBadUid, "D_LDDNS.LDD");
+_LIT(KLddFullNameBadUid, "Z:\\SYS\\BIN\\D_LDDNS.LDD");
 
 #ifdef __EPOC32__
 _LIT(KLddFileNameRam, "D_LDD_RAM.LDD");
@@ -315,15 +315,48 @@
 	test.Title();
 	test.Start(_L("Test device driver loading and unloading"));
 
+	// Turn off evil lazy dll unloading
+	RLoader l;
+	test(l.Connect() == KErrNone);
+	test(l.CancelLazyDllUnload() == KErrNone);
+	l.Close();
+
+    test.Next(_L("Check that a PDD or DLL cannot be loaded as an LDD"));
+	RLibrary lib;
+	RLibrary::TInfoV2 info;
+	TPckg<RLibrary::TInfoV2> infoPkg(info);
+	r = RLibrary::GetInfo(KLddFullNameBadUid, infoPkg);
+	test.Printf(_L("RLibrary::GetInfo(%S) returned %d\n"), &KLddFullNameBadUid, r);
+	if (r == KErrNone)
+		{
+		const TUidType uids (info.iUids);
+		test.Printf(_L("Info shows UIDs 0x%x, 0x%x, 0x%x\n"), uids[0], uids[1], uids[2]);
+		r = lib.Load(KLddFullNameBadUid, uids);
+		test.Printf(_L("RLibrary::Load(%S, (uids)) returned %d\n"), &KLddFullNameBadUid, r);
+		}
+	else
+		{
+		r = lib.Load(KLddFullNameBadUid);
+		test.Printf(_L("RLibrary::Load(%S) returned %d\n"), &KLddFullNameBadUid, r);
+		}
+	if (r >= 0)
+		{
+		TFileName libname (lib.FileName());
+		TUidType ids2 (lib.Type());
+		test.Printf(_L("Loaded %S as a DLL, UIDs 0x%x, 0x%x, 0x%x\n"), &libname, ids2[0], ids2[1], ids2[2]);
+		lib.Close();
+		}
+
+	r = User::LoadLogicalDevice(KLddFullNameBadUid);
+	test.Printf(_L("RLibrary::LoadLogicalDevice(%S) returned %d\n"), &KLddFullNameBadUid, r);
+	test(r == KErrNotSupported);	// This "LDD" is not valid (wrong UID2)
+
 	DoTest(KLddFileName);
 #ifdef __EPOC32__
 	DoTest(KLddFileNameRam);
 	DoTest2(KLddFileNameRam);
 #endif
 
-	r=User::LoadLogicalDevice(KLddFileNameBadUid);
-	test(r==KErrNotSupported);
-
     test.End();
 	return(KErrNone);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/dll/t_nestdll.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,91 @@
+// 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\dll\t_nestdll.cpp
+// 
+//
+
+#include <e32std.h>
+#include <e32debug.h>
+#include <e32svr.h>
+
+// Utility macros for stringification, long-stringification, and token pasting
+// These are indirected so that if you call them on things which are also macros,
+// the macros are expanded first.
+#define STRINGIFY_(x) #x
+#define STRINGIFY(x) STRINGIFY_(x)
+#define LSTRINGIFY_(x) L ## #x
+#define LSTRINGIFY(x) LSTRINGIFY_(x)
+#define PASTE_(x,y) x ## y
+#define PASTE(x,y) PASTE_(x,y)
+
+// Declare the imported functions for the DLLs we statically link to
+#ifdef LINK_TO
+IMPORT_C TInt PASTE(DataForDLL,LINK_TO)();
+#endif
+
+// Dummy class just to get a constructor into the binary
+class ConstructorTest
+	{
+public:
+	ConstructorTest();
+	};
+
+// Constructor, which should be called exactly once per DLL
+ConstructorTest::ConstructorTest()
+	{
+	RDebug::Printf("In constructor for DLL " STRINGIFY(DLL_NUMBER));
+
+	// Call the imported functions for the DLL we statically link to.
+	// This is just to get them into the import table.
+#ifdef LINK_TO
+	PASTE(DataForDLL,LINK_TO)();
+#endif
+
+	// Use DLL TLS handle zero to fake a global data object
+	TInt* loadOrder = (TInt*)UserSvr::DllTls(0);
+	if (!loadOrder)
+		{
+		// If we're the first constructor, allocate an array and zero it
+		loadOrder = new TInt[100];
+		for (TInt i = 0; i < 100; ++i)
+			loadOrder[i] = 0;
+		UserSvr::DllSetTls(0, loadOrder);
+		}
+
+	// Find the first zero entry in the load order array and add our index
+	TInt next = 0;
+	while (loadOrder[next] != 0)
+		++next;
+	loadOrder[next] = DLL_NUMBER;
+
+	// If we're supposed to be doing a nested DLL load, do it here.
+	// You aren't supposed to leave in a constructor but it causes an
+	// identifiable panic, to distinguish it from any other possible crash.
+#ifdef LOAD_DLL
+	RDebug::Printf("Doing nested DLL load");
+	RLibrary lib;
+	TInt r = lib.Load(TPtrC16((const TText*)(L"t_nestdll" LSTRINGIFY(LOAD_DLL) L".dll")));
+	RDebug::Printf("Nested DLL load returned %d", r);
+	User::LeaveIfError(r);
+#endif
+	}
+
+// Global instance of the dummy object
+ConstructorTest constructor_test;
+
+// The exported function for this DLL, which just tells you how many times the constructor was called
+EXPORT_C TInt PASTE(DataForDLL,DLL_NUMBER)()
+	{
+	return 0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/dll/t_nestedload.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,113 @@
+// 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\dll\t_nestedload.cpp
+// Overview:
+// Test that nested loading of DLLs does not cause incorrect constructor calls
+// API Information:
+// n/a
+// Details:
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites:
+// Failures and causes:
+// Base Port information:
+// 
+//
+
+/*
+
+This EXE links to and dynamically loads seven DLLs, t_nestdll1-7.dll.
+The diagram below shows the structure of the linkage. Regular arrows
+are normal static linkage, arrows marked with DY are dynamic loads with
+RLibrary::Load.
+
+ +-----+      +---+      +---+
+ | EXE |----->| 1 |--DY->| 3 |
+ +-----+      +---+      +---+\
+    | \                        \  EXE and 3 both link to 2
+    D  \                        \    +---+
+    Y   +------------------------+-->| 2 |
+    |                                +---+
+    v
+  +---+
+  | 5 |
+  +---+\
+    |   \
+    D    \
+    Y     \
+    |      \
+    v       \
+  +---+      \
+  | 6 |       \
+  +---+        \
+    |           \
+    D            \
+    Y             \
+    |              \
+    v               \   5 and 7 both link to 4
+  +---+              \    +---+
+  | 7 |---------------+-->| 4 |
+  +---+                   +---+
+
+The result should be that the constructors are called in order from 1 to 7,
+with no constructor being called more than once or omitted.
+
+*/
+
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32svr.h>
+
+IMPORT_C TInt DataForDLL1();
+IMPORT_C TInt DataForDLL2();
+
+TInt E32Main()
+	{
+	RTest test(_L("T_NESTEDLOAD"));
+	test.Title();
+
+	test.Start(_L("Test nested loading"));
+
+	test.Next(_L("Dummy calls to static dependencies"));
+	DataForDLL1();
+	DataForDLL2();
+
+	test.Next(_L("Load library triggering nested load"));
+	RLibrary lib;
+	test_KErrNone(lib.Load(_L("t_nestdll5.dll")));
+
+	test.Next(_L("Retrieve load order array"));
+	TInt* loadOrder = (TInt*)UserSvr::DllTls(0);
+	test_NotNull(loadOrder);
+
+	test.Next(_L("Load order:"));
+	TInt i;
+	for (i = 0; i < 100; ++i)
+		{
+		if (loadOrder[i] == 0)
+			break;
+		test.Printf(_L("%d "), loadOrder[i]);
+		}
+	test.Printf(_L("\n"));
+
+	// We expect DLLs 1-7 to be loaded in numerical order, with no repeats.
+	for (i = 0; i < 7; ++i)
+		test_Equal(i+1, loadOrder[i]);
+	test_Equal(0, loadOrder[7]);
+
+	test.End();
+	return(KErrNone);
+	}
+
--- a/kerneltest/e32test/dll/t_tls.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/dll/t_tls.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -313,7 +313,6 @@
 		return __LINE__;
 	TInt newInitSize = HeapSize(newHeap);
 	User::SwitchHeap(newHeap);
-	tlsHeap->Close();
 
 	// Allocate more TLS data
 	for(TInt i = 0 ; i < 100 ; ++i)
--- a/kerneltest/e32test/dma/t_dma.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/dma/t_dma.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -938,7 +938,7 @@
 		if(aChannel.CheckBuffer(KDestBuf0, 'A'))
 			break;
 
-		User::After(10000); // Wait 10 milliseconds
+		User::After(100000); // Wait 100 milliseconds
 		}
 	XTEST(aChannel.CheckBuffer(KDestBuf0, 'A'));
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll1.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL1v @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll2.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL2v @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll3.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL3v @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll4.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL4v @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll5.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL5v @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll6.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL6v @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/eabi/t_nestdll7.def	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z11DataForDLL7v @ 1 NONAME
+
--- a/kerneltest/e32test/group/bld.inf	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/group/bld.inf	Tue Nov 02 15:29:23 2010 +0000
@@ -521,6 +521,15 @@
 t_wsd_tst_cp
 t_wsd_tst_cu
 
+t_nestdll1		support
+t_nestdll2		support
+t_nestdll3		support
+t_nestdll4		support
+t_nestdll5		support
+t_nestdll6		support
+t_nestdll7		support
+t_nestedload
+
 // /e32test/ethernet
 ../ethernet/pump/etherpump  manual
 ../ethernet/macset/macset   manual
@@ -719,6 +728,7 @@
 t_mmcdrv    manual
 t_med_writebm   manual
 t_mmcinfo
+t_halnandmedia 
 
 #ifdef EPOC32
 t_crrdrv    support
@@ -1038,10 +1048,6 @@
 ../rm_debug/group/t_trkdummyapp
 #endif
 
-#if defined(MARM_ARMV5)
-../rm_debug/group/t_crashmonitor_lib
-#endif
-
 t_stacksize
 
 #if !defined(WINS) && !defined(X86)
--- a/kerneltest/e32test/group/d_lddns.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/group/d_lddns.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -14,21 +14,18 @@
 // e32test/group/d_lddns.mmp
 // 
 //
+// This dummy driver is built for a negative test: although the name
+// suggests it's an LDD, it's actually a PDD; then, the test program
+// checks that it CANNOT actually be loaded as an LDD.
 
 #include "kernel/kern_ext.mmh"
 
-TARGET         d_lddns.ldd
-TARGETTYPE     LDD
-SOURCEPATH	../device
-SOURCE         d_ldd.cpp
+TARGETTYPE		PDD
+TARGET			d_lddns.ldd
+SOURCEPATH		../device
+SOURCE			d_lddns.cpp
 
-library		d_ldd2.lib
-
-EPOCALLOWDLLDATA
-
-UID		0x01111111 0
-VENDORID 0x70000001
-RAMTARGET D_LDDNS_ram.LDD
+VENDORID		0x70000001
 
 capability		all
 SMPSAFE
--- a/kerneltest/e32test/group/t_entropysources.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/group/t_entropysources.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -20,11 +20,13 @@
 UID 			0x2000A3D2 0xA000D320
 VENDORID		0x70000001
 
+USERINCLUDE		../misc
+
 SOURCEPATH		../random
 SOURCE 	       	t_entropysources.cpp
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-LIBRARY			euser.lib hal.lib
+LIBRARY			euser.lib efsrv.lib hal.lib
 SMPSAFE
 CAPABILITY 		all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_halnandmedia.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -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_halnandmedia.mmp
+// 
+//
+
+TARGET         t_halnandmedia.exe        
+TARGETTYPE     EXE
+SOURCEPATH	   ../pccd
+SOURCE         t_halnandmedia.cpp
+USERINCLUDE		 ../system
+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_nestdll1.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,35 @@
+// 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_nestdll1.mmp
+// 
+//
+
+target			t_nestdll1.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll1.def
+nostrictdef
+library			euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=1
+macro LOAD_DLL=3
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestdll2.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,34 @@
+// 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_nestdll2.mmp
+// 
+//
+
+target			t_nestdll2.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll2.def
+nostrictdef
+library			euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=2
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestdll3.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,35 @@
+// 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_nestdll3.mmp
+// 
+//
+
+target			t_nestdll3.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll3.def
+nostrictdef
+library			euser.lib t_nestdll2.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=3
+macro LINK_TO=2
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestdll4.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,34 @@
+// 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_nestdll4.mmp
+// 
+//
+
+target			t_nestdll4.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll4.def
+nostrictdef
+library			euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=4
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestdll5.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -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/t_nestdll5.mmp
+// 
+//
+
+target			t_nestdll5.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll5.def
+nostrictdef
+library			euser.lib t_nestdll4.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=5
+macro LINK_TO=4
+macro LOAD_DLL=6
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestdll6.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,35 @@
+// 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_nestdll6.mmp
+// 
+//
+
+target			t_nestdll6.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll6.def
+nostrictdef
+library			euser.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=6
+macro LOAD_DLL=7
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestdll7.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,35 @@
+// 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_nestdll7.mmp
+// 
+//
+
+target			t_nestdll7.dll
+targettype		dll
+sourcepath		../dll
+source			t_nestdll.cpp
+deffile         t_nestdll7.def
+nostrictdef
+library			euser.lib t_nestdll4.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+macro DLL_NUMBER=7
+macro LINK_TO=4
+epocallowdlldata
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/group/t_nestedload.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test/group/t_nestedload.mmp
+// 
+//
+
+target			t_nestedload.exe
+targettype		exe
+sourcepath		../dll
+source			t_nestedload.cpp
+library			euser.lib t_nestdll1.lib t_nestdll2.lib
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+capability		none
+
+VENDORID 0x70000001
+
+SMPSAFE
--- a/kerneltest/e32test/misc/t_destruct_slave.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/misc/t_destruct_slave.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -61,6 +61,7 @@
 	// Open handle on dynamic DLL in this thread
 	RLibrary library;
 	test_KErrNone(library.Load(KDynamicDll));
+	RThread().Rendezvous(KErrNone);
 	for (;;)
 		;
 	}
@@ -250,7 +251,11 @@
 			{
 			RThread childThread;
 			test_KErrNone(childThread.Create(_L("ChildThread"), LoopThread, 4096, NULL, (TAny*)type));
+			TRequestStatus status;
+			childThread.Rendezvous(status);
 			childThread.Resume();
+			User::WaitForRequest(status);
+			test_KErrNone(status.Int());
 			childThread.Close();
 			test_KErrNone(messageQueue.Send(EMessagePreDestruct));
 			}
--- a/kerneltest/e32test/misc/testexclusions.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/misc/testexclusions.h	Tue Nov 02 15:29:23 2010 +0000
@@ -32,6 +32,8 @@
 
 // To disable invoking PowerController::PowerDown  
 const TUint KDisableControllerShutdown = 0x1;
+// To disable test t_entropysources on platforms/configurations known to have no entropy source
+const TUint KDisableEntropySourceCheck = 0x2;
 
 TInt GetExclusionFromFile(TUint& aTestExclusion)
 	{
--- a/kerneltest/e32test/mmu/t_sharedio.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/mmu/t_sharedio.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -368,7 +368,7 @@
 		__KHEAP_MARKEND;
 		}
 
-	__KHEAP_RESET;
+	User::__DbgSetAllocFail(ETrue,RAllocator::ENone,1);
 
 	test.Next(_L("Destroy buffer"));
 	if (aPhysicalAddress)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/pccd/t_halnandmedia.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,176 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// e32test\pccd\t_HalNandMedia.cpp
+// Overview:
+// Test class HalNandMedia APIs
+// Platforms/Drives/Compatibility:
+// All.
+// Assumptions/Requirement/Pre-requisites:
+// Failures and causes:
+// Base Port information:
+// 
+//
+
+#define __E32TEST_EXTENSION__
+
+#include <e32test.h>
+#include <e32hal.h>
+#include <u32hal.h>
+#include <e32svr.h>
+#include <hal.h>
+
+GLDEF_D RTest test(_L("T_HalNandMedia - HAL NandMedia test"));
+
+// Version Info const and enums
+enum
+     {
+     EHalGroupNandMedia = 28
+     };
+ 
+ 
+ /**
+     The number of nand media attributes.
+     It is simply defined by its position in the enumeration.
+ */ 
+ enum TNandMediaHalFunction
+     {
+     EEraseBlockSize=1,           /// nand device block size
+     EIsEraseNeedBeforeWrite,     /// erase command is mandatory before write
+     EAtomicWriteSize,            /// minimal size of data what can be written
+     
+     EGetVersionInfoItems=0x10,   ///  total amount of items in version info structure
+     EGetVersionInfo              ///  get version info structure array from media driver
+     };
+ 
+ 
+ /**
+     The nand media devices enumeration.
+ */ 
+ enum 
+     {
+     ENandMediaDevice1=1          /// nand device1
+     };
+
+
+const TUint8  KMaxSectionNameLen   = 12;
+const TUint8  KMaxVersionInfoLen   = 28;
+
+struct TVersionInfoItem
+     {
+     TText8  iSectionName[KMaxSectionNameLen];
+     TUint32 iSectionMaxSize;
+     TUint32 iImageCompressedSize;
+     TUint32 iImageSize;
+     TText8  iVersion[KMaxVersionInfoLen];
+     };
+
+// Image header
+// It is added after BB5_Common_Header
+struct TImageHeader
+     {
+     TUint32 iMagic;
+     TUint32 iImageCompressedSize;
+     TUint32 iImageSize;
+     TUint32 iLoadAddress;
+     TUint32 iReserved;
+     TText8  iVersion[KMaxVersionInfoLen];
+     };
+
+void TestCallNandMediaHalHandler()
+    {
+    test.Next(_L("Retrieving Nand Media Hal Attributes"));
+    
+     TText8              *buffer;
+     TUint32             infoItems;
+     TUint32             i, j;
+     TInt                err=KErrNone;
+     TVersionInfoItem    *vinfo;
+     TBuf<KMaxSectionNameLen> SectName;
+     TBuf<KMaxVersionInfoLen> VersInfo;
+     
+     // get number of items
+     err=UserSvr::HalFunction(EHalGroupNandMedia, EGetVersionInfoItems, &infoItems, 0, ENandMediaDevice1);
+     if(err!=KErrNone)
+         {
+         _LIT( KNoOfVersionsErrMsg, "HalFunction failed with %d when getting item count\n\r" );
+         test.Printf( KNoOfVersionsErrMsg, err );
+         return;
+         }
+     
+     _LIT( KNoOfVersionsMsg, "Number of version info items available: %d\n\r" );
+     test.Printf( KNoOfVersionsMsg, infoItems );
+     
+     // allocate buffer for items and fill it
+     buffer=(TUint8*)User::Alloc(infoItems*sizeof(TVersionInfoItem));
+     test(buffer!=NULL);
+     err=UserSvr::HalFunction(EHalGroupNandMedia, EGetVersionInfo, buffer, 0, ENandMediaDevice1);
+     if(err!=KErrNone)
+         {
+         _LIT( KVersionInfoErrMsg, "HalFunction failed with %d when getting items\n\r" );
+         test.Printf( KVersionInfoErrMsg, err );
+         User::Free(buffer);
+         return;
+         }
+     vinfo=(TVersionInfoItem *)buffer;
+    
+     for(i=0; i<infoItems; i++)
+         {
+         // prepare section name and version info
+         SectName.Zero();
+         VersInfo.Zero();
+         for(j=0; j<KMaxSectionNameLen; j++)
+             {
+             if(vinfo->iSectionName[j]=='\0')
+                 {
+                 break;
+                 }
+             SectName.Append(TChar((TUint)vinfo->iSectionName[j]));
+             }
+         SectName.SetLength(j);
+         
+         for(j=0; j<KMaxVersionInfoLen; j++)
+             {
+             if(vinfo->iVersion[j]=='\0')
+                 {
+                 break;
+                 }
+             VersInfo.Append(TChar((TUint)vinfo->iVersion[j]));
+             }
+         VersInfo.SetLength(j);
+    
+         // print items
+         _LIT( KVersionInfoMsg, "[%2d] (%11S) (%27S)  \nMaxSize = 0x%08X  \nSize = 0x%08X  \nCompSize = 0x%08X\n\r" );
+         test.Printf( KVersionInfoMsg, i, &SectName, &VersInfo, vinfo->iSectionMaxSize, vinfo->iImageSize, vinfo->iImageCompressedSize );
+         vinfo++;
+         }
+     
+    User::Free(buffer);
+    }
+
+
+GLDEF_C TInt E32Main()
+//
+// Test Kern HAL API
+//
+	{
+	test.Title();
+
+	test.Start(_L("Test class Kern HAL API functions"));
+
+	TestCallNandMediaHalHandler();
+	
+	test.End();
+	test.Close();
+ 	return(KErrNone);
+    }
--- a/kerneltest/e32test/random/t_entropysources.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/random/t_entropysources.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -26,6 +26,7 @@
 #include <hal.h>
 #include <e32math.h>
 #include "d_entropysources.h"
+#include "testexclusions.h"
 
 //---------------------------------------------------------------------------------------------------------------------
 //! @SYMTestCaseID				KBASE-entropysources-2703
@@ -98,13 +99,36 @@
 LOCAL_C TBool HardwareRNGPresent()
     {
     TInt muid = 0;
-    const TInt r = HAL::Get(HAL::EMachineUid, muid);
-    if (r != KErrNone) return EFalse;;
-    return ((muid != HAL::EMachineUid_X86PC) &&
-            (muid != HAL::EMachineUid_NE1_TB) &&
-            (muid != HAL::EMachineUid_OmapH6) &&
-            (muid != HAL::EMachineUid_OmapZoom) &&
-            (muid != HAL::EMachineUid_Win32Emulator));
+
+    TInt r = HAL::Get(HAL::EMachineUid, muid);
+    if (r != KErrNone)
+		{
+		return EFalse;
+		}
+
+    if ((muid == HAL::EMachineUid_X86PC) || 
+        (muid == HAL::EMachineUid_NE1_TB) ||
+        (muid == HAL::EMachineUid_OmapH6) || 
+        (muid == HAL::EMachineUid_OmapZoom) ||
+        (muid == HAL::EMachineUid_Win32Emulator))
+		{
+		return EFalse;
+		}
+
+	TInt testExclusions = 0;
+
+	r = GetTestExclusionSettings(testExclusions);
+	if (r != KErrNone)
+		{
+		return EFalse;
+		}
+
+	if (testExclusions & KDisableEntropySourceCheck)
+		{
+		return EFalse;
+		}
+
+	return ETrue;
     }
 
 GLDEF_C TInt E32Main()
--- a/kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1066 +0,0 @@
-// Copyright (c) 2008-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:
-// Tests the functionality of the SCM Libraries
-// 
-//
-
-#include "t_crashmonitor.h"
-
-#include <crashlogwalker.h>
-
-using namespace Debug;
-
-/**
- * Test suite version
- */
-const TVersion testVersion(1,1,0);
-
-
-/**
- * Constructor
- */
-CSCMLibraryClient::CSCMLibraryClient():
-	iNonCachedWriter(iBuffer, EFalse),
-	iCachedWriter(iBuffer, EFalse),
-	iWriter(NULL),
-	iReader(iBuffer)	
-	{
-	}
-
-/**
- * First phase constructor
- */
-CSCMLibraryClient* CSCMLibraryClient::NewL()
-	{
-	CSCMLibraryClient* self = new(ELeave) CSCMLibraryClient();
-  	self->ConstructL();
-	return self;
-	}
-
-/**
- * Destructor
- */
-CSCMLibraryClient::~CSCMLibraryClient()
-	{
-	}
-
-/**
- * ConstructL
- */
-void CSCMLibraryClient::ConstructL()
-	{}
-
-
-
-/**
- * Prints usage of this test suite
- */
-void CSCMLibraryClient::PrintUsage()
-	{
-	test.Printf(_L("Invoke with arguments:\n"));
-	test.Printf(_L("-r: run specified tests in reverse order\n"));
-	test.Printf(_L("-h: display usage information\n"));
-	test.Printf(_L("-v: display version\n"));
-	test.Printf(_L("<number>: test number to run, can specify more than one from the following list:\n"));
-	test.Printf(_L("Press any key for list...\n"));
-	test.Getch();
-	// if there are too many of these they won't fit on the screen! Stick another Getch() in if there get too many
-	for(TInt i=0; i<KMaxTests; i++)
-		{
-		test.Printf(_L("%2d: %S\n"), i, &(iTestArray[i].iFunctionName));
-		}
-	test.Printf(_L("Press any key...\n"));
-	test.Getch();
-	}
-
-/**
- * Parses arguments from command line
- * @param aMode Argument mode
- * @param aTests Array of tests
- */
-void CSCMLibraryClient::ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests)
-	{
-	// get the length of the command line arguments
-	TInt argc = User::CommandLineLength();
-
-	// allocate a buffer for the command line arguments and extract the data to it
-	HBufC* commandLine = HBufC::NewLC(argc);
-	TPtr commandLineBuffer = commandLine->Des();
-	User::CommandLine(commandLineBuffer);
-
-	// reset mode
-	aMode = (TTestMode)0;
-
-	// create a lexer and read through the command line
-	TLex lex(*commandLine);
-	while (!lex.Eos())
-		{
-		// expecting the first character to be a '-'
-		if (lex.Get() == '-')
-			{
-			TChar arg = lex.Get();
-			switch (arg)
-				{
-				case 'v':
-					//print out the help
-					aMode |= EModeVersion;
-					break;
-				case 'h':
-					//print out the help
-					aMode |= EModeHelp;
-					break;
-				case 'r':
-					//store the fact that we want to run in reverse
-					aMode |= EModeReverse;
-					break;
-				default:
-					// unknown argument so leave
-					User::Leave(KErrArgument);
-				}
-			}
-		else
-			{
-			lex.UnGet();
-			TInt testNumber;
-			User::LeaveIfError(lex.Val(testNumber));
-			if( (testNumber<0) || (testNumber>=KMaxTests) )
-				{
-				User::Leave(KErrArgument);
-				}
-			aTests.AppendL(testNumber);
-			}
-		lex.SkipSpace();
-		}
-	// if no tests specified then run them all
-	if(aTests.Count() == 0)
-		{
-		aMode |= EModeAll;
-		}
-
-	// do clean up
-	CleanupStack::PopAndDestroy(commandLine);
-	}
-
-/**
- * This will run all tests in the suite
- */
-void CSCMLibraryClient::ClientAppL()
-	{	
-	
-	FillArray();
-	
-	test.Start(_L("ClientAppL"));
-
-	RArray<TInt> testsToRun;
-	TUint32 testMode = 0;
-	ParseCommandLineL(testMode, testsToRun);
-
-	//if help or version mode specified then just print out the relevant stuff and quit
-	if((testMode & EModeHelp) || (testMode & EModeVersion))
-		{
-		if(testMode & EModeHelp)
-			{
-			PrintUsage();
-			}
-		if(testMode & EModeVersion)
-			{
-			PrintVersion();
-			}
-		test.End();
-		return;
-		}
-
-	if(testMode & EModeAll)
-		{
-		for(TInt i=0; i<KMaxTests; i++)
-			{
-			testsToRun.AppendL(i);
-			}
-		}
-
-	// if EModeReverse specified then reverse the array elements
-	TInt numberOfTests = testsToRun.Count();
-	if(testMode & EModeReverse)
-		{
-		for(TInt i=0; i<(numberOfTests>>1); i++)
-			{
-			TInt temp = testsToRun[i];
-			testsToRun[i] = testsToRun[numberOfTests - (i+1)];
-			testsToRun[numberOfTests - (i+1)] = temp;
-			}
-		}
-
-	HelpStartTestTimer();
-
-	// first run al tests with non cached writer
-	iWriter = &iNonCachedWriter;
-	for(TInt i=0; i<numberOfTests; i++)
-		{
-		RunTest(testsToRun[i]);
-		}
-	
-	iWriter = &iCachedWriter;	
-	for(TInt i=0; i<numberOfTests; i++)
-		{
-		RunTest(testsToRun[i]);
-		}
-
-	
-	testsToRun.Close();
-
-	HelpStopTestTimer();
-
-	ReportPerformance();
-	
-	test.End();
-	}
-
-/**
- * This fills our array of test functions with function pointers to tests
- */
-void CSCMLibraryClient::FillArray() 
-	{
-	
-	//iTestArray[0] = new TFunctionData();
-	iTestArray[0].iFunctionPtr = &CSCMLibraryClient::TestCheckSum;
-	iTestArray[0].iFunctionName = _L("TestCheckSum");
-	
-	iTestArray[1].iFunctionPtr = &CSCMLibraryClient::TestLockDataSerialization;
-	iTestArray[1].iFunctionName = _L("TestLockDataSerialization");
-	
-	iTestArray[2].iFunctionPtr = &CSCMLibraryClient::TestOffsetsHeaderSerialization;
-	iTestArray[2].iFunctionName = _L("TestOffsetsHeaderSerialization");
-	
-	iTestArray[3].iFunctionPtr = &CSCMLibraryClient::TestInfoHeaderSerialization;
-	iTestArray[3].iFunctionName = _L("TestInfoHeaderSerialization");
-	
-	iTestArray[4].iFunctionPtr = &CSCMLibraryClient::TestRawData;
-	iTestArray[4].iFunctionName = _L("TestRawData");
-
-	iTestArray[5].iFunctionPtr = &CSCMLibraryClient::TestProcessData;
-	iTestArray[5].iFunctionName = _L("TestProcessData");
-	
-	iTestArray[6].iFunctionPtr = &CSCMLibraryClient::TestThreadData;
-	iTestArray[6].iFunctionName = _L("TestThreadData");
-	
-	iTestArray[7].iFunctionPtr = &CSCMLibraryClient::TestThreadStack;
-	iTestArray[7].iFunctionName = _L("TestThreadStack");
-		
-	iTestArray[8].iFunctionPtr = &CSCMLibraryClient::TestRegisterValue;
-	iTestArray[8].iFunctionName = _L("TestRegisterValue");
-		
-	iTestArray[9].iFunctionPtr = &CSCMLibraryClient::TestRegisterSet;
-	iTestArray[9].iFunctionName = _L("TestRegisterSet");
-
-	iTestArray[10].iFunctionPtr = &CSCMLibraryClient::TestMemoryDump;
-	iTestArray[10].iFunctionName = _L("TestMemoryDump");
-	
-	iTestArray[11].iFunctionPtr = &CSCMLibraryClient::TestCodeSegmentSet;
-	iTestArray[11].iFunctionName = _L("TestCodeSegmentSet");
-	
-	iTestArray[12].iFunctionPtr = &CSCMLibraryClient::TestCodeSegment;
-	iTestArray[12].iFunctionName = _L("TestCodeSegment");
-	
-	iTestArray[13].iFunctionPtr = &CSCMLibraryClient::TestTraceDump;
-	iTestArray[13].iFunctionName = _L("TestTraceDump");
-	
-	iTestArray[14].iFunctionPtr = &CSCMLibraryClient::TestVariantSpecificData;
-	iTestArray[14].iFunctionName = _L("TestVariantSpecificData");
-	
-	iTestArray[15].iFunctionPtr = &CSCMLibraryClient::TestRomHeaderData;
-	iTestArray[15].iFunctionName = _L("TestRomHeaderData");
-	
-	iTestArray[16].iFunctionPtr = & CSCMLibraryClient::TestSCMLockData;
-	iTestArray[16].iFunctionName = _L("TestSCMLockData");
-
-	};
-
-/**
- * Entry point for crash monitor tests
- */
-GLDEF_C TInt E32Main()
-	{
-	TInt ret = KErrNone;
-	
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-	
-   	test.Title();
-   	CSCMLibraryClient* tester = CSCMLibraryClient::NewL();
-   	if (tester != NULL)
-       {
-        __UHEAP_MARK;
-	    TRAP(ret,tester->ClientAppL());
-	    __UHEAP_MARKEND;
-
-	   delete tester;
-       }
-       
-	delete trap;
-	return ret;
-	}
-
-/**
- * Runs a given test identified by argument
- * @param aTestNumber Test to run
- */
-void CSCMLibraryClient::RunTest(TInt aTestNumber)
-	{
-	if( (aTestNumber<0) || (aTestNumber>=KMaxTests) )
-		{
-		User::Panic(_L("Test number out of range"), aTestNumber);
-		}
-	__UHEAP_MARK;
-	
-	if(iTestArray[aTestNumber].iFunctionPtr)
-		{
-		test.Printf(_L("pre-run test %d"), aTestNumber);
-		(this->*(iTestArray[aTestNumber].iFunctionPtr))();
-		test.Printf(_L("post-run test %d"), aTestNumber);
-		}
-
-	__UHEAP_MARKEND;
-	}
-
-/**
- * Prints the version of this test suite
- */
-void CSCMLibraryClient::PrintVersion()
-	{
-	test.Printf(_L("\nt_crashmonitor_lib.exe\nVersion: %S\n"), &(testVersion.Name()));
-	test.Printf(_L("Press any key...\n"));
-	test.Getch();
-	}
-/**
- * Reports performance metrics from all the tests
- */
-void CSCMLibraryClient::ReportPerformance(void)
-	{
-	test.Printf(_L("\nPerformance\n"));
-	test.Printf(_L("========================\n"));
-
-	
-	// Runtime
-	TInt ticks = HelpGetTestTicks();
-#ifndef __WINS__
-	test (ticks != 0);  
-#endif
-	TInt nkTicksPerSecond = HelpTicksPerSecond();
-
-#ifndef __WINS__
-	test (nkTicksPerSecond != 0);
-#endif
-
-	test.Printf(_L("Total test runtime: %d seconds\n"),ticks/nkTicksPerSecond);
-
-	test.Printf(_L("\n"));
-	}
-
-/**
- * Returns the number of nanokernel ticks in one second
- * @return Number of nanokernel ticks. 0 if unsuccesful
- */
-TInt CSCMLibraryClient::HelpTicksPerSecond(void)
-	{
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-	
-	ASSERT(nanokernel_tick_period != 0);
-
-	static const TInt KOneMillion = 1000000;
-
-	return KOneMillion/nanokernel_tick_period;
-	}
-
-void CSCMLibraryClient::DoWrite(MByteStreamSerializable& aObjectToWrite, TInt aPosition)
-	{
-	if(iWriter == &iCachedWriter)
-		{
-		iCachedWriter.SetPosition(aPosition);
-		test(aObjectToWrite.Serialize(iCachedWriter) == KErrNone);
-		iCachedWriter.FlushCache();	
-		}
-	else if(iWriter == &iNonCachedWriter)
-		{
-		iNonCachedWriter.SetPosition(aPosition);		
-		test(aObjectToWrite.Serialize(iNonCachedWriter) == KErrNone);	
-		}
-	else
-		{
-		// no writer
-		test(EFalse);
-		}
-	}
-
-// BASE granted test id's 2364 to 2394
-
-//---------------------------------------------
-// !@SYMTestCaseID KBASE-T_SCMLIB-2364
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TScmChecksum structure 
-//! @SYMTestActions TScmChecksum serialized & then deserialized
-//! @SYMTestExpectedResults TScmChecksum structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestCheckSum()
-	{
-	test.Next(_L("TestCheckSum\n"));
-	
-	TScmChecksum chksm1;
-	chksm1.Reset();
-	
-	TInt blocksize1 = 123;
-	TInt blocksize2 = 166;
-	
-	TScmChecksum chksm2;
-	chksm2.Reset();
-		
-	test(ChecksumHelper(chksm1, blocksize1, iBuffer, KBufLen));
-	test(ChecksumHelper(chksm2, blocksize2, iBuffer, KBufLen));
-		
-	test(chksm1  == chksm2);
-
-	}
-
-TBool CSCMLibraryClient::ChecksumHelper(TScmChecksum& aChecksum, TUint aBlocksize, TUint8* aBuffer, TUint aBufferLen) 
-	{
-	if( aBlocksize == 0 || aBufferLen == 0 )
-		{
-		return EFalse;
-		}
-	
-	TInt remaining = aBufferLen;
-	TInt pos = 0;
-		
-	while(remaining > aBlocksize)
-		{		
-		aChecksum.ChecksumBlock(aBuffer + pos, aBlocksize);
-		pos += aBlocksize;
-		remaining -= aBlocksize;
-		}
-	
-	aChecksum.ChecksumBlock(aBuffer + pos, remaining);
-	pos += remaining;
-	
-	return (pos == aBufferLen);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2365
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TSCMLockData structure 
-//! @SYMTestActions TSCMLockData serialized & then deserialized
-//! @SYMTestExpectedResults TSCMLockData structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//--------------------------------------------- 
-void CSCMLibraryClient::TestLockDataSerialization()
-	{	
-	test.Next(_L("TestLockDataSerialization\n"));	
-
-	TSCMLockData lockData1;
-	
-	//Arbitrary values
-	lockData1.SetLockCount(10);
-	lockData1.SetMutexHoldCount(17);
-	lockData1.SetMutexThreadWaitCount(36);
-
-	DoWrite(lockData1);
-	
-	iReader.SetPosition(0);
-	//Test deserialisation works
-	TSCMLockData lockData2;	
-	test(lockData2.Deserialize(iReader) == KErrNone);
-	
-	//Test we got back the correct object
-	test(lockData1 == lockData2);
-	}
-
-//---------------------------------------------
-//! //! @SYMTestCaseID KBASE-T_SCMLIB-2366
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCrashOffsetsHeader structure 
-//! @SYMTestActions TCrashOffsetsHeader serialized & then deserialized
-//! @SYMTestExpectedResults TCrashOffsetsHeader structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//--------------------------------------------- 
-void CSCMLibraryClient::TestOffsetsHeaderSerialization()
-	{
-	test.Next(_L("TestOffsetsHeaderSer ialization\n"));	
-	
-	TCrashOffsetsHeader header1;
-	header1.iCTFullRegOffset = 123; 
-	header1.iCTUsrStkOffset = 456;
-	header1.iCTSvrStkOffset = 789;
-	header1.iCPMetaOffset = 1001;
-	header1.iCTMetaOffset = 99;		
-	header1.iCPCodeSegOffset = 1234;
-	header1.iSysUsrStkOffset = 3456;
-	header1.iSysSvrStkOffset = 255;
-	header1.iSysUsrRegOffset = 999;
-	header1.iSysSvrRegOffset = 2002;
-	header1.iTLstOffset = 3003;
-	header1.iPLstOffset = 4004;
-	header1.iSysCodeSegOffset = 5005;
-	header1.iExcStkOffset = 6006;
-	header1.iTraceOffset = 1233;
-	header1.iScmLocksOffset = 3421;
-	header1.iKernelHeapOffset = 89;
-	header1.iVarSpecInfOffset = 0;
-	header1.iRomInfoOffset = 123;
-
-	DoWrite(header1);
-	
-	iReader.SetPosition(0);
-	TCrashOffsetsHeader header2;
-	
-	test(header2.Deserialize(iReader) == KErrNone);
-	
-	test(header2 == header1);
-	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2367
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCrashInfoHeader structure 
-//! @SYMTestActions TCrashInfoHeader serialized & then deserialized
-//! @SYMTestExpectedResults TCrashInfoHeader structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestInfoHeaderSerialization()
-	{
-	test.Next(_L("TestInfoHeaderSerialization\n"));	
-
-	TCrashInfoHeader infoHeader1;
-	infoHeader1.iLogSize = 5000;	
-	infoHeader1.iFlashAlign = 4;
-	infoHeader1.iCachedWriterSize = 16;
-	infoHeader1.iPid = 1001;
-	infoHeader1.iTid = 2002;
-	infoHeader1.iExitType = 90;
-	infoHeader1.iExitReason = 23;	
-	infoHeader1.iExcCode = 8899;
-	infoHeader1.iCrashTime = 12345;	
-	infoHeader1.iCrashId = 23;
-	infoHeader1.iFlashBlockSize = 256 * 1024;
-	infoHeader1.iFlashPartitionSize = 1024 * 1024;
-	
-	TVersion ver(21,43,54);
-	
-	infoHeader1.iSCMDataTypesVersion = ver;
-
-	DoWrite(infoHeader1);
-	
-	iReader.SetPosition(0);
-	TCrashInfoHeader infoHeader2;
-	
-	test(infoHeader2.Deserialize(iReader) == KErrNone);
-	
-	test(infoHeader2 == infoHeader1);
-		
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2368 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRawData structure 
-//! @SYMTestActions TRawData serialized & then deserialized
-//! @SYMTestExpectedResults TRawData structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestRawData()
-	{
-	test.Next(_L("TestRawData\n"));
-	
-	const TInt KLen = 256;
-	
-	TUint8 data[KLen];
-	
-	for(TInt i=0;i<KLen;i++)
-		{
-		data[i] = ((i<<2) % KLen) + i;
-		}
-	
-	TRawData rawData1;
-
-	rawData1.iLength = KLen;
-	rawData1.iData.Set(const_cast<TUint8*>(data), KLen, KLen);;
-
-	DoWrite(rawData1);
-	
-	TPtr8 p(iBuffer, KBufLen, KBufLen);
-	TCrashLogWalker walker(p);
-	TInt pos = 0;
-	TInt len = 0;
-	TRawData* rawData2 = walker.GetRawDataTypeL(pos, len, p, 0);
-
-	CleanupStack::PushL(rawData2);
-	
-	test(rawData1.iLength == rawData2->iLength);
-	test(rawData1.iData.Compare(rawData2->iData) == 0);
-	
-	CleanupStack::PopAndDestroy(rawData2);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2369 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TProcessData structure 
-//! @SYMTestActions TProcessData serialized & then deserialized
-//! @SYMTestExpectedResults TProcessData structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestProcessData()
-	{
-	test.Next(_L("TestProcessData\n"));
-	
-	TProcessData procData1;
-	
-	procData1.iPriority = 99;		
-	procData1.iPid = MAKE_TINT64(34567,12345);
-	
-	
-	procData1.iName.Zero();
-	for(TInt i=0;i<KMaxProcessName;i++)
-		{	
-		procData1.iName.Append( TChar( (i%60) + 32 ));
-		}
-	
-	procData1.iNamesize = KMaxProcessName;		
-
-	DoWrite(procData1);
-	
-	TProcessData procData2;
-	iReader.SetPosition(0);
-	
-	test(procData2.Deserialize(iReader) == KErrNone);
-	test(procData1.iPriority == procData1.iPriority);	
-	test(procData1.iPid == procData2.iPid);	
-	test(procData1.iNamesize == procData2.iNamesize);
-	test(procData1.iName.Compare(procData2.iName) == 0);	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2370 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TThreadData structure 
-//! @SYMTestActions TThreadData serialized & then deserialized
-//! @SYMTestExpectedResults TThreadData structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestThreadData()
-	{
-	test.Next(_L("TestThreadData\n"));
-	
-	TThreadData threadData1;
-
-	threadData1.iPriority = 3455;
-	threadData1.iTid = MAKE_TINT64(34998,18345);
-	threadData1.iOwnerId = MAKE_TINT64(34448,48345);
-	threadData1.iSvcSP = 67272;
-	threadData1.iSvcStack = 888882;
-	threadData1.iSvcStacksize = 4535;
-	threadData1.iUsrSP = 892;
-	threadData1.iUsrStack = 7727;
-	threadData1.iUsrStacksize = 343;
-	threadData1.iLastCpu = 12312;
-	threadData1.iSvcHeap = 8738;
-	threadData1.iSvcHeapSize = 4;
-	
-	threadData1.iNamesize = TThreadData::KMaxThreadName;
-	
-	threadData1.iName.Zero();
-	for(TInt i=0;i<TThreadData::KMaxThreadName;i++)
-		{	
-		threadData1.iName.Append( TChar( (i%60) + 32 ));
-		}
-
-
-	DoWrite(threadData1);
-	
-	iReader.SetPosition(0);
-	TThreadData threadData2;
-	
-	test(threadData2.Deserialize(iReader) == KErrNone);
-	
-
-	test(threadData1.iPriority == threadData2.iPriority);
-	test(threadData1.iTid == threadData2.iTid);
-	test(threadData1.iOwnerId == threadData2.iOwnerId);
-	test(threadData1.iSvcSP == threadData2.iSvcSP);
-	test(threadData1.iSvcStack == threadData2.iSvcStack);
-	test(threadData1.iSvcStacksize == threadData2.iSvcStacksize);
-	test(threadData1.iUsrSP == threadData2.iUsrSP);
-	test(threadData1.iUsrStack == threadData2.iUsrStack);
-	test(threadData1.iUsrStacksize == threadData2.iUsrStacksize);
-	test(threadData1.iLastCpu == threadData2.iLastCpu);
-	test(threadData1.iSvcHeap == threadData2.iSvcHeap);
-	test(threadData1.iSvcHeapSize == threadData2.iSvcHeapSize);	
-	test(threadData1.iNamesize == threadData2.iNamesize);
-	test(threadData1.iName.Compare(threadData2.iName) == 0);	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2371 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TThreadStack structure 
-//! @SYMTestActions TThreadStack serialized & then deserialized
-//! @SYMTestExpectedResults TThreadStack structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestThreadStack()
-	{
-	test.Next(_L("TestThreadStack\n"));
-	
-	TThreadStack threadStack1;
-	threadStack1.iStackType = TThreadStack::ESvrStack;
-	threadStack1.iThreadId = MAKE_TINT64(774998,17345);
-	
-	DoWrite(threadStack1);
-
-	iReader.SetPosition(0);
-	TThreadStack threadStack2;
-	test(threadStack2.Deserialize(iReader) == KErrNone);
-	
-	test(threadStack1.iStackType == threadStack2.iStackType);
-	test(threadStack1.iThreadId == threadStack2.iThreadId);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2372 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRegisterValue structure 
-//! @SYMTestActions TRegisterValue serialized & then deserialized
-//! @SYMTestExpectedResults TRegisterValue structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestRegisterValue()
-	{
-	test.Next(_L("TestregisterValue\n"));
-	TRegisterValue regValue1;
-	
-	regValue1.iOwnId = MAKE_TINT64(55498,58345);
-	regValue1.iType = 3456;
-	regValue1.iClass = 45;
-	regValue1.iSubId = 5546;
-	regValue1.iSize = 2;
-	
-	DoWrite(regValue1);
-	
-	iReader.SetPosition(0);
-	TRegisterValue regValue2;
-	test(regValue2.Deserialize(iReader) == KErrNone);
-	
-	test(regValue1.iOwnId == regValue2.iOwnId);
-	test(regValue1.iType == regValue2.iType);
-	test(regValue1.iClass == regValue2.iClass);
-	test(regValue1.iSubId == regValue2.iSubId);
-	test(regValue1.iSize == regValue2.iSize);	
-	
-	switch(regValue1.iSize)
-		{
-		case 0:
-			test(regValue1.iValue8 == regValue2.iValue8);
-			break;
-		case 1:
-			test(regValue1.iValue16 == regValue2.iValue16);
-			break;
-		case 2:
-			test(regValue1.iValue32 == regValue2.iValue32);
-			break;
-		case 3:
-			test(regValue1.iValue64 == regValue2.iValue64);
-			break;
-		default:
-			test(EFalse);
-			break;
-		}	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2373 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRegisterSet structure 
-//! @SYMTestActions TRegisterSet serialized & then deserialized
-//! @SYMTestExpectedResults TRegisterSet structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestRegisterSet()
-	{
-	test.Next(_L("TRegisterSet\n"));
-	
-	TRegisterSet set1;	
-	set1.iNumRegisters = 3784;
-	DoWrite(set1);
-	
-	iReader.SetPosition(0); 
-	TRegisterSet set2;
-	test(set2.Deserialize(iReader) == KErrNone);
-		
-	test(set1.iNumRegisters == set2.iNumRegisters);	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2374 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TMemoryDump structure 
-//! @SYMTestActions TMemoryDump serialized & then deserialized
-//! @SYMTestExpectedResults TMemoryDump structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestMemoryDump()
-	{
-	test.Next(_L("TestMemoryDump\n"));
-	
-	TMemoryDump memDump1;
-	memDump1.iStartAddress = 0x23FACED0;
-	memDump1.iPid = MAKE_TINT64(1234, 5678);
-	memDump1.iLength = 999;
-	
-	DoWrite(memDump1);
-	
-	iReader.SetPosition(0); 
-	TMemoryDump memDump2;
-	test(memDump2.Deserialize(iReader) == KErrNone);
-
-	test(memDump1.iStartAddress = memDump2.iStartAddress);
-	test(memDump1.iPid = memDump2.iPid);
-	test(memDump1.iLength = memDump2.iLength);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2375 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCodeSegmentSet structure 
-//! @SYMTestActions TCodeSegmentSet serialized & then deserialized
-//! @SYMTestExpectedResults TCodeSegmentSet structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestCodeSegmentSet()
-	{
-	test.Next(_L("TestCodeSegmentSet\n"));
-	TCodeSegmentSet tss1;
-		
-	tss1.iNumSegs = 45;	
-	tss1.iPid = MAKE_TINT64(28272,671717);
-	
-	DoWrite(tss1);
-	
-	iReader.SetPosition(0);
-	TCodeSegmentSet tss2;
-	test(tss2.Deserialize(iReader) == KErrNone);
-	
-	test(tss1.iNumSegs == tss2.iNumSegs);
-	test(tss1.iPid == tss2.iPid);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2376 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TCodeSegment structure 
-//! @SYMTestActions TCodeSegment serialized & then deserialized
-//! @SYMTestExpectedResults TCodeSegment structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestCodeSegment()
-	{
-	test.Next(_L("TestCodeSegment\n"));
-	
-	TCodeSegment cs1;
-	cs1.iCodeSegType = EExeCodeSegType;	
-	cs1.iCodeSegMemInfo.iCodeBase = 345;
-	cs1.iCodeSegMemInfo.iCodeSize = 566;
-	cs1.iCodeSegMemInfo.iConstDataBase = 776;
-	cs1.iCodeSegMemInfo.iConstDataSize = 626267;
-	cs1.iCodeSegMemInfo.iInitialisedDataBase = 873;
-	cs1.iCodeSegMemInfo.iInitialisedDataSize = 52625;
-	cs1.iCodeSegMemInfo.iUninitialisedDataBase = 3737;
-	cs1.iCodeSegMemInfo.iUninitialisedDataSize = 53535;
-	
-	cs1.iName.Zero();
-	for(TInt i=0;i<TCodeSegment::KMaxSegmentNameSize;i++)
-		{
-		cs1.iName.Append( TChar( (i%60) + 32 ));
-		}
-
-	cs1.iNameLength = TCodeSegment::KMaxSegmentNameSize;
-	cs1.iXip = ETrue;
-	
-	DoWrite(cs1);
-	
-	iReader.SetPosition(0);	
-	TCodeSegment cs2;
-	test(cs2.Deserialize(iReader) == KErrNone);
-		
-	test(cs1.iCodeSegType == cs2.iCodeSegType);	
-	test(cs1.iCodeSegMemInfo.iCodeBase == cs2.iCodeSegMemInfo.iCodeBase);
-	test(cs1.iCodeSegMemInfo.iCodeSize == cs2.iCodeSegMemInfo.iCodeSize);
-	test(cs1.iCodeSegMemInfo.iConstDataBase == cs2.iCodeSegMemInfo.iConstDataBase);
-	test(cs1.iCodeSegMemInfo.iConstDataSize == cs2.iCodeSegMemInfo.iConstDataSize); 
-	test(cs1.iCodeSegMemInfo.iInitialisedDataBase == cs2.iCodeSegMemInfo.iInitialisedDataBase);
-	test(cs1.iCodeSegMemInfo.iInitialisedDataSize == cs2.iCodeSegMemInfo.iInitialisedDataSize);
-	test(cs1.iCodeSegMemInfo.iUninitialisedDataBase == cs2.iCodeSegMemInfo.iUninitialisedDataBase);
-	test(cs1.iCodeSegMemInfo.iUninitialisedDataSize == cs2.iCodeSegMemInfo.iUninitialisedDataSize);
-		
-	test(cs1.iNameLength == cs2.iNameLength);
-	test(cs1.iName.Compare(cs2.iName) == 0);	
-	test(cs1.iXip == cs2.iXip);
-	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2377 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TTraceDump structure 
-//! @SYMTestActions TTraceDump serialized & then deserialized
-//! @SYMTestExpectedResults TTraceDump structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestTraceDump()
-	{
-	test.Next(_L("TestTraceDump\n"));
-	
-	TTraceDump td1;
-	td1.iSizeOfMemory = 378282;
-	td1.iNumberOfParts = 440;
-	
-	DoWrite(td1);
-	
-	iReader.SetPosition(0);
-
-	TTraceDump td2;
-	test(td2.Deserialize(iReader) == KErrNone);
-	test(td1.iSizeOfMemory == td2.iSizeOfMemory);
-	test(td1.iNumberOfParts == td2.iNumberOfParts);
-	}
-	
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2379 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TVariantSpecificData structure 
-//! @SYMTestActions TVariantSpecificData serialized & then deserialized
-//! @SYMTestExpectedResults TVariantSpecificData structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestVariantSpecificData()
-	{
-	test.Next(_L("TestVariantSpecificData\n"));		
-	TVariantSpecificData vsd1;
-	
-	vsd1.iSize = 37372;
-	DoWrite(vsd1);
-	
-	iReader.SetPosition(0);		
-	TVariantSpecificData vsd2;
-	test(vsd2.Deserialize(iReader) == KErrNone);	
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBASE-T_SCMLIB-2380 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TRomHeaderData structure 
-//! @SYMTestActions TRomHeaderData serialized & then deserialized
-//! @SYMTestExpectedResults TRomHeaderData structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestRomHeaderData()
-	{
-	test.Next(_L("TestRomHeaderData\n"));
-	
-	TRomHeaderData rhd1;
-	rhd1.iMajorVersion = 12;
-	rhd1.iMinorVersion = 2;							
-	rhd1.iBuildNumber = 7828;				
-	rhd1.iTime = MAKE_TINT64(716171, 62672);
-	
-	DoWrite(rhd1);
-	
-	iReader.SetPosition(0);
-	TRomHeaderData rhd2;
-	test(rhd2.Deserialize(iReader) == KErrNone);
-	test(rhd1.iMajorVersion == rhd2.iMajorVersion);
-	test(rhd1.iMinorVersion == rhd2.iMinorVersion);							
-	test(rhd1.iBuildNumber == rhd2.iBuildNumber);				
-	test(rhd1.iTime == rhd2.iTime);		
-	}
-
-//---------------------------------------------
-//! //! @SYMTestCaseID KBASE-T_SCMLIB-2381 
-//! @SYMTestType
-//! @SYMPREQ PREQ1700
-//! @SYMTestCaseDesc Ensures we can serialise and deserialise the TSCMLockData structure 
-//! @SYMTestActions TSCMLockData serialized & then deserialized
-//! @SYMTestExpectedResults <> structure serialized / deserialized ok
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CSCMLibraryClient::TestSCMLockData()
-	{
-	
-	test.Next(_L("TestSCMLockData\n"));
-
-	TSCMLockData ld1;	
-	ld1.SetMutexHoldCount(3);
-	ld1.SetLockCount(4);
-	ld1.SetMutexThreadWaitCount(5);
-
-	DoWrite(ld1);
-	
-	iReader.SetPosition(0);
-	TSCMLockData ld2;
-	test(ld2.Deserialize(iReader) == KErrNone);
-	
-	test(ld1.MutexHoldCount() == ld2.MutexHoldCount());
-	test(ld1.MutexThreadWaitCount() == ld2.MutexThreadWaitCount());
-	test(ld1.LockCount() == ld2.LockCount());
-	test(ld1 == ld2);
-	test(!(ld1 != ld2));
-	}	
-		
-//eof
-
--- a/kerneltest/e32test/rm_debug/crashmonitor/t_crashmonitor.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-// Copyright (c) 2008-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:
-// System Crash Monitor Shared Library tests
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef CRASH_MONITOR
-#define CRASH_MONITOR
-
-#include <e32base.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32cmn.h>
-#include <scmdatatypes.h>
-#include <scmbytestreamutil.h>
-#include <hal.h>
-
-using namespace Debug;
-
-LOCAL_D RTest test(_L("T_CRASHMONITOR_LIB"));
-
-//number of test functions that we have
-const TInt KMaxTests = 25;
-const TUint KBufLen =  52224; // 0.5 meg buffer
-
-class CSCMLibraryClient;
-
-// Create a pointer to function type
-typedef void (CSCMLibraryClient::*testFunction)();
-
-class TFunctionData
-	{
-		
-public:
-	TFunctionData()
-	: iFunctionPtr(NULL)
-	{	
-	}
-
-	testFunction iFunctionPtr;
-	TBuf<40> iFunctionName;
-	};
-
-//
-// class CSCMLibraryClient
-//
-// The basic SCM Library Client
-//
-class CSCMLibraryClient : public CBase
-	{
-public:
-	static CSCMLibraryClient* NewL();
-	~CSCMLibraryClient();
-	void ClientAppL();
-
-private:
-	CSCMLibraryClient();
-	void ConstructL();
-
-	TInt TestStartup();
-	TInt TestShutdown();
-
-	void FillArray();
-	void PrintUsage();
-	void PrintVersion();
-
-	enum TTestMode 
-		{
-		//run all the tests
-		EModeAll = 1<<0,
-		//run the specified tests in reverse order
-		EModeReverse = 1<<1,
-		//print out help
-		EModeHelp = 1<<2,
-		//print out help
-		EModeVersion = 1<<3
-		};
-	
-	//Tests
-	void TestCheckSum();
-
-	void TestLockDataSerialization();
-	void TestOffsetsHeaderSerialization();
-	void TestInfoHeaderSerialization();
-	void TestRawData();
-	void TestProcessData();
-	void TestThreadData();
-	void TestThreadStack();
-	void TestRegisterValue();
-	void TestRegisterSet();
-	
-	void TestMemoryDump();
-	void TestCodeSegmentSet();
-	void TestCodeSegment();
-	void TestTraceDump();
-	void TestVariantSpecificData();
-	void TestRomHeaderData();
-	void TestSCMLockData();
-
-	void RunTest(TInt aTestNumber);
-	void ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests);
-	void HelpStartTestTimer(void) { iStartTick = User::NTickCount(); iStopTick = 0; };
-	void HelpStopTestTimer(void) { iStopTick = User::NTickCount(); };
-	TInt HelpGetTestTicks(void) { return (iStopTick - iStartTick); };
-	TInt HelpTicksPerSecond();
-	void ReportPerformance();
-
-private:
-	TBool ChecksumHelper(TScmChecksum& aChecksum, TUint aBlocksize, TUint8* aBuffer, TUint aBufferLen);
-	void DoWrite(MByteStreamSerializable& aObjectToWrite, TInt aPositon = 0);
-
-	
-private:	
-	TFunctionData iTestArray[KMaxTests];
-	
-	// Timing information
-	TInt iStartTick;
-	TInt iStopTick;	
-	
-	TUint8		iBuffer[KBufLen]; 
-	
-	TByteStreamWriter iNonCachedWriter;	
-	TCachedByteStreamWriter iCachedWriter;
-	
-	TByteStreamWriter* iWriter;
-	TByteStreamReader iReader;
-	};
-
-#endif // CRASH_MONITOR
--- a/kerneltest/e32test/rm_debug/group/t_crashmonitor_lib.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 2008-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:
-// Tests the functionality of the System Crash Monitor libraries
-//
-
-ALWAYS_BUILD_AS_ARM
-
-targettype     exe
- 
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-userinclude    ../../../../kernel/eka/debug/crashMonitor/inc
-sourcepath	   	../crashmonitor
-
-source        	t_crashmonitor.cpp
-
-library	euser.lib
-library hal.lib
-staticlibrary scmusr_lib.lib
-
-target         t_crashmonitor_lib.exe
-
-UID            0x0 0x4321bbbc
-SECUREID       0x2000B26F
-
-capability		none
-
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/system/t_mstim.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32test/system/t_mstim.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -43,6 +43,8 @@
 
 #include <e32test.h>
 #include <e32uid.h>
+#include <e32svr.h>
+#include <u32hal.h>
 #include "d_mstim.h"
 
 RTest test(_L("T_MSTIM"));
@@ -92,9 +94,15 @@
 // Test millisecond timers
 //
     {
+	// RTest::Printf and Next are very high latency under SMP, so suppress them
+	const TBool unicore = (UserSvr::HalFunction(EHalGroupKernel, EKernelHalSmpSupported, 0, 0) == KErrNotSupported);
+
 //	test.SetLogged(EFalse);
 	test.Title();
 
+	if (!unicore)
+		test.Printf(_L("Running on a SMP system - output reduced\n"));
+
 	test.Start(_L("Load test LDD"));
 	TInt r=User::LoadLogicalDevice(KLddFileName);
 	TEST(r==KErrNone || r==KErrAlreadyExists);
@@ -117,56 +125,67 @@
 	r=mstim.StartPeriodicDfc(7,71);
 	CHECK(r);
 
-	test.Next(_L("Start while started"));
+	if (unicore)
+		test.Next(_L("Start while started"));
 	TRequestStatus s;
 	mstim.StartOneShotInt(s,0,100);
 	User::WaitForRequest(s);
 	TEST(s==KErrInUse);
 
-	test.Next(_L("One shot interrupt"));
+	if (unicore)
+		test.Next(_L("One shot interrupt"));
 	mstim.StartOneShotInt(s,2,100);
 	User::WaitForRequest(s);
 	TUint fc1=User::NTickCount();
 	TEST(s==KErrNone);
 	TInt time=GetOneShotTime(2);
-	test.Printf(_L("Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Took %dms\n"),time);
 	TESTTIME(time,100,102);
 
-	test.Next(_L("One shot DFC"));
+	if (unicore)
+		test.Next(_L("One shot DFC"));
 	mstim.StartOneShotDfc(s,3,200);
 	User::WaitForRequest(s);
 	TUint fc3=User::NTickCount();
 	TEST(s==KErrNone);
 	time=GetOneShotTime(3);
-	test.Printf(_L("Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Took %dms\n"),time);
 	TESTTIME(time,200,202);
 
-	test.Next(_L("One shot interrupt again"));
+	if (unicore)
+		test.Next(_L("One shot interrupt again"));
 	TUint fc2=User::NTickCount();
 	mstim.StartOneShotIntAgain(s,2,300);
 	User::WaitForRequest(s);
 	TEST(s==KErrNone);
 	TInt time2=GetOneShotTime(2);
-	test.Printf(_L("Took %dms, delay %dms\n"),time2,fc2-fc1);
+	if (unicore)
+		test.Printf(_L("Took %dms, delay %dms\n"),time2,fc2-fc1);
 	time2+=TInt(fc2-fc1);
 	TESTTIME(time2,295,306);
 
-	test.Next(_L("One shot interrupt again too late"));
+	if (unicore)
+		test.Next(_L("One shot interrupt again too late"));
 	mstim.StartOneShotIntAgain(s,3,10);
 	User::WaitForRequest(s);
 	TEST(s==KErrArgument);
 
-	test.Next(_L("One shot interrupt again"));
+	if (unicore)
+		test.Next(_L("One shot interrupt again"));
 	fc2=User::NTickCount();
 	mstim.StartOneShotIntAgain(s,3,300);
 	User::WaitForRequest(s);
 	TEST(s==KErrNone);
 	time=GetOneShotTime(3);
-	test.Printf(_L("Took %dms, delay %dms\n"),time,fc2-fc3);
+	if (unicore)
+		test.Printf(_L("Took %dms, delay %dms\n"),time,fc2-fc3);
 	time+=TInt(fc2-fc3);
 	TESTTIME(time,295,306);
 
-	test.Printf(_L("Please wait...\n"));
+	if (unicore)
+		test.Printf(_L("Please wait...\n"));
 	User::After(10000000);
 
 	SMsTimerInfo info[8];
@@ -179,7 +198,8 @@
 
 	TUint final_count=User::NTickCount();
 	TInt elapsed=TInt(final_count-init_count);
-	test.Printf(_L("Elapsed time %dms\n"),elapsed);
+	if (unicore)
+		test.Printf(_L("Elapsed time %dms\n"),elapsed);
 
 	const TInt period[8]={31,32,0,0,7,43,19,71};
 	for (i=0; i<8; i++)
@@ -188,7 +208,8 @@
 		if (p==0)
 			continue;
 		SMsTimerInfo& z=info[i];
-		test.Printf(_L("%1d: min=%-6d max=%-6d avg=%-6d count=%d\n"),i,z.iMin,z.iMax,z.iAvg,z.iCount);
+		if (unicore)
+			test.Printf(_L("%1d: min=%-6d max=%-6d avg=%-6d count=%d\n"),i,z.iMin,z.iMax,z.iAvg,z.iCount);
 		TInt count=elapsed/p;
 		TInt cdiff=count-z.iCount;
 		TEST(cdiff>=0 && cdiff<=2);
@@ -199,7 +220,8 @@
 		TEST(Abs(z.iAvg-1000*p)<1000);
 		}
 
-	test.Next(_L("Cancel periodic"));
+	if (unicore)
+		test.Next(_L("Cancel periodic"));
 	r=mstim.StopPeriodic(7);
 	CHECK(r);
 	r=mstim.GetInfo(7,info[7]);
@@ -209,16 +231,19 @@
 	CHECK(r);
 	TEST(info[6].iCount==info[7].iCount);
 
-	test.Next(_L("Reuse cancelled"));
+	if (unicore)
+		test.Next(_L("Reuse cancelled"));
 	mstim.StartOneShotInt(s,7,128);
 	User::WaitForRequest(s);
 	TEST(s==KErrNone);
 	time=GetOneShotTime(7);
-	test.Printf(_L("Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Took %dms\n"),time);
 	TESTTIME(time,128,130);
 
 	TRequestStatus s2;
-	test.Next(_L("Timed Cancel"));
+	if (unicore)
+		test.Next(_L("Timed Cancel"));
 	mstim.StartOneShotInt(s,2,128);
 	mstim.IntCancel(s2,2,130);
 	User::WaitForRequest(s);
@@ -226,10 +251,12 @@
 	User::WaitForRequest(s2);
 	TEST(s2==KErrNone);
 	time=GetOneShotTime(2);
-	test.Printf(_L("Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Took %dms\n"),time);
 	TESTTIME(time,128,130);
 	time=GetOneShotTime(7);
-	test.Printf(_L("Cancel Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Cancel Took %dms\n"),time);
 	TESTTIME(time,130,132);
 
 	mstim.StartOneShotInt(s,2,128);
@@ -239,38 +266,46 @@
 	User::WaitForRequest(s2);
 	TEST(s2==KErrNone);
 	time=GetOneShotTime(7);
-	test.Printf(_L("Cancel Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Cancel Took %dms\n"),time);
 	TESTTIME(time,126,128);
 
-	test.Next(_L("Reuse cancelled"));
+	if (unicore)
+		test.Next(_L("Reuse cancelled"));
 	mstim.StartOneShotInt(s,2,64);
 	User::WaitForRequest(s);
 	TEST(s==KErrNone);
 	time=GetOneShotTime(2);
-	test.Printf(_L("Took %dms\n"),time);
+	if (unicore)
+		test.Printf(_L("Took %dms\n"),time);
 	TESTTIME(time,64,66);
 
 #ifdef _DEBUG
-	test.Next(_L("Random test"));
+	if (unicore)
+		test.Next(_L("Random test"));
 	r=mstim.BeginRandomTest();
 	CHECK(r);
 #endif
 
-	test.Printf(_L("Please wait...\n"));
+	if (unicore)
+		test.Printf(_L("Please wait...\n"));
 	User::After(10000000);
 
 #ifdef _DEBUG
 	r=mstim.EndRandomTest();
 	CHECK(r);
-	SRandomTestInfo rInfo;
-	r=mstim.GetRandomTestInfo(rInfo);
-	test.Printf(_L("min error = %d\n"),rInfo.iMin);
-	test.Printf(_L("max error = %d\n"),rInfo.iMax);
-	test.Printf(_L("xfer cancel = %d\n"),rInfo.iXferC);
-	test.Printf(_L("crit cancel = %d\n"),rInfo.iCritC);
-	test.Printf(_L("start fails = %d\n"),rInfo.iStartFail);
-	test.Printf(_L("debug calls = %d\n"),rInfo.iCallBacks);
-	test.Printf(_L("completions = %d\n"),rInfo.iCompletions);
+	if (unicore)
+		{
+		SRandomTestInfo rInfo;
+		r=mstim.GetRandomTestInfo(rInfo);
+		test.Printf(_L("min error = %d\n"),rInfo.iMin);
+		test.Printf(_L("max error = %d\n"),rInfo.iMax);
+		test.Printf(_L("xfer cancel = %d\n"),rInfo.iXferC);
+		test.Printf(_L("crit cancel = %d\n"),rInfo.iCritC);
+		test.Printf(_L("start fails = %d\n"),rInfo.iStartFail);
+		test.Printf(_L("debug calls = %d\n"),rInfo.iCallBacks);
+		test.Printf(_L("completions = %d\n"),rInfo.iCompletions);
+		}
 #endif
 
 	for (i=0; i<8; i++)
@@ -281,7 +316,8 @@
 
 	final_count=User::NTickCount();
 	elapsed=TInt(final_count-init_count);
-	test.Printf(_L("Elapsed time %dms\n"),elapsed);
+	if (unicore)
+		test.Printf(_L("Elapsed time %dms\n"),elapsed);
 
 	const TInt period2[8]={31,32,0,0,7,43,19,0};
 	for (i=0; i<8; i++)
@@ -292,7 +328,8 @@
 		r=mstim.StopPeriodic(i);
 		CHECK(r);
 		SMsTimerInfo& z=info[i];
-		test.Printf(_L("%1d: min=%-6d max=%-6d avg=%-6d count=%d\n"),i,z.iMin,z.iMax,z.iAvg,z.iCount);
+		if (unicore)
+			test.Printf(_L("%1d: min=%-6d max=%-6d avg=%-6d count=%d\n"),i,z.iMin,z.iMax,z.iAvg,z.iCount);
 		TInt count=elapsed/p;
 		TInt cdiff=count-z.iCount;
 		TEST(cdiff>=0 && cdiff<=2);
--- a/kerneltest/e32utils/group/usbmsapp.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/e32utils/group/usbmsapp.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -2,7 +2,7 @@
  @file
  @SYMPurpose usbmsapp.exe USB mass storage sample application
  */
-// 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"
@@ -17,8 +17,10 @@
 // Description:
 //
 
-TARGET         		usbmsapp.exe
-TARGETTYPE     		EXE
+TARGET         	usbmsapp.exe
+TARGETTYPE     	EXE
+
+MACRO BUILD_OTG_USBMSAPP
 
 SOURCEPATH		../usbmsapp
 SOURCE 	       	usbmsapp.cpp
--- a/kerneltest/f32test/group/bld.inf	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/group/bld.inf	Tue Nov 02 15:29:23 2010 +0000
@@ -99,6 +99,7 @@
 t_misc      
 t_nmbs      
 t_notify    
+t_tfsys_notify support
 t_dspace        
 t_open      
 t_parse     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/group/t_tfsys_notify.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,40 @@
+// Copyright (c) 1997-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:
+// f32test/group/t_tfsys.mmp
+// 
+//
+
+TARGET			t_tfsys_notify.fsy
+TARGETTYPE		fsy
+
+SOURCEPATH	../testfsys
+SOURCE			t_tfsys_notify.cpp
+
+USERINCLUDE		../../../userlibandfileserver/fileserver/inc	    // assumes f32test and f32 components in same directory
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+LIBRARY			euser.lib efile.lib
+
+
+START WINS
+BASEADDRESS		0x61000000
+END
+
+
+UID		0x100039df 0x10000CEE
+VENDORID 0x70000001
+
+#include "../../../userlibandfileserver/fileserver/group/f32caps.mmh"  // Capabilities of File Server process
+
+SMPSAFE
--- a/kerneltest/f32test/server/t_filecache.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/server/t_filecache.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -591,7 +591,7 @@
 		test(fileCacheStats.iLockedSegmentCount >= maxLockedSegmentCount);
 		maxLockedSegmentCount = Max(maxLockedSegmentCount, fileCacheStats.iLockedSegmentCount);
 		// wrap to start of file
-		if (pos >= gFileCacheConfig.iCacheSize)	
+		if (pos >= gFileCacheConfig.iCacheSize || pos >= KBufSize)	
 			pos = 0;
 		}
 	timer.Close();
@@ -1017,14 +1017,11 @@
 	test_Value(r, r==KErrArgument);
 	//**********************************
 	// Test that continuously appending to a file yields the correct size...
-	// NB: Must have lock failure more ON in debug mode for this test to pass
+	// NB: Must have lock failure mode ON in debug mode for this test to pass
 	//**********************************
 	test.Next(_L("Test appending to a file & checking the file size..."));
 	gBufPtr.SetLength(KBufSize);
 
-	r = f.Replace(TheFs, testFile, EFileWrite | EFileWriteBuffered);
-	test_KErrNone(r);
-
 	const TInt KWriteLen = KSegmentSize+1;
 	writePtr.Set(gBuf->Des().Ptr(), KWriteLen);
 
@@ -1039,6 +1036,9 @@
 	TInt fileSize = 0;
 	for (TInt i=0; i<4; i++)
 		{
+		r = f.Replace(TheFs, testFile, EFileWrite | EFileWriteBuffered);
+		test_KErrNone(r);
+
 		fileSize = 0;
 		r = f.SetSize(fileSize);
 		test_KErrNone(r);
@@ -1080,6 +1080,13 @@
 #endif
 
 			}
+		// Close & delete the file after filling it - to ensure all pages are decomitted
+		// otherwise we may never again get a simulated lock failure
+		r = f.Flush();
+		test_KErrNone(r);
+		f.Close();
+		r = TheFs.Delete(testFile);
+		test_KErrNone(r);
 		}
 
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
--- a/kerneltest/f32test/server/t_main.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/server/t_main.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -665,12 +665,17 @@
 	TInt orgSessionCount;
 	r = controlIo(TheFs,theDrive, KControlIoSessionCount, orgSessionCount);
 	test_KErrNone(r);
-	test.Printf(_L("Session count start=%d\n"),orgSessionCount);
+	test.Printf(_L("Session count   start=%d\n"),orgSessionCount);
 
 	TInt orgObjectCount;
 	r = controlIo(TheFs,theDrive, KControlIoObjectCount, orgObjectCount);
 	test_KErrNone(r);
-	test.Printf(_L("Object count start=%d\n"),orgObjectCount);
+	test.Printf(_L("Object count    start=%d\n"),orgObjectCount);
+
+	TInt orgHeapCellCount;
+	r = controlIo(TheFs,theDrive, KControlIoHeapCellCount, orgHeapCellCount);
+	test_KErrNone(r);
+	test.Printf(_L("Heap cell count start=%d\n"),orgHeapCellCount);
 
 
 	TPckgBuf<TIOCacheValues> pkgOrgValues;
@@ -742,11 +747,11 @@
 
 		r = controlIo(TheFs,theDrive, KControlIoSessionCount, endSessionCount);
 		test_KErrNone(r);
-		test.Printf(_L("Session count end=%d\n"),endSessionCount);
+		test.Printf(_L("Session count   end=%d\n"),endSessionCount);
 
 		r = controlIo(TheFs,theDrive, KControlIoObjectCount, endObjectCount);
 		test_KErrNone(r);
-		test.Printf(_L("Object count end=%d\n"),endObjectCount);
+		test.Printf(_L("Object count    end=%d\n"),endObjectCount);
 
 		if (endSessionCount == orgSessionCount && endObjectCount == orgObjectCount)
 			break;
@@ -755,6 +760,11 @@
 		User::After(1000000);
 		}
 
+	TInt endHeapCellCount;
+	r = controlIo(TheFs,theDrive, KControlIoHeapCellCount, endHeapCellCount);
+	test_KErrNone(r);
+	test.Printf(_L("Heap cell count end=%d\n"),endHeapCellCount);
+
 	// some tests don't close their sessions, so this test won't work until 
 	// all the tests are fixed :
 //	test(endSessionCount == orgSessionCount);
--- a/kerneltest/f32test/server/t_notifier.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/server/t_notifier.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -23,6 +23,7 @@
 #include "t_server.h"
 #include "t_chlffs.h"
 #include "t_notify_plugin.h"
+#include "f32_test_utils.h"
 
 const TInt KNotificationHeaderSize = (sizeof(TUint16)*2)+(sizeof(TUint));
 const TInt KMinNotificationBufferSize = 2*KNotificationHeaderSize + 2*KMaxFileName;
@@ -31,6 +32,9 @@
 RTest test(_L("T_NOTIFIER"));
 const TInt KMaxHeapSize = 0x800000;
 TInt globalDriveNum;
+TBuf<50> filesystem; //storing original file system name
+_LIT(KTestNotifyFileSystemExeName,"t_tfsys_notify.fsy");
+_LIT(KNotifyTestFileSystem,"CNotifyTestFileSystem");
 
 void DismountPlugin()
 	{
@@ -38,6 +42,24 @@
 	TheFs.RemovePlugin(KNotifyPluginFileName);
 	}
 
+void RemountOriginalFileSystem()
+    {
+    //Replace old FS.
+    TheFs.DismountFileSystem(KNotifyTestFileSystem,globalDriveNum);
+    TheFs.MountFileSystem(filesystem,globalDriveNum);
+    TheFs.RemoveFileSystem(KNotifyTestFileSystem);
+    }
+
+inline void safe_external_test(RTest& aTest, TInt aError, TInt aLine, TText* aName)
+    {
+    if(aError!=KErrNone)
+        {
+        test.Printf(_L(": ERROR : %d received on line %d\n"),aError,aLine);
+        RemountOriginalFileSystem();
+        aTest.operator()(aError==KErrNone,aLine,(TText*)aName);
+        }
+    }
+
 inline void safe_test(RTest& aTest, TInt aError, TInt aLine, TText* aName)
 	{
 	if(aError!=KErrNone)
@@ -519,7 +541,7 @@
 	if(_path.Match(fullname)!=KErrNone)
 		safe_test(simpleTestWatcher,KErrBadName,__LINE__,(TText*)Expand("t_notifier.cpp"));
 	
-	/*
+	
 	TInt driveNumber = 0;
 	TInt gDriveNum = -1;
 	notification->DriveNumber(driveNumber);
@@ -528,11 +550,11 @@
 		safe_test(simpleTestWatcher,KErrBadHandle,__LINE__,(TText*)Expand("t_notifier.cpp"));
 	
 	TUid uid;
-	TUint32 realUID = 0x76543210;
+	TInt32 realUID = 0x76543210;
 	r = notification->UID(uid);
 	safe_test(simpleTestWatcher,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
-	safe_test(simpleTestWatcher,(realUID == uid.iUid)==1,__LINE__,(TText*)Expand("t_notifier.cpp"));
-	*/
+	safe_test(simpleTestWatcher,((realUID == uid.iUid)?KErrNone:KErrNotFound),__LINE__,(TText*)Expand("t_notifier.cpp"));
+	
 	delete notify;
 	fs.Close();
 	simpleTestWatcher.End();
@@ -3621,6 +3643,138 @@
 	return KErrNone;
 	}
 
+_LIT(KPhantomExtendedReplace,"?:\\PhantomExtended_Replaced.txt");
+_LIT(KPhantomExtendedRenamed,"?:\\PhantomExtended_Renamed.txt");
+_LIT(KPhantomExtendedRenameMe,"?:\\PhantomExtended_RenameMe.txt");
+
+TInt DoTestExternalNotificationL()
+    {
+    TRequestStatus statusN, statusT;
+    RTimer timer1;
+    TTimeIntervalMicroSeconds32 time = 10000000;    
+    
+    test.Printf(_L("DoTestExternalNotification"));
+    CFsNotify* notify = CFsNotify::NewL(TheFs,1024);
+    TInt r = notify->AddNotification(TFsNotification::ECreate, _L("?:\\"),_L("PhantomExtended_Replaced.txt"));
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = notify->RequestNotifications(statusN);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    
+    RFile file;
+    r = file.Replace(TheFs,_L("\\Extended_Replaced.txt"),EFileWrite);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    file.Close();    
+    
+    r = timer1.CreateLocal();
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    timer1.After(statusT,time);
+    User::WaitForRequest(statusN,statusT);
+    test_Compare(statusN.Int(),!=,KRequestPending)
+    timer1.Cancel();
+    timer1.Close();
+    User::WaitForRequest(statusT);
+    
+    const TFsNotification* notification = notify->NextNotification();
+    if(!notification)
+        safe_external_test(test,KErrUnderflow,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    
+    //Check Path
+    TPtrC path;
+    r = notification->Path(path);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    
+    if(path.Match(KPhantomExtendedReplace)==KErrNotFound)
+        {
+        safe_external_test(test,KErrNotFound,__LINE__,(TText*)Expand("t_notifier.cpp"));
+        }
+   
+    //Check NewName
+    TPtrC newName;
+    r = notification->NewName(newName);
+    safe_external_test(test,(r==KErrNotSupported) ? KErrNone : r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    
+    notify->CancelNotifications(statusN);
+    delete notify;
+    
+    //*************************************************************
+    // Rename:
+    //*************************************************************
+    
+    notify = CFsNotify::NewL(TheFs,1024);
+    r = notify->AddNotification(TFsNotification::ERename, _L("?:\\"),_L("PhantomExtended_Renamed.txt"));
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = notify->RequestNotifications(statusN);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+
+    r = file.Replace(TheFs,_L("\\Extended_RenameMe.txt"),EFileWrite);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    file.Close();    
+
+    r = timer1.CreateLocal();
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    timer1.After(statusT,time);
+    User::WaitForRequest(statusN,statusT);
+    test_Compare(statusN.Int(),!=,KRequestPending)
+    timer1.Cancel();
+    timer1.Close();
+    User::WaitForRequest(statusT);
+
+    notification = notify->NextNotification();
+    if(!notification)
+        safe_external_test(test,KErrUnderflow,__LINE__,(TText*)Expand("t_notifier.cpp"));
+
+    r = notification->Path(path);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+
+    if(path.Match(KPhantomExtendedRenameMe)==KErrNotFound)
+        {
+        safe_external_test(test,KErrNotFound,__LINE__,(TText*)Expand("t_notifier.cpp"));
+        }
+    
+    //Check NewName
+    r = notification->NewName(newName);
+    if(newName.Match(KPhantomExtendedRenamed)==KErrNotFound)
+        {
+        safe_external_test(test,KErrNotFound,__LINE__,(TText*)Expand("t_notifier.cpp"));
+        }
+
+    notify->CancelNotifications(statusN);
+    delete notify;
+        
+    return KErrNone;
+    }
+
+void TestExternalNotifications()
+    {
+    test.Printf(_L("Test External Notifications (Load test file system)"));
+
+    if(F32_Test_Utils::Is_SimulatedSystemDrive(TheFs,globalDriveNum))
+        {
+        test.Printf(_L("Not testing External Notifications on SimulatedSystemDrive"));
+        return;
+        }
+
+    TInt r = TheFs.FileSystemName(filesystem,globalDriveNum);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = TheFs.DismountFileSystem(filesystem,globalDriveNum);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = TheFs.AddFileSystem(KTestNotifyFileSystemExeName);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = TheFs.MountFileSystem(KNotifyTestFileSystem,globalDriveNum);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    
+    TRAP(r,DoTestExternalNotificationL());
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+        
+    //Replace old FS.
+    r = TheFs.DismountFileSystem(KNotifyTestFileSystem,globalDriveNum);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = TheFs.MountFileSystem(filesystem,globalDriveNum);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    r = TheFs.RemoveFileSystem(KNotifyTestFileSystem);
+    safe_external_test(test,r,__LINE__,(TText*)Expand("t_notifier.cpp"));
+    }
+
 /*
  * This test is testing the use cases
  * and for negative testing of SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
@@ -4515,6 +4669,10 @@
 	test_KErrNone(r);
 	test.Printf(_L("------- End of Data-Caging Tests -------------------------------------\n"));
 	
+	PrintLine();
+	test.Next(_L("Test TestExternalNotifications()"));
+	TestExternalNotifications();
+	test.Printf(_L("------- End of TestExternalNotifications Tests -------------------------------------\n"));
 	
 	test.End();
 	test.Close();
--- a/kerneltest/f32test/server/t_notify.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/server/t_notify.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -31,6 +31,8 @@
 const TInt KNotifyChangeAfter=100000;
 const TInt KMediaRemountForceMediaChange = 0x00000001;
 
+TInt gDriveNum = -1;
+
 RTest test(_L("T_NOTIFY"));
 RSemaphore gSleepThread;
 TInt gSocketNumber=0;
@@ -4233,7 +4235,212 @@
 
 }
 
-
+_LIT(KTestNotifyFileSystemExeName,"t_tfsys_notify.fsy");
+_LIT(KNotifyTestFileSystem,"CNotifyTestFileSystem");
+
+TInt TestExternalNotificationsWellformedness()
+    {
+    //Do Something to cause a notification:
+ 
+    //********************************************
+    //
+    // Opening(Replacing) \\Wellformed_functionWrite, 
+    //             will issue a create notification on file \PhantomFile_functionWrite.txt
+    TRequestStatus status1, status2;
+    TheFs.NotifyChange(ENotifyFile,status1,_L("\\PhantomFile_functionReplace.txt"));
+    RFile file;
+    TInt r = file.Replace(TheFs,_L("\\Wellformed_functionReplace.txt"),EFileWrite);
+    test_KErrNone(r);
+
+    
+    RTimer timer1;
+    r = timer1.CreateLocal();
+    test_KErrNone(r);
+    TTimeIntervalMicroSeconds32 time = 10000000;
+    timer1.After(status2,time);
+    User::WaitForRequest(status1,status2);
+    test_Compare(status1.Int(),!=,KRequestPending)
+    timer1.Cancel();
+    timer1.Close();
+    User::WaitForRequest(status2);
+    
+    //********************************************
+    //
+    // Rename \Wellformed_functionWrite.txt --> \Wellformed_functionRename.txt, 
+    // will issue a rename notification on  \PhantomFile_functionWrite.txt --> \PhantomFile_functionRename.txt
+    TheFs.NotifyChange(ENotifyEntry,status1,_L("\\PhantomFile_functionRename.txt"));
+    r = file.Rename(_L("\\Wellformed_functionWrite.txt"));
+    test_KErrNone(r);
+
+    r = timer1.CreateLocal();
+    test_KErrNone(r);
+    timer1.After(status2,time);
+    User::WaitForRequest(status1,status2);
+    test_Compare(status1.Int(),!=,KRequestPending);
+    timer1.Cancel();
+    timer1.Close();
+    User::WaitForRequest(status2);
+    file.Close();
+    
+    //********************************************
+    //
+    // SetAttributes
+    //
+    TheFs.NotifyChange(ENotifyAttributes,status1,_L("\\PhantomFile_functionAttributes.txt"));
+    r = file.Open(TheFs,_L("\\Wellformed_functionAttributes.txt"),EFileWrite);
+    test_KErrNone(r);
+    r = file.SetAtt(KEntryAttHidden,KEntryAttSystem);
+    test_KErrNone(r);
+    
+    {
+        r = timer1.CreateLocal();
+        test_KErrNone(r);
+        timer1.After(status2,time);
+        User::WaitForRequest(status1,status2);
+        test_Compare(status1.Int(),!=,KRequestPending);
+        timer1.Cancel();
+        timer1.Close();
+        User::WaitForRequest(status2);
+    }
+    file.Close();
+    
+    //********************************************
+    //
+    // File Write
+    // \\Wellformed_functionWrite.txt -> \\PhantomFile_functionWrite.txt
+    //
+    TheFs.NotifyChange(ENotifyWrite,status1,_L("\\PhantomFile_functionWrite.txt"));
+    r = file.Replace(TheFs,_L("\\Wellformed_functionWrite.txt"),EFileWrite);
+    test_KErrNone(r);
+    TBuf8<4> blah;
+    blah.Append(_L("Blah"));
+    r = file.Write(blah);
+    test_KErrNone(r);
+    {
+        r = timer1.CreateLocal();
+        test_KErrNone(r);
+        timer1.After(status2,time);
+        User::WaitForRequest(status1,status2);
+        test_Compare(status1.Int(),!=,KRequestPending);
+        timer1.Cancel();
+        timer1.Close();
+        User::WaitForRequest(status2);
+    }
+    
+    file.Close();
+    return KErrNone;
+    }
+
+TInt TestExternalNotificationsMalformed()
+    {
+
+    TRequestStatus status1, status2;
+    RTimer timer1;
+    TInt r = timer1.CreateLocal();
+    test_KErrNone(r);
+    TTimeIntervalMicroSeconds32 time = 5000000;
+    
+    //********************************************
+    //
+    // Don't set file size
+    //
+    TheFs.NotifyChange(ENotifyWrite,status1,_L("\\PhantomFileMalformed_functionWrite.txt"));
+    RFile file;
+    r = file.Open(TheFs,_L("\\Malformed_functionWrite.txt"),EFileWrite);
+    test_KErrNone(r);
+    r = file.Write(_L8("abcd"));
+    test_Value(KErrArgument,r);
+    {
+        r = timer1.CreateLocal();
+        test_KErrNone(r);
+        timer1.After(status2,time);
+        test.Printf(_L("Wait for timeout.."));
+        User::WaitForRequest(status1,status2);
+        test_Compare(status1.Int(),==,KRequestPending);
+        timer1.Cancel();
+        timer1.Close();
+        TheFs.NotifyChangeCancel(status1);
+        User::WaitForRequest(status1);
+    }
+    
+    //********************************************
+    //
+    // Set new name incorrectly
+    //
+     TheFs.NotifyChange(ENotifyFile,status1,_L("\\PhantomFileMalformed_functionRename.txt"));
+     r = file.Rename(_L("\\Malformed_functionRename.txt"));
+     test_Value(KErrArgument,r);
+     {
+         r = timer1.CreateLocal();
+         test_KErrNone(r);
+         timer1.After(status2,time);
+         test.Printf(_L("Wait for timeout.."));
+         User::WaitForRequest(status1,status2);
+         test_Compare(status1.Int(),==,KRequestPending)
+         timer1.Cancel();
+         timer1.Close();
+         TheFs.NotifyChangeCancel(status1);
+         User::WaitForRequest(status1);
+     }
+    
+    
+    file.Close();
+    return KErrNone;
+    }
+
+void TestExternalNotifications()
+    {
+    test.Printf(_L("Test External Notifications (Load test file system)"));
+    
+    if(F32_Test_Utils::Is_SimulatedSystemDrive(TheFs,gDriveNum))
+        {
+        test.Printf(_L("Not testing External Notifications on SimulatedSystemDrive"));
+        return;
+        }
+    
+    test.Printf(_L("Test External Notifications (get file system name)"));
+    TBuf<50> filesystem;
+    TInt r = TheFs.FileSystemName(filesystem,gDriveNum);
+    test_KErrNone(r);
+    test.Printf(_L("Test External Notifications (add new file system)"));
+    r = TheFs.AddFileSystem(KTestNotifyFileSystemExeName);
+    if(r != KErrNone && r!=KErrAlreadyExists)
+        {
+        test_KErrNone(r);
+        }
+    test.Printf(_L("Test External Notifications (dismount existing file system)"));
+    r = TheFs.DismountFileSystem(filesystem,gDriveNum);
+    test_KErrNone(r);
+    test.Printf(_L("Test External Notifications (mount new file system)"));
+    r = TheFs.MountFileSystem(KNotifyTestFileSystem,gDriveNum);
+    test_KErrNone(r);
+    
+    CHECK_NO_PENDING_REQUESTS;
+    
+    test.Printf(_L("Test External Notifications (Perform tests)"));
+    r = TestExternalNotificationsWellformedness();
+    test_KErrNone(r); 
+    
+    CHECK_NO_PENDING_REQUESTS;
+    
+// only test this in UREL
+// as in DEBUG it PANICS.
+#if !defined _DEBUG
+    test.Printf(_L("Test External Notifications (Perform malformed tests (UREL only))"));
+    r = TestExternalNotificationsMalformed();
+    test_KErrNone(r); 
+    CHECK_NO_PENDING_REQUESTS;
+#endif
+    
+    test.Printf(_L("Test External Notifications (Replace FS)"));
+    //Replace old FS.
+    r = TheFs.DismountFileSystem(KNotifyTestFileSystem,gDriveNum);
+    test_KErrNone(r);
+    r = TheFs.MountFileSystem(filesystem,gDriveNum);
+    test_KErrNone(r);
+    r = TheFs.RemoveFileSystem(KNotifyTestFileSystem);
+    test_KErrNone(r);
+    }
 
 //-----------------------------------------------------------------------
 
@@ -4242,7 +4449,9 @@
 //
 GLDEF_C void CallTestsL()
 	{
-
+    TInt nRes=TheFs.CharToDrive(gDriveToTest, gDriveNum);
+    test_KErrNone(nRes);
+            
 	CreateTestDirectory(_L("\\F32-TST\\NOTIFY\\"));
 
 //	Test RFs::NotifyChange()
@@ -4358,4 +4567,6 @@
 	CHECK_NO_PENDING_REQUESTS;
     TestRootDirNotifyChange();
 	CHECK_NO_PENDING_REQUESTS;
+    TestExternalNotifications();
+    CHECK_NO_PENDING_REQUESTS;
 	}
--- a/kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -40,7 +40,7 @@
 
 #include "cdisplay.h"
 #include "husbconsapp.h"
-#include "tmslog.h"
+#include "debug.h"
 
 
 _LIT(KTxtApp,"HOST USB CONSOLE APP");
@@ -48,59 +48,58 @@
 
 
 CHeartBeat* CHeartBeat::NewLC(CDisplay& aDisplay)
-	{
-	CHeartBeat* me = new(ELeave) CHeartBeat(aDisplay);
-	CleanupStack::PushL(me);
-	me->ConstructL();
-	return me;
-	}
+    {
+    CHeartBeat* me = new(ELeave) CHeartBeat(aDisplay);
+    CleanupStack::PushL(me);
+    me->ConstructL();
+    return me;
+    }
 
 
 CHeartBeat::CHeartBeat(CDisplay& aDisplay)
 :   CActive(0),
     iDisplay(aDisplay)
-	{}
+    {}
 
 
 void CHeartBeat::ConstructL()
-	{
-	CActiveScheduler::Add(this);
-	iTimer.CreateLocal();
-	RunL();
-	}
+    {
+    CActiveScheduler::Add(this);
+    iTimer.CreateLocal();
+    RunL();
+    }
 
 
 CHeartBeat::~CHeartBeat()
-	{
-	Cancel();
-	}
+    {
+    Cancel();
+    }
 
 
 void CHeartBeat::DoCancel()
-	{
+    {
     iTimer.Cancel();
-	}
+    }
 
 
 void CHeartBeat::RunL()
-	{
-	SetActive();
-	// Print RAM usage & up time
-	iUpTime++;
+    {
+    SetActive();
+    // Print RAM usage & up time
+    iUpTime++;
     iDisplay.UpTime(iUpTime);
 
-	TInt mem=0;
-	if (HAL::Get(HALData::EMemoryRAMFree, mem)==KErrNone)
-		{
+    TInt mem=0;
+    if (HAL::Get(HALData::EMemoryRAMFree, mem)==KErrNone)
+        {
         iDisplay.MemoryFree(mem);
-		}
-	iTimer.After(iStatus, 1000000);
-	}
+        }
+    iTimer.After(iStatus, 1000000);
+    }
 
 
 GLDEF_C void RunAppL()
     {
-    __MSFNSLOG
     CActiveScheduler* sched = new(ELeave) CActiveScheduler;
     CleanupStack::PushL(sched);
     CActiveScheduler::Install(sched);
@@ -114,11 +113,11 @@
     User::LeaveIfError(err);
 
     CConsoleBase* console;
-	console = Console::NewL(KTxtApp, TSize(KConsFullScreen,KConsFullScreen));
-	CleanupStack::PushL(console);
+    console = Console::NewL(KTxtApp, TSize(KConsFullScreen,KConsFullScreen));
+    CleanupStack::PushL(console);
 
     CDisplay* display = CDisplay::NewLC(fs, *console);
-	CMessageKeyProcessor::NewLC(*display, usbOtgSession);
+    CMessageKeyProcessor::NewLC(*display, usbOtgSession);
     CHeartBeat::NewLC(*display);
 
     display->Menu();
@@ -135,8 +134,8 @@
     // *************************************************************************
     CActiveScheduler::Start();
 
-	// 1 sec delay for sessions to stop
-	User::After(1000000);
+    // 1 sec delay for sessions to stop
+    User::After(1000000);
     CleanupStack::PopAndDestroy(usbHost);
     CleanupStack::PopAndDestroy();  // CPeriodUpdate
     CleanupStack::PopAndDestroy();  // CMessageKeyProcessor
@@ -149,12 +148,12 @@
 
 
 GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	TRAPD(error, RunAppL());
-	__ASSERT_ALWAYS(!error, User::Panic(KTxtApp, error));
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return 0;
-	}
+    {
+    __UHEAP_MARK;
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    TRAPD(error, RunAppL());
+    __ASSERT_ALWAYS(!error, User::Panic(KTxtApp, error));
+    delete cleanup;
+    __UHEAP_MARKEND;
+    return 0;
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -33,9 +33,6 @@
 SOURCE			cusbmsmountmanager.cpp
 SOURCE			rextfilesystem.cpp
 
-SOURCEPATH	../shared
-SOURCE			tmslog.cpp
-
 SOURCEPATH	.
 SOURCE 	       	husbconsapp.cpp
 SOURCE          cdisplay.cpp
--- a/kerneltest/f32test/shostmassstorage/msman/client/msmanclient.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/client/msmanclient.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -13,24 +13,21 @@
 // Description:
 //
 
-TARGET			msmanclient.dll
+TARGET                  msmanclient.dll
 
-TARGETTYPE		dll
+TARGETTYPE              dll
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE	.
-USERINCLUDE	../shared
-
-SOURCEPATH	.
-SOURCE	rusbhostsession.cpp
-SOURCE	rusbotgsession.cpp
+USERINCLUDE     .
+USERINCLUDE     ../shared
 
-SOURCEPATH	../shared
-SOURCE	tmslog.cpp
+SOURCEPATH      .
+SOURCE  rusbhostsession.cpp
+SOURCE  rusbotgsession.cpp
 
-LIBRARY		efsrv.lib euser.lib
+LIBRARY         efsrv.lib euser.lib
 
-// MACRO			_TESTAPP_DEBUG_PRINT_
+// MACRO                        _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
--- a/kerneltest/f32test/shostmassstorage/msman/client/rusbhostsession.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/client/rusbhostsession.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -26,13 +26,11 @@
 
 #include "msmanclientserver.h"
 #include "rusbhostsession.h"
-#include "tmslog.h"
 #include "debug.h"
 
 
 TVersion RUsbHostSession::Version() const
     {
-    __MSFNSLOG
     return(TVersion(KUsbHostSrvMajorVersionNumber,
                     KUsbHostSrvMinorVersionNumber,
                     KUsbHostSrvBuildVersionNumber));
@@ -41,14 +39,11 @@
 
 EXPORT_C RUsbHostSession::RUsbHostSession()
     {
-    __MSFNSLOG
     }
 
 
 EXPORT_C TInt RUsbHostSession::Connect()
     {
-    __MSFNSLOG
-
     TInt retry = 2;
     for (;;)
         {
@@ -73,8 +68,6 @@
 
 TInt RUsbHostSession::StartServer()
     {
-    __MSFNSLOG
-
     const TUidType serverUid(KNullUid, KNullUid, KUsbHostServerUid3);
 
     // Create the server process
@@ -96,7 +89,7 @@
         return status.Int();
         }
 
-	server.SetPriority(EPriorityHigh);
+    server.SetPriority(EPriorityHigh);
     server.Resume(); // start the server
 
     // Test whether the process has ended and if it has ended, return how it ended.
@@ -115,6 +108,6 @@
 
 
 EXPORT_C TInt RUsbHostSession::Start()
-	{
-	return SendReceive(EUsbHostStart);
-	}
+    {
+    return SendReceive(EUsbHostStart);
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/client/rusbotgsession.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/client/rusbotgsession.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -28,13 +28,11 @@
 
 #include "msmanclientserver.h"
 #include "rusbotgsession.h"
-#include "tmslog.h"
 #include "debug.h"
 
 
 TVersion RUsbOtgSession::Version() const
     {
-    __MSFNSLOG
     return(TVersion(KUsbOtgSrvMajorVersionNumber,
                     KUsbOtgSrvMinorVersionNumber,
                     KUsbOtgSrvBuildVersionNumber));
@@ -43,19 +41,15 @@
 
 EXPORT_C RUsbOtgSession::RUsbOtgSession()
     {
-    __MSFNSLOG
     }
 
 
 EXPORT_C RUsbOtgSession::RUsbOtgSession(TInt /* aParam */)
     {
-    __MSFNSLOG
     }
 
 EXPORT_C TInt RUsbOtgSession::Connect()
     {
-    __MSFNSLOG
-
     TInt retry = 2;
     for (;;)
         {
@@ -80,8 +74,6 @@
 
 TInt RUsbOtgSession::StartServer()
     {
-    __MSFNSLOG
-
     const TUidType serverUid(KNullUid, KNullUid, KUsbOtgServerUid3);
 
     // Create the server process
@@ -103,7 +95,7 @@
         return status.Int();
         }
 
-	server.SetPriority(EPriorityHigh);
+    server.SetPriority(EPriorityHigh);
     server.Resume(); // start the server
 
     // Test whether the process has ended and if it has ended, return how it ended.
@@ -122,7 +114,6 @@
 
 EXPORT_C TBool RUsbOtgSession::DeviceInserted()
     {
-    __MSFNSLOG
     TPckgBuf<TBool> pckg;
     TIpcArgs args(&pckg);
 
@@ -134,7 +125,6 @@
 
 EXPORT_C void RUsbOtgSession::NotifyChange(TBool& /* aChanged */, TRequestStatus& aStatus)
     {
-    __MSFNSLOG
     TPckgBuf<TBool> pckg;
     TIpcArgs args(&pckg);
 
@@ -144,13 +134,11 @@
 
 EXPORT_C TInt RUsbOtgSession::NotifyChangeCancel()
     {
-    __MSFNSLOG
     return SendReceive(EUsbOtgNotifyChangeCancel);
     }
 
 
 EXPORT_C TInt RUsbOtgSession::BusDrop()
-	{
-    __MSFNSLOG
-	return SendReceive(EUsbOtgBusDrop);
-	}
+    {
+    return SendReceive(EUsbOtgBusDrop);
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/server/cusbhostserver.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/server/cusbhostserver.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // Implements a Symbian OS server that exposes the RUsbMassStorage API
-// 
+//
 //
 
 
@@ -38,74 +38,63 @@
 #include "cusbhostserver.h"
 #include "cusbhostsession.h"
 
-#include "tmslog.h"
-
 CUsbHostServer* CUsbHostServer::NewLC()
-	{
-    __MSFNSLOG
-	CUsbHostServer* r = new (ELeave) CUsbHostServer();
-	CleanupStack::PushL(r);
+    {
+    CUsbHostServer* r = new (ELeave) CUsbHostServer();
+    CleanupStack::PushL(r);
     r->ConstructL();
-	return r;
-	}
+    return r;
+    }
 
 
 CUsbHostServer::CUsbHostServer()
 :   CServer2(EPriorityLow)
-	{
-    __MSFNSLOG
-	}
+    {
+    }
 
 
 void CUsbHostServer::ConstructL()
     {
-    __MSFNSLOG
     iUsbHost = CUsbHost::NewL();
-	StartL(KUsbHostServerName);
+    StartL(KUsbHostServerName);
     }
 
 
 CUsbHostServer::~CUsbHostServer()
-	{
-    __MSFNSLOG
+    {
     delete iUsbHost;
-	}
+    }
 
 
 CSession2* CUsbHostServer::NewSessionL(const TVersion &aVersion, const RMessage2& /*aMessage*/) const
-	{
-    __MSFNSLOG
-	TVersion v(KUsbHostSrvMajorVersionNumber, KUsbHostSrvMinorVersionNumber, KUsbHostSrvBuildVersionNumber);
+    {
+    TVersion v(KUsbHostSrvMajorVersionNumber, KUsbHostSrvMinorVersionNumber, KUsbHostSrvBuildVersionNumber);
 
-	if (!User::QueryVersionSupported(v, aVersion))
-		User::Leave(KErrNotSupported);
+    if (!User::QueryVersionSupported(v, aVersion))
+        User::Leave(KErrNotSupported);
 
-	CUsbHostSession* session = CUsbHostSession::NewL();
+    CUsbHostSession* session = CUsbHostSession::NewL();
 
-	return session;
-	}
+    return session;
+    }
 
 
 
 TInt CUsbHostServer::RunError(TInt aError)
-	{
-    __MSFNSLOG
-
-	Message().Complete(aError);
-	ReStart();
+    {
+    Message().Complete(aError);
+    ReStart();
     return KErrNone;
-	}
+    }
 
 
 void CUsbHostServer::AddSession()
     {
-    __MSFNSLOG
     ++iSessionCount;
     }
 
 void CUsbHostServer::RemoveSession()
     {
-    __MSFNSLOG
     if (--iSessionCount == 0)
         {
         User::After(1000000);
--- a/kerneltest/f32test/shostmassstorage/msman/server/cusbhostsession.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/server/cusbhostsession.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // Implements a Session of a Symbian OS server for the RUsbMassStorage API
-// 
+//
 //
 
 
@@ -25,7 +25,6 @@
 #include <e32cmn.h>
 #include <e32base.h>
 
-#include "tmslog.h"
 #include "msmanclientserver.h"
 
 #include <f32file.h>
@@ -42,71 +41,62 @@
 
 
 CUsbHostSession* CUsbHostSession::NewL()
-	{
-    __MSFNSLOG
-	CUsbHostSession* r = new (ELeave) CUsbHostSession();
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
-	}
+    {
+    CUsbHostSession* r = new (ELeave) CUsbHostSession();
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
+    }
 
 
 CUsbHostSession::CUsbHostSession()
-	{
-    __MSFNSLOG
-
-	}
+    {
+    }
 
 void CUsbHostSession::ConstructL()
-	{
-    __MSFNSLOG
- 	}
+    {
+    }
 
 
 void CUsbHostSession::CreateL()
-	{
-    __MSFNSLOG
+    {
     Server().AddSession();
-	}
+    }
 
 
 CUsbHostSession::~CUsbHostSession()
-	{
-    __MSFNSLOG
+    {
     Server().RemoveSession();
-	}
+    }
 
 
 void CUsbHostSession::ServiceL(const RMessage2& aMessage)
-	{
-    __MSFNSLOG
-	DispatchMessageL(aMessage);
-	}
+    {
+    DispatchMessageL(aMessage);
+    }
 
 
 void CUsbHostSession::DispatchMessageL(const RMessage2& aMessage)
-	{
-    __MSFNSLOG
-	TInt ret = KErrNone;
+    {
+    TInt ret = KErrNone;
 
-	switch (aMessage.Function())
-		{
-	case EUsbHostStart:
-		ret = Start(aMessage);
-		break;
-	default:
-		aMessage.Panic(KUsbHostClientPncCat, EUsbHostPanicIllegalIPC);
-		break;
-		}
+    switch (aMessage.Function())
+        {
+    case EUsbHostStart:
+        ret = Start(aMessage);
+        break;
+    default:
+        aMessage.Panic(KUsbHostClientPncCat, EUsbHostPanicIllegalIPC);
+        break;
+        }
 
-	aMessage.Complete(ret);
-	}
+    aMessage.Complete(ret);
+    }
 
 
 TInt CUsbHostSession::Start(const RMessage2& aMessage)
-	{
-    __MSFNSLOG
+    {
     Server().iUsbHost->Start();
-	return KErrNone;
-	}
+    return KErrNone;
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/server/cusbotgserver.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/server/cusbotgserver.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // Implements a Symbian OS server that exposes the RUsbMassStorage API
-// 
+//
 //
 
 
@@ -35,75 +35,63 @@
 #include "cusbotgserver.h"
 #include "cusbotgsession.h"
 
-#include "tmslog.h"
-
 CUsbOtgServer* CUsbOtgServer::NewLC()
-	{
-    __MSFNSLOG
-	CUsbOtgServer* r = new (ELeave) CUsbOtgServer();
-	CleanupStack::PushL(r);
+    {
+    CUsbOtgServer* r = new (ELeave) CUsbOtgServer();
+    CleanupStack::PushL(r);
     r->ConstructL();
-	return r;
-	}
+    return r;
+    }
 
 
 CUsbOtgServer::CUsbOtgServer()
 :   CServer2(EPriorityLow)
-	{
-    __MSFNSLOG
-	}
+    {
+    }
 
 
 void CUsbOtgServer::ConstructL()
     {
-    __MSFNSLOG
-
-	iUsbOtg = CUsbOtg::NewL();
-	StartL(KUsbOtgServerName);
+    iUsbOtg = CUsbOtg::NewL();
+    StartL(KUsbOtgServerName);
     }
 
 
 CUsbOtgServer::~CUsbOtgServer()
-	{
-    __MSFNSLOG
+    {
     delete iUsbOtg;
-	}
+    }
 
 
 CSession2* CUsbOtgServer::NewSessionL(const TVersion &aVersion, const RMessage2& /*aMessage*/) const
-	{
-    __MSFNSLOG
-	TVersion v(KUsbOtgSrvMajorVersionNumber, KUsbOtgSrvMinorVersionNumber, KUsbOtgSrvBuildVersionNumber);
+    {
+    TVersion v(KUsbOtgSrvMajorVersionNumber, KUsbOtgSrvMinorVersionNumber, KUsbOtgSrvBuildVersionNumber);
 
-	if (!User::QueryVersionSupported(v, aVersion))
-		User::Leave(KErrNotSupported);
+    if (!User::QueryVersionSupported(v, aVersion))
+        User::Leave(KErrNotSupported);
 
-	CUsbOtgSession* session = CUsbOtgSession::NewL();
+    CUsbOtgSession* session = CUsbOtgSession::NewL();
 
-	return session;
-	}
+    return session;
+    }
 
 
 
 TInt CUsbOtgServer::RunError(TInt aError)
-	{
-    __MSFNSLOG
-
-	Message().Complete(aError);
-	ReStart();
+    {
+    Message().Complete(aError);
+    ReStart();
     return KErrNone;
-	}
+    }
 
 
 void CUsbOtgServer::AddSession()
     {
-    __MSFNSLOG
     ++iSessionCount;
     }
 
 void CUsbOtgServer::RemoveSession()
     {
-    __MSFNSLOG
     if (--iSessionCount == 0)
         {
         User::After(1000000);
--- a/kerneltest/f32test/shostmassstorage/msman/server/cusbotgsession.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/server/cusbotgsession.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // Implements a Session of a Symbian OS server for the RUsbMassStorage API
-// 
+//
 //
 
 
@@ -25,7 +25,6 @@
 #include <e32cmn.h>
 #include <e32base.h>
 
-#include "tmslog.h"
 #include "msmanclientserver.h"
 
 #include <f32file.h>
@@ -40,56 +39,48 @@
 
 
 CUsbOtgSession* CUsbOtgSession::NewL()
-	{
-    __MSFNSLOG
-	CUsbOtgSession* r = new (ELeave) CUsbOtgSession();
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
-	}
+    {
+    CUsbOtgSession* r = new (ELeave) CUsbOtgSession();
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
+    }
 
 
 CUsbOtgSession::CUsbOtgSession()
-	{
-    __MSFNSLOG
-
-	}
+    {
+    }
 
 void CUsbOtgSession::ConstructL()
-	{
-    __MSFNSLOG
- 	}
+    {
+    }
 
 
 void CUsbOtgSession::CreateL()
-	{
-    __MSFNSLOG
+    {
     Server().AddSession();
-	}
+    }
 
 
 CUsbOtgSession::~CUsbOtgSession()
-	{
-    __MSFNSLOG
+    {
     Server().RemoveSession();
-	}
+    }
 
 
 void CUsbOtgSession::ServiceL(const RMessage2& aMessage)
-	{
-    __MSFNSLOG
-	DispatchMessageL(aMessage);
-	}
+    {
+    DispatchMessageL(aMessage);
+    }
 
 
 void CUsbOtgSession::DispatchMessageL(const RMessage2& aMessage)
-	{
-    __MSFNSLOG
-	TInt ret = KErrNone;
+    {
+    TInt ret = KErrNone;
 
-	switch (aMessage.Function())
-		{
+    switch (aMessage.Function())
+        {
     case EUsbOtgDeviceInserted:
         DeviceInsertedL(aMessage);
         break;
@@ -99,21 +90,20 @@
     case EUsbOtgNotifyChangeCancel:
         NotifyChangeCancel();
         break;
-	case EUsbOtgBusDrop:
-		ret = BusDrop();
-		break;
-	default:
-		aMessage.Panic(KUsbOtgClientPncCat, EUsbOtgPanicIllegalIPC);
-		break;
-		}
+    case EUsbOtgBusDrop:
+        ret = BusDrop();
+        break;
+    default:
+        aMessage.Panic(KUsbOtgClientPncCat, EUsbOtgPanicIllegalIPC);
+        break;
+        }
 
-	aMessage.Complete(ret);
-	}
+    aMessage.Complete(ret);
+    }
 
 
 void CUsbOtgSession::DeviceInsertedL(const RMessage2& aMessage)
     {
-    __MSFNSLOG
     TBool inserted = Server().iUsbOtg->DeviceInserted();
     TPckgBuf<TBool> p(inserted);
     aMessage.WriteL(0,p);
@@ -121,20 +111,17 @@
 
 void CUsbOtgSession::NotifyChange(const RMessage2& aMessage)
     {
-    __MSFNSLOG
     Server().iUsbOtg->NotifyChange(aMessage);
     }
 
 
 void CUsbOtgSession::NotifyChangeCancel()
     {
-    __MSFNSLOG
     Server().iUsbOtg->NotifyChangeCancel();
     }
 
 
 TInt CUsbOtgSession::BusDrop()
     {
-    __MSFNSLOG
     return Server().iUsbOtg->BusDrop();
-	}
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/server/usbhostserver.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/server/usbhostserver.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -13,42 +13,39 @@
 // Description:
 //
 
-TARGET			usbhostserver.exe
+TARGET                  usbhostserver.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE	.
-USERINCLUDE	../shared
-USERINCLUDE	../src
+USERINCLUDE     .
+USERINCLUDE     ../shared
+USERINCLUDE     ../src
 
-SOURCEPATH	.
-SOURCE			cusbhostsession.cpp
-SOURCE			cusbhostserver.cpp
-SOURCE			usbhostserver.cpp
+SOURCEPATH      .
+SOURCE                  cusbhostsession.cpp
+SOURCE                  cusbhostserver.cpp
+SOURCE                  usbhostserver.cpp
 
 SOURCEPATH ../src
-SOURCE			cusbhostao.cpp
-SOURCE			cusbhost.cpp
-SOURCE			cusbmsmountmanager.cpp
-SOURCE			rextfilesystem.cpp
+SOURCE                  cusbhostao.cpp
+SOURCE                  cusbhost.cpp
+SOURCE                  cusbmsmountmanager.cpp
+SOURCE                  rextfilesystem.cpp
 
-SOURCEPATH	../shared
-SOURCE			tmslog.cpp
+USERINCLUDE     .
+USERINCLUDE     ../shared
+USERINCLUDE     ../inc
 
-USERINCLUDE	.
-USERINCLUDE	../shared
-USERINCLUDE	../inc
-
-LIBRARY		efsrv.lib euser.lib usbdescriptors.lib usbdi_utils.lib usbhostmsclient.lib
+LIBRARY         efsrv.lib euser.lib usbdescriptors.lib usbdi_utils.lib usbhostmsclient.lib
 
 
-//MACRO		_TESTAPP_DEBUG_PRINT_
+//MACRO         _TESTAPP_DEBUG_PRINT_
 
 //CAPABILITY ALL
 CAPABILITY CommDD PowerMgmt DISKADMIN ALLFILES NetworkControl
 
 
-UID		0	0x10282b48
+UID             0       0x10282b48
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/server/usbotgserver.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/server/usbotgserver.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -13,51 +13,48 @@
 // Description:
 //
 
-TARGET			usbotgserver.exe
+TARGET                  usbotgserver.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE	.
-USERINCLUDE	../shared
-USERINCLUDE	../src
+USERINCLUDE     .
+USERINCLUDE     ../shared
+USERINCLUDE     ../src
 
-SOURCEPATH	.
-SOURCE			cusbotgsession.cpp
-SOURCE			cusbotgserver.cpp
-SOURCE			usbotgserver.cpp
+SOURCEPATH      .
+SOURCE                  cusbotgsession.cpp
+SOURCE                  cusbotgserver.cpp
+SOURCE                  usbotgserver.cpp
 
 SOURCEPATH ../src
-SOURCE			cusbhostao.cpp
-SOURCE			cusbhost.cpp
-SOURCE			cusbmsmountmanager.cpp
-SOURCE			rextfilesystem.cpp
+SOURCE                  cusbhostao.cpp
+SOURCE                  cusbhost.cpp
+SOURCE                  cusbmsmountmanager.cpp
+SOURCE                  rextfilesystem.cpp
 
-SOURCE			rusbmspublisher.cpp
-SOURCE			cusbotgwatcher.cpp
-SOURCE			cusbotg.cpp
+SOURCE                  rusbmspublisher.cpp
+SOURCE                  cusbotgwatcher.cpp
+SOURCE                  cusbotg.cpp
 
-SOURCEPATH	../shared
-SOURCE			tmslog.cpp
+USERINCLUDE             .
+USERINCLUDE             ../inc
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
 
-USERINCLUDE		.
-USERINCLUDE		../inc
-USERINCLUDE		../shared
-USERINCLUDE		../client
-
-LIBRARY		efsrv.lib 
-LIBRARY		euser.lib 
-LIBRARY		usbdescriptors.lib
-LIBRARY		usbdi_utils.lib 
-LIBRARY		usbhostmsclient.lib
+LIBRARY         efsrv.lib
+LIBRARY         euser.lib
+LIBRARY         usbdescriptors.lib
+LIBRARY         usbdi_utils.lib
+LIBRARY         usbhostmsclient.lib
 
 
-//MACRO		_TESTAPP_DEBUG_PRINT_
+//MACRO         _TESTAPP_DEBUG_PRINT_
 
 //CAPABILITY ALL
 CAPABILITY CommDD PowerMgmt DISKADMIN ALLFILES NetworkControl
 
 
-UID		0	0x101fe1db
+UID             0       0x101fe1db
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/shared/debug.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/shared/debug.h	Tue Nov 02 15:29:23 2010 +0000
@@ -88,7 +88,21 @@
 #define __USBHOSTPRINT5(t,a,b,c,d,e)
 #endif
 
+#if defined(_USBMS_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
+#define __PRINT(t) {RDebug::Print(t);}
+#define __PRINT1(t,a) {RDebug::Print(t,a);}
+#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
+#define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
+#define __PRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
 
 
+#else
+#define __PRINT(t)
+#define __PRINT1(t,a)
+#define __PRINT2(t,a,b)
+#define __PRINT3(t,a,b,c)
+#define __PRINT4(t,a,b,c,d)
+
+#endif
 
 #endif // DEBUG_H
--- a/kerneltest/f32test/shostmassstorage/msman/shared/tmslog.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-// Copyright (c) 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:
-//
-
-#include "tmslog.h"
-
-#ifdef TRACE_ENABLED
-
-_LIT8(KMsgSIn, ">>\t%S\r\n");
-_LIT8(KMsgSOut,"<<\t%S\r\n");
-_LIT8(KMsgIn, ">>[0x%08x]\t%S\r\n");
-_LIT8(KMsgOut,"<<[0x%08x]\t%S\r\n");
-
-
-TMsLogStaticFn::TMsLogStaticFn(const TDesC8& aFunctionName)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KMsgSIn, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogStaticFn::~TMsLogStaticFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KMsgSOut, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogFn::TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer)
-:   iThisPointer(aThisPointer)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KMsgIn, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogFn::~TMsLogFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KMsgOut, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-#endif
--- a/kerneltest/f32test/shostmassstorage/msman/shared/tmslog.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
-* Copyright (c) 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:
-* @file tmslog.h
-* 
-*
-*/
-
-
-
-
-
-
-#ifndef TMSLOG_H
-#define TMSLOG_H
-
-//#define _TESTAPP_DEBUG_PRINT_
-
-#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#include <e32debug.h>
-#endif
-
-#if defined(_TESTAPP_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define TRACE_ENABLED
-#endif
-
-#ifdef TRACE_ENABLED
-
-class TMsLogStaticFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-
-    TMsLogStaticFn(const TDesC8& aFunctionName);
-
-	~TMsLogStaticFn();
-
-protected:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-    };
-
-
-
-
-class TMsLogFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-	TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer);
-
-	~TMsLogFn();
-
-private:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-	void* iThisPointer;
-    };
-
-
-
-
-#define __MSFNLOG TMsLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this);
-#define __MSFNSLOG TMsLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__));
-#else
-#define __MSFNSLOG
-#define __MSFNLOG
-#endif
-
-
-
-#ifdef TRACE_ENABLED
-#define __PRINT(t) {RDebug::Print(t);}
-#define __PRINT1(t,a) {RDebug::Print(t,a);}
-#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
-#define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-#else
-#define __PRINT(t)
-#define __PRINT1(t,a)
-#define __PRINT2(t,a,b)
-#define __PRINT3(t,a,b,c)
-
-#endif
-
-
-#endif // TMSLOG_H
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbhost.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbhost.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -29,7 +29,6 @@
 #include "mdrivedisplay.h"
 #include "cusbhostao.h"
 #include "cusbhost.h"
-#include "tmslog.h"
 #include "debug.h"
 
 
@@ -40,21 +39,19 @@
 
 CUsbHost* CUsbHost::NewL()
     {
-    __MSFNSLOG
-	CUsbHost* r = new (ELeave) CUsbHost();
-	CleanupStack::PushL(r);
+    CUsbHost* r = new (ELeave) CUsbHost();
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CUsbHost::ConstructL()
     {
-    __MSFNLOG
     OpenHubL();
-	LoadFileSystemL();
+    LoadFileSystemL();
 
     iUsbHostAo = CUsbHostAo::NewL(iHubDriver, iEvent, *this);
 
@@ -64,13 +61,11 @@
 
 CUsbHost::CUsbHost()
     {
-    __MSFNLOG
     }
 
 
 CUsbHost::~CUsbHost()
     {
-    __MSFNLOG
     delete iUsbHostAo;
 
     DismountAllFileSystemsL();
@@ -83,11 +78,10 @@
 
 void CUsbHost::LoadFileSystemL()
     {
-    __MSFNLOG
     RFs fs;
     User::LeaveIfError(fs.Connect());
     CleanupClosePushL(fs);
-	_LIT(KFsNm, "elocal");
+    _LIT(KFsNm, "elocal");
 
     TInt err;
     err = fs.AddFileSystem(KFsNm);
@@ -108,7 +102,6 @@
 
 void CUsbHost::OpenHubL()
     {
-    __MSFNLOG
     TInt err;
     err = User::LoadLogicalDevice(KHubDriverLddFileName);
     if (err != KErrAlreadyExists)
@@ -125,24 +118,22 @@
 
 void CUsbHost::CloseHubL()
     {
-    __MSFNLOG
-	iHubDriver.StopHost();
-	iHubDriver.Close();
+    iHubDriver.StopHost();
+    iHubDriver.Close();
+
+    TInt err1 = User::FreeLogicalDevice(KUsbdiLddFileName);
+    __ASSERT_DEBUG(err1==KErrNone, User::Panic(KUsbdiLddFileName, err1));
 
-	TInt err1 = User::FreeLogicalDevice(KUsbdiLddFileName);
-	__ASSERT_DEBUG(err1==KErrNone, User::Panic(KUsbdiLddFileName, err1));
+    TInt err2 = User::FreeLogicalDevice(KHubDriverLddFileName);
+    __ASSERT_DEBUG(err2==KErrNone, User::Panic(KHubDriverLddFileName, err2));
 
-	TInt err2 = User::FreeLogicalDevice(KHubDriverLddFileName);
-	__ASSERT_DEBUG(err2==KErrNone, User::Panic(KHubDriverLddFileName, err2));
-
-	User::LeaveIfError(err1);
-	User::LeaveIfError(err2);
+    User::LeaveIfError(err1);
+    User::LeaveIfError(err2);
     }
 
 
 TToken CUsbHost::OpenDeviceL()
     {
-    __MSFNLOG
     CDevice* device = CDevice::NewL();
 
     TToken token = 0;
@@ -159,7 +150,6 @@
 
 void CUsbHost::CloseDeviceL()
     {
-    __MSFNLOG
     CDevice* device = iMountManager->RemoveDeviceL(iDeviceHandle);
     device->CloseDeviceL();
     delete device;
@@ -168,43 +158,36 @@
 
 void CUsbHost::CloseAllDevicesL()
     {
-    __MSFNLOG
     iMountManager->CloseAllDevicesL();
     }
 
 
 void CUsbHost::MountDeviceL()
     {
-    __MSFNLOG
     iMountManager->MountDeviceL(iDeviceHandle);
     }
 
 
 void CUsbHost::DismountDeviceL()
     {
-    __MSFNLOG
     iMountManager->DismountDeviceL(iDeviceHandle);
     }
 
 
 void CUsbHost::DismountAllFileSystemsL()
     {
-    __MSFNLOG
     iMountManager->DismountL();
     }
 
 
 void CUsbHost::Start()
     {
-    __MSFNLOG
     iUsbHostAo->Wait();
     }
 
 
 void CUsbHost::ProcessBusEventL()
     {
-    __MSFNLOG
-
     __USBHOSTPRINT2(_L(">> CUsbHost RUsbHubDriver Event[%d] Device Handle = %d"),
                     iEvent.iEventType, iEvent.iDeviceHandle);
     __USBHOSTPRINT2(_L("Error = %d reason = %x"),
@@ -218,12 +201,12 @@
         /* Jungo stack has attached the device */
         TUint32 token = OpenDeviceL();
         MountDeviceL();
-	    __USBHOSTPRINT(_L("CUsbHost: device attached"));
+        __USBHOSTPRINT(_L("CUsbHost: device attached"));
         }
     else if (event == RUsbHubDriver::TBusEvent::EDeviceRemoved)
         {
-		TRAPD(err, DismountDeviceL());
-	    CloseDeviceL();
+        TRAPD(err, DismountDeviceL());
+        CloseDeviceL();
         User::LeaveIfError(err);
         __USBHOSTPRINT(_L("CUsbHost: device removed"));
         }
@@ -237,7 +220,6 @@
 
 RUsbHubDriver::TBusEvent::TEvent CUsbHost::WaitForBusEvent()
     {
-    __MSFNLOG
     TRequestStatus status;
     RUsbHubDriver::TBusEvent event;
     TBool eventReceived = EFalse;
@@ -281,14 +263,12 @@
 
 void CUsbHost::DriveMap(TDriveMap& aDriveMap) const
     {
-    __MSFNSLOG
     iMountManager->DriveMap(aDriveMap);
     }
 
 
 void CUsbHost::DeviceMap(TInt aDeviceIndex, TDeviceMap& aDeviceMap) const
     {
-    __MSFNSLOG
     iMountManager->DeviceMap(aDeviceIndex, aDeviceMap);
     }
 
@@ -301,18 +281,16 @@
 
 CUsbHostDisp* CUsbHostDisp::NewL(MDriveDisplay& aDriveDisplay)
     {
-    __MSFNSLOG
-	CUsbHostDisp* r = new (ELeave) CUsbHostDisp(aDriveDisplay);
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    CUsbHostDisp* r = new (ELeave) CUsbHostDisp(aDriveDisplay);
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CUsbHostDisp::ConstructL()
     {
-    __MSFNLOG
     CUsbHost::ConstructL();
     }
 
@@ -321,13 +299,11 @@
 :   CUsbHost(),
     iDriveDisplay(aDriveDisplay)
     {
-    __MSFNLOG
     }
 
 
 CUsbHostDisp::~CUsbHostDisp()
     {
-    __MSFNLOG
     }
 
 void CUsbHostDisp::ProcessBusEventL()
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbhostao.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbhostao.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -23,7 +23,6 @@
 #include "cusbmsmountmanager.h"
 //#include "cusbhost.h"
 #include "cusbhostao.h"
-#include "tmslog.h"
 #include "debug.h"
 
 
@@ -33,16 +32,14 @@
                              RUsbHubDriver::TBusEvent& aEvent,
                              MUsbHostBusEventObserver& aObserver)
     {
-    __MSFNSLOG
     CUsbHostAo* r = new (ELeave) CUsbHostAo(aHubDriver, aEvent, aObserver);
-	r->ConstructL();
-	return r;
+    r->ConstructL();
+    return r;
     }
 
 
 void CUsbHostAo::ConstructL()
     {
-    __MSFNLOG
     }
 
 
@@ -54,78 +51,72 @@
     iEvent(aEvent),
     iObserver(aObserver)
     {
-    __MSFNLOG
     CActiveScheduler::Add(this);
     }
 
 
 CUsbHostAo::~CUsbHostAo()
     {
-    __MSFNLOG
-	Cancel();
+    Cancel();
 
     }
 
 
 void CUsbHostAo::Wait()
     {
-    __MSFNLOG
-	if (IsActive())
-		{
-		__ASSERT_ALWAYS(EFalse, User::Panic(KTxtApp, -1));
-		return;
-		}
+    if (IsActive())
+        {
+        __ASSERT_ALWAYS(EFalse, User::Panic(KTxtApp, -1));
+        return;
+        }
 
     __USBHOSTPRINT(_L("WaitForBusEvent..."));
-	iHubDriver.WaitForBusEvent(iEvent, iStatus);
+    iHubDriver.WaitForBusEvent(iEvent, iStatus);
     __USBHOSTPRINT2(_L("WaitForBusEvent done. Event=%d Status=%d"),
                     iEvent.iEventType, iStatus.Int());
-	SetActive();
+    SetActive();
     }
 
 
 void CUsbHostAo::DoCancel()
-	{
-    __MSFNLOG
+    {
     iHubDriver.CancelWaitForBusEvent();
-	}
+    }
 
 
 void CUsbHostAo::RunL()
-	{
-    __MSFNLOG
+    {
 
     TInt status = iStatus.Int();
-	if (status == KErrNotReady)
-		{
+    if (status == KErrNotReady)
+        {
         const TInt KDelay = 500 * 1000;  // in uSecs
         User::After(KDelay);
         Wait();
-		return;
-		}
+        return;
+        }
 
     // Let RunError handle any other error
     User::LeaveIfError(status);
 
     // Process bus event
     TRAP(status, iObserver.ProcessBusEventL());
-	if(status != KErrNone)
-		{
+    if(status != KErrNone)
+        {
         Wait();
-		return;
-		}
+        return;
+        }
 
     Wait();
-	}
+    }
 
 _LIT(KErrLog, "ERROR %d in CActiveUsbHost");
 
 TInt CUsbHostAo::RunError(TInt aError)
-	{
-	__MSFNLOG
-	RDebug::Print(KErrLog, aError);
-	return KErrNone;
-	}
+    {
+    RDebug::Print(KErrLog, aError);
+    return KErrNone;
+    }
 
 
 
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbmsmountmanager.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbmsmountmanager.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -27,44 +27,38 @@
 #include "rextfilesystem.h"
 #include "usbtypes.h"
 #include "cusbmsmountmanager.h"
-#include "tmslog.h"
 #include "debug.h"
 
 
 CDevice* CDevice::NewL()
     {
-    __MSFNSLOG
-	CDevice* r = new (ELeave) CDevice();
-	CleanupStack::PushL(r);
+    CDevice* r = new (ELeave) CDevice();
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CDevice::ConstructL()
     {
-    __MSFNLOG
     }
 
 
 CDevice::CDevice()
     {
-    __MSFNLOG
     }
 
 
 CDevice::~CDevice()
     {
-    __MSFNLOG
     __USBHOSTPRINT1(_L("~CDevice Token=%d"), iDeviceToken);
     }
 
 
 TToken CDevice::OpenDeviceL(TUint aDeviceHandle, RUsbHubDriver& aHub)
     {
-    __MSFNLOG
     __USBHOSTPRINT1(_L("CDevice::OpenDeviceL Handle=%d"), aDeviceHandle);
 
     TInt err = iUsbDevice.Open(aHub, aDeviceHandle);
@@ -106,32 +100,32 @@
         User::Leave(KErrGeneral);
         }
 
-	TUint8 iProtocolId = ifDescriptor.InterfaceSubClass();
-	TUint8 iTransportId = ifDescriptor.InterfaceProtocol();
+    TUint8 iProtocolId = ifDescriptor.InterfaceSubClass();
+    TUint8 iTransportId = ifDescriptor.InterfaceProtocol();
 
     interface_ep0.Close();
 
     THostMassStorageConfig msConfig;
     msConfig.iInterfaceToken = token;
-	msConfig.iProtocolId =iProtocolId;
-	msConfig.iTransportId = iTransportId;
-	msConfig.iStatusPollingInterval = 10; // 10 secs
+    msConfig.iProtocolId =iProtocolId;
+    msConfig.iTransportId = iTransportId;
+    msConfig.iStatusPollingInterval = 10; // 10 secs
 
     TUint32 numLun;
 
     TRequestStatus status;
     iUsbHostMsDevice.Add(msConfig, status);
-	User::WaitForRequest(status);
-	if (status.Int() != KErrNone)
+    User::WaitForRequest(status);
+    if (status.Int() != KErrNone)
         {
-		__USBHOSTPRINT(_L("Add device failed"));
-		User::Leave(status.Int());
+        __USBHOSTPRINT(_L("Add device failed"));
+        User::Leave(status.Int());
         }
-	TInt r = iUsbHostMsDevice.GetNumLun(numLun);
-	if (r != KErrNone)
+    TInt r = iUsbHostMsDevice.GetNumLun(numLun);
+    if (r != KErrNone)
         {
-		__USBHOSTPRINT(_L("GetNumLun failed"));
-		User::Leave(r);
+        __USBHOSTPRINT(_L("GetNumLun failed"));
+        User::Leave(r);
         }
 
     if (numLun > KMaxLun)
@@ -151,8 +145,6 @@
 
 void CDevice::CloseDeviceL()
     {
-    __MSFNLOG
-
     THostMassStorageConfig msConfig;
     msConfig.iInterfaceToken = iDeviceToken;
 
@@ -163,7 +155,6 @@
 
 void CDevice::MountLogicalUnitsL()
     {
-    __MSFNLOG
     iExt.OpenL();
 
     for (TInt lun = 0; lun < iNumLuns; lun++)
@@ -184,7 +175,6 @@
 
 void CDevice::DismountLogicalUnitsL()
     {
-    __MSFNLOG
     for (TInt lun = 0; lun < iLuList.Count(); lun++)
         {
         TDriveNumber driveNumber = iLuList[lun];
@@ -201,83 +191,79 @@
                                  TUint8 aTransferType,
                                  TUint8 aDirection,
                                  TInt& aEndpointAddress) const
-	{
-    __MSFNSLOG
+    {
+    // Get the interface descriptor
+    RDebug::Print(_L("GetEndpointAddress : Getting the interface descriptor for this alternate setting"));
 
-	// Get the interface descriptor
-	RDebug::Print(_L("GetEndpointAddress : Getting the interface descriptor for this alternate setting"));
-
-	TUsbInterfaceDescriptor alternateInterfaceDescriptor;
-	TInt err = aUsbInterface.GetAlternateInterfaceDescriptor(aInterfaceSetting, alternateInterfaceDescriptor);
+    TUsbInterfaceDescriptor alternateInterfaceDescriptor;
+    TInt err = aUsbInterface.GetAlternateInterfaceDescriptor(aInterfaceSetting, alternateInterfaceDescriptor);
 
-	if (err)
-		{
-		RDebug::Print(_L("GetEndpointAddress : <Error %d> Unable to get alternate interface (%d) descriptor"),err,aInterfaceSetting);
-		return err;
-		}
+    if (err)
+        {
+        RDebug::Print(_L("GetEndpointAddress : <Error %d> Unable to get alternate interface (%d) descriptor"),err,aInterfaceSetting);
+        return err;
+        }
+
+    // Parse the descriptor tree from the interface
+    RDebug::Print(_L("Search the child descriptors for matching endpoint attributes"));
 
-	// Parse the descriptor tree from the interface
-	RDebug::Print(_L("Search the child descriptors for matching endpoint attributes"));
+    TUsbGenericDescriptor* descriptor = alternateInterfaceDescriptor.iFirstChild;
 
-	TUsbGenericDescriptor* descriptor = alternateInterfaceDescriptor.iFirstChild;
+    while (descriptor)
+        {
+        RDebug::Print(_L("GetEndpointAddress : Check descriptor type for endpoint"));
 
-	while (descriptor)
-		{
-		RDebug::Print(_L("GetEndpointAddress : Check descriptor type for endpoint"));
+        // Cast the descriptor to an endpoint descriptor
+        TUsbEndpointDescriptor* endpoint = TUsbEndpointDescriptor::Cast(descriptor);
 
-		// Cast the descriptor to an endpoint descriptor
-		TUsbEndpointDescriptor* endpoint = TUsbEndpointDescriptor::Cast(descriptor);
+        if (endpoint)
+            {
+            RDebug::Print(_L("GetEndpointAddress : Match attributes for transfer type"));
 
-		if (endpoint)
-			{
-			RDebug::Print(_L("GetEndpointAddress : Match attributes for transfer type"));
-
-			if ( (endpoint->Attributes() & aTransferType) == aTransferType)
-				{
-				RDebug::Print(_L("GetEndpointAddress : Match attributes for endpoint direction"));
+            if ( (endpoint->Attributes() & aTransferType) == aTransferType)
+                {
+                RDebug::Print(_L("GetEndpointAddress : Match attributes for endpoint direction"));
 
-				if ( (endpoint->EndpointAddress() & 0x80) == aDirection)
-					{
-					aEndpointAddress = endpoint->EndpointAddress();
-					RDebug::Print(_L("GetEndpointAddress : Endpoint address found"));
-					return KErrNone;
-					}
-				}
-			}
+                if ( (endpoint->EndpointAddress() & 0x80) == aDirection)
+                    {
+                    aEndpointAddress = endpoint->EndpointAddress();
+                    RDebug::Print(_L("GetEndpointAddress : Endpoint address found"));
+                    return KErrNone;
+                    }
+                }
+            }
 
-		descriptor = descriptor->iNextPeer;
-		}
+        descriptor = descriptor->iNextPeer;
+        }
 
-	// Unable to find the endpoint address
-	RDebug::Print(_L("GetEndpointAddress : Unable to find endpoint address matching the specified attributes"));
+    // Unable to find the endpoint address
+    RDebug::Print(_L("GetEndpointAddress : Unable to find endpoint address matching the specified attributes"));
 
-	return KErrNotFound;
-	}
+    return KErrNotFound;
+    }
 
 
 TBool CDevice::IsDeviceMassStorage(const TUsbInterfaceDescriptor& aInterfaceDesc,
                                    const TUsbDeviceDescriptor& aDeviceDesc) const
     {
-    __MSFNSLOG
-	/* check the interface descriptor */
-	if(aInterfaceDesc.InterfaceClass() == 0x08 &&
-		aInterfaceDesc.InterfaceSubClass() == 0x06 &&
-		aInterfaceDesc.InterfaceProtocol() == 0x50)
+    /* check the interface descriptor */
+    if(aInterfaceDesc.InterfaceClass() == 0x08 &&
+        aInterfaceDesc.InterfaceSubClass() == 0x06 &&
+        aInterfaceDesc.InterfaceProtocol() == 0x50)
         {
-		if(aDeviceDesc.DeviceClass() == 0x00 &&
-			aDeviceDesc.DeviceSubClass() == 0x00 &&
-			aDeviceDesc.DeviceProtocol() == 0x00)
-			return ETrue;
+        if(aDeviceDesc.DeviceClass() == 0x00 &&
+            aDeviceDesc.DeviceSubClass() == 0x00 &&
+            aDeviceDesc.DeviceProtocol() == 0x00)
+            return ETrue;
         }
 
-	return EFalse;
+    return EFalse;
 
     }
 
 
 TLun CDevice::DriveMap(TDriveMap& aDriveMap) const
     {
-    __MSFNSLOG
     TDriveNumber driveNumber;
     RDebug::Printf("LuList.Count=%d", iLuList.Count());
     for (TInt i = 0; i < iLuList.Count(); i++)
@@ -293,7 +279,6 @@
 
 TLun CDevice::DeviceMap(TDeviceMap& aDeviceMap) const
     {
-    __MSFNSLOG
     TDriveNumber driveNumber;
     RDebug::Printf("LuList.Count=%d", iLuList.Count());
     for (TInt i = 0; i < iLuList.Count(); i++)
@@ -309,31 +294,27 @@
 
 CUsbMsMountManager* CUsbMsMountManager::NewL()
     {
-    __MSFNSLOG
-	CUsbMsMountManager* r = new (ELeave) CUsbMsMountManager();
-	CleanupStack::PushL(r);
+    CUsbMsMountManager* r = new (ELeave) CUsbMsMountManager();
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CUsbMsMountManager::ConstructL()
     {
-    __MSFNLOG
     }
 
 
 CUsbMsMountManager::CUsbMsMountManager()
     {
-    __MSFNLOG
     }
 
 
 CUsbMsMountManager::~CUsbMsMountManager()
     {
-    __MSFNLOG
     iDeviceList.ResetAndDestroy();
     }
 
@@ -341,23 +322,20 @@
 // adds new entry for this device
 void CUsbMsMountManager::AddDeviceL(CDevice* aDevice)
     {
-    __MSFNLOG
     iDeviceList.Append(aDevice);
     }
 
 
 CDevice* CUsbMsMountManager::RemoveDeviceL(TUint aDeviceHandle)
     {
-    __MSFNLOG
-	TInt index = GetHandleIndexL(aDeviceHandle);
-	CDevice* device = iDeviceList[index];
+    TInt index = GetHandleIndexL(aDeviceHandle);
+    CDevice* device = iDeviceList[index];
     iDeviceList.Remove(index);
     return device;
     }
 
 void CUsbMsMountManager::CloseAllDevicesL()
     {
-    __MSFNLOG
     for (TInt i = 0; i < iDeviceList.Count(); i++)
         {
         iDeviceList[i]->CloseDeviceL();
@@ -367,7 +345,6 @@
 
 TInt CUsbMsMountManager::GetDeviceIndexL(TToken aDeviceToken) const
     {
-    __MSFNSLOG
     TInt index;
     for (index = 0; index < iDeviceList.Count(); index++)
         {
@@ -388,7 +365,6 @@
 
 TInt CUsbMsMountManager::GetHandleIndexL(TUint aDeviceHandle) const
     {
-    __MSFNSLOG
     TInt index;
     for (index = 0; index < iDeviceList.Count(); index++)
         {
@@ -411,7 +387,6 @@
 // mounts all LUNs for the device
 void CUsbMsMountManager::MountDeviceL(TUint aDeviceHandle)
     {
-    __MSFNLOG
     TInt index = GetHandleIndexL(aDeviceHandle);
     iDeviceList[index]->MountLogicalUnitsL();
     }
@@ -421,7 +396,6 @@
 // dismount all LUNs for this device
 void CUsbMsMountManager::DismountDeviceL(TUint aDeviceHandle)
     {
-    __MSFNLOG
     TInt index = GetHandleIndexL(aDeviceHandle);
     iDeviceList[index]->DismountLogicalUnitsL();
     }
@@ -430,7 +404,6 @@
 // dismount all LUNs
 void CUsbMsMountManager::DismountL()
     {
-    __MSFNLOG
     for (TInt i = 0; i < iDeviceList.Count(); i++)
         {
         iDeviceList[i]->DismountLogicalUnitsL();
@@ -440,7 +413,6 @@
 
 void CUsbMsMountManager::DriveMap(TDriveMap& aDriveMap) const
     {
-    __MSFNSLOG
     TInt maxLun = 0;
     RDebug::Printf("DeviceList.Count=%d", iDeviceList.Count());
     for (TInt i = 0; i < iDeviceList.Count(); i++)
@@ -453,7 +425,6 @@
 
 void CUsbMsMountManager::DeviceMap(TInt aDeviceIndex, TDeviceMap& aDeviceMap) const
     {
-    __MSFNSLOG
     RDebug::Printf("Device=%d", aDeviceIndex);
 
     __ASSERT_DEBUG(aDeviceIndex < iDeviceList.Count(), User::Invariant());
@@ -468,215 +439,215 @@
     }
 
 void TUsbPrint::PrintTree(const TUsbGenericDescriptor& aDesc, TInt aDepth)
-	{
+    {
     if (!iDebug)
         {
         return;
         }
 
-	TBuf<20> buf;
-	for(TInt depth=aDepth;depth>=0;--depth)
-		{
-		buf.Append(_L("  "));
-		}
-	if(aDesc.iRecognisedAndParsed == TUsbGenericDescriptor::ERecognised)
-		{
-		RDebug::Print(_L("%S+0x%08x - %d 0x%02x"), &buf, &aDesc, aDesc.ibLength, aDesc.ibDescriptorType);
-		}
-	else
-		{
-		RDebug::Print(_L("%S-0x%08x - %d 0x%02x"), &buf, &aDesc, aDesc.ibLength, aDesc.ibDescriptorType);
-		}
-	HBufC* blob = HBufC::New(5*aDesc.iBlob.Length()); // 5* for " 0x" + 2*bytes for hex representation
-	if(blob)
-		{
-		for(TInt i=0;i<aDesc.iBlob.Length();++i)
-			{
-			blob->Des().AppendFormat(_L("0x%02x "), aDesc.iBlob[i]);
-			}
-		RDebug::Print(_L("%S >%S"), &buf, blob);
-		delete blob;
-		}
-	if(aDesc.iFirstChild)
-		{
-		RDebug::Print(_L("%S \\ "), &buf);
-		PrintTree(*(aDesc.iFirstChild), aDepth+1);
-		RDebug::Print(_L("%S / "), &buf);
-		}
-	if(aDesc.iNextPeer)
-		{
-		PrintTree(*(aDesc.iNextPeer), aDepth);
-		}
-	}
+    TBuf<20> buf;
+    for(TInt depth=aDepth;depth>=0;--depth)
+        {
+        buf.Append(_L("  "));
+        }
+    if(aDesc.iRecognisedAndParsed == TUsbGenericDescriptor::ERecognised)
+        {
+        RDebug::Print(_L("%S+0x%08x - %d 0x%02x"), &buf, &aDesc, aDesc.ibLength, aDesc.ibDescriptorType);
+        }
+    else
+        {
+        RDebug::Print(_L("%S-0x%08x - %d 0x%02x"), &buf, &aDesc, aDesc.ibLength, aDesc.ibDescriptorType);
+        }
+    HBufC* blob = HBufC::New(5*aDesc.iBlob.Length()); // 5* for " 0x" + 2*bytes for hex representation
+    if(blob)
+        {
+        for(TInt i=0;i<aDesc.iBlob.Length();++i)
+            {
+            blob->Des().AppendFormat(_L("0x%02x "), aDesc.iBlob[i]);
+            }
+        RDebug::Print(_L("%S >%S"), &buf, blob);
+        delete blob;
+        }
+    if(aDesc.iFirstChild)
+        {
+        RDebug::Print(_L("%S \\ "), &buf);
+        PrintTree(*(aDesc.iFirstChild), aDepth+1);
+        RDebug::Print(_L("%S / "), &buf);
+        }
+    if(aDesc.iNextPeer)
+        {
+        PrintTree(*(aDesc.iNextPeer), aDepth);
+        }
+    }
 
 
 static TUint16 gLangId = 0x0000;
 
 void TUsbPrint::SetLanguageToPrintL(RUsbDevice& aDevice)
-	{
+    {
     if (!iDebug) return;
 
-	// Try to set language to US Eng, otherwise take the first one listed.
-	if(gLangId == 0x0000) // Only make the request if not been made before.
-		{
-		// Get string descriptor 0.
-		TBuf8<256> stringBuf;
-		TUsbStringDescriptor* stringDesc = NULL;
-		User::LeaveIfError(aDevice.GetStringDescriptor(stringDesc, stringBuf, 0));
-		CleanupStack::PushL(*stringDesc);
+    // Try to set language to US Eng, otherwise take the first one listed.
+    if(gLangId == 0x0000) // Only make the request if not been made before.
+        {
+        // Get string descriptor 0.
+        TBuf8<256> stringBuf;
+        TUsbStringDescriptor* stringDesc = NULL;
+        User::LeaveIfError(aDevice.GetStringDescriptor(stringDesc, stringBuf, 0));
+        CleanupStack::PushL(*stringDesc);
 
-		// Search for US English
-		TBool usEngLang = EFalse;
-		TInt langId = 0;
-		TInt index = 0;
-		const TUint16 KLangIdUsEng = 0x0409;
-		while(!usEngLang && langId != KErrNotFound)
-			{
-			langId = stringDesc->GetLangId(index);
-			usEngLang = (langId == KLangIdUsEng);
-			index++;
-			}
+        // Search for US English
+        TBool usEngLang = EFalse;
+        TInt langId = 0;
+        TInt index = 0;
+        const TUint16 KLangIdUsEng = 0x0409;
+        while(!usEngLang && langId != KErrNotFound)
+            {
+            langId = stringDesc->GetLangId(index);
+            usEngLang = (langId == KLangIdUsEng);
+            index++;
+            }
 
-		// Set the language appropriately
-		if(usEngLang)
-			{
-        	gLangId = KLangIdUsEng;
-			}
-		else
-			{
-			gLangId = stringDesc->GetLangId(0);
-			}
+        // Set the language appropriately
+        if(usEngLang)
+            {
+            gLangId = KLangIdUsEng;
+            }
+        else
+            {
+            gLangId = stringDesc->GetLangId(0);
+            }
 
-		CleanupStack::PopAndDestroy(); // stringDesc
-		}
-	}
+        CleanupStack::PopAndDestroy(); // stringDesc
+        }
+    }
 
 
 void TUsbPrint::PrintStringFromIndex(const TDesC& aFormatString,
                                      TInt aIndex,
                                      RUsbDevice* aDevice)
-	{
+    {
     if (!iDebug) return;
 
-	// If we have no device handle, we cannot go and get any strings.
-	// If we have index 0, this indicates we don't have a string for this entry.
-	if(aDevice && aIndex != 0)
-		{
-		TRAPD(err, SetLanguageToPrintL(*aDevice));
-		if(err == KErrNone)
-			{
-			TBuf8<255> stringBuf;
-			TUsbStringDescriptor* stringDesc = NULL;
-			err = aDevice->GetStringDescriptor(stringDesc, stringBuf, aIndex, gLangId);
-			if(err == KErrNone)
-				{
-				TBuf<128> buf;
-				stringDesc->StringData(buf);
-				RDebug::Print(aFormatString, &buf);
-				stringDesc->DestroyTree();
-				}
-			delete stringDesc;
-			}
-		else
-			{
-			RDebug::Print(_L("Error while Selecting Langauge %d\n"), err);
-			}
-		}
-	}
+    // If we have no device handle, we cannot go and get any strings.
+    // If we have index 0, this indicates we don't have a string for this entry.
+    if(aDevice && aIndex != 0)
+        {
+        TRAPD(err, SetLanguageToPrintL(*aDevice));
+        if(err == KErrNone)
+            {
+            TBuf8<255> stringBuf;
+            TUsbStringDescriptor* stringDesc = NULL;
+            err = aDevice->GetStringDescriptor(stringDesc, stringBuf, aIndex, gLangId);
+            if(err == KErrNone)
+                {
+                TBuf<128> buf;
+                stringDesc->StringData(buf);
+                RDebug::Print(aFormatString, &buf);
+                stringDesc->DestroyTree();
+                }
+            delete stringDesc;
+            }
+        else
+            {
+            RDebug::Print(_L("Error while Selecting Langauge %d\n"), err);
+            }
+        }
+    }
 
 
 void TUsbPrint::PrintDescriptor(const TUsbDeviceDescriptor& aDeviceDesc,
                                 TInt /*aVariant*/,
                                 RUsbDevice* aDevice)
-	{
+    {
     if (!iDebug) return;
 
-	RDebug::Print(_L("USBBcd = 0x%04x\n"), aDeviceDesc.USBBcd());
-	RDebug::Print(_L("DeviceClass = 0x%02x\n"), aDeviceDesc.DeviceClass());
-	RDebug::Print(_L("DeviceSubClass = 0x%02x\n"), aDeviceDesc.DeviceSubClass());
-	RDebug::Print(_L("DeviceProtocol = 0x%02x\n"), aDeviceDesc.DeviceProtocol());
-	RDebug::Print(_L("MaxPacketSize0 = 0x%02x\n"), aDeviceDesc.MaxPacketSize0());
-	RDebug::Print(_L("VendorId = 0x%04x\n"), aDeviceDesc.VendorId());
-	RDebug::Print(_L("ProductId = 0x%04x\n"), aDeviceDesc.ProductId());
-	RDebug::Print(_L("DeviceBcd = 0x%04x\n"), aDeviceDesc.DeviceBcd());
-	RDebug::Print(_L("ManufacturerIndex = 0x%02x\n"), aDeviceDesc.ManufacturerIndex());
-	PrintStringFromIndex(_L("ManufacturerString = %S\n"), aDeviceDesc.ManufacturerIndex(), aDevice);
-	RDebug::Print(_L("ProductIndex = 0x%02x\n"), aDeviceDesc.ProductIndex());
-	PrintStringFromIndex(_L("ProductString = %S\n"), aDeviceDesc.ProductIndex(), aDevice);
-	RDebug::Print(_L("SerialNumberIndex = 0x%02x\n"), aDeviceDesc.SerialNumberIndex());
-	PrintStringFromIndex(_L("SerialNumberString = %S\n"), aDeviceDesc.SerialNumberIndex(), aDevice);
-	RDebug::Print(_L("NumConfigurations = 0x%02x\n"), aDeviceDesc.NumConfigurations());
-	}
+    RDebug::Print(_L("USBBcd = 0x%04x\n"), aDeviceDesc.USBBcd());
+    RDebug::Print(_L("DeviceClass = 0x%02x\n"), aDeviceDesc.DeviceClass());
+    RDebug::Print(_L("DeviceSubClass = 0x%02x\n"), aDeviceDesc.DeviceSubClass());
+    RDebug::Print(_L("DeviceProtocol = 0x%02x\n"), aDeviceDesc.DeviceProtocol());
+    RDebug::Print(_L("MaxPacketSize0 = 0x%02x\n"), aDeviceDesc.MaxPacketSize0());
+    RDebug::Print(_L("VendorId = 0x%04x\n"), aDeviceDesc.VendorId());
+    RDebug::Print(_L("ProductId = 0x%04x\n"), aDeviceDesc.ProductId());
+    RDebug::Print(_L("DeviceBcd = 0x%04x\n"), aDeviceDesc.DeviceBcd());
+    RDebug::Print(_L("ManufacturerIndex = 0x%02x\n"), aDeviceDesc.ManufacturerIndex());
+    PrintStringFromIndex(_L("ManufacturerString = %S\n"), aDeviceDesc.ManufacturerIndex(), aDevice);
+    RDebug::Print(_L("ProductIndex = 0x%02x\n"), aDeviceDesc.ProductIndex());
+    PrintStringFromIndex(_L("ProductString = %S\n"), aDeviceDesc.ProductIndex(), aDevice);
+    RDebug::Print(_L("SerialNumberIndex = 0x%02x\n"), aDeviceDesc.SerialNumberIndex());
+    PrintStringFromIndex(_L("SerialNumberString = %S\n"), aDeviceDesc.SerialNumberIndex(), aDevice);
+    RDebug::Print(_L("NumConfigurations = 0x%02x\n"), aDeviceDesc.NumConfigurations());
+    }
 
 
 void TUsbPrint::PrintDescriptor(const TUsbConfigurationDescriptor& aConfigDesc,
                                 TInt /*aVariant*/,
                                 RUsbDevice* aDevice)
-	{
+    {
     if (!iDebug) return;
-	RDebug::Print(_L("TotalLength = 0x%04x\n"), aConfigDesc.TotalLength());
-	RDebug::Print(_L("NumInterfaces = 0x%02x\n"), aConfigDesc.NumInterfaces());
-	RDebug::Print(_L("ConfigurationValue = 0x%02x\n"), aConfigDesc.ConfigurationValue());
-	RDebug::Print(_L("ConfigurationIndex = 0x%02x\n"), aConfigDesc.ConfigurationIndex());
-	PrintStringFromIndex(_L("ConfigurationString = %S\n"), aConfigDesc.ConfigurationIndex(), aDevice);
-	RDebug::Print(_L("Attributes = 0x%02x\n"), aConfigDesc.Attributes());
-	RDebug::Print(_L("MaxPower = 0x%02x\n"), aConfigDesc.MaxPower());
-	}
+    RDebug::Print(_L("TotalLength = 0x%04x\n"), aConfigDesc.TotalLength());
+    RDebug::Print(_L("NumInterfaces = 0x%02x\n"), aConfigDesc.NumInterfaces());
+    RDebug::Print(_L("ConfigurationValue = 0x%02x\n"), aConfigDesc.ConfigurationValue());
+    RDebug::Print(_L("ConfigurationIndex = 0x%02x\n"), aConfigDesc.ConfigurationIndex());
+    PrintStringFromIndex(_L("ConfigurationString = %S\n"), aConfigDesc.ConfigurationIndex(), aDevice);
+    RDebug::Print(_L("Attributes = 0x%02x\n"), aConfigDesc.Attributes());
+    RDebug::Print(_L("MaxPower = 0x%02x\n"), aConfigDesc.MaxPower());
+    }
 
 
 void TUsbPrint::PrintDescriptor(const TUsbEndpointDescriptor& aEndpointDesc,
                                 TInt /*aVariant*/,
                                 RUsbDevice* /*aDevice*/)
-	{
+    {
     if (!iDebug) return;
-	RDebug::Print(_L("EndpointAddress = 0x%02x\n"), aEndpointDesc.EndpointAddress());
-	RDebug::Print(_L("Attributes = 0x%02x\n"), aEndpointDesc.Attributes());
-	RDebug::Print(_L("MaxPacketSize = 0x%04x\n"), aEndpointDesc.MaxPacketSize());
-	RDebug::Print(_L("Interval = 0x%02x\n"), aEndpointDesc.Interval());
-	}
+    RDebug::Print(_L("EndpointAddress = 0x%02x\n"), aEndpointDesc.EndpointAddress());
+    RDebug::Print(_L("Attributes = 0x%02x\n"), aEndpointDesc.Attributes());
+    RDebug::Print(_L("MaxPacketSize = 0x%04x\n"), aEndpointDesc.MaxPacketSize());
+    RDebug::Print(_L("Interval = 0x%02x\n"), aEndpointDesc.Interval());
+    }
 
 
 void TUsbPrint::PrintDescriptor(const TUsbInterfaceDescriptor& aInterfaceDesc,
                                 TInt /*aVariant*/,
                                 RUsbDevice* /*aDevice*/)
-	{
+    {
     if (!iDebug) return;
-	RDebug::Print(_L("InterfaceNumber = 0x%02x\n"), aInterfaceDesc.InterfaceNumber());
-	RDebug::Print(_L("AlternateSetting = 0x%02x\n"), aInterfaceDesc.AlternateSetting());
-	RDebug::Print(_L("NumEndpoints = 0x%02x\n"), aInterfaceDesc.NumEndpoints());
-	RDebug::Print(_L("InterfaceClass = 0x%02x\n"), aInterfaceDesc.InterfaceClass());
-	RDebug::Print(_L("InterfaceSubClass = 0x%02x\n"), aInterfaceDesc.InterfaceSubClass());
-	RDebug::Print(_L("InterfaceProtocol = 0x%02x\n"), aInterfaceDesc.InterfaceProtocol());
-	RDebug::Print(_L("Interface = 0x%02x\n"), aInterfaceDesc.Interface());
-	}
+    RDebug::Print(_L("InterfaceNumber = 0x%02x\n"), aInterfaceDesc.InterfaceNumber());
+    RDebug::Print(_L("AlternateSetting = 0x%02x\n"), aInterfaceDesc.AlternateSetting());
+    RDebug::Print(_L("NumEndpoints = 0x%02x\n"), aInterfaceDesc.NumEndpoints());
+    RDebug::Print(_L("InterfaceClass = 0x%02x\n"), aInterfaceDesc.InterfaceClass());
+    RDebug::Print(_L("InterfaceSubClass = 0x%02x\n"), aInterfaceDesc.InterfaceSubClass());
+    RDebug::Print(_L("InterfaceProtocol = 0x%02x\n"), aInterfaceDesc.InterfaceProtocol());
+    RDebug::Print(_L("Interface = 0x%02x\n"), aInterfaceDesc.Interface());
+    }
 
 
 void TUsbPrint::PrintDescriptor(const TUsbStringDescriptor& aStringDesc,
                                 TInt aVariant,
                                 RUsbDevice* /*aDevice*/)
-	{
+    {
     if (!iDebug) return;
-	if(aVariant == 0)
-		{
-		RDebug::Print(_L("String Descriptor Zero\n"));
-		TInt index = 0;
-		TInt langId = 0;
-		while((langId = aStringDesc.GetLangId(index)) != KErrNotFound)
-			{
-			RDebug::Print(_L("  >0x%04x\n"), langId);
-			++index;
-			}
-		}
-	else
-		{
-		RDebug::Print(_L("Generic String Descriptor\n"));
-		HBufC16* string = HBufC16::New(128);
-		if(string)
-			{
-			TPtr16 stringPtr = string->Des();
-			aStringDesc.StringData(stringPtr);
-			RDebug::Print(_L("  >%S\n"), string);
-			}
-		delete string;
-		}
-	}
+    if(aVariant == 0)
+        {
+        RDebug::Print(_L("String Descriptor Zero\n"));
+        TInt index = 0;
+        TInt langId = 0;
+        while((langId = aStringDesc.GetLangId(index)) != KErrNotFound)
+            {
+            RDebug::Print(_L("  >0x%04x\n"), langId);
+            ++index;
+            }
+        }
+    else
+        {
+        RDebug::Print(_L("Generic String Descriptor\n"));
+        HBufC16* string = HBufC16::New(128);
+        if(string)
+            {
+            TPtr16 stringPtr = string->Des();
+            aStringDesc.StringData(stringPtr);
+            RDebug::Print(_L("  >%S\n"), string);
+            }
+        delete string;
+        }
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbotg.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbotg.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -22,8 +22,6 @@
 #include "cusbotgwatcher.h"
 #include "rusbmspublisher.h"
 
-
-#include "tmslog.h"
 #include "debug.h"
 
 _LIT(KOtgdiLddFileName, "otgdi");
@@ -32,13 +30,11 @@
 ROtgStateChangeNotifier::ROtgStateChangeNotifier()
 :   iRegistered(EFalse)
     {
-    __MSFNSLOG
     }
 
 
 ROtgStateChangeNotifier::~ROtgStateChangeNotifier()
     {
-    __MSFNSLOG
     if (iRegistered)
         iMessage.Complete(KErrDisconnected);
     }
@@ -50,54 +46,48 @@
 */
 void ROtgStateChangeNotifier::Register(const RMessage2& aMessage)
     {
-    __MSFNLOG
-	iRegistered = ETrue;
-	iMessage = aMessage;
+    iRegistered = ETrue;
+    iMessage = aMessage;
     }
 
 
 void ROtgStateChangeNotifier::DoNotifyL()
     {
-	__MSFNLOG
-	CompleteNotifierL(KErrNone);
+    CompleteNotifierL(KErrNone);
     }
 
 
 void ROtgStateChangeNotifier::DoCancelL()
     {
-	__MSFNLOG
-	CompleteNotifierL(KErrCancel);
+    CompleteNotifierL(KErrCancel);
     }
 
 
 void ROtgStateChangeNotifier::CompleteNotifierL(TInt aReason)
-	{
-    __MSFNLOG
-	if (iRegistered)
+    {
+    if (iRegistered)
         {
-		TBool changed = ETrue;
+        TBool changed = ETrue;
         TPckgBuf<TBool> p(changed);
-		iMessage.WriteL(0, p);
-		iMessage.Complete(aReason);
-		iRegistered = EFalse;
+        iMessage.WriteL(0, p);
+        iMessage.Complete(aReason);
+        iRegistered = EFalse;
         }
-	}
+    }
 
 
 CUsbOtg* CUsbOtg::NewL()
-	{
-    __MSFNSLOG
-	CUsbOtg* self = new (ELeave) CUsbOtg();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
+    {
+    CUsbOtg* self = new (ELeave) CUsbOtg();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
 
 
 void CUsbOtg::ConstructL()
-	{
-    __MSFNLOG
+    {
 
     TInt r = User::LoadLogicalDevice(KOtgdiLddFileName);
 
@@ -126,19 +116,17 @@
         }
 
     __USBOTGPRINT(_L("   otg stacks successfully started"));
-	}
+    }
 
 
 CUsbOtg::CUsbOtg()
 :   iOtgState(KOtgStateStart)
     {
-    __MSFNLOG
     }
 
 
 CUsbOtg::~CUsbOtg()
-	{
-    __MSFNLOG
+    {
     Stop();
 
     TInt r = iUsbOtgDriver.BusDrop();
@@ -153,15 +141,14 @@
         }
 
     TInt err = User::FreeLogicalDevice(RUsbOtgDriver::Name());
-	}
+    }
 
 
 void CUsbOtg::StartL()
     {
-    __MSFNLOG
-	// Request Otg notifications
+    // Request Otg notifications
     iOtgEventWatcher = CUsbOtgEventWatcher::NewL(iUsbOtgDriver, *this);
-	iOtgEventWatcher->Start();
+    iOtgEventWatcher->Start();
 
     iRequestSessionWatcher = CRequestSessionWatcher::NewL(*this);
     }
@@ -172,8 +159,6 @@
  * Stop the USB OTG events watcher
  */
     {
-    __MSFNLOG
-
     if (iOtgEventWatcher)
         {
         iOtgEventWatcher->Cancel();
@@ -191,7 +176,6 @@
 
 void CUsbOtg::BusRequestL()
     {
-    __MSFNLOG
     if (iOtgState == KOtgStateAPlugInserted)
         {
         TInt err = iUsbOtgDriver.BusRequest();
@@ -208,8 +192,6 @@
 
 void CUsbOtg::HandleUsbOtgEvent(RUsbOtgDriver::TOtgEvent aEvent)
     {
-    __MSFNLOG
-
     switch (aEvent)
         {
         case RUsbOtgDriver::EEventAPlugInserted:
@@ -245,26 +227,22 @@
 
 TBool CUsbOtg::DeviceInserted()
     {
-    __MSFNLOG
     return iOtgState == KOtgStateAPlugInserted ? ETrue : EFalse;
     }
 
 void CUsbOtg::NotifyChange(const RMessage2& aMessage)
     {
-    __MSFNLOG
     iNotifier.Register(aMessage);
     }
 
 
 void CUsbOtg::NotifyChangeCancel()
     {
-    __MSFNLOG
     iNotifier.DoCancelL();
     }
 
 
 TInt CUsbOtg::BusDrop()
     {
-    __MSFNLOG
     return iUsbOtgDriver.BusDrop();
     }
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbotgwatcher.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbotgwatcher.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -22,36 +22,31 @@
 #include "cusbotg.h"
 #include "cusbotgwatcher.h"
 
-#include "tmslog.h"
 #include "debug.h"
 
 
 CUsbOtgBaseWatcher::CUsbOtgBaseWatcher(RUsbOtgDriver& aLdd)
 :   CActive(CActive::EPriorityStandard),
     iLdd(aLdd)
-	{
-    __MSFNLOG
-	CActiveScheduler::Add(this);
-	}
+    {
+    CActiveScheduler::Add(this);
+    }
 
 
 CUsbOtgBaseWatcher::~CUsbOtgBaseWatcher()
-	{
-    __MSFNLOG
-	Cancel();
-	}
+    {
+    Cancel();
+    }
 
 void CUsbOtgBaseWatcher::Start()
-	{
-    __MSFNLOG
-	Post();
-	}
+    {
+    Post();
+    }
 
 
 
 CRequestSessionWatcher* CRequestSessionWatcher::NewL(MUsbRequestSessionObserver& aObserver)
     {
-    __MSFNSLOG
     CRequestSessionWatcher* r = new (ELeave) CRequestSessionWatcher(aObserver);
     r->ConstructL();
     return r;
@@ -61,31 +56,27 @@
 :   CActive(EPriorityStandard),
     iObserver(aObserver)
     {
-    __MSFNLOG
     }
 
 void CRequestSessionWatcher::ConstructL()
     {
-    __MSFNLOG
     User::LeaveIfError(iProperty.Define(KUidUsbManCategory, KUsbRequestSessionProperty, RProperty::EInt));
     User::LeaveIfError(iProperty.Attach(KUidUsbManCategory, KUsbRequestSessionProperty));
     CActiveScheduler::Add(this);
 
     // initial subscription and process current property value
-	RunL();
+    RunL();
     }
 
 
 void CRequestSessionWatcher::DoCancel()
-	{
-    __MSFNLOG
-	iProperty.Cancel();
-	}
+    {
+    iProperty.Cancel();
+    }
 
 
 CRequestSessionWatcher::~CRequestSessionWatcher()
     {
-    __MSFNLOG
     Cancel();
     iProperty.Close();
     iProperty.Delete(KUidUsbManCategory, KUsbRequestSessionProperty);
@@ -94,10 +85,9 @@
 
 void CRequestSessionWatcher::RunL()
     {
-    __MSFNLOG
-	// resubscribe before processing new value to prevent missing updates
-	iProperty.Subscribe(iStatus);
-	SetActive();
+    // resubscribe before processing new value to prevent missing updates
+    iProperty.Subscribe(iStatus);
+    SetActive();
     TInt val;
     User::LeaveIfError(iProperty.Get(KUidUsbManCategory, KUsbRequestSessionProperty, val));
     __USBOTGPRINT1(_L(">> CUsbRequestSessionWatcher[%d]"), val);
@@ -117,7 +107,6 @@
 
 TInt CRequestSessionWatcher::RunError(TInt aError)
     {
-    __MSFNLOG
     __USBOTGPRINT1(_L("CUsbRequestSessionWatcher::RunError[%d]"), aError);
     return KErrNone;
     }
@@ -133,7 +122,6 @@
 CUsbOtgEventWatcher* CUsbOtgEventWatcher::NewL(RUsbOtgDriver& aLdd,
                                                CUsbOtg& aUsbOtg)
     {
-    __MSFNSLOG
     CUsbOtgEventWatcher* r = new (ELeave) CUsbOtgEventWatcher(aLdd, aUsbOtg);
     r->ConstructL();
     return r;
@@ -144,40 +132,33 @@
 :   CUsbOtgBaseWatcher(aLdd),
     iUsbOtg(aUsbOtg)
     {
-    __MSFNLOG
     }
 
 
 void CUsbOtgEventWatcher::ConstructL()
     {
-    __MSFNLOG
     }
 
 
 void CUsbOtgEventWatcher::DoCancel()
-	{
-    __MSFNLOG
+    {
     iLdd.CancelOtgEventRequest();
-	}
+    }
 
 
 CUsbOtgEventWatcher::~CUsbOtgEventWatcher()
     {
-    __MSFNLOG
     }
 
 
 void CUsbOtgEventWatcher::Post()
     {
-    __MSFNLOG
     iLdd.QueueOtgEventRequest(iEvent, iStatus);
     SetActive();
     }
 
 void CUsbOtgEventWatcher::RunL()
     {
-    __MSFNLOG
-
     TInt r = iStatus.Int();
     User::LeaveIfError(r);
 
@@ -190,7 +171,6 @@
 
 TInt CUsbOtgEventWatcher::RunError(TInt aError)
     {
-    __MSFNLOG
     __USBOTGPRINT1(_L("CUsbRequestSessionWatcher::RunError[%d]"), aError);
     return KErrNone;
     }
--- a/kerneltest/f32test/shostmassstorage/msman/src/rextfilesystem.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/src/rextfilesystem.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -17,25 +17,22 @@
 
 #include "rusbhostmsdevice.h"
 #include "rextfilesystem.h"
-#include "tmslog.h"
+#include "debug.h"
 
 
 _LIT(KFsNm, "elocal");
 
 RExtFileSystem::RExtFileSystem()
     {
-    __MSFNLOG
     }
 
 RExtFileSystem::~RExtFileSystem()
     {
-    __MSFNLOG
     }
 
 
 void RExtFileSystem::OpenL()
     {
-    __MSFNLOG
     RFs fs;
     User::LeaveIfError(fs.Connect());
     CleanupClosePushL(fs);
@@ -59,7 +56,6 @@
 
 void RExtFileSystem::CloseL()
     {
-    __MSFNLOG
     RFs fs;
     User::LeaveIfError(fs.Connect());
     CleanupClosePushL(fs);
@@ -73,8 +69,6 @@
                             TToken aToken,
                             TLun aLun)
     {
-    __MSFNLOG
-
     TTime start;
     TTime end;
 
@@ -85,13 +79,13 @@
     CleanupClosePushL(fs);
 
     TInt err;
-	err = aDevice.MountLun(aLun, aDriveNumber);
-	if (!(KErrAlreadyExists == err || KErrNotReady == err))
-		{
-	    __PRINT1(_L("** Error: MountLun returned %d **"), err);
+    err = aDevice.MountLun(aLun, aDriveNumber);
+    if (!(KErrAlreadyExists == err || KErrNotReady == err))
+        {
+        __PRINT1(_L("** Error: MountLun returned %d **"), err);
         RDebug::Print(_L("** Error: MountLun returned %d **"), err);
         User::LeaveIfError(err);
-		}
+        }
 
     CleanupStack::PopAndDestroy(&fs);
 
@@ -109,11 +103,10 @@
 
 void RExtFileSystem::DismountL(RUsbHostMsDevice& aDevice, TDriveNumber aDriveNumber)
     {
-    __MSFNLOG
     RFs fs;
     User::LeaveIfError(fs.Connect());
     __PRINT(_L("DismountFileSystem"));
-	//TInt err = aDevice.DismountLun(aDriveNumber);
+    //TInt err = aDevice.DismountLun(aDriveNumber);
     aDevice.DismountLun(aDriveNumber);
     fs.Close();
     }
@@ -129,7 +122,7 @@
 
     TInt drive;
     for (drive = EDriveG; drive <= EDriveZ; drive++)
-    	{
+        {
         // Skip K drive which is reserved for LFFS but shows as being free
         if (drive == EDriveK)
             {
--- a/kerneltest/f32test/shostmassstorage/msman/test/cblockdevicetester.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/cblockdevicetester.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -20,7 +20,6 @@
 #include <e32test.h>
 #include <e32math.h>
 
-#include "tmslog.h"
 #include "cblockdevicetester.h"
 
 extern RTest test;
@@ -38,7 +37,6 @@
 
 void TLocalBuffer::Init()
     {
-    __MSFNSLOG
     TInt64 rndSeed = 123456789;
 
     //-- initialize buffer with random rubbish
@@ -65,34 +63,29 @@
 RTargetMedia::RTargetMedia(TInt aDriveNumber)
 :   iDriveNumber(aDriveNumber)
     {
-    __MSFNSLOG
     }
 
 
 void RTargetMedia::OpenL()
     {
-    __MSFNSLOG
     User::LeaveIfError(iRawDisk.Open(fsSession, iDriveNumber));
     }
 
 
 void RTargetMedia::Close()
     {
-    __MSFNSLOG
     iRawDisk.Close();
     }
 
 
 TInt RTargetMedia::MediaRawWrite(TPos aPos, const TDesC8& aData)
     {
-    __MSFNSLOG
     return iRawDisk.Write(aPos, (TDesC8&)aData);
     }
 
 
 TInt RTargetMedia::MediaRawRead(TPos aPos, TUint32 aLen, TDes8& aData)
     {
-    __MSFNSLOG
     aData.SetMax();
     TPtr8 ptr = aData.LeftTPtr(aLen);
     TInt err = iRawDisk.Read(aPos, ptr);
@@ -108,7 +101,6 @@
 
 TInt RTargetDrive::OpenTestAreaL(const TDesC8& aData)
     {
-    __MSFNSLOG
     RTargetMedia::OpenL();
     iStartLba = 0x20;
 
@@ -121,7 +113,6 @@
 
 TInt RTargetDrive::Update(TInt aPos, TUint aLen)
     {
-    __MSFNSLOG
     TPtrC8 ptr = iSource.Mid(aPos, aLen);
     TPos targetPos = TargetPos(aPos);
     return MediaRawWrite(targetPos, ptr);
@@ -130,7 +121,6 @@
 
 TInt RTargetDrive::Verify()
     {
-    __MSFNLOG
     TInt res = MediaRawRead(StartPos(), iSource.Length(), iTmpBuffer);
     if (res)
         return res;
@@ -141,7 +131,6 @@
 
 TInt RTargetDrive::Verify(TInt aPos, TUint aLen)
     {
-    __MSFNSLOG
     TPos pos = TargetPos(aPos);
     TInt res = MediaRawRead(pos, aLen, iTmpBuffer);
     if (res)
@@ -157,7 +146,6 @@
 
 TInt RTargetDrive::VerifyBlock(TLba aLba, TLba aBlocks)
     {
-    __MSFNSLOG
     return Verify(TLbaUtils::Pos(aLba), TLbaUtils::Length(aBlocks));
     }
 
@@ -168,12 +156,10 @@
 TTargetTestArea::TTargetTestArea(RTargetMedia& aMedia)
 :   iTargetMedia(aMedia)
     {
-    __MSFNLOG
     }
 
 void TTargetTestArea::CreateControlFile()
     {
-    __MSFNLOG
     iStartLba = -1;
     static const TInt KBlockSize = 0x200;
     static const TInt KFileSize = KBlockSize * 8;
@@ -196,7 +182,6 @@
 
 void TTargetTestArea::RemoveControlFile()
     {
-    __MSFNLOG
     TInt err = fsSession.Delete(KTxtControlFile);
     test(err == KErrNone);
     }
@@ -204,7 +189,6 @@
 
 void TTargetTestArea::FindBlockStartL()
     {
-    __MSFNLOG
     iTargetMedia.OpenL();
     // search for first block
     TBuf8<KBlockSize> readBlock;
@@ -237,7 +221,6 @@
 
 TInt TTargetTestArea::WriteBlockL(TBuf8<KBlockSize>& aBlock)
     {
-    __MSFNLOG
     iTargetMedia.OpenL();
     TInt err = iTargetMedia.MediaRawWrite(iStartLba * KBlockSize, aBlock);
     iTargetMedia.Close();
@@ -247,7 +230,6 @@
 
 TInt TTargetTestArea::ReadBlockL(TBuf8<KBlockSize>& aBlock)
     {
-    __MSFNLOG
     iTargetMedia.OpenL();
     TInt err = iTargetMedia.MediaRawRead(iStartLba * KBlockSize, KBlockSize, aBlock);
     iTargetMedia.Close();
@@ -258,13 +240,11 @@
 RBlockTargetMedia::RBlockTargetMedia(TInt aDriveNumber)
 :   RTargetMedia(aDriveNumber)
     {
-    __MSFNSLOG
     }
 
 
 void RBlockTargetMedia::OpenL()
     {
-    __MSFNSLOG
     RTargetMedia::OpenL();
 
     TInt64 rndSeed = 123456789;
@@ -280,7 +260,6 @@
 
 TInt RBlockTargetMedia::WriteBlock(TLba aLba)
     {
-    __MSFNSLOG
     TPos pos = TLbaUtils::Pos(aLba);
     return iRawDisk.Write(pos, (TDesC8&)iBlockData);
     }
@@ -288,7 +267,6 @@
 
 TInt RBlockTargetMedia::ReadBlock(TLba aLba)
     {
-    __MSFNSLOG
     TBuf8<KBlockSize> blockData;
     TPos pos = TLbaUtils::Pos(aLba);
     blockData.SetMax();
@@ -299,19 +277,17 @@
 
 CBlockDeviceTester* CBlockDeviceTester::NewL(TInt aDriveNumber)
     {
-    __MSFNSLOG
-	CBlockDeviceTester* r = new (ELeave) CBlockDeviceTester(aDriveNumber);
-	CleanupStack::PushL(r);
+    CBlockDeviceTester* r = new (ELeave) CBlockDeviceTester(aDriveNumber);
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CBlockDeviceTester::ConstructL()
     {
-    __MSFNLOG
     TVolumeInfo volumeInfo;
 
     User::LeaveIfError(fsSession.Volume(volumeInfo, iDriveNumber));
@@ -326,13 +302,11 @@
 :   iDriveNumber(aDriveNumber),
     iTargetDrive(aDriveNumber)
     {
-    __MSFNLOG
     }
 
 
 CBlockDeviceTester::~CBlockDeviceTester()
     {
-    __MSFNLOG
     iTargetDrive.Close();
     }
 
@@ -351,14 +325,12 @@
 
 TInt CBlockDeviceTester::VerifyDrive()
     {
-    __MSFNLOG
     return iTargetDrive.Verify();
     }
 
 
 TInt CBlockDeviceTester::Update(TPos aPos, TUint aLen)
     {
-    __MSFNLOG
     iLocalBuffer.Update(aPos, aLen);
     return iTargetDrive.Update(aPos, aLen);
     }
@@ -366,20 +338,17 @@
 
 TInt CBlockDeviceTester::UpdateBlock(TLba aLba, TLba aBlocks)
     {
-    __MSFNLOG
     return Update(TLbaUtils::Pos(aLba), TLbaUtils::Length(aBlocks));
     }
 
 
 TInt CBlockDeviceTester::Verify(TPos aPos, TUint aLen)
     {
-    __MSFNLOG
     return iTargetDrive.Verify(aPos, aLen);
     }
 
 TInt CBlockDeviceTester::VerifyBlock(TLba aLba, TLba aBlocks)
     {
-    __MSFNLOG
     return iTargetDrive.VerifyBlock(aLba, aBlocks);
     }
 
@@ -388,19 +357,17 @@
  */
 CBotTester* CBotTester::NewL(TInt aDriveNumber)
     {
-    __MSFNSLOG
-	CBotTester* r = new (ELeave) CBotTester(aDriveNumber);
-	CleanupStack::PushL(r);
+    CBotTester* r = new (ELeave) CBotTester(aDriveNumber);
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CBotTester::ConstructL()
     {
-    __MSFNLOG
 
     CBlockDeviceTester::ConstructL();
 
@@ -421,20 +388,17 @@
 CBotTester::CBotTester(TInt aDriveNumber)
 :   CBlockDeviceTester(aDriveNumber)
     {
-    __MSFNLOG
     }
 
 
 CBotTester::~CBotTester()
     {
-    __MSFNLOG
     iTargetDrive.Close();
     }
 
 
 TInt CBotTester::SetTest(TTestCase aTestCase)
     {
-    __MSFNLOG
     iCmdBuffer[KTestCaseDataOffset] = static_cast<TUint8>(aTestCase);
 
     TPos pos = KSetTestPos;
@@ -444,7 +408,6 @@
 
 TInt CBotTester::WriteEnableFile()
     {
-    __MSFNLOG
     TPos pos = KWriteEnableFilePos;
     return iTargetDrive.MediaRawWrite(pos, iOutEnableBuffer);
     }
@@ -452,7 +415,6 @@
 
 TInt CBotTester::InitReadEnableFile()
     {
-    __MSFNLOG
     TPos pos = KReadEnableFilePos;
     return iTargetDrive.MediaRawWrite(pos, iInEnableBuffer);
     }
@@ -460,7 +422,6 @@
 
 TInt CBotTester::ReadEnableFile()
     {
-    __MSFNLOG
     TBuf8<KInEnableBufferSize> readBuf(KInEnableBufferSize);
     TPos pos = KReadEnableFilePos;
     return iTargetDrive.MediaRawRead(pos, readBuf.Size(), readBuf);
@@ -472,20 +433,17 @@
  */
 CSbcErrTester* CSbcErrTester::NewL(TInt aDriveNumber)
     {
-    __MSFNSLOG
-	CSbcErrTester* r = new (ELeave) CSbcErrTester(aDriveNumber);
-	CleanupStack::PushL(r);
+    CSbcErrTester* r = new (ELeave) CSbcErrTester(aDriveNumber);
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CSbcErrTester::ConstructL()
     {
-    __MSFNLOG
-
     CBlockDeviceTester::ConstructL();
 
     iCmdBuffer.Append(KTxtTestCaseOutPreamble);
@@ -505,20 +463,17 @@
 CSbcErrTester::CSbcErrTester(TInt aDriveNumber)
 :   CBlockDeviceTester(aDriveNumber)
     {
-    __MSFNLOG
     }
 
 
 CSbcErrTester::~CSbcErrTester()
     {
-    __MSFNLOG
     iTargetDrive.Close();
     }
 
 
 TInt CSbcErrTester::WriteTestFile()
     {
-    __MSFNLOG
     TPos pos = KWriteTestFilePos;
     return iTargetDrive.MediaRawWrite(pos, iEnableBuffer);
     }
@@ -526,7 +481,6 @@
 
 TInt CSbcErrTester::ReadTestFile()
     {
-    __MSFNLOG
     TBuf8<KEnableBufferSize> readBuf(KEnableBufferSize);
     TPos pos = KReadTestFilePos;
     TInt err = iTargetDrive.MediaRawRead(pos, readBuf.Size(), readBuf);
@@ -536,7 +490,6 @@
 
 TInt CSbcErrTester::WriteSenseErrorFile(TTestSenseError aTestSenseError)
     {
-    __MSFNLOG
     iSenseErrorBuffer[KTestCaseDataOffset] = static_cast<TUint8>(aTestSenseError);
     TPos pos = KSenseErrorFile;
     return iTargetDrive.MediaRawWrite(pos, iSenseErrorBuffer);
@@ -545,18 +498,16 @@
 
 CWrPrTester* CWrPrTester::NewL(TInt aDriveNumber)
     {
-    __MSFNSLOG
-	CWrPrTester* r = new (ELeave) CWrPrTester(aDriveNumber);
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    CWrPrTester* r = new (ELeave) CWrPrTester(aDriveNumber);
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CWrPrTester::ConstructL()
     {
-    __MSFNLOG
     iCmdBuffer.Append(KTxtTestCaseOutPreamble);
     iCmdBuffer.Append(KTxtTestConfig);
     iCmdBuffer.AppendFill('c', iCmdBuffer.MaxLength() - iCmdBuffer.Length());
@@ -574,20 +525,17 @@
 :   iTargetMedia(aDriveNumber),
     iTargetTestArea(iTargetMedia)
     {
-    __MSFNLOG
     }
 
 
 CWrPrTester::~CWrPrTester()
     {
-    __MSFNLOG
     iTargetTestArea.RemoveControlFile();
     }
 
 
 void CWrPrTester::SetWriteProtectL()
     {
-    __MSFNLOG
     // first write WrPr CLR Control block to media to enable setting to be
     // cleared
     iInCmdBuffer[KTestCaseDataOffset] = ETestConfigMediaWpClr;
@@ -605,7 +553,6 @@
 
 void CWrPrTester::ClrWriteProtectL()
     {
-    __MSFNLOG
     test.Printf(_L("Clearing WRITE PROTECT"));
     TInt err = KErrNone;
     // Write protect so read the control file from the drive
@@ -623,7 +570,6 @@
 
 TInt CWrPrTester::SetRemovableL()
     {
-    __MSFNLOG
     iCmdBuffer[KTestCaseDataOffset] = ETestConfigMediaRmbSet;
     iTargetMedia.OpenL();
     TInt err = iTargetMedia.MediaRawWrite(KCmdPos, iCmdBuffer);
@@ -633,7 +579,6 @@
 
 TInt CWrPrTester::ClrRemovableL()
     {
-    __MSFNLOG
     iCmdBuffer[KTestCaseDataOffset] = ETestConfigMediaRmbClr;
     iTargetMedia.OpenL();
     TInt err = iTargetMedia.MediaRawWrite(KCmdPos, iCmdBuffer);
@@ -644,7 +589,6 @@
 
 TInt CWrPrTester::WriteReadTestL()
     {
-    __MSFNLOG
     TInt err = KErrNone;
     TBuf8<KCmdBufferSize> wrBuffer;
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msblock.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msblock.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -30,7 +30,6 @@
 #include "cmsdrive.h"
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
-#include "tmslog.h"
 
 using namespace F32_Test_Utils;
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msblock.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msblock.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -14,41 +14,37 @@
 // Verify read/write access of block deivce.
 //
 
-TARGET			t_msblock.exe
+TARGET                  t_msblock.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
-USERINCLUDE		../../../server
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
+USERINCLUDE             ../../../server
 USERINCLUDE     ../../../fileutils/inc
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			cblockdevicetester.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  cblockdevicetester.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
 
-SOURCE			t_msmain.cpp
-SOURCE			t_msblock.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_msblock.cpp
+
+SOURCEPATH              ../../../fileutils/src
+SOURCE                  f32_test_utils.cpp
+
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-SOURCEPATH		../../../fileutils/src
-SOURCE			f32_test_utils.cpp
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
-
-
-//MACRO			_TESTAPP_DEBUG_PRINT_
+//MACRO                 _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msbot.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msbot.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -28,7 +28,6 @@
 #include "cmsdrive.h"
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
-#include "tmslog.h"
 
 extern CMsDrive* msDrive;
 
@@ -164,19 +163,17 @@
 
 CTestBot* CTestBot::NewL()
     {
-    __MSFNSLOG
-	CTestBot* r = new (ELeave) CTestBot();
-	CleanupStack::PushL(r);
+    CTestBot* r = new (ELeave) CTestBot();
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CTestBot::ConstructL()
     {
-    __MSFNLOG
     TInt driveNumber = msDrive->DriveNumber();
     iBotTester = CBotTester::NewL(driveNumber);
     }
@@ -184,14 +181,12 @@
 
 CTestBot::CTestBot()
     {
-    __MSFNLOG
     }
 
 
 
 CTestBot::~CTestBot()
     {
-    __MSFNLOG
     delete iBotTester;
     }
 
@@ -206,7 +201,6 @@
  */
 void CTestBot::CswResetRecovery(CBotTester::TTestCase aTestCase, const TDesC& aTestName)
     {
-    __MSFNLOG
     TInt res;
     test.Start(aTestName);
 
@@ -237,7 +231,6 @@
 
 void CTestBot::NoDataResetRecovery(CBotTester::TTestCase aTestCase, const TDesC& aTestName)
     {
-    __MSFNLOG
     TInt res;
     test.Start(aTestName);
 
@@ -264,7 +257,6 @@
 
 void CTestBot::NoDataClearStall(CBotTester::TTestCase aTestCase, const TDesC& aTestName)
     {
-    __MSFNLOG
     TInt res;
     test.Start(aTestName);
 
@@ -303,7 +295,6 @@
 
 void CTestBot::DataOutClearStall(CBotTester::TTestCase aTestCase, const TDesC& aTestName)
     {
-    __MSFNLOG
     TInt res;
     test.Start(aTestName);
 
@@ -342,7 +333,6 @@
 
 void CTestBot::DataInClearStall(CBotTester::TTestCase aTestCase, const TDesC& aTestName)
     {
-    __MSFNLOG
     TInt res;
     test.Start(aTestName);
 
@@ -393,7 +383,6 @@
 */
 void CTestBot::tTagMismatch()
     {
-    __MSFNLOG
     CswResetRecovery(CBotTester::ETestCaseTagMismatch, KTagMismatch);
     }
 
@@ -406,7 +395,6 @@
 */
 void CTestBot::tInvalidSignature()
     {
-    __MSFNLOG
     CswResetRecovery(CBotTester::ETestCaseInvalidSignature, KInvalidSignature);
     }
 
@@ -419,7 +407,6 @@
 */
 void CTestBot::tNoDataStallCsw()
     {
-    __MSFNLOG
     NoDataClearStall(CBotTester::ETestCaseNoDataStallCsw, KNoDataStallCsw);
     }
 
@@ -430,35 +417,30 @@
 */
 void CTestBot::tNoDataPhaseError()
     {
-    __MSFNLOG
     NoDataResetRecovery(CBotTester::ETestCaseNoDataPhaseError, KNoDataPhaseError);
     }
 
 
 void CTestBot::tDoStallCsw()
     {
-    __MSFNLOG
     DataOutClearStall(CBotTester::ETestCaseDoStallCsw, KDoStallCsw);
     }
 
 
 void CTestBot::tDoStallData()
     {
-    __MSFNLOG
     DataOutClearStall(CBotTester::ETestCaseDoStallData, KDoStallData);
     }
 
 
 void CTestBot::tDoPhaseError()
     {
-    __MSFNLOG
     CswResetRecovery(CBotTester::ETestCaseDoPhaseError, KDoPhaseError);
     }
 
 
 void CTestBot::tDoResidue()
     {
-    __MSFNLOG
     TInt res;
     test.Start(KDoResidue);
     res = iBotTester->SetTest(CBotTester::ETestCaseDoResidue);
@@ -484,28 +466,24 @@
 
 void CTestBot::tDiStallCsw()
     {
-    __MSFNLOG
     DataInClearStall(CBotTester::ETestCaseDiStallCsw, KDiStallCsw);
     }
 
 
 void CTestBot::tDiStallData()
     {
-    __MSFNLOG
     DataInClearStall(CBotTester::ETestCaseDiStallData, KDiStallData);
     }
 
 
 void CTestBot::tDiPhaseError()
     {
-    __MSFNLOG
     CswResetRecovery(CBotTester::ETestCaseDiPhaseError, KDiPhaseError);
     }
 
 
 void CTestBot::tDiResidue()
     {
-    __MSFNLOG
     TInt res;
     test.Start(KDiResidue);
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msbot.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msbot.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -15,38 +15,33 @@
 //
 
 
-TARGET			t_msbot.exe
+TARGET                  t_msbot.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
-USERINCLUDE		../../../server
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
+USERINCLUDE             ../../../server
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			cblockdevicetester.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  cblockdevicetester.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
 
-SOURCE			t_msmain.cpp
-SOURCE			t_msbot.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_msbot.cpp
+
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
-
-
-// MACRO			_TESTAPP_DEBUG_PRINT_
+// MACRO                        _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msformat.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msformat.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -23,7 +23,6 @@
 
 #include "cmsdrive.h"
 #include "tmsprintdrive.h"
-#include "tmslog.h"
 
 extern CMsDrive* msDrive;
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msformat.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msformat.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -14,33 +14,30 @@
 // Test format of Mass Storage is successful
 //
 
-TARGET			t_msformat.exe
+TARGET                  t_msformat.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
-SOURCE			t_msmain.cpp
-SOURCE			t_msformat.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_msformat.cpp
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-// MACRO			_TESTAPP_DEBUG_PRINT_
+// MACRO                        _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msmain.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msmain.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -26,13 +26,12 @@
 #include "rusbhostsession.h"
 #include "rusbotgsession.h"
 #include "cmsdrive.h"
-#include "tmslog.h"
 
 /*
-OTG Platform configuration 
-Define for H4 and undefine for Navi Engine 
+OTG Platform configuration
+Define for H4 and undefine for Navi Engine
 */
-#define _OTG_CONFIG 
+#define _OTG_CONFIG
 
 extern RTest test;
 extern RFs fsSession;
@@ -44,8 +43,6 @@
 
 GLDEF_C void MainL()
     {
-    __MSFNSLOG
-
     TInt err;
     CleanupClosePushL(fsSession);
     User::LeaveIfError(fsSession.Connect());
@@ -70,7 +67,7 @@
         TRequestStatus status;
         test.Printf(_L("Waiting for hub inserted event...\n"));
         usbOtgSession.NotifyChange(change, status);
-    
+
         User::WaitForRequest(status);
         User::LeaveIfError(status.Int());
 
@@ -135,7 +132,7 @@
         test(EFalse);
         }
 
-    
+
     test.Printf(_L("Destroying sessions...\n"));
     test.Printf(_L("Destroying USB Host session...\n"));
     CleanupStack::PopAndDestroy(&usbHostSession);
@@ -154,16 +151,16 @@
 
 
 GLDEF_C TInt E32Main()
-	{
+    {
     CTrapCleanup* cleanup = CTrapCleanup::New();
-	__UHEAP_MARK;
+    __UHEAP_MARK;
     test.Title();
     test.Start(_L("Starting tests..."));
 
-	TTime timerC;
-	timerC.HomeTime();
+    TTime timerC;
+    timerC.HomeTime();
 
-	TRAPD(err, MainL());
+    TRAPD(err, MainL());
     test(err == KErrNone);
 
     TTime endTimeC;
@@ -173,10 +170,10 @@
     test(err == KErrNone);
     test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC.Int());
 
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	delete cleanup;
-	return KErrNone;
-	}
+    test.End();
+    test.Close();
+    __UHEAP_MARKEND;
+    delete cleanup;
+    return KErrNone;
+    }
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msman.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msman.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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,7 +24,6 @@
 #include <e32test.h>
 
 #include "tmsprintdrive.h"
-#include "tmslog.h"
 #include "cmsdrive.h"
 
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msman.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msman.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -14,33 +14,30 @@
 // Utility to mount connected USB device as a Mass Storage drive.
 //
 
-TARGET			t_msman.exe
+TARGET                  t_msman.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
-SOURCE			t_msmain.cpp
-SOURCE			t_msman.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_msman.cpp
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-// MACRO			_TESTAPP_DEBUG_PRINT_
+// MACRO                        _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msrmb.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msrmb.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -27,7 +27,6 @@
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
 #include "cblockdevicetester.h"
-#include "tmslog.h"
 
 extern CMsDrive* msDrive;
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msrmb.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msrmb.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -33,9 +33,6 @@
 SOURCE			t_msmain.cpp
 SOURCE			t_msrmb.cpp
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
 SOURCEPATH		../../../fileutils/src
 SOURCE			f32_test_utils.cpp
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -28,7 +28,6 @@
 #include "cmsdrive.h"
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
-#include "tmslog.h"
 
 extern CMsDrive* msDrive;
 
@@ -57,19 +56,17 @@
 
 CTestSbcErr* CTestSbcErr::NewL()
     {
-    __MSFNSLOG
-	CTestSbcErr* r = new (ELeave) CTestSbcErr();
-	CleanupStack::PushL(r);
+    CTestSbcErr* r = new (ELeave) CTestSbcErr();
+    CleanupStack::PushL(r);
 
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
     }
 
 
 void CTestSbcErr::ConstructL()
     {
-    __MSFNLOG
     TInt driveNumber = msDrive->DriveNumber();
     iSbcErrTester = CSbcErrTester::NewL(driveNumber);
     }
@@ -77,21 +74,18 @@
 
 CTestSbcErr::CTestSbcErr()
     {
-    __MSFNLOG
     }
 
 
 
 CTestSbcErr::~CTestSbcErr()
     {
-    __MSFNLOG
     delete iSbcErrTester;
     }
 
 
 void CTestSbcErr::tTest1()
     {
-    __MSFNLOG
     TInt res;
     test.Start(_L("tTest1\n"));
 
@@ -109,7 +103,6 @@
 
 void CTestSbcErr::tTest2()
     {
-    __MSFNLOG
     TInt res;
     test.Start(_L("tTest2\n"));
 
@@ -138,7 +131,6 @@
 
 void CTestSbcErr::tTest3()
     {
-    __MSFNLOG
     TInt res;
     test.Start(_L("tTest3\n"));
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_mssbcerr.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -15,39 +15,34 @@
 //
 
 
-TARGET			t_mssbcerr.exe
+TARGET                  t_mssbcerr.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
-USERINCLUDE		../../../server
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
+USERINCLUDE             ../../../server
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			cblockdevicetester.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  cblockdevicetester.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
 
-SOURCE			t_msmain.cpp
-SOURCE			t_mssbcerr.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_mssbcerr.cpp
+
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
-
-
-// MACRO			_TESTAPP_DEBUG_PRINT_
+// MACRO                        _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_mssuspend.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_mssuspend.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -26,7 +26,6 @@
 #include "cmsdrive.h"
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
-#include "tmslog.h"
 
 extern CMsDrive* msDrive;
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_mssuspend.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_mssuspend.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -14,36 +14,31 @@
 // Check that host enters suspend and resumes properly
 //
 
-TARGET			t_mssuspend.exe
+TARGET                  t_mssuspend.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
-USERINCLUDE		../../../server
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
+USERINCLUDE             ../../../server
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
-SOURCE			t_msmain.cpp
-SOURCE			t_mssuspend.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_mssuspend.cpp
+
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
-
-
-//MACRO			_TESTAPP_DEBUG_PRINT_
+//MACRO                 _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msvbus.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msvbus.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -30,7 +30,6 @@
 #include "cmsdrive.h"
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
-#include "tmslog.h"
 
 RTest test(_L("T_MSVBUS"));
 RFs fsSession;
@@ -96,8 +95,6 @@
 
 GLDEF_C void MainL()
     {
-    __MSFNSLOG
-
     TInt err;
 
     RUsbHostSession usbHostSession;
@@ -132,16 +129,16 @@
 
 
 GLDEF_C TInt E32Main()
-	{
+    {
     CTrapCleanup* cleanup = CTrapCleanup::New();
-	__UHEAP_MARK;
+    __UHEAP_MARK;
     test.Title();
     test.Start(_L("Starting tests..."));
 
-	TTime timerC;
-	timerC.HomeTime();
+    TTime timerC;
+    timerC.HomeTime();
 
-	TRAPD(err, MainL());
+    TRAPD(err, MainL());
 
     if (err != KErrNone)
        {
@@ -155,9 +152,9 @@
     test(err == KErrNone);
     test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC.Int());
 
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	delete cleanup;
-	return KErrNone;
-	}
+    test.End();
+    test.Close();
+    __UHEAP_MARKEND;
+    delete cleanup;
+    return KErrNone;
+    }
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_msvbus.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_msvbus.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -15,34 +15,30 @@
 //
 
 
-TARGET			t_msvbus.exe
+TARGET                  t_msvbus.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
-USERINCLUDE		../../../server
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
+USERINCLUDE             ../../../server
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
-SOURCE			t_msvbus.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
+SOURCE                  t_msvbus.cpp
+
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
-
-
-MACRO			_TESTAPP_DEBUG_PRINT_
+MACRO                   _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_mswrpr.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_mswrpr.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -27,7 +27,6 @@
 #include "tmsprintdrive.h"
 #include "ttestutils.h"
 #include "cblockdevicetester.h"
-#include "tmslog.h"
 
 extern CMsDrive* msDrive;
 
--- a/kerneltest/f32test/shostmassstorage/msman/test/t_mswrpr.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/t_mswrpr.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -14,37 +14,32 @@
 // Check that host detects WRITE PROTECT status flag
 //
 
-TARGET			t_mswrpr.exe
+TARGET                  t_mswrpr.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE		.
-USERINCLUDE		../shared
-USERINCLUDE		../client
-USERINCLUDE		../../../server
+USERINCLUDE             .
+USERINCLUDE             ../shared
+USERINCLUDE             ../client
+USERINCLUDE             ../../../server
 
-SOURCEPATH		.
-SOURCE			rfsydebug.cpp
-SOURCE			cblockdevicetester.cpp
-SOURCE			ttestutils.cpp
-SOURCE			cmsdrive.cpp
-SOURCE			tmsprintdrive.cpp
-SOURCE			t_msmain.cpp
-SOURCE			t_mswrpr.cpp
+SOURCEPATH              .
+SOURCE                  rfsydebug.cpp
+SOURCE                  cblockdevicetester.cpp
+SOURCE                  ttestutils.cpp
+SOURCE                  cmsdrive.cpp
+SOURCE                  tmsprintdrive.cpp
+SOURCE                  t_msmain.cpp
+SOURCE                  t_mswrpr.cpp
+
+LIBRARY                 msmanclient.lib efsrv.lib euser.lib
 
 
-
-SOURCEPATH		../shared
-SOURCE			tmslog.cpp
-
-LIBRARY			msmanclient.lib efsrv.lib euser.lib
-
-
-// MACRO			_TESTAPP_DEBUG_PRINT_
+// MACRO                        _TESTAPP_DEBUG_PRINT_
 
 CAPABILITY ALL
 
-UID			0 0x10285B2E
+UID                     0 0x10285B2E
 
 SMPSAFE
--- a/kerneltest/f32test/shostmassstorage/msman/test/ttestutils.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/msman/test/ttestutils.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // USB Host Mass Storage
-// 
+//
 //
 
 
@@ -26,7 +26,6 @@
 
 
 #include "ttestutils.h"
-#include "tmslog.h"
 #include "e32test.h"
 #include "e32debug.h"
 
@@ -46,7 +45,6 @@
 
 void TTestUtils::WaitForBusEventL()
     {
-    __MSFNSLOG
     _LIT_SECURITY_POLICY_PASS(KMsAllowAllPolicy);
     _LIT_SECURITY_POLICY_S0(KMsWritePolicy, KUsbmanSvrSid.iUid);
 
@@ -74,7 +72,6 @@
 
 TBool TTestUtils::WaitForConnectionStateEventL()
     {
-    __MSFNSLOG
     _LIT_SECURITY_POLICY_PASS(KMsAllowAllPolicy);
     _LIT_SECURITY_POLICY_S0(KMsWritePolicy, KUsbmanSvrSid.iUid);
 
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cmassstoragefilesystem.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cmassstoragefilesystem.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // CMassStorageFileSystem implementation.
-// 
+//
 //
 
 
@@ -34,7 +34,6 @@
 #include "cmassstoragefilesystem.h"
 #include "cmassstoragemountcb.h"
 #include "debug.h"
-#include "msdebug.h"
 #include "massstorage.h"
 
 _LIT(KMsFsyName, "MassStorageFileSystem");
@@ -45,40 +44,36 @@
 LOCAL_D const TInt KMsFsyMinorVersionNumber=0;
 
 CMassStorageFileSystem::CMassStorageFileSystem()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 CMassStorageFileSystem::~CMassStorageFileSystem()
-	{
-    __MSFNLOG
-	//Kill the controller thread if it exists
-	delete iMassStorageController;
-	iMediaChangedStatusList.Close();
-	RThread thread;
-	TInt err = thread.Open(KMsThreadName);
-	if (err == KErrNone)
-		{
-		thread.Kill(1); //Parameter is irrelevant
-		}
-	thread.Close();
-	iDriveMap.Close();
-	}
+    {
+    //Kill the controller thread if it exists
+    delete iMassStorageController;
+    iMediaChangedStatusList.Close();
+    RThread thread;
+    TInt err = thread.Open(KMsThreadName);
+    if (err == KErrNone)
+        {
+        thread.Kill(1); //Parameter is irrelevant
+        }
+    thread.Close();
+    iDriveMap.Close();
+    }
 
 CMassStorageFileSystem* CMassStorageFileSystem::NewL()
-	{
-    __MSFNSLOG
-	CMassStorageFileSystem*  self = new (ELeave) CMassStorageFileSystem();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
+    {
+    CMassStorageFileSystem*  self = new (ELeave) CMassStorageFileSystem();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
 
 void CMassStorageFileSystem::ConstructL()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 /**
 Set the file system version and name
@@ -86,45 +81,43 @@
 @return Any of the standard Symbian error codes.
 */
 TInt CMassStorageFileSystem::Install()
-	{
-    __MSFNLOG
-	iVersion=TVersion(KMsFsyMajorVersionNumber, KMsFsyMinorVersionNumber, KF32BuildVersionNumber);
-	TInt err = SetName(&KMsFsyName);
-	return err;
-	}
+    {
+    iVersion=TVersion(KMsFsyMajorVersionNumber, KMsFsyMinorVersionNumber, KF32BuildVersionNumber);
+    TInt err = SetName(&KMsFsyName);
+    return err;
+    }
 
 TInt CMassStorageFileSystem::Remove()
-	{
-    __MSFNLOG
-	TInt err = KErrNone;
-	if (iInstalled)
-		{
-		// Try connecting to the server to send a shutdown message.
-		// - If the class controller has a session in use, this will return KErrInUse
-		RUsbMassStorage usbMs;
-		err = usbMs.Connect();
-		if(err == KErrNone)
-			{
-			err = usbMs.Shutdown();
-			usbMs.Close();
+    {
+    TInt err = KErrNone;
+    if (iInstalled)
+        {
+        // Try connecting to the server to send a shutdown message.
+        // - If the class controller has a session in use, this will return KErrInUse
+        RUsbMassStorage usbMs;
+        err = usbMs.Connect();
+        if(err == KErrNone)
+            {
+            err = usbMs.Shutdown();
+            usbMs.Close();
 
-			if(err == KErrNone)
-				{
-				User::WaitForRequest(iThreadStat);
-				err = iThreadStat.Int();
-				}
-			else
-				{
-				__PRINT1(_L("CMassStorageFileSystem::Remove Shutdown Error %d\n"),err);
-				}
-			}
-		else
-			{
-			__PRINT1(_L("CMassStorageFileSystem::Remove Connect Error %d\n"),err);
-			}
-		}
-	return(err);
-	}
+            if(err == KErrNone)
+                {
+                User::WaitForRequest(iThreadStat);
+                err = iThreadStat.Int();
+                }
+            else
+                {
+                __PRINT1(_L("CMassStorageFileSystem::Remove Shutdown Error %d\n"),err);
+                }
+            }
+        else
+            {
+            __PRINT1(_L("CMassStorageFileSystem::Remove Connect Error %d\n"),err);
+            }
+        }
+    return(err);
+    }
 
 /**
 Creates a new Mass Storage mount object.
@@ -133,14 +126,13 @@
 @leave KErrNotReady if the Mass Storage controller is not running.
 */
 CMountCB* CMassStorageFileSystem::NewMountL() const
-	{
-    __MSFNSLOG
-	if (!iRunning)
-		{
-		User::Leave(KErrNotReady);
-		}
-	return CMassStorageMountCB::NewL(iDriveMap);
-	}
+    {
+    if (!iRunning)
+        {
+        User::Leave(KErrNotReady);
+        }
+    return CMassStorageMountCB::NewL(iDriveMap);
+    }
 
 /**
 Sets the media attributes and type in the aInfo parameter to those of the specified drive.
@@ -149,18 +141,17 @@
 @param aDriveNumber The number of the drive to get the information from.
 */
 void CMassStorageFileSystem::DriveInfo(TDriveInfo& aInfo, TInt aDriveNumber) const
-	{
-    __MSFNSLOG
-	TLocalDriveCapsV2Buf caps;
-	if (!IsValidLocalDriveMapping(aDriveNumber))
-		{
-		return;
-		}
-	GetLocalDrive(aDriveNumber).Caps(caps);
-	aInfo.iMediaAtt=caps().iMediaAtt;
+    {
+    TLocalDriveCapsV2Buf caps;
+    if (!IsValidLocalDriveMapping(aDriveNumber))
+        {
+        return;
+        }
+    GetLocalDrive(aDriveNumber).Caps(caps);
+    aInfo.iMediaAtt=caps().iMediaAtt;
     aInfo.iType = ::EMediaNotPresent;  // Media is not available to the file system
-	aInfo.iDriveAtt=caps().iDriveAtt;
-	}
+    aInfo.iDriveAtt=caps().iDriveAtt;
+    }
 
 /**
 Returns a reference to the Mass Storage controller.
@@ -168,68 +159,65 @@
 @return Reference to the Mass Storage controller.
 */
 CUsbMassStorageController& CMassStorageFileSystem::Controller()
-	{
-    __MSFNLOG
-	return *iMassStorageController;
-	}
+    {
+    return *iMassStorageController;
+    }
 
 /**
 Fill iMsDrives with a mapping of lun->drive number for supported mass storage drives
 
 */
 TInt CMassStorageFileSystem::EnumerateMsDrivesL()
-	{
-    __MSFNLOG
-	iDriveMap.Reset();
-	TInt driveCount = 0;
+    {
+    iDriveMap.Reset();
+    TInt driveCount = 0;
 
-	TLocalDriveCapsV2Buf caps;
+    TLocalDriveCapsV2Buf caps;
 
-	for (TInt i = EDriveC; i < KMaxDrives; i++)
-		{
-		caps.FillZ();
+    for (TInt i = EDriveC; i < KMaxDrives; i++)
+        {
+        caps.FillZ();
 
-		if (IsValidLocalDriveMapping(i))
-			{
-			TInt err = GetLocalDrive(i).Caps(caps);
-			TInt locDrvNum = DriveNumberToLocalDriveNumber(i);
-			__PRINT2(_L("Caps: err=%d, att=%d\n"), err, caps().iDriveAtt);
+        if (IsValidLocalDriveMapping(i))
+            {
+            TInt err = GetLocalDrive(i).Caps(caps);
+            TInt locDrvNum = DriveNumberToLocalDriveNumber(i);
+            __PRINT2(_L("Caps: err=%d, att=%d\n"), err, caps().iDriveAtt);
 
-			TBool isRemovable = err==KErrNotReady || (caps().iDriveAtt & KDriveAttRemovable);
-			__PRINT2(_L("EnumerateMsDrives: Drive %c: is %sremovable\n"),
-							'A'+i-EDriveA,
-							isRemovable?_S(""):_S("NOT "));
+            TBool isRemovable = err==KErrNotReady || (caps().iDriveAtt & KDriveAttRemovable);
+            __PRINT2(_L("EnumerateMsDrives: Drive %c: is %sremovable\n"),
+                            'A'+i-EDriveA,
+                            isRemovable?_S(""):_S("NOT "));
 
-			if (isRemovable)
-				{
-				//
-				// STF: Connect to the local drive here.  This gives us the media changed flag, and
-				//		our own TBusLocalDrive object for use by the proxy drive and controller.
+            if (isRemovable)
+                {
+                //
+                // STF: Connect to the local drive here.  This gives us the media changed flag, and
+                //      our own TBusLocalDrive object for use by the proxy drive and controller.
                 //
 
                 TMediaChangedStatus mediaChanged;
                 iMediaChangedStatusList.AppendL(mediaChanged);
 
                 TBool& mediaChangedRef = iMediaChangedStatusList[driveCount].iMediaChanged;
-				TInt err = iMediaChangedStatusList[driveCount].iLocalDrive.Connect(locDrvNum, mediaChangedRef);
-				if (err == KErrNone)
-					{
-					iDriveMap.Append(static_cast <TDriveNumber>(i));
-					}
-				driveCount++;
-				}
-			}
-		}
+                TInt err = iMediaChangedStatusList[driveCount].iLocalDrive.Connect(locDrvNum, mediaChangedRef);
+                if (err == KErrNone)
+                    {
+                    iDriveMap.Append(static_cast <TDriveNumber>(i));
+                    }
+                driveCount++;
+                }
+            }
+        }
 
-	__PRINT1(_L("EnumerateMsDrives Out, %d MS drives found\n"), driveCount);
-	return driveCount;
-	}
+    __PRINT1(_L("EnumerateMsDrives Out, %d MS drives found\n"), driveCount);
+    return driveCount;
+    }
 
 TBool CMassStorageFileSystem::IsExtensionSupported() const
-	{
-    __MSFNSLOG
-	return ETrue;
-	}
+    {
+    return ETrue;
+    }
 
 /**
 Creates a TrapCleanup and ActiveScheduler and initializes the Mass Storage controller.
@@ -238,82 +226,79 @@
 @return Any of the standard Symbian error codes.
 */
 TInt CMassStorageFileSystem::InitThread()
-	{
-    __MSFNLOG
-
-	//Give the thread a name so we can kill it later
-	User::RenameThread(KMsThreadName);
+    {
+    //Give the thread a name so we can kill it later
+    User::RenameThread(KMsThreadName);
 
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		return KErrNoMemory;
-		}
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    if (cleanup == NULL)
+        {
+        return KErrNoMemory;
+        }
 
-	TRAPD(err, InitThreadL());
+    TRAPD(err, InitThreadL());
 
-	delete cleanup;
+    delete cleanup;
 
-	__PRINT1(_L("CMassStorageFileSystem::InitThread Out, error=%d\n"), err);
-	return err;
-	}
+    __PRINT1(_L("CMassStorageFileSystem::InitThread Out, error=%d\n"), err);
+    return err;
+    }
 
 TInt CMassStorageFileSystem::InitThreadL()
-	{
-    __MSFNLOG
-	RSemaphore gSemThreadReady;
-	gSemThreadReady.OpenGlobal(KMsFsysSemName);
+    {
+    RSemaphore gSemThreadReady;
+    gSemThreadReady.OpenGlobal(KMsFsysSemName);
 
-	// Determine which drives are available for Mass Storage.
-	// (this also creates a local TBusLocalDrive for use by the drive controller)
-	EnumerateMsDrivesL();
+    // Determine which drives are available for Mass Storage.
+    // (this also creates a local TBusLocalDrive for use by the drive controller)
+    EnumerateMsDrivesL();
 
-	CActiveScheduler* sched = new (ELeave) CActiveScheduler;
-	if (sched == NULL)
-		{
-		gSemThreadReady.Signal();
-		User::Leave(KErrNoMemory);
-		}
-	CleanupStack::PushL(sched);
-	CActiveScheduler::Install(sched);
+    CActiveScheduler* sched = new (ELeave) CActiveScheduler;
+    if (sched == NULL)
+        {
+        gSemThreadReady.Signal();
+        User::Leave(KErrNoMemory);
+        }
+    CleanupStack::PushL(sched);
+    CActiveScheduler::Install(sched);
 
-	iMassStorageController = CUsbMassStorageController::NewL();
-	if (iMassStorageController == NULL)
-		{
-		gSemThreadReady.Signal();
-		User::Leave(KErrNoMemory);
-		}
+    iMassStorageController = CUsbMassStorageController::NewL();
+    if (iMassStorageController == NULL)
+        {
+        gSemThreadReady.Signal();
+        User::Leave(KErrNoMemory);
+        }
 
-	__PRINT(_L("CMassStorageFileSystem::InitThread: Creating Mass Storage Controller\n"));
-	TRAPD(err, iMassStorageController->CreateL(iDriveMap));
-	if (err != KErrNone)
-		{
-		gSemThreadReady.Signal();
-		CActiveScheduler::Install(NULL);
-		User::Leave(err);
-		}
+    __PRINT(_L("CMassStorageFileSystem::InitThread: Creating Mass Storage Controller\n"));
+    TRAPD(err, iMassStorageController->CreateL(iDriveMap));
+    if (err != KErrNone)
+        {
+        gSemThreadReady.Signal();
+        CActiveScheduler::Install(NULL);
+        User::Leave(err);
+        }
 
-	CleanupStack::Pop(sched);
+    CleanupStack::Pop(sched);
 
-	iRunning = ETrue;
-	gSemThreadReady.Signal();
-	gSemThreadReady.Close();
-	CActiveScheduler::Start();
+    iRunning = ETrue;
+    gSemThreadReady.Signal();
+    gSemThreadReady.Close();
+    CActiveScheduler::Start();
 
 //========= stop thread ================
-	delete iMassStorageController;
-	iMassStorageController = NULL;
+    delete iMassStorageController;
+    iMassStorageController = NULL;
 
-	for (TInt i=0; i < iMediaChangedStatusList.Count(); i++)
-		{
+    for (TInt i=0; i < iMediaChangedStatusList.Count(); i++)
+        {
         iMediaChangedStatusList[i].iLocalDrive.Disconnect();
-		}
-	iMediaChangedStatusList.Reset();
+        }
+    iMediaChangedStatusList.Reset();
 
-	delete sched;
-	iRunning = EFalse;
-	return KErrNone;
-	}
+    delete sched;
+    iRunning = EFalse;
+    return KErrNone;
+    }
 
 /**
 Not supported in Mass Storage file system.
@@ -321,11 +306,10 @@
 @leave KErrNotReady
 */
 CFileCB* CMassStorageFileSystem::NewFileL() const
-	{
-    __MSFNSLOG
-	User::Leave(KErrNotReady);
-	return NULL;
-	}
+    {
+    User::Leave(KErrNotReady);
+    return NULL;
+    }
 
 /**
 Not supported in Mass Storage file system.
@@ -333,11 +317,10 @@
 @leave KErrNotReady
 */
 CDirCB* CMassStorageFileSystem::NewDirL() const
-	{
-    __MSFNSLOG
-	User::Leave(KErrNotReady);
-	return NULL;
-	}
+    {
+    User::Leave(KErrNotReady);
+    return NULL;
+    }
 
 /**
 Not supported in Mass Storage file system.
@@ -345,11 +328,10 @@
 @leave KErrNotReady
 */
 CFormatCB* CMassStorageFileSystem::NewFormatL() const
-	{
-    __MSFNSLOG
-	User::Leave(KErrNotReady);
-	return NULL;
-	}
+    {
+    User::Leave(KErrNotReady);
+    return NULL;
+    }
 
 /**
 Not supported in Mass Storage file system.
@@ -357,10 +339,9 @@
 @return KErrNotSupported
 */
 TInt CMassStorageFileSystem::DefaultPath(TDes& /*aPath*/) const
-	{
-    __MSFNSLOG
-	return KErrNotSupported;
-	}
+    {
+    return KErrNotSupported;
+    }
 
 /**
 Not supported in Mass Storage file system.
@@ -368,66 +349,65 @@
 @return KErrNotSupported
 */
 TInt CMassStorageFileSystem::DriveList(TDriveList& /*aList*/) const
-	{
-    __MSFNSLOG
-	return KErrNotSupported;
-	}
+    {
+    return KErrNotSupported;
+    }
 
 /**
 Thread entry point.
 */
 LOCAL_C TInt MsInitThreadFn(TAny* aPtr)
-	{
-	User::SetCritical(User::ESystemCritical);
-	((CMassStorageFileSystem*)aPtr)->InitThread();
-	//Rename the thread so we can create a new one with the same original name later
-	User::RenameThread(KMsDeadThreadName);
-	return KErrNone;
-	}
+    {
+    User::SetCritical(User::ESystemCritical);
+    ((CMassStorageFileSystem*)aPtr)->InitThread();
+    //Rename the thread so we can create a new one with the same original name later
+    User::RenameThread(KMsDeadThreadName);
+    return KErrNone;
+    }
 
 /**
 Standard entry point for file systems.
 Creates a new file system object and starts a new thread for the Mass Storage controller.
 */
 extern "C" EXPORT_C CFileSystem* CreateFileSystem()
-	{
-	__PRINT(_L("CMassStorageFileSystem::CreateFileSystem In\n"));
-	RSemaphore gSemThreadReady;
-	TInt err = gSemThreadReady.CreateGlobal(KMsFsysSemName, 0);
-	if (err != KErrNone)
-		{
-		__PRINT1(_L("CMassStorageFileSystem::CreateFileSystem Out Semaphore Error %d\n"),err);
-		return NULL;
-		}
+    {
+    __PRINT(_L("CMassStorageFileSystem::CreateFileSystem In\n"));
+    RSemaphore gSemThreadReady;
+    TInt err = gSemThreadReady.CreateGlobal(KMsFsysSemName, 0);
+    if (err != KErrNone)
+        {
+        __PRINT1(_L("CMassStorageFileSystem::CreateFileSystem Out Semaphore Error %d\n"),err);
+        return NULL;
+        }
 
-	CFileSystem* msFsys = NULL;
-	TRAP(err,  msFsys = CMassStorageFileSystem::NewL());
-	if (err != KErrNone)
-		{
-		__PRINT1(_L("CMassStorageFileSystem::CreateFileSystem Out MSFS Error %d\n"),err);
-		gSemThreadReady.Close();
-		return NULL;
-		}
+    CFileSystem* msFsys = NULL;
+    TRAP(err,  msFsys = CMassStorageFileSystem::NewL());
+    if (err != KErrNone)
+        {
+        __PRINT1(_L("CMassStorageFileSystem::CreateFileSystem Out MSFS Error %d\n"),err);
+        gSemThreadReady.Close();
+        return NULL;
+        }
 
-	RThread msThread;
-	__PRINT(_L("CMassStorageFileSystem::CreateFileSystem: Creating Mass Storage thread\n"));
-	err = msThread.Create(KMsThreadName, MsInitThreadFn, KDefaultStackSize, NULL, msFsys);
-	if (err != KErrNone)
-		{
-		__PRINT1(_L("CMassStorageFileSystem::CreateFileSystem Out Thread Error %d\n"),err);
-		gSemThreadReady.Close();
-		return msFsys;
-		}
-	((CMassStorageFileSystem*)msFsys)->iInstalled=ETrue;
+    RThread msThread;
+    __PRINT(_L("CMassStorageFileSystem::CreateFileSystem: Creating Mass Storage thread\n"));
+    err = msThread.Create(KMsThreadName, MsInitThreadFn, KDefaultStackSize, NULL, msFsys);
+    if (err != KErrNone)
+        {
+        __PRINT1(_L("CMassStorageFileSystem::CreateFileSystem Out Thread Error %d\n"),err);
+        gSemThreadReady.Close();
+        return msFsys;
+        }
+    ((CMassStorageFileSystem*)msFsys)->iInstalled=ETrue;
 
 
-	msThread.Logon(((CMassStorageFileSystem*)msFsys)->iThreadStat);
-	msThread.Resume();
-	gSemThreadReady.Wait();
-	gSemThreadReady.Close();
-	msThread.Close();
+    msThread.Logon(((CMassStorageFileSystem*)msFsys)->iThreadStat);
+    msThread.Resume();
+    gSemThreadReady.Wait();
+    gSemThreadReady.Close();
+    msThread.Close();
 
-	__PRINT(_L("CMassStorageFileSystem::CreateFileSystem Out Clean\n"));
+    __PRINT(_L("CMassStorageFileSystem::CreateFileSystem Out Clean\n"));
 
-	return msFsys;
-	}
+    return msFsys;
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cmassstoragemountcb.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cmassstoragemountcb.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // CMassStorageMountCB implementation.
-// 
+//
 //
 
 
@@ -37,13 +37,13 @@
 
 CMassStorageMountCB::CMassStorageMountCB(const TLunToDriveMap& aDriveMapping)
 :   iDriveMapping(aDriveMapping)
-	{
-	}
+    {
+    }
 
 CMassStorageMountCB* CMassStorageMountCB::NewL(const TLunToDriveMap& aDriveMapping)
-	{
-	return new (ELeave) CMassStorageMountCB(aDriveMapping);
-	}
+    {
+    return new (ELeave) CMassStorageMountCB(aDriveMapping);
+    }
 
 /**
 Checks that the drive number is supported.
@@ -51,18 +51,17 @@
 @leave KErrNotReady The drive number is not supported.
 */
 TInt CMassStorageMountCB::CheckDriveNumberL()
-	{
-	__FNLOG("CMassStorageMountCB::CheckDriveNumberL");
-	TInt driveNumber;
-	driveNumber = Drive().DriveNumber();
-	if (!IsValidLocalDriveMapping(driveNumber))
-		{
-		__PRINT1(_L("CMassStorageMountCB::CheckDriveNumberL: Drive number %d not supported"), driveNumber);
-		User::Leave(KErrNotReady);
-		}
-	__PRINT1(_L("CMassStorageMountCB::CheckDriveNumberL: Drive number = %d"), driveNumber);
-	return driveNumber;
-	}
+    {
+    TInt driveNumber;
+    driveNumber = Drive().DriveNumber();
+    if (!IsValidLocalDriveMapping(driveNumber))
+        {
+        __PRINT1(_L("CMassStorageMountCB::CheckDriveNumberL: Drive number %d not supported"), driveNumber);
+        User::Leave(KErrNotReady);
+        }
+    __PRINT1(_L("CMassStorageMountCB::CheckDriveNumberL: Drive number = %d"), driveNumber);
+    return driveNumber;
+    }
 
 /**
 Registers the drive with the Mass Storage drive manager.
@@ -70,56 +69,54 @@
 @leave KErrNotSupported The drive is not compatible with Mass Storage.
 */
 void CMassStorageMountCB::MountL(TBool /*aForceMount*/)
-	{
-	__FNLOG("CMassStorageMountCB::MountL");
+    {
+    CheckDriveNumberL();
+    CMassStorageFileSystem& msFsys = *reinterpret_cast<CMassStorageFileSystem*>(Drive().GetFSys());
 
-	CheckDriveNumberL();
-	CMassStorageFileSystem& msFsys = *reinterpret_cast<CMassStorageFileSystem*>(Drive().GetFSys());
-
-	TInt lun = DriveNumberToLun(Drive().DriveNumber());
+    TInt lun = DriveNumberToLun(Drive().DriveNumber());
 
-	if(lun < 0)
-		{
-		// This is not a supported Mass Storage drive
-		User::Leave(KErrNotSupported);
-		}
+    if(lun < 0)
+        {
+        // This is not a supported Mass Storage drive
+        User::Leave(KErrNotSupported);
+        }
 
-	TBusLocalDrive& localDrive = msFsys.iMediaChangedStatusList[lun].iLocalDrive;
+    TBusLocalDrive& localDrive = msFsys.iMediaChangedStatusList[lun].iLocalDrive;
 
-	TInt err = CreateLocalDrive(localDrive);
-	User::LeaveIfError(err);
+    TInt err = CreateLocalDrive(localDrive);
+    User::LeaveIfError(err);
 
-	CProxyDrive* proxyDrive = LocalDrive();
+    CProxyDrive* proxyDrive = LocalDrive();
 
-	TLocalDriveCapsV2Buf caps;
-	err = localDrive.Caps(caps);
+    TLocalDriveCapsV2Buf caps;
+    err = localDrive.Caps(caps);
 
-	//Make sure file system is FAT and removable
-	if (err == KErrNone)
-		{
-		err = KErrNotSupported;
-		if ((caps().iDriveAtt & KDriveAttRemovable) == KDriveAttRemovable)
-			{
-			if (caps().iType != EMediaNotPresent)
-				{
-				err = KErrNone;
-				}
-			}
-		}
+    //Make sure file system is FAT and removable
+    if (err == KErrNone)
+        {
+        err = KErrNotSupported;
+        if ((caps().iDriveAtt & KDriveAttRemovable) == KDriveAttRemovable)
+            {
+            if (caps().iType != EMediaNotPresent)
+                {
+                err = KErrNone;
+                }
+            }
+        }
 
-	if (err != KErrNone && err != KErrNotReady)
-		{
-		__PRINT1(_L("CMassStorageMountCB::MountL: Drive is not compatible with Mass Storage, err=%d"), err);
-		User::Leave(err);
-		}
+    if (err != KErrNone && err != KErrNotReady)
+        {
+        __PRINT1(_L("CMassStorageMountCB::MountL: Drive is not compatible with Mass Storage, err=%d"), err);
+        User::Leave(err);
+        }
 
-	__PRINT(_L("CMassStorageMountCB::MountL: Registering drive"));
-	// Set media changed to true so that Win2K doesn't used cached drive data
-	TBool& mediaChanged = msFsys.iMediaChangedStatusList[lun].iMediaChanged;
+    __PRINT(_L("CMassStorageMountCB::MountL: Registering drive"));
+    // Set media changed to true so that Win2K doesn't used cached drive data
+    TBool& mediaChanged = msFsys.iMediaChangedStatusList[lun].iMediaChanged;
     mediaChanged = ETrue;
-	msFsys.Controller().DriveManager().RegisterDriveL(*proxyDrive, mediaChanged, lun);
-	SetVolumeName(_L("MassStorage").AllocL());
-	}
+    msFsys.Controller().DriveManager().RegisterDriveL(*proxyDrive, mediaChanged, lun);
+    SetVolumeName(_L("MassStorage").AllocL());
+    }
 
 /**
 Returns the LUN that corresponds to the specified drive number.
@@ -127,39 +124,37 @@
 @param aDriveNumber The drive number.
 */
 TInt CMassStorageMountCB::DriveNumberToLun(TInt aDriveNumber)
-	{
-	__FNLOG("CMassStorageMountCB::DriveNumberToLun");
-	TInt lun = -1;
-	for (TInt i = 0; i < iDriveMapping.Count(); i++)
-		{
-		if (iDriveMapping[i] == aDriveNumber)
-			{
-			lun = i;
-			break;
-			}
-		}
-	__PRINT2(_L("CMassStorageMountCB::DriveNumberToLun: Drive %d maps to LUN %d"), aDriveNumber, lun);
-	return lun;
-	}
+    {
+    TInt lun = -1;
+    for (TInt i = 0; i < iDriveMapping.Count(); i++)
+        {
+        if (iDriveMapping[i] == aDriveNumber)
+            {
+            lun = i;
+            break;
+            }
+        }
+    __PRINT2(_L("CMassStorageMountCB::DriveNumberToLun: Drive %d maps to LUN %d"), aDriveNumber, lun);
+    return lun;
+    }
 
 /**
 Deregisters the drive from the Drive Manager.
 */
 void CMassStorageMountCB::Dismounted()
-	{
-	__FNLOG("CMassStorageMountCB::Dismounted");
-	TInt driveNumber = -1;
-	TRAPD(err, driveNumber = CheckDriveNumberL());
-	if (err != KErrNone)
-		{
-		return;
-		}
-	__PRINT(_L("CMassStorageMountCB::Dismounted: Deregistering drive"));
+    {
+    TInt driveNumber = -1;
+    TRAPD(err, driveNumber = CheckDriveNumberL());
+    if (err != KErrNone)
+        {
+        return;
+        }
+    __PRINT(_L("CMassStorageMountCB::Dismounted: Deregistering drive"));
     CMassStorageFileSystem& msFsys = *reinterpret_cast<CMassStorageFileSystem*>(Drive().GetFSys());
-	msFsys.Controller().DriveManager().DeregisterDrive(DriveNumberToLun(driveNumber));
+    msFsys.Controller().DriveManager().DeregisterDrive(DriveNumberToLun(driveNumber));
 
-	DismountedLocalDrive();
-	}
+    DismountedLocalDrive();
+    }
 
 /**
 Unlocks the drive with the specified password, optionally storing the password for later use.
@@ -168,196 +163,194 @@
 @param aStore True if the password is to be stored.
 */
 TInt CMassStorageMountCB::Unlock(TMediaPassword& aPassword, TBool aStore)
-	{
-	__FNLOG("CMassStorageMountCB::Unlock");
-	TInt driveNumber = -1;
-	TRAPD(err, driveNumber = CheckDriveNumberL());
-	if (err != KErrNone)
-		{
-		return err;
-		}
-	TBusLocalDrive& localDrive=GetLocalDrive(driveNumber);
-	if(localDrive.Status() == KErrLocked)
-		{
-		localDrive.Status() = KErrNotReady;
-		}
-	TInt r = localDrive.Unlock(aPassword, aStore);
-	if(r == KErrNone && aStore)
-		{
-		WritePasswordData();
-		}
-	return(r);
-	}
+    {
+    TInt driveNumber = -1;
+    TRAPD(err, driveNumber = CheckDriveNumberL());
+    if (err != KErrNone)
+        {
+        return err;
+        }
+    TBusLocalDrive& localDrive=GetLocalDrive(driveNumber);
+    if(localDrive.Status() == KErrLocked)
+        {
+        localDrive.Status() = KErrNotReady;
+        }
+    TInt r = localDrive.Unlock(aPassword, aStore);
+    if(r == KErrNone && aStore)
+        {
+        WritePasswordData();
+        }
+    return(r);
+    }
 
 /**
 Stores the password for the drive to the password file.
 */
 void CMassStorageMountCB::WritePasswordData()
-	{
-	__FNLOG("CMassStorageMountCB::WritePasswordData");
-	TBusLocalDrive& local=GetLocalDrive(Drive().DriveNumber());
-	TInt length = local.PasswordStoreLengthInBytes();
-	if(length==0)
-		{
-		TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
-		mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
-		WriteToDisk(mediaPWrdFile,_L8(""));
-		return;
-		}
-	HBufC8* hDes=HBufC8::New(length);
-	if(hDes==NULL)
-		{
-		return;
-		}
-	TPtr8 pDes=hDes->Des();
-	TInt r=local.ReadPasswordData(pDes);
-	if(r==KErrNone)
-		{
-		TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
-		mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
-		WriteToDisk(mediaPWrdFile,pDes);
-		}
-	delete hDes;
-	}
+    {
+    TBusLocalDrive& local=GetLocalDrive(Drive().DriveNumber());
+    TInt length = local.PasswordStoreLengthInBytes();
+    if(length==0)
+        {
+        TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
+        mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
+        WriteToDisk(mediaPWrdFile,_L8(""));
+        return;
+        }
+    HBufC8* hDes=HBufC8::New(length);
+    if(hDes==NULL)
+        {
+        return;
+        }
+    TPtr8 pDes=hDes->Des();
+    TInt r=local.ReadPasswordData(pDes);
+    if(r==KErrNone)
+        {
+        TBuf<sizeof(KMediaPWrdFile)> mediaPWrdFile(KMediaPWrdFile);
+        mediaPWrdFile[0] = (TUint8) RFs::GetSystemDriveChar();
+        WriteToDisk(mediaPWrdFile,pDes);
+        }
+    delete hDes;
+    }
 
 
 TInt CMassStorageMountCB::ReMount()
-	{
+    {
     RDebug::Printf("CMassStorageMountCB::ReMount()");
-	return KErrNotReady;
-	}
+    return KErrNotReady;
+    }
 
 void CMassStorageMountCB::VolumeL(TVolumeInfo& /*aVolume*/) const
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::SetVolumeL(TDes& /*aName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::MkDirL(const TDesC& /*aName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::RmDirL(const TDesC& /*aName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::DeleteL(const TDesC& /*aName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::RenameL(const TDesC& /*anOldName*/,const TDesC& /*anNewName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::ReplaceL(const TDesC& /*anOldName*/,const TDesC& /*anNewName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::EntryL(const TDesC& /*aName*/,TEntry& /*anEntry*/) const
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::SetEntryL(const TDesC& /*aName*/,const TTime& /*aTime*/,TUint /*aSetAttMask*/,TUint /*aClearAttMask*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::FileOpenL(const TDesC& /*aName*/,TUint /*aMode*/,TFileOpen /*anOpen*/,CFileCB* /*aFile*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::DirOpenL(const TDesC& /*aName*/,CDirCB* /*aDir*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 
 void CMassStorageMountCB::RawReadL(TInt64 /*aPos*/,TInt /*aLength*/,const TAny* /*aTrg*/,TInt /*anOffset*/,const RMessagePtr2& /*aMessage*/) const
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::RawWriteL(TInt64 /*aPos*/,TInt /*aLength*/,const TAny* /*aSrc*/,TInt /*anOffset*/,const RMessagePtr2& /*aMessage*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 
 void CMassStorageMountCB::GetShortNameL(const TDesC& /*aLongName*/,TDes& /*aShortName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 void CMassStorageMountCB::GetLongNameL(const TDesC& /*aShorName*/,TDes& /*aLongName*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 #if defined(_DEBUG)
 TInt CMassStorageMountCB::ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2)
 //
 // Debug function
 //
-	{
-	if(aCommand>=(KMaxTInt/2))
-		return LocalDrive()->ControlIO(aMessage,aCommand-(KMaxTInt/2),aParam1,aParam2);
-	else
-		return KErrNotSupported;
-	}
+    {
+    if(aCommand>=(KMaxTInt/2))
+        return LocalDrive()->ControlIO(aMessage,aCommand-(KMaxTInt/2),aParam1,aParam2);
+    else
+        return KErrNotSupported;
+    }
 #else
 TInt CMassStorageMountCB::ControlIO(const RMessagePtr2& /*aMessage*/,TInt /*aCommand*/,TAny* /*aParam1*/,TAny* /*aParam2*/)
-	{return(KErrNotSupported);}
+    {return(KErrNotSupported);}
 #endif
 
 void CMassStorageMountCB::ReadSectionL(const TDesC& /*aName*/,TInt /*aPos*/,TAny* /*aTrg*/,TInt /*aLength*/,const RMessagePtr2& /*aMessage*/)
-	{
-	User::Leave(KErrNotReady);
-	}
+    {
+    User::Leave(KErrNotReady);
+    }
 
 /**
 Returns ETrue if aNum is a power of two
 */
 TBool CMassStorageMountCB::IsPowerOfTwo(TInt aNum)
-	{
+    {
 
-	if (aNum==0)
-		return(EFalse);
+    if (aNum==0)
+        return(EFalse);
 
-	while(aNum)
-		{
-		if (aNum & 0x01)
-			{
-			if (aNum>>1)
-				return EFalse;
-			break;
-			}
-		aNum>>=1;
-		}
-	return ETrue;
-	}
+    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
 */
 TInt CMassStorageMountCB::Log2(TInt aNum)
-	{
+    {
 
-	TInt res=-1;
-	while(aNum)
-		{
-		res++;
-		aNum>>=1;
-		}
-	return(res);
-	}
+    TInt res=-1;
+    while(aNum)
+        {
+        res++;
+        aNum>>=1;
+        }
+    return(res);
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cusbmassstoragecontroller.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cusbmassstoragecontroller.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // CUsbMassStorageController implementation.
-// 
+//
 //
 
 
@@ -40,19 +40,15 @@
 #include "cusbmassstorageserver.h"
 #include "cusbmassstoragecontroller.h"
 #include "debug.h"
-#include "msdebug.h"
-
-
 
 
 CUsbMassStorageController* CUsbMassStorageController::NewL()
     {
-    __MSFNSLOG
-	CUsbMassStorageController* self = new (ELeave) CUsbMassStorageController();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
+    CUsbMassStorageController* self = new (ELeave) CUsbMassStorageController();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
     }
 
 
@@ -62,26 +58,25 @@
 
 
 void CUsbMassStorageController::ConstructL()
-	{
+    {
 #ifdef MSDC_TESTMODE
     // TestParser for modifying client behaviour to create  BOT 13 Case device
     // exceptions conditions
     __TESTMODEPRINT("Test Mode is active");
     iTestParser = new (ELeave) TTestParser;
 #endif
-	}
+    }
 
 /**
 Destructor
 */
 CUsbMassStorageController::~CUsbMassStorageController()
-	{
-    __MSFNLOG
-	delete iServer;
-	delete iProtocol;
-	delete iTransport;
-	delete iDriveManager;
-	}
+    {
+    delete iServer;
+    delete iProtocol;
+    delete iTransport;
+    delete iDriveManager;
+    }
 
 /**
 Creates the drive manager, transport, protocol and server
@@ -89,28 +84,27 @@
 @param aMaxDrives Maximum number of Mass Storage drives supported.
 */
 void CUsbMassStorageController::CreateL(const TLunToDriveMap& aDriveMapping)
-	{
-    __MSFNLOG
-	//Create and init drive manager
-	iDriveManager = CDriveManager::NewL(aDriveMapping);
+    {
+    //Create and init drive manager
+    iDriveManager = CDriveManager::NewL(aDriveMapping);
 
-	//Create transport and protocol and initialize them
-	__PRINT(_L("CUsbMassStorageController::CreateL: Creating transport and protocol"));
+    //Create transport and protocol and initialize them
+    __PRINT(_L("CUsbMassStorageController::CreateL: Creating transport and protocol"));
 #ifdef MSDC_TESTMODE
-	iTransport = CBulkOnlyTransport::NewL(aDriveMapping.Count(), *this, iTestParser);
-	iProtocol = CScsiServerProtocol::NewL(*iDriveManager, iTestParser);
+    iTransport = CBulkOnlyTransport::NewL(aDriveMapping.Count(), *this, iTestParser);
+    iProtocol = CScsiServerProtocol::NewL(*iDriveManager, iTestParser);
 #else
-	iTransport = CBulkOnlyTransport::NewL(aDriveMapping.Count(), *this);
-	iProtocol = CScsiServerProtocol::NewL(*iDriveManager);
+    iTransport = CBulkOnlyTransport::NewL(aDriveMapping.Count(), *this);
+    iProtocol = CScsiServerProtocol::NewL(*iDriveManager);
 #endif
-	iTransport->RegisterProtocol(*iProtocol);
-	iProtocol->RegisterTransport(iTransport);
+    iTransport->RegisterProtocol(*iProtocol);
+    iProtocol->RegisterTransport(iTransport);
 
-	//Create and start server
-	__PRINT(_L("CUsbMassStorageController::CreateL: Creating server"));
-	iServer = CUsbMassStorageServer::NewLC(*this);
-	CleanupStack::Pop(iServer);
-	}
+    //Create and start server
+    __PRINT(_L("CUsbMassStorageController::CreateL: Creating server"));
+    iServer = CUsbMassStorageServer::NewLC(*this);
+    CleanupStack::Pop(iServer);
+    }
 
 /**
 Returns a reference to the drive manager
@@ -118,10 +112,9 @@
 @return A reference to the drive manager
 */
 CDriveManager& CUsbMassStorageController::DriveManager()
-	{
-    __MSFNLOG
-	return *iDriveManager;
-	}
+    {
+    return *iDriveManager;
+    }
 
 /**
 Starts the transport and initializes the protocol.
@@ -129,57 +122,54 @@
 @param aConfig Reference to Mass Storage configuration data
 */
 TInt CUsbMassStorageController::Start(const TMassStorageConfig& aConfig)
-	{
-    __MSFNLOG
-	//Save this value for use in the Reset method.
-	iConfig = aConfig;
-	TInt err = KErrNotReady;
-	if (iProtocol && iTransport)
-		{
-		__PRINT(_L("CUsbMassStorageController::Start: Starting"));
-		iProtocol->SetParameters(aConfig);
-		err = iTransport->Start();
-		}
-	return err;
-	}
+    {
+    //Save this value for use in the Reset method.
+    iConfig = aConfig;
+    TInt err = KErrNotReady;
+    if (iProtocol && iTransport)
+        {
+        __PRINT(_L("CUsbMassStorageController::Start: Starting"));
+        iProtocol->SetParameters(aConfig);
+        err = iTransport->Start();
+        }
+    return err;
+    }
 
 /**
 Stops the transport.
 */
 TInt CUsbMassStorageController::Stop()
-	{
-    __MSFNLOG
-	TInt err = KErrNotReady;
-	if (iTransport)
-		{
-		__PRINT(_L("CUsbMassStorageController::Stop: Stopping"));
-		err = iTransport->Stop();
-		}
+    {
+    TInt err = KErrNotReady;
+    if (iTransport)
+        {
+        __PRINT(_L("CUsbMassStorageController::Stop: Stopping"));
+        err = iTransport->Stop();
+        }
 
-	iDriveManager->SetCritical(CDriveManager::KAllLuns, EFalse);   //unset critical
-	return err;
-	}
+    iDriveManager->SetCritical(CDriveManager::KAllLuns, EFalse);   //unset critical
+    return err;
+    }
 
 /**
 Delete the transport and protocol and start new ones.
 */
 void CUsbMassStorageController::Reset()
-	{
-    __MSFNLOG
-	delete iProtocol;
-	iProtocol = NULL;
+    {
+    delete iProtocol;
+    iProtocol = NULL;
 
-	//Create transport and protocol and initialize them
-	__PRINT(_L("CUsbMassStorageController::Reset: Creating  protocol"));
+    //Create transport and protocol and initialize them
+    __PRINT(_L("CUsbMassStorageController::Reset: Creating  protocol"));
 
 #ifdef MSDC_TESTMODE
-	TRAPD(err,iProtocol = CScsiServerProtocol::NewL(*iDriveManager, iTestParser));
+    TRAPD(err,iProtocol = CScsiServerProtocol::NewL(*iDriveManager, iTestParser));
 #else
-	TRAPD(err,iProtocol = CScsiServerProtocol::NewL(*iDriveManager));
+    TRAPD(err,iProtocol = CScsiServerProtocol::NewL(*iDriveManager));
 #endif
-	err = err;
-	__ASSERT_DEBUG(err==KErrNone, User::Invariant());
-	iTransport->RegisterProtocol(*iProtocol);
-	iProtocol->RegisterTransport(iTransport);
+    err = err;
+    __ASSERT_DEBUG(err==KErrNone, User::Invariant());
+    iTransport->RegisterProtocol(*iProtocol);
+    iProtocol->RegisterTransport(iTransport);
     iProtocol->SetParameters(iConfig);
-	}
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cusbmassstoragesession.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/cusbmassstoragesession.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // Implements a Session of a Symbian OS server for the RUsbMassStorage API
-// 
+//
 //
 
 
@@ -33,136 +33,127 @@
 #include "cusbmassstorageserver.h"
 
 #include "debug.h"
-#include "msdebug.h"
 
 /**
  Construct a Symbian OS session object.
 
- @param	aServer		Service the session will be a member of
- @param	aMessage	The message from the client.
- @return	A new CUsbMassStorageSession object
+ @param aServer     Service the session will be a member of
+ @param aMessage    The message from the client.
+ @return    A new CUsbMassStorageSession object
  */
 CUsbMassStorageSession* CUsbMassStorageSession::NewL(CUsbMassStorageServer& aServer)
-	{
-    __MSFNSLOG
-	CUsbMassStorageSession* r = new (ELeave) CUsbMassStorageSession(aServer);
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
-	}
+    {
+    CUsbMassStorageSession* r = new (ELeave) CUsbMassStorageSession(aServer);
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
+    }
 
 /**
  Constructor.
 
- @param	aServer	Service the session will be a member of
+ @param aServer Service the session will be a member of
  */
 CUsbMassStorageSession::CUsbMassStorageSession(CUsbMassStorageServer& aServer)
-	: iUsbMsServer(aServer)
-	{
-    __MSFNLOG
-	}
+    : iUsbMsServer(aServer)
+    {
+    }
 
 
 /**
  2nd Phase Construction.
  */
 void CUsbMassStorageSession::ConstructL()
-	{
-    __MSFNLOG
-	iUsbMsServer.IncrementSessionCount();
+    {
+    iUsbMsServer.IncrementSessionCount();
     if (iUsbMsServer.SessionCount() > 1)
         {
         __PRINT1(_L("\tiSessionCount: %d\n"), iUsbMsServer.SessionCount());
         // Only one session is allowed
         User::Leave(KErrInUse);
         }
- 	}
+    }
 
 
 /**
  Destructor.
  */
 CUsbMassStorageSession::~CUsbMassStorageSession()
-	{
-    __MSFNLOG
-	iUsbMsServer.DecrementSessionCount();
-	}
+    {
+    iUsbMsServer.DecrementSessionCount();
+    }
 
 /**
  Called when a message is received from the client.
 
- @param	aMessage	Message received from the client
+ @param aMessage    Message received from the client
  */
 void CUsbMassStorageSession::ServiceL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	DispatchMessageL(aMessage);
-	}
+    {
+    DispatchMessageL(aMessage);
+    }
 
 /**
  Handles the request (in the form of a the message) received from the client
 
  @internalTechnology
- @param	aMessage	The received message
+ @param aMessage    The received message
  */
 void CUsbMassStorageSession::DispatchMessageL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	TInt ret = KErrNone;
+    {
+    TInt ret = KErrNone;
 
-	switch (aMessage.Function())
-		{
-	case EUsbMsStart:
-		ret = Start(aMessage);
-		break;
-	case EUsbMsStop:
-		ret = Stop();
-		break;
-	case EUsbMsShutdown:
-		ret = Shutdown();
-		break;
+    switch (aMessage.Function())
+        {
+    case EUsbMsStart:
+        ret = Start(aMessage);
+        break;
+    case EUsbMsStop:
+        ret = Stop();
+        break;
+    case EUsbMsShutdown:
+        ret = Shutdown();
+        break;
 
-	default:
-		aMessage.Panic(KUsbMsCliPncCat, EUsbMsPanicIllegalIPC);
-		break;
-		}
+    default:
+        aMessage.Panic(KUsbMsCliPncCat, EUsbMsPanicIllegalIPC);
+        break;
+        }
 
-	aMessage.Complete(ret);
-	}
+    aMessage.Complete(ret);
+    }
 
 /**
  Client request to start the device.
 
- @return	Any error that occurred or KErrNone
+ @return    Any error that occurred or KErrNone
  */
 TInt CUsbMassStorageSession::Start(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	__PRINT(_L("CUsbMassStorageSession::Start\n"));
+    {
+    __PRINT(_L("CUsbMassStorageSession::Start\n"));
 
-	TMassStorageConfig msConfig;
-	TRAPD(err, GetMsConfigL(aMessage, msConfig));
-	if (err != KErrNone)
-		{
-		__PRINT(_L("Failed to get mass storage configuration data\n"));
-		return err;
-		}
+    TMassStorageConfig msConfig;
+    TRAPD(err, GetMsConfigL(aMessage, msConfig));
+    if (err != KErrNone)
+        {
+        __PRINT(_L("Failed to get mass storage configuration data\n"));
+        return err;
+        }
 
-	return iUsbMsServer.Controller().Start(msConfig);
-	}
+    return iUsbMsServer.Controller().Start(msConfig);
+    }
 
 /**
  Client request to stop the device.
 
- @return	Any error that occurred or KErrNone
+ @return    Any error that occurred or KErrNone
  */
 TInt CUsbMassStorageSession::Stop()
     {
-    __MSFNLOG
     TInt err = iUsbMsServer.Controller().Stop();
-	return err;
-	}
+    return err;
+    }
 
 /**
  Client request to shut down the server
@@ -171,18 +162,16 @@
  */
 TInt CUsbMassStorageSession::Shutdown()
     {
-    __MSFNLOG
     CActiveScheduler::Stop();
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
  /**
   Get mass storage configuration data from the received message
   */
  void CUsbMassStorageSession::GetMsConfigL(const RMessage2& aMessage, TMassStorageConfig& aMsStorage)
- 	{
-    __MSFNLOG
- 	aMessage.ReadL(0,aMsStorage.iVendorId);
- 	aMessage.ReadL(1,aMsStorage.iProductId);
- 	aMessage.ReadL(2,aMsStorage.iProductRev);
- 	}
+    {
+    aMessage.ReadL(0,aMsStorage.iVendorId);
+    aMessage.ReadL(1,aMsStorage.iProductId);
+    aMessage.ReadL(2,aMsStorage.iProductRev);
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/drivemanager.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/drivemanager.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // Class implementation of CDriveManager and CMassStorageDrive.
-// 
+//
 //
 
 
@@ -32,7 +32,6 @@
 #include "drivepublisher.h"
 #include "drivemanager.h"
 #include "debug.h"
-#include "msdebug.h"
 
 
 void TMediaParams::Init(TLocalDriveCapsV4& aCaps)
@@ -70,57 +69,55 @@
 
 
 TInt TLocalDriveRef::Read(const TInt64& aPos, TInt aLength, TDes8& aBuf, TBool aWholeMedia)
-	{
-    __MSFNLOG
-
-	TInt err = KErrUnknown; // never return this
+    {
+    TInt err = KErrUnknown; // never return this
 
-	if(aWholeMedia)
-		{
-		err = iProxyDrive.Read(aPos, aLength, &aBuf, KLocalMessageHandle, 0, RLocalDrive::ELocDrvWholeMedia);
-		}
-	else
-		{
-		err = iProxyDrive.Read(aPos, aLength, aBuf);
-		}
+    if(aWholeMedia)
+        {
+        err = iProxyDrive.Read(aPos, aLength, &aBuf, KLocalMessageHandle, 0, RLocalDrive::ELocDrvWholeMedia);
+        }
+    else
+        {
+        err = iProxyDrive.Read(aPos, aLength, aBuf);
+        }
 
-	if (err == KErrLocked)
-		{
-		SetDriveState(TLocalDriveRef::ELocked);
-		}
+    if (err == KErrLocked)
+        {
+        SetDriveState(TLocalDriveRef::ELocked);
+        }
 
-	return err;
-	}
+    return err;
+    }
 
 
 TInt TLocalDriveRef::Write(const TInt64& aPos, TDesC8& aBuf, TBool aWholeMedia)
     {
-	TInt err = KErrNone;
+    TInt err = KErrNone;
 
-	TDriveState oldState = iDriveState;
-	if (oldState != EActive)
+    TDriveState oldState = iDriveState;
+    if (oldState != EActive)
         {
-		// SCSI hasn't called SetCritical
-		SetDriveState(EActive);
-		}
+        // SCSI hasn't called SetCritical
+        SetDriveState(EActive);
+        }
 
-	if (aWholeMedia)
-		{
-		err = iProxyDrive.Write(aPos, aBuf.Length(), &aBuf, KLocalMessageHandle, 0, RLocalDrive::ELocDrvWholeMedia);
-		}
-	else
-		{
-		err = iProxyDrive.Write(aPos,aBuf);
-		}
+    if (aWholeMedia)
+        {
+        err = iProxyDrive.Write(aPos, aBuf.Length(), &aBuf, KLocalMessageHandle, 0, RLocalDrive::ELocDrvWholeMedia);
+        }
+    else
+        {
+        err = iProxyDrive.Write(aPos,aBuf);
+        }
 
-	if (err == KErrLocked)
-		{
-		SetDriveState(ELocked);
-		}
-	else if (oldState != EActive)
-		{
-		SetDriveState(oldState);
-		}
+    if (err == KErrLocked)
+        {
+        SetDriveState(ELocked);
+        }
+    else if (oldState != EActive)
+        {
+        SetDriveState(oldState);
+        }
     return err;
     }
 
@@ -131,15 +128,14 @@
 @param aReset If true, the Media Changed flag is reset to EFalse.
 */
 TBool TLocalDriveRef::IsMediaChanged(TBool aReset)
-	{
-    __MSFNLOG
-	TBool mediaChanged = iMediaChanged;
-	if (aReset)
+    {
+    TBool mediaChanged = iMediaChanged;
+    if (aReset)
         {
-	   	iMediaChanged = EFalse;
-	   	}
-	return mediaChanged;
-	}
+        iMediaChanged = EFalse;
+        }
+    return mediaChanged;
+    }
 
 
 /**
@@ -148,19 +144,18 @@
 @param aCritical ETrue for Active, EFalse for Idle
 */
 TInt TLocalDriveRef::SetCritical(TBool aCritical)
-	{
-    __MSFNLOG
-	TInt err = KErrNone;
+    {
+    TInt err = KErrNone;
     if (iDriveState == EMediaNotPresent)
-		{
-		err = KErrNotReady;
-		}
-	else
-		{
+        {
+        err = KErrNotReady;
+        }
+    else
+        {
         SetDriveState(aCritical ? EActive : EIdle);
-		}
-	return err;
-	}
+        }
+    return err;
+    }
 
 
 /**
@@ -170,23 +165,22 @@
 @param aInfo
 */
 TInt TLocalDriveRef::Caps(TLocalDriveCapsV4& aInfo)
-	{
-    __MSFNLOG
-	TLocalDriveCapsV4Buf buf;
-	buf.FillZ();
+    {
+    TLocalDriveCapsV4Buf buf;
+    buf.FillZ();
 
-	__PRINT(_L("CMassStorageDrive::DoCaps calling Caps\n"));
-	TInt err = iProxyDrive.Caps(buf);
-	__PRINT1(_L("CMassStorageDrive::DoCaps: Caps returned %d\n"), err);
+    __PRINT(_L("CMassStorageDrive::DoCaps calling Caps\n"));
+    TInt err = iProxyDrive.Caps(buf);
+    __PRINT1(_L("CMassStorageDrive::DoCaps: Caps returned %d\n"), err);
 
-	if (err == KErrNone)
-		{
-		// Invoke function call operator to cast to TLocalDriveCapsV4&
-		aInfo = buf();
-		}
+    if (err == KErrNone)
+        {
+        // Invoke function call operator to cast to TLocalDriveCapsV4&
+        aInfo = buf();
+        }
 
-	return err;
-	}
+    return err;
+    }
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -195,68 +189,63 @@
 @param aCritSec A Critical Section object shared by all drives.
 @param aDrives Reference to the list of CMassStorageDrive objects.
 @param aDriveMap Reference to array mapping lun to drive number for supported
-	   mass storage drives.
+       mass storage drives.
 @post Object is fully constructed
  */
 CMassStorageDrive* CMassStorageDrive::NewL(RCriticalSection& aCritSec,
                                            RDriveStateChangedPublisher& aDriveStateChangedPublisher)
     {
-    __MSFNSLOG
-	CMassStorageDrive* self = new (ELeave) CMassStorageDrive(aCritSec, aDriveStateChangedPublisher);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
+    CMassStorageDrive* self = new (ELeave) CMassStorageDrive(aCritSec, aDriveStateChangedPublisher);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
     }
 
 
 CMassStorageDrive::CMassStorageDrive(RCriticalSection& aCritSec,
-									 RDriveStateChangedPublisher& aDriveStateChangedPublisher)
+                                     RDriveStateChangedPublisher& aDriveStateChangedPublisher)
 :   iCritSec(aCritSec),
-	iMountState(EDisconnected),
-	iDriveStateChangedPublisher(aDriveStateChangedPublisher)
-	{
-    __MSFNLOG
-	}
+    iMountState(EDisconnected),
+    iDriveStateChangedPublisher(aDriveStateChangedPublisher)
+    {
+    }
 
 
 void CMassStorageDrive::ConstructL()
     {
-    __MSFNLOG
     iDriveMediaErrorPublisher = new (ELeave) RDriveMediaErrorPublisher();
     }
 
 
 CMassStorageDrive::~CMassStorageDrive()
-	{
-    __MSFNLOG
+    {
     delete iDriveMediaErrorPublisher;
-	delete iLocalDrive;
-	}
+    delete iLocalDrive;
+    }
 
 /**
 Read from the target drive unit.
 @return KErrNone on success, otherwise system wide error code
 */
 TInt CMassStorageDrive::Read(const TInt64& aPos, TInt aLength, TDes8& aBuf, TBool aWholeMedia)
-	{
-    __MSFNLOG
+    {
 
-	TInt err = KErrUnknown; // never return this
-	iCritSec.Wait();
+    TInt err = KErrUnknown; // never return this
+    iCritSec.Wait();
 
-	if(iMountState != EConnected)
-		{
-		err = KErrDisconnected;
-		}
-	else
-		{
+    if(iMountState != EConnected)
+        {
+        err = KErrDisconnected;
+        }
+    else
+        {
         err = iLocalDrive->Read(aPos, aLength, aBuf, aWholeMedia);
-		}
+        }
 
-	iCritSec.Signal();
-	return err;
-	}
+    iCritSec.Signal();
+    return err;
+    }
 
 
 /**
@@ -264,25 +253,23 @@
 @return KErrNone on success, otherwise system wide error code
 */
 TInt CMassStorageDrive::Write(const TInt64& aPos, TDesC8& aBuf, TBool aWholeMedia)
-	{
-    __MSFNLOG
-
-	TInt err = KErrNone;
-	iCritSec.Wait();
+    {
+    TInt err = KErrNone;
+    iCritSec.Wait();
 
-	if (iMountState != EConnected)
-		{
-		err = KErrDisconnected;
-		}
-	else
-		{
-		__ASSERT_DEBUG(iLocalDrive, User::Invariant());
+    if (iMountState != EConnected)
+        {
+        err = KErrDisconnected;
+        }
+    else
+        {
+        __ASSERT_DEBUG(iLocalDrive, User::Invariant());
         err = iLocalDrive->Write(aPos, aBuf, aWholeMedia);
-		}
+        }
 
-	iCritSec.Signal();
-	return err;
-	}
+    iCritSec.Signal();
+    return err;
+    }
 
 
 /**
@@ -292,16 +279,15 @@
 @param aInfo
 */
 TInt CMassStorageDrive::DoCaps(TLocalDriveCapsV4& aInfo)
-	{
-    __MSFNLOG
+    {
     TInt err = KErrDisMounted;
 
     if (iLocalDrive)
         {
         err = iLocalDrive->Caps(aInfo);
         }
-	return err;
-	}
+    return err;
+    }
 
 
 /**
@@ -310,23 +296,21 @@
 Note: User notification is not implemented, instead we abort and dismount.
 */
 TInt CMassStorageDrive::HandleCriticalError()
-	{
-    __MSFNLOG
-	TRAPD(err, iDriveMediaErrorPublisher->PublishErrorL(ETrue));
+    {
+    TRAPD(err, iDriveMediaErrorPublisher->PublishErrorL(ETrue));
     // ignore leave
     err = err;
-	return KErrAbort;
-	}
+    return KErrAbort;
+    }
 
 
 TInt CMassStorageDrive::ClearCriticalError()
-	{
-    __MSFNLOG
-	TRAPD(err, iDriveMediaErrorPublisher->PublishErrorL(EFalse));
+    {
+    TRAPD(err, iDriveMediaErrorPublisher->PublishErrorL(EFalse));
     // ignore leave
     err = err;
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 
 /**
@@ -335,22 +319,20 @@
 @param aReset If true, the Media Changed flag is reset to EFalse.
 */
 TBool CMassStorageDrive::IsMediaChanged(TBool aReset)
-	{
-    __MSFNLOG
-
-	iCritSec.Wait();
+    {
+    iCritSec.Wait();
 
-	TBool mediaChanged = EFalse;
-	if (iLocalDrive)
-		{
-		mediaChanged = iLocalDrive->IsMediaChanged(aReset);
+    TBool mediaChanged = EFalse;
+    if (iLocalDrive)
+        {
+        mediaChanged = iLocalDrive->IsMediaChanged(aReset);
         }
 
-	iCritSec.Signal();
+    iCritSec.Signal();
 
-	__PRINT1(_L("CMassStorageDrive::IsMediaChanged: returning %d\n"), mediaChanged);
-	return mediaChanged;
-	}
+    __PRINT1(_L("CMassStorageDrive::IsMediaChanged: returning %d\n"), mediaChanged);
+    return mediaChanged;
+    }
 
 /**
 Set the Drive State to Active or Idle.
@@ -358,19 +340,17 @@
 @param aCritical ETrue for Active, EFalse for Idle
 */
 TInt CMassStorageDrive::SetCritical(TBool aCritical)
-	{
-    __MSFNLOG
+    {
+    TInt err = KErrDisMounted;
+    iCritSec.Wait();
+    if (iLocalDrive)
+        {
+        err = iLocalDrive->SetCritical(aCritical);
+        }
 
-	TInt err = KErrDisMounted;
-	iCritSec.Wait();
-	if (iLocalDrive)
-		{
-        err = iLocalDrive->SetCritical(aCritical);
-		}
-
-	iCritSec.Signal();
-	return err;
-	}
+    iCritSec.Signal();
+    return err;
+    }
 
 /**
 Set the mount state
@@ -378,24 +358,23 @@
 void CMassStorageDrive::SetMountConnectedL(CProxyDrive& aProxyDrive,
                                            TBool& aMediaChanged,
                                            RDriveStateChangedPublisher& aDriveStateChangedPublisher)
-	{
-    __MSFNLOG
-	TLocalDriveRef* localDrive = NULL;
+    {
+    TLocalDriveRef* localDrive = NULL;
 
-	__PRINT(_L("SetMountConnectedL entering critical section\n"));
-	iCritSec.Wait(); // note: signalled in SetMountState
+    __PRINT(_L("SetMountConnectedL entering critical section\n"));
+    iCritSec.Wait(); // note: signalled in SetMountState
 
-   	TRAPD(err, localDrive = new (ELeave) TLocalDriveRef(aProxyDrive,
+    TRAPD(err, localDrive = new (ELeave) TLocalDriveRef(aProxyDrive,
                                                         aMediaChanged,
                                                         aDriveStateChangedPublisher));
-   	if (err)
-   		{
-   		iCritSec.Signal();
-   		User::Leave(err);
-   		}
-	iLocalDrive = localDrive;
-	SetMountState(EConnected, ETrue);
-	}
+    if (err)
+        {
+        iCritSec.Signal();
+        User::Leave(err);
+        }
+    iLocalDrive = localDrive;
+    SetMountState(EConnected, ETrue);
+    }
 
 /**
 @return KErrNone
@@ -403,144 +382,140 @@
 @param aLocalDrive Only provide this if aNewState is EConnected.
 */
 void CMassStorageDrive::SetMountState(TMountState aNewState, TBool aCriticalSection/*=EFalse*/)
-	{
-    __MSFNLOG
-	if(iMountState == aNewState)
-		{
-		__PRINT(_L("SetMountState: No change\n"));
-		}
-	else
-		{
-		// If called from SetMountConnected, already in critical section,
+    {
+    if(iMountState == aNewState)
+        {
+        __PRINT(_L("SetMountState: No change\n"));
+        }
+    else
+        {
+        // If called from SetMountConnected, already in critical section,
         // otherwise, must enter it here.
         if (!aCriticalSection)
             {
-			iCritSec.Wait();
+            iCritSec.Wait();
             }
 
-		switch(aNewState)
-			{
-			case EDisconnected:
-				delete iLocalDrive;
-				iLocalDrive = NULL;
-				break;
+        switch(aNewState)
+            {
+            case EDisconnected:
+                delete iLocalDrive;
+                iLocalDrive = NULL;
+                break;
 
-			case EConnected:
-			case EDisconnecting:
-			case EConnecting:
-				// Do not change iLocalDrive for these state changes
-				break;
-			}
+            case EConnected:
+            case EDisconnecting:
+            case EConnecting:
+                // Do not change iLocalDrive for these state changes
+                break;
+            }
 
-		iMountState = aNewState;
-		__PRINT1(_L("SetMountState: state=%d\n"), iMountState);
+        iMountState = aNewState;
+        __PRINT1(_L("SetMountState: state=%d\n"), iMountState);
 
-		iDriveStateChangedPublisher.DriveStateChanged();
-		iCritSec.Signal();
-		__PRINT(_L("SetMountState has left the critical section\n"));
-		}
-	}
+        iDriveStateChangedPublisher.DriveStateChanged();
+        iCritSec.Signal();
+        __PRINT(_L("SetMountState has left the critical section\n"));
+        }
+    }
 
 /**
 @return Current drive media state
 */
 TLocalDriveRef::TDriveState CMassStorageDrive::DriveState() const
-	{
-    __MSFNSLOG
-	return iLocalDrive ? iLocalDrive->DriveState() : TLocalDriveRef::EErrDisMounted;
-	}
+    {
+    return iLocalDrive ? iLocalDrive->DriveState() : TLocalDriveRef::EErrDisMounted;
+    }
 
 /**
 Check for media not present, and return the drive state.
 @return Current drive media state
 */
 TLocalDriveRef::TDriveState CMassStorageDrive::CheckDriveState()
-	{
-    __MSFNLOG
-	TLocalDriveRef::TDriveState state = TLocalDriveRef::EErrDisMounted;
-	iCritSec.Wait();
+    {
+    TLocalDriveRef::TDriveState state = TLocalDriveRef::EErrDisMounted;
+    iCritSec.Wait();
 
-	if (iLocalDrive)
-		{
-		TInt err = KErrGeneral;
+    if (iLocalDrive)
+        {
+        TInt err = KErrGeneral;
         TLocalDriveCapsV4 caps;
 
-		FOREVER
-			{
-			// Initialise in case Caps() fails
-			caps.iType = ::EMediaNotPresent;
-			err = DoCaps(caps);
+        FOREVER
+            {
+            // Initialise in case Caps() fails
+            caps.iType = ::EMediaNotPresent;
+            err = DoCaps(caps);
 
-			__PRINTERR(_L("CheckDriveState: DoCaps err=%d\n"), err);
-			if (err == KErrNotReady || (err == KErrNone && caps.iType == ::EMediaNotPresent))
-				{
-				__PRINT(_L("CheckDriveState: detected MediaNotPresent\n"));
+            __PRINTERR(_L("CheckDriveState: DoCaps err=%d\n"), err);
+            if (err == KErrNotReady || (err == KErrNone && caps.iType == ::EMediaNotPresent))
+                {
+                __PRINT(_L("CheckDriveState: detected MediaNotPresent\n"));
 
-				SetDriveState(TLocalDriveRef::EMediaNotPresent);
+                SetDriveState(TLocalDriveRef::EMediaNotPresent);
 
-				if (HandleCriticalError() == KErrAbort)
-					break;
-				}
-			else
-				{
-				ClearCriticalError();
-				break;
-				}
-			}
+                if (HandleCriticalError() == KErrAbort)
+                    break;
+                }
+            else
+                {
+                ClearCriticalError();
+                break;
+                }
+            }
 
-		if (err == KErrNone && caps.iType != ::EMediaNotPresent)
-			{
+        if (err == KErrNone && caps.iType != ::EMediaNotPresent)
+            {
             iMediaParams.Init(caps);
             TLocalDriveRef::TDriveState driveState = TLocalDriveRef::EIdle;
 
-			if (iLocalDrive->DriveState() == TLocalDriveRef::EMediaNotPresent)
-				{
-				__PRINT(_L("CheckDriveState: detected media inserted\n"));
-				}
-			else if (iLocalDrive->DriveState() == TLocalDriveRef::ELocked &&
-					 !(caps.iMediaAtt & KMediaAttLocked))
-				{
-				__PRINT(_L("CheckDriveState: detected media unlocked\n"));
-				}
-			else if (caps.iMediaAtt & KMediaAttLocked)
-				{
-				__PRINT(_L("CheckDriveState: detected media locked\n"));
-				driveState = TLocalDriveRef::ELocked;
-				}
+            if (iLocalDrive->DriveState() == TLocalDriveRef::EMediaNotPresent)
+                {
+                __PRINT(_L("CheckDriveState: detected media inserted\n"));
+                }
+            else if (iLocalDrive->DriveState() == TLocalDriveRef::ELocked &&
+                     !(caps.iMediaAtt & KMediaAttLocked))
+                {
+                __PRINT(_L("CheckDriveState: detected media unlocked\n"));
+                }
+            else if (caps.iMediaAtt & KMediaAttLocked)
+                {
+                __PRINT(_L("CheckDriveState: detected media locked\n"));
+                driveState = TLocalDriveRef::ELocked;
+                }
             SetDriveState(driveState);
-			}
+            }
 
-		// Get the current state
-		state = iLocalDrive->DriveState();
-		}
+        // Get the current state
+        state = iLocalDrive->DriveState();
+        }
 
-	iCritSec.Signal();
+    iCritSec.Signal();
 
-	return state;
-	}
+    return state;
+    }
 
 
 /**
 @param aNewState
 */
 void CMassStorageDrive::SetDriveState(TLocalDriveRef::TDriveState aNewState)
-	{
-    __MSFNLOG
-	__ASSERT_DEBUG(aNewState == TLocalDriveRef::EIdle ||
+    {
+    __ASSERT_DEBUG(aNewState == TLocalDriveRef::EIdle ||
                    (iMountState == EConnected && NULL != iLocalDrive) ||
                    (iMountState == EDisconnecting && NULL != iLocalDrive),
         User::Invariant());
 
-	if (!iLocalDrive)
-		{
-		__PRINT(_L("SetDriveState: Drive not mounted.\n"));
-		}
-	else
-		{
+    if (!iLocalDrive)
+        {
+        __PRINT(_L("SetDriveState: Drive not mounted.\n"));
+        }
+    else
+        {
         iLocalDrive->SetDriveState(aNewState);
-		__PRINT2(_L("SetDriveState: %d->%d\n"), iLocalDrive->iDriveState, aNewState);
-		}
-	}
+        __PRINT2(_L("SetDriveState: %d->%d\n"), iLocalDrive->iDriveState, aNewState);
+        }
+    }
 
 
 /////////////////////////////////////////////////////////////////
@@ -548,61 +523,57 @@
 /**
 Construct a CDriveManager object.
 @param aDriveMap Reference to array mapping lun to drive number for supported
-	   mass storage drives.
+       mass storage drives.
 */
 CDriveManager* CDriveManager::NewL(const TLunToDriveMap& aDriveMap)
-	{
-    __MSFNSLOG
-	__PRINT1(_L("CDriveManager::NewL - %d drives\n"), aDriveMap.Count());
+    {
+    __PRINT1(_L("CDriveManager::NewL - %d drives\n"), aDriveMap.Count());
 
-	CDriveManager* self = new (ELeave) CDriveManager(aDriveMap.Count() -1);
-	CleanupStack::PushL(self);
-	self->ConstructL(aDriveMap);
-	CleanupStack::Pop();
-	return self;
-	}
+    CDriveManager* self = new (ELeave) CDriveManager(aDriveMap.Count() -1);
+    CleanupStack::PushL(self);
+    self->ConstructL(aDriveMap);
+    CleanupStack::Pop();
+    return self;
+    }
 
 CDriveManager::CDriveManager(TLun aMaxLun)
 :   iMaxLun(aMaxLun)
-	{
-    __MSFNLOG
+    {
     }
 
 /**
 Construct a CDriveManager object.
 */
 void CDriveManager::ConstructL(const TLunToDriveMap& aDriveMap)
-	{
-    __MSFNLOG
-	User::LeaveIfError(iDriveCritSec.CreateLocal());
+    {
+    User::LeaveIfError(iDriveCritSec.CreateLocal());
 
     iDriveStateChangedPublisher = new (ELeave) RDriveStateChangedPublisher(iDrives, aDriveMap);
 
     iDrives.Reserve(iMaxLun + 1);
 
-	for (TLun lun = 0; lun < iMaxLun + 1; lun++)
-		{
-		iDrives.Append(CMassStorageDrive::NewL(iDriveCritSec,
+    for (TLun lun = 0; lun < iMaxLun + 1; lun++)
+        {
+        iDrives.Append(CMassStorageDrive::NewL(iDriveCritSec,
                                                *iDriveStateChangedPublisher));
-		}
+        }
 
-	// Publish initial drive state
-	if (iDrives.Count() > 0)
-		{
-		iDriveStateChangedPublisher->DriveStateChanged();
-		}
-	}
+    // Publish initial drive state
+    if (iDrives.Count() > 0)
+        {
+        iDriveStateChangedPublisher->DriveStateChanged();
+        }
+    }
 
 /**
 Destructor
 */
 CDriveManager::~CDriveManager()
-	{
-    __MSFNLOG
-	iDrives.ResetAndDestroy();
-	delete iDriveStateChangedPublisher;
-	iDriveCritSec.Close();
-	}
+    {
+    iDrives.ResetAndDestroy();
+    delete iDriveStateChangedPublisher;
+    iDriveCritSec.Close();
+    }
 
 /**
 Set the mount state to Connected and specify the Proxy Drive.
@@ -614,12 +585,11 @@
 @post The Mount State will be Connected.
 */
 void CDriveManager::RegisterDriveL(CProxyDrive& aProxyDrive, TBool& aMediaChanged, TLun aLun)
-	{
-    __MSFNLOG
-	__PRINT1(_L("Lun=%d \n"),aLun);
-	CMassStorageDrive* drive = Drive(aLun);
-	drive->SetMountConnectedL(aProxyDrive, aMediaChanged, *iDriveStateChangedPublisher);
-	}
+    {
+    __PRINT1(_L("Lun=%d \n"),aLun);
+    CMassStorageDrive* drive = Drive(aLun);
+    drive->SetMountConnectedL(aProxyDrive, aMediaChanged, *iDriveStateChangedPublisher);
+    }
 
 /**
 Set the mount state to Disconnected.
@@ -628,11 +598,10 @@
 @post The Mount State will be Disconnected.
 */
 void CDriveManager::DeregisterDrive(TLun aLun)
-	{
-    __MSFNLOG
+    {
     CMassStorageDrive* drive = Drive(aLun);
-	drive->SetMountDisconnected();
-	}
+    drive->SetMountDisconnected();
+    }
 
 /**
 Return a pointer to the drive specified aLun, or NULL if aLun is invalid.
@@ -642,11 +611,10 @@
 @param aError KErrNone on success, KErrArgument if NULL is returned.
 */
 CMassStorageDrive* CDriveManager::Drive(TLun aLun) const
-	{
-    __MSFNSLOG
-	__ASSERT_DEBUG(aLun < iDrives.Count(), User::Invariant());
+    {
+    __ASSERT_DEBUG(aLun < iDrives.Count(), User::Invariant());
     return iDrives[aLun];
-	}
+    }
 
 /**
 Checks the Media Changed flag, and optionally resets it.
@@ -655,11 +623,10 @@
 @param aReset If true, the Media Changed flag is reset to EFalse.
 */
 TBool CDriveManager::IsMediaChanged(TLun aLun, TBool aReset)
-	{
-    __MSFNLOG
-	CMassStorageDrive* drive = Drive(aLun);
-	return drive->IsMediaChanged(aReset);
-	}
+    {
+    CMassStorageDrive* drive = Drive(aLun);
+    return drive->IsMediaChanged(aReset);
+    }
 
 /**
 Set the Drive State to Active or Idle.
@@ -669,30 +636,28 @@
 @param aCritical ETrue for Active, EFalse for Idle
 */
 TInt CDriveManager::SetCritical(TLun aLun, TBool aCritical)
-	{
-    __MSFNLOG
-	TInt err = KErrUnknown; // never return this
+    {
+    TInt err = KErrUnknown; // never return this
 
-	TLun i = aLun;
-	TLun cnt = aLun + 1;
+    TLun i = aLun;
+    TLun cnt = aLun + 1;
 
-	if (aLun == KAllLuns)
-		{
-		i = 0;
-		cnt = iMaxLun + 1;
-		}
+    if (aLun == KAllLuns)
+        {
+        i = 0;
+        cnt = iMaxLun + 1;
+        }
 
-	for(; i < cnt; i++)
-		{
-		CMassStorageDrive* drive = Drive(i);
-		err = drive->SetCritical(aCritical);
-		}
-	return err;
-	}
+    for(; i < cnt; i++)
+        {
+        CMassStorageDrive* drive = Drive(i);
+        err = drive->SetCritical(aCritical);
+        }
+    return err;
+    }
 
 void CDriveManager::Connect()
-	{
-	__FNLOG("CDriveManager::Connect");
+    {
     TLun lun = iMaxLun;
     do
         {
@@ -708,31 +673,29 @@
 @post The Mount State will be Connected or Connecting.
 */
 void CDriveManager::Connect(TLun aLun)
-	{
-    __MSFNLOG
-	CMassStorageDrive* drive = Drive(aLun);
+    {
+    CMassStorageDrive* drive = Drive(aLun);
 
-	__PRINT2(_L("CDriveManager::Connect lun=%d, mountState=%d\n"), aLun, drive->MountState());
+    __PRINT2(_L("CDriveManager::Connect lun=%d, mountState=%d\n"), aLun, drive->MountState());
 
-   	switch(drive->MountState())
-   		{
- 	case CMassStorageDrive::EDisconnected:
- 		drive->SetMountConnecting();
- 		break;
- 	case CMassStorageDrive::EDisconnecting:
- 		drive->SetMountConnected();
- 		break;
- 	case CMassStorageDrive::EConnected:
- 	case CMassStorageDrive::EConnecting:
+    switch(drive->MountState())
+        {
+    case CMassStorageDrive::EDisconnected:
+        drive->SetMountConnecting();
+        break;
+    case CMassStorageDrive::EDisconnecting:
+        drive->SetMountConnected();
+        break;
+    case CMassStorageDrive::EConnected:
+    case CMassStorageDrive::EConnecting:
     default:
- 		// do nothing
- 		break;
-		}
-	}
+        // do nothing
+        break;
+        }
+    }
 
 void CDriveManager::Disconnect()
-	{
-	__FNLOG("CDriveManager::Disconnect");
+    {
     TLun lun = iMaxLun;
     do
         {
@@ -748,20 +711,19 @@
 @post The Mount State will be Disconnected or Disconnecting.
 */
 void CDriveManager::Disconnect(TLun aLun)
-	{
-    __MSFNLOG
-	CMassStorageDrive* drive = Drive(aLun);
-   	switch (drive->MountState())
-   		{
-   	case CMassStorageDrive::EConnected:
-   		drive->SetMountDisconnecting();
-   		break;
-   	case CMassStorageDrive::EConnecting:
-   		drive->SetMountDisconnected();
-   		break;
-   	case CMassStorageDrive::EDisconnected:
-   	case CMassStorageDrive::EDisconnecting:
-   		// do nothing
-   		break;
-   		}
-	}
+    {
+    CMassStorageDrive* drive = Drive(aLun);
+    switch (drive->MountState())
+        {
+    case CMassStorageDrive::EConnected:
+        drive->SetMountDisconnecting();
+        break;
+    case CMassStorageDrive::EConnecting:
+        drive->SetMountDisconnected();
+        break;
+    case CMassStorageDrive::EDisconnected:
+    case CMassStorageDrive::EDisconnecting:
+        // do nothing
+        break;
+        }
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/drivepublisher.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/drivepublisher.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -20,7 +20,7 @@
 // CUsbTransferPublisher,
 // CUsbReadTransferPublisher,
 // CUsbReadTransferPublisher.
-// 
+//
 //
 
 
@@ -42,39 +42,38 @@
 #include "drivepublisher.h"
 #include "drivemanager.h"
 #include "debug.h"
-#include "msdebug.h"
 
 //
 // Use Lookup table to translate from the internal pair of state variables
 // to the externally published drive state code.
 //
-LOCAL_D	const TUint8 table[][5] =
+LOCAL_D const TUint8 table[][5] =
 {
 //TMountState=EDisconnected
-	{EUsbMsDriveState_Disconnected,
-	 EUsbMsDriveState_Disconnected,
-	 EUsbMsDriveState_Disconnected,
-	 EUsbMsDriveState_Disconnected,
-	 EUsbMsDriveState_Disconnected},
+    {EUsbMsDriveState_Disconnected,
+     EUsbMsDriveState_Disconnected,
+     EUsbMsDriveState_Disconnected,
+     EUsbMsDriveState_Disconnected,
+     EUsbMsDriveState_Disconnected},
 //TMountState=EConnecting
-	{EUsbMsDriveState_Connecting,
-	 EUsbMsDriveState_Connecting,
-	 EUsbMsDriveState_Connecting,
-	 EUsbMsDriveState_Connecting,
-	 EUsbMsDriveState_Connecting},
+    {EUsbMsDriveState_Connecting,
+     EUsbMsDriveState_Connecting,
+     EUsbMsDriveState_Connecting,
+     EUsbMsDriveState_Connecting,
+     EUsbMsDriveState_Connecting},
 //TMountState=EConnected
-	//EIdle,EActive,ELocked,EMediaNotPresent,EErrDisMounted
-	{EUsbMsDriveState_Connected,
-	 EUsbMsDriveState_Active,
-	 EUsbMsDriveState_Locked,
-	 EUsbMsDriveState_MediaNotPresent,
-	 EUsbMsDriveState_Removed},
+    //EIdle,EActive,ELocked,EMediaNotPresent,EErrDisMounted
+    {EUsbMsDriveState_Connected,
+     EUsbMsDriveState_Active,
+     EUsbMsDriveState_Locked,
+     EUsbMsDriveState_MediaNotPresent,
+     EUsbMsDriveState_Removed},
 //TMountState=EDisconnecting
-	{EUsbMsDriveState_Disconnecting,
-	 EUsbMsDriveState_Disconnecting,
-	 EUsbMsDriveState_Disconnecting,
-	 EUsbMsDriveState_Disconnecting,
-	 EUsbMsDriveState_Disconnecting}
+    {EUsbMsDriveState_Disconnecting,
+     EUsbMsDriveState_Disconnecting,
+     EUsbMsDriveState_Disconnecting,
+     EUsbMsDriveState_Disconnecting,
+     EUsbMsDriveState_Disconnecting}
 };
 
 
@@ -83,27 +82,25 @@
 Constructor
 */
 RDriveMediaErrorPublisher::RDriveMediaErrorPublisher()
-	{
-	__MSFNLOG
-	_LIT_SECURITY_POLICY_PASS(KMassStorageReadPolicy);
-	_LIT_SECURITY_POLICY_S0(KMassStorageWritePolicy, KUsbMsDriveState_Category.iUid);
+    {
+    _LIT_SECURITY_POLICY_PASS(KMassStorageReadPolicy);
+    _LIT_SECURITY_POLICY_S0(KMassStorageWritePolicy, KUsbMsDriveState_Category.iUid);
 
-	TInt result = RProperty::Define(EUsbMsDriveState_MediaError, RProperty::EInt,
-									KMassStorageReadPolicy, KMassStorageWritePolicy);
+    TInt result = RProperty::Define(EUsbMsDriveState_MediaError, RProperty::EInt,
+                                    KMassStorageReadPolicy, KMassStorageWritePolicy);
 
-	__ASSERT_DEBUG(result == KErrAlreadyExists || result == KErrNone, User::Invariant());
+    __ASSERT_DEBUG(result == KErrAlreadyExists || result == KErrNone, User::Invariant());
 
-	result = iMediaErrorProperty.Attach(KUsbMsDriveState_Category, EUsbMsDriveState_MediaError);
-	__ASSERT_DEBUG(result == KErrNone, User::Invariant());
-	}
+    result = iMediaErrorProperty.Attach(KUsbMsDriveState_Category, EUsbMsDriveState_MediaError);
+    __ASSERT_DEBUG(result == KErrNone, User::Invariant());
+    }
 
 
 RDriveMediaErrorPublisher::~RDriveMediaErrorPublisher()
-	{
-	__MSFNLOG
-	iMediaErrorProperty.Close();
-	RProperty::Delete(KUsbMsDriveState_Category, EUsbMsDriveState_MediaError);
-	}
+    {
+    iMediaErrorProperty.Close();
+    RProperty::Delete(KUsbMsDriveState_Category, EUsbMsDriveState_MediaError);
+    }
 
 /**
 Publishing method
@@ -113,18 +110,17 @@
 @param aError ETrue if drive media has an error else EFalse for no error
 */
 void RDriveMediaErrorPublisher::PublishErrorL(TBool aError)
-	{
-    __MSFNLOG
-	__PRINT1(_L("<< RDriveMediaErrorPublisher::PublishError %x"), aError);
+    {
+    __PRINT1(_L("<< RDriveMediaErrorPublisher::PublishError %x"), aError);
+
+    TInt oldValue;
+    iMediaErrorProperty.Get(oldValue);
 
-	TInt oldValue;
-	iMediaErrorProperty.Get(oldValue);
-
-	if (oldValue != aError)
-		{
-		User::LeaveIfError(iMediaErrorProperty.Set(aError));
-		}
-	}
+    if (oldValue != aError)
+        {
+        User::LeaveIfError(iMediaErrorProperty.Set(aError));
+        }
+    }
 
 //----------------------------------------------------------------------------
 /**
@@ -134,29 +130,27 @@
 @param aDriveMap
 */
 RDriveStateChangedPublisher::RDriveStateChangedPublisher(const TMsDriveList& aDrives,
-														 const TLunToDriveMap& aDriveMap)
-	:
-	iDrives(aDrives),
-	iDriveMap(aDriveMap)
-	{
-	__MSFNLOG
-	_LIT_SECURITY_POLICY_PASS(KMassStorageReadPolicy);
-	_LIT_SECURITY_POLICY_S0(KMassStorageWritePolicy, KUsbMsDriveState_Category.iUid);
+                                                         const TLunToDriveMap& aDriveMap)
+    :
+    iDrives(aDrives),
+    iDriveMap(aDriveMap)
+    {
+    _LIT_SECURITY_POLICY_PASS(KMassStorageReadPolicy);
+    _LIT_SECURITY_POLICY_S0(KMassStorageWritePolicy, KUsbMsDriveState_Category.iUid);
 
-	TInt result = RProperty::Define(KUsbMsDriveState_Category,
-									EUsbMsDriveState_DriveStatus, RProperty::EByteArray,
-									KMassStorageReadPolicy, KMassStorageWritePolicy,
-									KUsbMsMaxDrives*2);
-	__ASSERT_DEBUG(result == KErrAlreadyExists || result == KErrNone, User::Invariant());
-	result = result;	// remove urel warning
-	}
+    TInt result = RProperty::Define(KUsbMsDriveState_Category,
+                                    EUsbMsDriveState_DriveStatus, RProperty::EByteArray,
+                                    KMassStorageReadPolicy, KMassStorageWritePolicy,
+                                    KUsbMsMaxDrives*2);
+    __ASSERT_DEBUG(result == KErrAlreadyExists || result == KErrNone, User::Invariant());
+    result = result;    // remove urel warning
+    }
 
 
 RDriveStateChangedPublisher::~RDriveStateChangedPublisher()
-	{
-	__MSFNLOG
-	RProperty::Delete(KUsbMsDriveState_Category, EUsbMsDriveState_DriveStatus);
-	}
+    {
+    RProperty::Delete(KUsbMsDriveState_Category, EUsbMsDriveState_DriveStatus);
+    }
 
 
 /**
@@ -166,36 +160,35 @@
 values encoded into one 32-bit word.
 */
 void RDriveStateChangedPublisher::DriveStateChanged()
-	{
-	__MSFNLOG
-	TUsbMsDrivesStatus allDrivesStatus;
+    {
+    TUsbMsDrivesStatus allDrivesStatus;
 
-	for(TUint8 i = 0; i < iDrives.Count(); i++)
-		{
-		allDrivesStatus.Append(iDriveMap[i]);
+    for(TUint8 i = 0; i < iDrives.Count(); i++)
+        {
+        allDrivesStatus.Append(iDriveMap[i]);
 
-		CMassStorageDrive::TMountState ms = iDrives[i]->MountState();
-		TLocalDriveRef::TDriveState ds = iDrives[i]->DriveState();
-		TInt driveStatus = EUsbMsDriveState_Error;
-		if((TUint8)ds < sizeof(table[0]) && (TUint8)ms < sizeof(table)/sizeof(table[0]))
-			{
-			driveStatus = table[ms][ds];
-			__PRINT3(_L("ms=%d ds=%d %d"), ms, ds, driveStatus);
-			}
-		allDrivesStatus.Append(driveStatus);
-		}
+        CMassStorageDrive::TMountState ms = iDrives[i]->MountState();
+        TLocalDriveRef::TDriveState ds = iDrives[i]->DriveState();
+        TInt driveStatus = EUsbMsDriveState_Error;
+        if((TUint8)ds < sizeof(table[0]) && (TUint8)ms < sizeof(table)/sizeof(table[0]))
+            {
+            driveStatus = table[ms][ds];
+            __PRINT3(_L("ms=%d ds=%d %d"), ms, ds, driveStatus);
+            }
+        allDrivesStatus.Append(driveStatus);
+        }
 
 
-	__PRINT1(_L("Publishing EUsbMsDriveState_DriveStatus for %d drives\n"),
-				allDrivesStatus.Length()/2);
+    __PRINT1(_L("Publishing EUsbMsDriveState_DriveStatus for %d drives\n"),
+                allDrivesStatus.Length()/2);
 
-	if(KErrNone != RProperty::Set(KUsbMsDriveState_Category,
-								  EUsbMsDriveState_DriveStatus,
-								  allDrivesStatus))
-		{
-		__ASSERT_DEBUG(EFalse,User::Invariant());
-		}
-	}
+    if(KErrNone != RProperty::Set(KUsbMsDriveState_Category,
+                                  EUsbMsDriveState_DriveStatus,
+                                  allDrivesStatus))
+        {
+        __ASSERT_DEBUG(EFalse,User::Invariant());
+        }
+    }
 
 
 //----------------------------------------------------------------------------
@@ -209,53 +202,49 @@
 CUsbTransferPublisher::CUsbTransferPublisher(TUsbMsDriveState_Subkey aSubKey,
                                              const TBytesTransferedList& aArray)
 :   iSubKey(aSubKey),
-	iArray(aArray)
-	{
-    __MSFNLOG
-	}
+    iArray(aArray)
+    {
+    }
 
 
 void CUsbTransferPublisher::ConstructL()
-	{
-	__MSFNLOG
+    {
+    _LIT_SECURITY_POLICY_PASS(KMassStorageReadPolicy);
+    _LIT_SECURITY_POLICY_S0(KMassStorageWritePolicy, KUsbMsDriveState_Category.iUid);
 
-	_LIT_SECURITY_POLICY_PASS(KMassStorageReadPolicy);
-	_LIT_SECURITY_POLICY_S0(KMassStorageWritePolicy, KUsbMsDriveState_Category.iUid);
-
-	TInt r = RProperty::Define(iSubKey, RProperty::EByteArray,
-							   KMassStorageReadPolicy, KMassStorageWritePolicy,
-							   KUsbMsMaxDrives*sizeof(TInt));
+    TInt r = RProperty::Define(iSubKey, RProperty::EByteArray,
+                               KMassStorageReadPolicy, KMassStorageWritePolicy,
+                               KUsbMsMaxDrives*sizeof(TInt));
 
-	if (r != KErrAlreadyExists)
-		{
-		User::LeaveIfError(r);
-		}
+    if (r != KErrAlreadyExists)
+        {
+        User::LeaveIfError(r);
+        }
 
-	// Attach to the properties here. Only do this once, continuously attaching
-	// will currently cause a memory leak
-	User::LeaveIfError(iProperty.Attach(KUsbMsDriveState_Category, iSubKey));
+    // Attach to the properties here. Only do this once, continuously attaching
+    // will currently cause a memory leak
+    User::LeaveIfError(iProperty.Attach(KUsbMsDriveState_Category, iSubKey));
 
-	// Create the EDataTransferred timer
-	iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-	iTimerRunning = EFalse;
-	}
+    // Create the EDataTransferred timer
+    iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iTimerRunning = EFalse;
+    }
 
 
 /**
 Destructor
 */
 CUsbTransferPublisher::~CUsbTransferPublisher()
-	{
-	__MSFNLOG
-	if(iTimer)
-		{
-		iTimer->Cancel();
-		}
-	delete iTimer;
-	iProperty.Close();
+    {
+    if(iTimer)
+        {
+        iTimer->Cancel();
+        }
+    delete iTimer;
+    iProperty.Close();
 
-	RProperty::Delete(KUsbMsDriveState_Category, iSubKey);
-	}
+    RProperty::Delete(KUsbMsDriveState_Category, iSubKey);
+    }
 
 
 /**
@@ -266,11 +255,10 @@
 @return not used in CPeriodic callback (see TCallback)
 */
 TInt CUsbTransferPublisher::PublishDataTransferredEvent(TAny* obj)
-	{
-	__MSFNSLOG
-	static_cast<CUsbTransferPublisher*>(obj)->DoPublishDataTransferredEvent();
-	return 1;
-	}
+    {
+    static_cast<CUsbTransferPublisher*>(obj)->DoPublishDataTransferredEvent();
+    return 1;
+    }
 
 
 /**
@@ -278,22 +266,21 @@
 the last update.
 */
 void CUsbTransferPublisher::DoPublishDataTransferredEvent()
-	{
-    __MSFNLOG
-	if (PublishDataTransferred())
-		{
-		// some data has been transfered so reset the counter
-		iTimerCancelCnt = ETimerCancelDelay;
-		}
+    {
+    if (PublishDataTransferred())
+        {
+        // some data has been transfered so reset the counter
+        iTimerCancelCnt = ETimerCancelDelay;
+        }
 
-	// Update the cancel count if no data was transferred the last
-	// (few) times this has been called
-	if (--iTimerCancelCnt == 0)
-		{
-		StopTimer();
-		iTimerCancelCnt = ETimerCancelDelay;
-		}
-	}
+    // Update the cancel count if no data was transferred the last
+    // (few) times this has been called
+    if (--iTimerCancelCnt == 0)
+        {
+        StopTimer();
+        iTimerCancelCnt = ETimerCancelDelay;
+        }
+    }
 
 
 /**
@@ -301,43 +288,42 @@
 the last update.
 */
 TBool CUsbTransferPublisher::PublishDataTransferred()
-	{
-	__MSFNLOG
-	TUsbMsBytesTransferred bytesTransferred;
-	TBool dataTransferred = EFalse;
+    {
+    TUsbMsBytesTransferred bytesTransferred;
+    TBool dataTransferred = EFalse;
+
+    for (TInt i = 0; i < iArray.Count(); i++)
+        {
+        bytesTransferred[i] = GetBytesTransferred(i);
+        }
 
-	for (TInt i = 0; i < iArray.Count(); i++)
-		{
-		bytesTransferred[i] = GetBytesTransferred(i);
-		}
+    // Update the properties only if they have changed
+    // (or if there's an error reading the old value.)
+    // Possible optimisation: keep a copy of the value
+    // as a member variable so we don't need the Get.
+    TUsbMsBytesTransferred oldValue;
 
-	// Update the properties only if they have changed
-	// (or if there's an error reading the old value.)
-	// Possible optimisation: keep a copy of the value
-	// as a member variable so we don't need the Get.
-	TUsbMsBytesTransferred oldValue;
-
-	if ((iProperty.Get(oldValue) != KErrNone) || (oldValue != bytesTransferred))
-		{
+    if ((iProperty.Get(oldValue) != KErrNone) || (oldValue != bytesTransferred))
+        {
 #ifdef __PRINT3
-		// trace of the bytes transferred
-		for (TInt j=0; j < iArray.Count(); j++)
-			{
-			if(oldValue[j] != bytesTransferred[j])
-				{
-				__PRINT3(_L("CDrivePublisher: KBytes[%d] %d->%d\n"), j, oldValue[j], bytesTransferred[j]);
-				}
-			}
+        // trace of the bytes transferred
+        for (TInt j=0; j < iArray.Count(); j++)
+            {
+            if(oldValue[j] != bytesTransferred[j])
+                {
+                __PRINT3(_L("CDrivePublisher: KBytes[%d] %d->%d\n"), j, oldValue[j], bytesTransferred[j]);
+                }
+            }
 #endif
-		if (KErrNone != iProperty.Set(bytesTransferred))
-			{
-			__ASSERT_DEBUG(EFalse, User::Invariant());
-			}
-		dataTransferred = ETrue;
-		}
+        if (KErrNone != iProperty.Set(bytesTransferred))
+            {
+            __ASSERT_DEBUG(EFalse, User::Invariant());
+            }
+        dataTransferred = ETrue;
+        }
 
-	return dataTransferred;
-	}
+    return dataTransferred;
+    }
 
 
 /**
@@ -345,33 +331,31 @@
 If the timer is not yet running then start it.
 */
 void CUsbTransferPublisher::StartTimer()
-	{
-	__MSFNLOG
-	if (!iTimerRunning)
-		{
-		// EDataTransferred event every second
-		const TTimeIntervalMicroSeconds32 interval = 1 * 1000 * 1000;
-		TCallBack callback(PublishDataTransferredEvent, this);
-		__PRINT(_L("Starting timer"));
-		iTimer->Start(interval, interval, callback);
-		iTimerRunning = ETrue;
-		}
-	}
+    {
+    if (!iTimerRunning)
+        {
+        // EDataTransferred event every second
+        const TTimeIntervalMicroSeconds32 interval = 1 * 1000 * 1000;
+        TCallBack callback(PublishDataTransferredEvent, this);
+        __PRINT(_L("Starting timer"));
+        iTimer->Start(interval, interval, callback);
+        iTimerRunning = ETrue;
+        }
+    }
 
 
 /**
 Ensure that the Timer is stopped
 */
 void CUsbTransferPublisher::StopTimer()
-	{
-	__MSFNLOG
-	if (iTimerRunning)
-		{
-		__PRINT(_L("Stopping timer"));
-		iTimer->Cancel();
-		iTimerRunning = EFalse;
-		}
-	}
+    {
+    if (iTimerRunning)
+        {
+        __PRINT(_L("Stopping timer"));
+        iTimer->Cancel();
+        iTimerRunning = EFalse;
+        }
+    }
 
 
 //----------------------------------------------------------------------------
@@ -381,21 +365,19 @@
 @param aArray
 */
 CUsbWriteTransferPublisher* CUsbWriteTransferPublisher::NewL(const TBytesTransferedList& aArray)
-	{
-	__MSFNSLOG
-	CUsbWriteTransferPublisher* self = new (ELeave) CUsbWriteTransferPublisher(aArray);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
+    {
+    CUsbWriteTransferPublisher* self = new (ELeave) CUsbWriteTransferPublisher(aArray);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
 
 
 CUsbWriteTransferPublisher::CUsbWriteTransferPublisher(const TBytesTransferedList& aArray)
 :   CUsbTransferPublisher(EUsbMsDriveState_KBytesWritten, aArray)
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 
 //----------------------------------------------------------------------------
@@ -405,21 +387,19 @@
 @param aArray
 */
 CUsbReadTransferPublisher* CUsbReadTransferPublisher::NewL(const TBytesTransferedList& aArray)
-	{
-	__MSFNSLOG
-	CUsbReadTransferPublisher* self = new (ELeave) CUsbReadTransferPublisher(aArray);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
+    {
+    CUsbReadTransferPublisher* self = new (ELeave) CUsbReadTransferPublisher(aArray);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
 
 
 CUsbReadTransferPublisher::CUsbReadTransferPublisher(const TBytesTransferedList& aArray)
 :   CUsbTransferPublisher(EUsbMsDriveState_KBytesRead, aArray)
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 /**
 Transfer function for the property
@@ -430,5 +410,5 @@
 */
 TUint CUsbTransferPublisher::GetBytesTransferred(TLun aLun) const
 {
-	return I64LOW(iArray[aLun] / (TUint64)1000);
+    return I64LOW(iArray[aLun] / (TUint64)1000);
 }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/debug.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/debug.h	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -51,18 +51,6 @@
 _LIT(KMsgIn, ">>%S\n");
 _LIT(KMsgOut,"<<%S\n");
 
-class TMSLogFn
-{
-	protected:
-	TBuf<100> iName;
-
-	public:
-	TMSLogFn(const TDesC& aName){iName = aName; RDebug::Print(KMsgIn, &iName);};
-	~TMSLogFn(){RDebug::Print(KMsgOut, &iName);};
-};
-
-#define __FNLOG(name) TMSLogFn __fn_log__(_L(name))
-
 #else
 #define __PRINT(t)
 #define __PRINT1(t,a)
@@ -73,7 +61,6 @@
 #define __PRINT8BIT1(t,a)
 #define __PRINT1TEMP(t,a)
 #define __PRINTERR(txt,err)
-#define __FNLOG(name)
 #endif
 
 
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/msdebug.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 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:
-// msdebug.cpp
-// 
-//
-
-
-
-/**
- @file
- @internalTechnology
-*/
-
-#ifndef MSDEBUG_H
-#define MSDEBUG_H
-
-//#define _MSFN_DEBUG_PRINT_
-
-#if defined(_MSFN_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define MSFN_TRACE_ENABLED
-#endif
-
-#ifdef MSFN_TRACE_ENABLED
-#include <e32debug.h>
-
-
-/**
-Logging function to be used with static functions. Prints the function string on
-function entry and exit.
-*/
-class TMsLogStaticFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-
-    TMsLogStaticFn(const TDesC8& aFunctionName);
-
-	~TMsLogStaticFn();
-
-protected:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-    };
-
-
-/**
-Logging function which prints the function string on function entry and exit.
-*/
-class TMsLogFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-	TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer);
-
-	~TMsLogFn();
-
-private:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-	void* iThisPointer;
-    };
-
-
-
-#define __MSFNLOG TMsLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this);
-#define __MSFNSLOG TMsLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__));
-#else
-#define __MSFNSLOG
-#define __MSFNLOG
-#endif
-
-#endif // MSDEBUG_H
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/msdebug.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-// Copyright (c) 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:
-//
-
-
-
-/**
- @file
- @internalTechnology
-*/
-
-#include "msdebug.h"
-
-#ifdef MSFN_TRACE_ENABLED
-
-_LIT8(KFnMsgSIn, ">>\t%S\r\n");
-_LIT8(KFnMsgSOut,"<<\t%S\r\n");
-_LIT8(KFnMsgIn, ">>[0x%08x]\t%S\r\n");
-_LIT8(KFnMsgOut,"<<[0x%08x]\t%S\r\n");
-
-TMsLogStaticFn::TMsLogStaticFn(const TDesC8& aFunctionName)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KFnMsgSIn, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogStaticFn::~TMsLogStaticFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KFnMsgSOut, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogFn::TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer)
-:   iThisPointer(aThisPointer)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KFnMsgIn, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogFn::~TMsLogFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KFnMsgOut, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-#endif
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/cscsiserverprotocol.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/cscsiserverprotocol.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -31,22 +31,20 @@
 #include "testman.h"
 #include "cscsiserverprotocol.h"
 #include "debug.h"
-#include "msdebug.h"
 
 
 TMediaWriteMan::TMediaWriteMan()
 :   iActive(EFalse),
     iOffset(0),
-	iMediaWriteSize(KDefaultMediaWriteSize)
+    iMediaWriteSize(KDefaultMediaWriteSize)
     {
     }
 
 void TMediaWriteMan::ReportHighSpeedDevice()
-	{
-    __MSFNLOG
-	iMediaWriteSize = KHsMediaWriteSize;
-	__PRINT1(_L("HS Device reported: SCSI will use %d bytes disk write size"), iMediaWriteSize);
-	}
+    {
+    iMediaWriteSize = KHsMediaWriteSize;
+    __PRINT1(_L("HS Device reported: SCSI will use %d bytes disk write size"), iMediaWriteSize);
+    }
 
 
 TInt64 TMediaWriteMan::Start(TUint32 aLba, TUint32 aLength, TUint32 aBlockSize)
@@ -55,7 +53,7 @@
     iOffset = static_cast<TInt64>(aLba) * aBlockSize;
     iBytesRemain = aLength * aBlockSize;
 
-	TInt64 theEnd = iOffset + iBytesRemain;
+    TInt64 theEnd = iOffset + iBytesRemain;
     return theEnd;
     }
 
@@ -81,8 +79,8 @@
 TUint32 TMediaWriteMan::GetPacketLength() const
     {
     // KMaxBufSize or the MediaWriteSize, whichever is smallest.
-	TUint32 thisLength = (iBytesRemain > KMaxBufSize) ? KMaxBufSize : iBytesRemain;
-	thisLength = (thisLength > iMediaWriteSize) ? iMediaWriteSize : thisLength;
+    TUint32 thisLength = (iBytesRemain > KMaxBufSize) ? KMaxBufSize : iBytesRemain;
+    thisLength = (thisLength > iMediaWriteSize) ? iMediaWriteSize : thisLength;
     return thisLength;
     }
 
@@ -93,25 +91,23 @@
 @param aDriveManager reference to the drive manager object
 */
 CScsiServerProtocol* CScsiServerProtocol::NewL(CDriveManager& aDriveManager)
-	{
-    __MSFNSLOG
-	CScsiServerProtocol* self = new (ELeave) CScsiServerProtocol(aDriveManager);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
+    {
+    CScsiServerProtocol* self = new (ELeave) CScsiServerProtocol(aDriveManager);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
 
 #ifdef MSDC_TESTMODE
 CScsiServerProtocol* CScsiServerProtocol::NewL(CDriveManager& aDriveManager, TTestParser* aTestParser)
-	{
-    __MSFNSLOG
-	CScsiServerProtocol* self = new (ELeave) CScsiServerProtocol(aDriveManager, aTestParser);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
+    {
+    CScsiServerProtocol* self = new (ELeave) CScsiServerProtocol(aDriveManager, aTestParser);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
 #endif
 
 
@@ -122,51 +118,45 @@
 */
 CScsiServerProtocol::CScsiServerProtocol(CDriveManager& aDriveManager)
 :   iDriveManager(aDriveManager)
-	{
-    __MSFNLOG
-
-	iWriteTransferPublisher = CUsbWriteTransferPublisher::NewL(iBytesWritten);
-	iReadTransferPublisher = CUsbReadTransferPublisher::NewL(iBytesRead);
+    {
+    iWriteTransferPublisher = CUsbWriteTransferPublisher::NewL(iBytesWritten);
+    iReadTransferPublisher = CUsbReadTransferPublisher::NewL(iBytesRead);
 
-	for (TUint i = 0; i < KUsbMsMaxDrives; i++)
-		{
-		iBytesRead[i] = 0;
-		iBytesWritten[i] = 0;
-		}
-	}
+    for (TUint i = 0; i < KUsbMsMaxDrives; i++)
+        {
+        iBytesRead[i] = 0;
+        iBytesWritten[i] = 0;
+        }
+    }
 
 #ifdef MSDC_TESTMODE
 CScsiServerProtocol::CScsiServerProtocol(CDriveManager& aDriveManager, TTestParser* aTestParser)
 :   iDriveManager(aDriveManager),
     iTestParser(aTestParser)
-	{
-    __MSFNLOG
-
-	iWriteTransferPublisher = CUsbWriteTransferPublisher::NewL(iBytesWritten);
-	iReadTransferPublisher = CUsbReadTransferPublisher::NewL(iBytesRead);
+    {
+    iWriteTransferPublisher = CUsbWriteTransferPublisher::NewL(iBytesWritten);
+    iReadTransferPublisher = CUsbReadTransferPublisher::NewL(iBytesRead);
 
-	for (TUint i = 0; i < KUsbMsMaxDrives; i++)
-		{
-		iBytesRead[i] = 0;
-		iBytesWritten[i] = 0;
-		}
-	}
+    for (TUint i = 0; i < KUsbMsMaxDrives; i++)
+        {
+        iBytesRead[i] = 0;
+        iBytesWritten[i] = 0;
+        }
+    }
 #endif
 
 
 CScsiServerProtocol::~CScsiServerProtocol()
-	{
-    __MSFNLOG
+    {
     iDataBuf.Close();
-	delete iWriteTransferPublisher;
-	delete iReadTransferPublisher;
-	}
+    delete iWriteTransferPublisher;
+    delete iReadTransferPublisher;
+    }
 
 
 void CScsiServerProtocol::ConstructL()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 
 /**
@@ -175,10 +165,9 @@
 @param aTransport pointer to the transport object
 */
 void CScsiServerProtocol::RegisterTransport(MDeviceTransport* aTransport)
-	{
-    __MSFNLOG
-	iTransport = aTransport;
-	}
+    {
+    iTransport = aTransport;
+    }
 
 
 /**
@@ -191,17 +180,15 @@
 
 */
 void CScsiServerProtocol::ReportHighSpeedDevice()
-	{
-    __MSFNLOG
+    {
     iMediaWriteMan.ReportHighSpeedDevice();
-	}
+    }
 
 
 void CScsiServerProtocol::SetParameters(const TMassStorageConfig& aConfig)
-	{
-    __MSFNLOG
-	iConfig = aConfig;
-	}
+    {
+    iConfig = aConfig;
+    }
 
 
 /**
@@ -213,18 +200,17 @@
 @return  ETrue if command was decoded and executed successfully
 */
 TBool CScsiServerProtocol::DecodePacket(TPtrC8& aData, TUint8 aLun)
-	{
-    __MSFNLOG
+    {
     TScsiServerReq* cdb = NULL;
     TRAPD(err, cdb = cdb->CreateL(static_cast<TScsiServerReq::TOperationCode>(aData[0]), aData));
 
     TBool decodeGood = EFalse;
     if (err == KErrNotSupported)
-    	iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidCmdCode);
-	else if (err != KErrNone)
-		iSenseInfo.SetSense(TSenseInfo::EAbortedCommand, TSenseInfo::EInsufficientRes);
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidCmdCode);
+    else if (err != KErrNone)
+        iSenseInfo.SetSense(TSenseInfo::EAbortedCommand, TSenseInfo::EInsufficientRes);
     else if (cdb->iNaca) // Check the CONTROL byte
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
     else if (cdb->iLink)
         iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
     else
@@ -291,12 +277,12 @@
                 }
             }
         __PRINT1(_L("DecodePacket result = %d"), iSenseInfo.SenseOk());
-    	decodeGood = iSenseInfo.SenseOk();
+        decodeGood = iSenseInfo.SenseOk();
         }
 
     delete cdb;
     return decodeGood;
-	}
+    }
 
 
 /**
@@ -306,8 +292,7 @@
 @return pointer to drive correspondent to LUN if drive mounted and ready, NULL otherwise
 */
 CMassStorageDrive* CScsiServerProtocol::GetCheckDrive()
-	{
-    __MSFNLOG
+    {
 #ifdef MSDC_TESTMODE
     if (iTestParser && iTestParser->SenseError() != TTestParser::ETestSenseErrorNoSense)
         {
@@ -332,44 +317,44 @@
         }
 #endif
 
-	CMassStorageDrive* drive = iDriveManager.Drive(iLun);
-	CMassStorageDrive::TMountState mountState = drive->MountState();
+    CMassStorageDrive* drive = iDriveManager.Drive(iLun);
+    CMassStorageDrive::TMountState mountState = drive->MountState();
 
-	if (mountState == CMassStorageDrive::EDisconnected || mountState == CMassStorageDrive::EConnecting)
-		{
-		__PRINT(_L("Drive disconnected\n"));
-		iSenseInfo.SetSense(TSenseInfo::ENotReady,
-							TSenseInfo::EMediaNotPresent);
-		return NULL;
-		}
+    if (mountState == CMassStorageDrive::EDisconnected || mountState == CMassStorageDrive::EConnecting)
+        {
+        __PRINT(_L("Drive disconnected\n"));
+        iSenseInfo.SetSense(TSenseInfo::ENotReady,
+                            TSenseInfo::EMediaNotPresent);
+        return NULL;
+        }
 
-	TLocalDriveRef::TDriveState state = drive->CheckDriveState();
-	if (state == TLocalDriveRef::EMediaNotPresent || state == TLocalDriveRef::ELocked)
-		{
-		__PRINT1(_L("Media not present or locked. (state =0x%X)\n"),state);
-		iSenseInfo.SetSense(TSenseInfo::ENotReady, TSenseInfo::EMediaNotPresent);
-		return NULL;
-		}
+    TLocalDriveRef::TDriveState state = drive->CheckDriveState();
+    if (state == TLocalDriveRef::EMediaNotPresent || state == TLocalDriveRef::ELocked)
+        {
+        __PRINT1(_L("Media not present or locked. (state =0x%X)\n"),state);
+        iSenseInfo.SetSense(TSenseInfo::ENotReady, TSenseInfo::EMediaNotPresent);
+        return NULL;
+        }
 
-	if (drive->IsMediaChanged(ETrue))  //reset "media changed" status
-		{
-		__PRINT(_L("Media was changed\n"));
-		// SAM-2 Section 5.9.5 Unit Attention Condition
-		iSenseInfo.SetSense(TSenseInfo::EUnitAttention, TSenseInfo::ENotReadyToReadyChange);
-		iDriveManager.Connect(iLun);   //publish event to USB app
-		return NULL;
-		}
+    if (drive->IsMediaChanged(ETrue))  //reset "media changed" status
+        {
+        __PRINT(_L("Media was changed\n"));
+        // SAM-2 Section 5.9.5 Unit Attention Condition
+        iSenseInfo.SetSense(TSenseInfo::EUnitAttention, TSenseInfo::ENotReadyToReadyChange);
+        iDriveManager.Connect(iLun);   //publish event to USB app
+        return NULL;
+        }
 
-	if (mountState == CMassStorageDrive::EDisconnecting)
-		{
-		__PRINT(_L("Drive disconnecting\n"));
-		iSenseInfo.SetSense(TSenseInfo::ENotReady,
-							TSenseInfo::EMediaNotPresent);
-		return NULL;
-		}
+    if (mountState == CMassStorageDrive::EDisconnecting)
+        {
+        __PRINT(_L("Drive disconnecting\n"));
+        iSenseInfo.SetSense(TSenseInfo::ENotReady,
+                            TSenseInfo::EMediaNotPresent);
+        return NULL;
+        }
 
-	return drive;
-	}
+    return drive;
+    }
 
 
 /**
@@ -379,10 +364,9 @@
 @return ETrue if successful,
 */
 TBool CScsiServerProtocol::HandleUnitReady()
-	{
-    __MSFNLOG
-	return GetCheckDrive() ? ETrue : EFalse;
-	}
+    {
+    return GetCheckDrive() ? ETrue : EFalse;
+    }
 
 
 /**
@@ -391,10 +375,9 @@
 @return ETrue if successful,
 */
 TBool CScsiServerProtocol::HandleRequestSense(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
+    {
     const TScsiServerRequestSenseReq request = static_cast<const TScsiServerRequestSenseReq&>(aRequest);
-	__PRINT1(_L("length = %d\n"), request.iAllocationLength);
+    __PRINT1(_L("length = %d\n"), request.iAllocationLength);
 
     TScsiServerRequestSenseResp requestSense;
     requestSense.iAllocationLength = request.iAllocationLength;
@@ -403,16 +386,16 @@
     requestSense.iSensePtr = &iSenseInfo;
     requestSense.Encode(iCommandBuf);
 
-	__PRINT4(_L("Response=0x%x Sense=0x%x, Additional=0x%x, Qualifier=0x%x\n"),
-				iCommandBuf[0], iCommandBuf[02], iCommandBuf[12], iCommandBuf[13]);
+    __PRINT4(_L("Response=0x%x Sense=0x%x, Additional=0x%x, Qualifier=0x%x\n"),
+                iCommandBuf[0], iCommandBuf[02], iCommandBuf[12], iCommandBuf[13]);
 
-	TPtrC8 writeBuf = iCommandBuf.Left(request.iAllocationLength);
-	iTransport->SetupDataIn(writeBuf);
+    TPtrC8 writeBuf = iCommandBuf.Left(request.iAllocationLength);
+    iTransport->SetupDataIn(writeBuf);
 
-	// clear the sense info
-	iSenseInfo.SetSense(TSenseInfo::ENoSense);
-	return ETrue;
-	}
+    // clear the sense info
+    iSenseInfo.SetSense(TSenseInfo::ENoSense);
+    return ETrue;
+    }
 
 
 /**
@@ -422,15 +405,14 @@
 @return ETrue if successful,
 */
 TBool CScsiServerProtocol::HandleInquiry(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
+    {
     const TScsiServerInquiryReq request = static_cast<const TScsiServerInquiryReq&>(aRequest);
 
-	if (request.iCmdDt || request.iEvpd || request.iPage || iLun >= KUsbMsMaxDrives)
-		{
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
-		return EFalse;
-		}
+    if (request.iCmdDt || request.iEvpd || request.iPage || iLun >= KUsbMsMaxDrives)
+        {
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
+        return EFalse;
+        }
 
     TScsiServerInquiryResp inquiry(iConfig);
 
@@ -448,12 +430,12 @@
 
     TUint length = inquiry.Length();
 
-	TPtrC8 writeBuf = iCommandBuf.Left(length);
-	iTransport->SetupDataIn(writeBuf);
+    TPtrC8 writeBuf = iCommandBuf.Left(length);
+    iTransport->SetupDataIn(writeBuf);
 
-	iSenseInfo.SetSense(TSenseInfo::ENoSense);
-	return ETrue;
-	}
+    iSenseInfo.SetSense(TSenseInfo::ENoSense);
+    return ETrue;
+    }
 
 
 /**
@@ -464,65 +446,63 @@
  @return ETrue if successful, TFalse otherwise
  */
 TBool CScsiServerProtocol::HandleStartStopUnit(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
-
-	const TScsiServerStartStopUnitReq request = static_cast<const TScsiServerStartStopUnitReq&>(aRequest);
+    {
+    const TScsiServerStartStopUnitReq request = static_cast<const TScsiServerStartStopUnitReq&>(aRequest);
 
-	if (request.iLoej)
-		{
-		if(request.iStart)	//Start unit
-			{
-			iDriveManager.Connect(iLun);
-			__PRINT(_L("Load media\n"));
+    if (request.iLoej)
+        {
+        if(request.iStart)  //Start unit
+            {
+            iDriveManager.Connect(iLun);
+            __PRINT(_L("Load media\n"));
 
             // rd/wr publisher
-			iBytesRead[iLun] = 0;
-			iBytesWritten[iLun] = 0;
+            iBytesRead[iLun] = 0;
+            iBytesWritten[iLun] = 0;
 
-			// publish the initial values
-			iWriteTransferPublisher->DoPublishDataTransferredEvent();
-			iReadTransferPublisher->DoPublishDataTransferredEvent();
-			}
-		else		//Stop unit
-			{
-			iDriveManager.SetCritical(iLun, EFalse);
-			iDriveManager.Disconnect(iLun);
-			__PRINT(_L("Unload media\n"));
-			}
-		}
+            // publish the initial values
+            iWriteTransferPublisher->DoPublishDataTransferredEvent();
+            iReadTransferPublisher->DoPublishDataTransferredEvent();
+            }
+        else        //Stop unit
+            {
+            iDriveManager.SetCritical(iLun, EFalse);
+            iDriveManager.Disconnect(iLun);
+            __PRINT(_L("Unload media\n"));
+            }
+        }
 
-	if (request.iImmed)
-		{
-		return ETrue;
-		}
+    if (request.iImmed)
+        {
+        return ETrue;
+        }
 
-	CMassStorageDrive* drive = iDriveManager.Drive(iLun);
+    CMassStorageDrive* drive = iDriveManager.Drive(iLun);
 
-	TInt  timeLeft (20);   // 1 sec timeout
-	CMassStorageDrive::TMountState mountState;
+    TInt  timeLeft (20);   // 1 sec timeout
+    CMassStorageDrive::TMountState mountState;
 
-	do
-		{
-		User::After(1000 * 50);		// 50 mSec
-		--timeLeft;
-		mountState = drive->MountState();
+    do
+        {
+        User::After(1000 * 50);     // 50 mSec
+        --timeLeft;
+        mountState = drive->MountState();
 
-		if ((!request.iStart && mountState != CMassStorageDrive::EConnected)
-			 ||
-			 (request.iStart &&
-				(mountState == CMassStorageDrive::EDisconnecting ||
+        if ((!request.iStart && mountState != CMassStorageDrive::EConnected)
+             ||
+             (request.iStart &&
+                (mountState == CMassStorageDrive::EDisconnecting ||
                mountState == CMassStorageDrive::EConnected)))
-			{
-			return ETrue;
-			}
-		} while (timeLeft>0);
+            {
+            return ETrue;
+            }
+        } while (timeLeft>0);
 
-	//timeout happend
-	iSenseInfo.SetSense(TSenseInfo::ENotReady,
-						TSenseInfo::EAscLogicalUnitDoesNotRespondToSelection);
-	return EFalse;
-	}
+    //timeout happend
+    iSenseInfo.SetSense(TSenseInfo::ENotReady,
+                        TSenseInfo::EAscLogicalUnitDoesNotRespondToSelection);
+    return EFalse;
+    }
 
 
 /**
@@ -533,28 +513,25 @@
 @return ETrue if successful.
 */
 TBool CScsiServerProtocol::HandlePreventMediaRemoval(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
-	const TScsiServerPreventMediaRemovalReq& request = static_cast<const TScsiServerPreventMediaRemovalReq&>(aRequest);
-	__FNLOG("CScsiProtocol::HandlePreventMediaRemoval");
-	CMassStorageDrive* drive = GetCheckDrive();
+    {
+    const TScsiServerPreventMediaRemovalReq& request = static_cast<const TScsiServerPreventMediaRemovalReq&>(aRequest);
+    CMassStorageDrive* drive = GetCheckDrive();
 
-	if (drive == NULL)
-		{
-		return EFalse;
-		}
-	iDriveManager.SetCritical(iLun, request.iPrevent);
-	return ETrue;
-	}
+    if (drive == NULL)
+        {
+        return EFalse;
+        }
+    iDriveManager.SetCritical(iLun, request.iPrevent);
+    return ETrue;
+    }
 
 
 /** Cancel active state, Invoked by transnport when it stops */
 TInt CScsiServerProtocol::Cancel()
-	{
-    __MSFNLOG
-	iDriveManager.SetCritical(CDriveManager::KAllLuns, EFalse);
-	return KErrNone;
-	}
+    {
+    iDriveManager.SetCritical(CDriveManager::KAllLuns, EFalse);
+    return KErrNone;
+    }
 
 
 TBool CScsiServerProtocol::HandleReadFormatCapacities(const TScsiServerReq& aRequest)
@@ -563,9 +540,8 @@
  *
  * @return ETrue if successful, else a standard Symbian OS error code.
  */
-	{
-    __MSFNLOG
-	const TScsiServerReadFormatCapacitiesReq& request = static_cast<const TScsiServerReadFormatCapacitiesReq&>(aRequest);
+    {
+    const TScsiServerReadFormatCapacitiesReq& request = static_cast<const TScsiServerReadFormatCapacitiesReq&>(aRequest);
 
     CMassStorageDrive* drive = NULL;
     for (TInt i = 0; i < 10; i++)
@@ -578,21 +554,21 @@
         User::After(100000);
         }
 
-	if (!drive)
-		{
+    if (!drive)
+        {
         return EFalse;
-		}
+        }
 
-	TUint32 numBlocks = I64LOW(drive->MediaParams().NumBlocks());
+    TUint32 numBlocks = I64LOW(drive->MediaParams().NumBlocks());
 
     TScsiServerReadFormatCapacitiesResp response(request.AllocationLength());
     response.SetNumberBlocks(numBlocks);
 
     response.Encode(iCommandBuf);
-	TPtrC8 writeBuf = iCommandBuf;
-	iTransport->SetupDataIn(writeBuf);
-	return ETrue;
-	}
+    TPtrC8 writeBuf = iCommandBuf;
+    iTransport->SetupDataIn(writeBuf);
+    return ETrue;
+    }
 
 
 /**
@@ -603,30 +579,29 @@
 @return ETrue if successful.
 */
 TBool CScsiServerProtocol::HandleReadCapacity10(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
-	const TScsiServerReadCapacity10Req& request = static_cast<const TScsiServerReadCapacity10Req&>(aRequest);
-	CMassStorageDrive* drive = GetCheckDrive();
-	if (drive == NULL)
-		{
-		return EFalse;
-		}
+    {
+    const TScsiServerReadCapacity10Req& request = static_cast<const TScsiServerReadCapacity10Req&>(aRequest);
+    CMassStorageDrive* drive = GetCheckDrive();
+    if (drive == NULL)
+        {
+        return EFalse;
+        }
 
-	if (request.iPmi || request.iLogicalBlockAddress)   //do not support partial medium indicator
-		{
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
-		return EFalse;
-		}
+    if (request.iPmi || request.iLogicalBlockAddress)   //do not support partial medium indicator
+        {
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
+        return EFalse;
+        }
 
     TScsiServerReadCapacity10Resp response;
     response.Set(drive->MediaParams().BlockSize(), drive->MediaParams().NumBlocks());
     response.Encode(iCommandBuf);
 
-	TPtrC8 writeBuf = iCommandBuf;
-	iTransport->SetupDataIn(writeBuf);
+    TPtrC8 writeBuf = iCommandBuf;
+    iTransport->SetupDataIn(writeBuf);
 
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 
 /**
@@ -637,42 +612,41 @@
 @return ETrue if successful.
 */
 TBool CScsiServerProtocol::HandleRead10(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
-	const TScsiServerRead10Req& request = static_cast<const TScsiServerRead10Req&>(aRequest);
-	CMassStorageDrive* drive = GetCheckDrive();
-	if (drive == NULL)
-		{
-		return EFalse;
-		}
+    {
+    const TScsiServerRead10Req& request = static_cast<const TScsiServerRead10Req&>(aRequest);
+    CMassStorageDrive* drive = GetCheckDrive();
+    if (drive == NULL)
+        {
+        return EFalse;
+        }
 
-	if (request.iProtect)
-		{
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
-		return EFalse;
-		}
+    if (request.iProtect)
+        {
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
+        return EFalse;
+        }
 
-	if (!request.iTransferLength)
-		{
-		return ETrue; // do nothing - this is not an error
-		}
+    if (!request.iTransferLength)
+        {
+        return ETrue; // do nothing - this is not an error
+        }
 
     TUint32 blockSize = drive->MediaParams().BlockSize();
 
-	const TInt64 bOffset = static_cast<TInt64>(request.iLogicalBlockAddress) * blockSize;
-	const TInt bLength = request.iTransferLength * blockSize;
-	const TInt64 theEnd = bOffset + bLength;
+    const TInt64 bOffset = static_cast<TInt64>(request.iLogicalBlockAddress) * blockSize;
+    const TInt bLength = request.iTransferLength * blockSize;
+    const TInt64 theEnd = bOffset + bLength;
 
-	if (theEnd > drive->MediaParams().Size())  //check if media big enough for this request
-		{
-		__PRINT(_L("err - Request ends out of media\n"));
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::ELbaOutOfRange);
-		return EFalse;
-		}
+    if (theEnd > drive->MediaParams().Size())  //check if media big enough for this request
+        {
+        __PRINT(_L("err - Request ends out of media\n"));
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::ELbaOutOfRange);
+        return EFalse;
+        }
 
-	// check if our buffer can hold requested data
-	if (iDataBuf.MaxLength() < bLength)
-		{
+    // check if our buffer can hold requested data
+    if (iDataBuf.MaxLength() < bLength)
+        {
         TRAPD(err,iDataBuf.ReAllocL(bLength));
         if (err)
             {
@@ -680,33 +654,33 @@
             iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
             return EFalse;
             }
-		}
+        }
 
     iDataBuf.SetLength(bLength);
-	TInt err = drive->Read(bOffset, bLength, iDataBuf);
-	if (err != KErrNone)
-		{
-		__PRINT1(_L("Read failed, err=%d\n"), err);
-		iSenseInfo.SetSense(TSenseInfo::ENotReady, TSenseInfo::EMediaNotPresent);
-		return EFalse;
-		}
+    TInt err = drive->Read(bOffset, bLength, iDataBuf);
+    if (err != KErrNone)
+        {
+        __PRINT1(_L("Read failed, err=%d\n"), err);
+        iSenseInfo.SetSense(TSenseInfo::ENotReady, TSenseInfo::EMediaNotPresent);
+        return EFalse;
+        }
 
-	TPtrC8 writeBuf = iDataBuf;
+    TPtrC8 writeBuf = iDataBuf;
 
     // rd publisher
-	iBytesRead[iLun] += writeBuf.Length();
-	iReadTransferPublisher->StartTimer();
+    iBytesRead[iLun] += writeBuf.Length();
+    iReadTransferPublisher->StartTimer();
 
-	// Set up data write to the host
+    // Set up data write to the host
 #ifdef MSDC_TESTMODE
     if (iTestParser)
         {
         TBool test = iTestParser->DInSearch(writeBuf);
         }
 #endif
-	iTransport->SetupDataIn(writeBuf);
-	return ETrue;
-	}
+    iTransport->SetupDataIn(writeBuf);
+    return ETrue;
+    }
 
 
 /**
@@ -717,41 +691,40 @@
 @return ETrue if successful.
 */
 TBool CScsiServerProtocol::HandleWrite10(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
-	const TScsiServerWrite10Req& request = static_cast<const TScsiServerWrite10Req&>(aRequest);
-	CMassStorageDrive* drive = GetCheckDrive();
-	if (drive == NULL)
-		{
-		return EFalse;
-		}
-	if (request.iProtect)
-		{
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
-		return EFalse;
-		}
+    {
+    const TScsiServerWrite10Req& request = static_cast<const TScsiServerWrite10Req&>(aRequest);
+    CMassStorageDrive* drive = GetCheckDrive();
+    if (drive == NULL)
+        {
+        return EFalse;
+        }
+    if (request.iProtect)
+        {
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::EInvalidFieldInCdb);
+        return EFalse;
+        }
 
-	if (!request.iTransferLength)
-		{
-		return ETrue; // do nothing - this is not an error
-		}
+    if (!request.iTransferLength)
+        {
+        return ETrue; // do nothing - this is not an error
+        }
 
     const TMediaParams& params = drive->MediaParams();
 
-	if (params.IsWriteProtected() ||
-		params.IsLocked())
-		{
-		iSenseInfo.SetSense(TSenseInfo::EDataProtection, TSenseInfo::EWriteProtected);
-		return EFalse;
-		}
+    if (params.IsWriteProtected() ||
+        params.IsLocked())
+        {
+        iSenseInfo.SetSense(TSenseInfo::EDataProtection, TSenseInfo::EWriteProtected);
+        return EFalse;
+        }
 
     TInt64 theEnd = iMediaWriteMan.Start(request.iLogicalBlockAddress, request.iTransferLength, params.BlockSize());
-	if (theEnd > params.Size())  //check if media big enough for this request
-		{
-		__PRINT(_L("err - Request ends out of media\n"));
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::ELbaOutOfRange);
-		return EFalse;
-		}
+    if (theEnd > params.Size())  //check if media big enough for this request
+        {
+        __PRINT(_L("err - Request ends out of media\n"));
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest, TSenseInfo::ELbaOutOfRange);
+        return EFalse;
+        }
 
     TUint32 thisLength = iMediaWriteMan.GetPacketLength();
 
@@ -767,20 +740,19 @@
             }
         }
 
-	iDataBuf.SetLength(thisLength);
-	TPtr8 readBuf = iDataBuf.LeftTPtr(iDataBuf.Length());
+    iDataBuf.SetLength(thisLength);
+    TPtr8 readBuf = iDataBuf.LeftTPtr(iDataBuf.Length());
 
     // wr publisher
-	iBytesWritten[iLun] += readBuf.Length();
-	iWriteTransferPublisher->StartTimer();
-	iTransport->SetupDataOut(readBuf);
-	return ETrue;
-	}
+    iBytesWritten[iLun] += readBuf.Length();
+    iWriteTransferPublisher->StartTimer();
+    iTransport->SetupDataOut(readBuf);
+    return ETrue;
+    }
 
 
 void CScsiServerProtocol::MediaWriteAbort()
     {
-    __MSFNLOG
     iMediaWriteMan.Reset();
     iSenseInfo.SetSense(TSenseInfo::EAbortedCommand);
     }
@@ -797,8 +769,7 @@
         KErrNone if command processing is complete and was successful.
 */
 TInt CScsiServerProtocol::MediaWritePacket(TUint& aBytesWritten)
-	{
-    __MSFNLOG
+    {
     aBytesWritten = 0;
     if (iMediaWriteMan.Active() == EFalse)
         {
@@ -867,10 +838,10 @@
         }
 #endif
 
-	const TInt64 bOffset = iMediaWriteMan.Offset();
+    const TInt64 bOffset = iMediaWriteMan.Offset();
     iMediaWriteMan.Reset();
 
-   	__PRINT1(_L("SCSI: writing %d bytes\n"), iDataBuf.Length());
+    __PRINT1(_L("SCSI: writing %d bytes\n"), iDataBuf.Length());
 
     TInt err = KErrNone;
 #ifdef MSDC_TESTMODE
@@ -889,30 +860,30 @@
         }
 #else
     // ********* Write data to the drive ********
-   	err = drive->Write(bOffset, iDataBuf);
+    err = drive->Write(bOffset, iDataBuf);
 #endif
-   	if (err != KErrNone)
-   		{
-   		__PRINT1(_L("Error after write = 0x%X \n"), err);
-   		iSenseInfo.SetSense(TSenseInfo::EAbortedCommand);
-   		return KErrAbort;
-   		}
+    if (err != KErrNone)
+        {
+        __PRINT1(_L("Error after write = 0x%X \n"), err);
+        iSenseInfo.SetSense(TSenseInfo::EAbortedCommand);
+        return KErrAbort;
+        }
 
-   	TUint thisLength = iDataBuf.Length();
+    TUint thisLength = iDataBuf.Length();
     aBytesWritten = thisLength;
 
     iMediaWriteMan.SetOffset(bOffset, thisLength);
 
-   	if (iMediaWriteMan.BytesRemain() == 0)
+    if (iMediaWriteMan.BytesRemain() == 0)
         {
         return iSenseInfo.SenseOk() ? KErrNone : KErrAbort;
         }
 
     // More data is expected - set up another request to read from the host
     const TUint32 nextPacketLength = iMediaWriteMan.NextPacket();
- 	TUint bytesAvail = iTransport->BytesAvailable() & ~(drive->MediaParams().BlockSize()-1);
+    TUint bytesAvail = iTransport->BytesAvailable() & ~(drive->MediaParams().BlockSize()-1);
 
- 	TBool wait = EFalse;
+    TBool wait = EFalse;
 
     thisLength = nextPacketLength;
     if (bytesAvail)
@@ -927,13 +898,13 @@
             }
         }
 
- 	thisLength = (thisLength > KMaxBufSize) ? KMaxBufSize : thisLength;
+    thisLength = (thisLength > KMaxBufSize) ? KMaxBufSize : thisLength;
 
-   	iDataBuf.SetLength(thisLength);
-   	TPtr8 readBuf = iDataBuf.LeftTPtr(iDataBuf.Length());
+    iDataBuf.SetLength(thisLength);
+    TPtr8 readBuf = iDataBuf.LeftTPtr(iDataBuf.Length());
     iTransport->SetupDataOut(readBuf);
     return wait ? KErrNotReady : KErrCompletion;
-	}
+    }
 
 
 /**
@@ -942,29 +913,28 @@
 @return ETrue if successful.
 */
 TBool CScsiServerProtocol::HandleModeSense6(const TScsiServerReq& aRequest)
-	{
-    __MSFNLOG
-	const TScsiServerModeSense6Req& request = static_cast<const TScsiServerModeSense6Req&>(aRequest);
+    {
+    const TScsiServerModeSense6Req& request = static_cast<const TScsiServerModeSense6Req&>(aRequest);
 
-	TScsiServerModeSense6Resp response;
+    TScsiServerModeSense6Resp response;
     response.SetAllocationLength(request.iAllocationLength);
 
-	if (request.iPageCode != TScsiServerModeSense6Req::KAllPages ||
+    if (request.iPageCode != TScsiServerModeSense6Req::KAllPages ||
         request.iPageControl == TScsiServerModeSense6Req::EChangeableValues)
-		{
-		__PRINT(_L("TSenseInfo::EIllegalRequest,TSenseInfo::EInvalidFieldInCdb"));
-		iSenseInfo.SetSense(TSenseInfo::EIllegalRequest,TSenseInfo::EInvalidFieldInCdb);
-		return EFalse;
-		}
-	if (request.iPageControl != TScsiServerModeSense6Req::EDefaultValues)
-		{
-		//check if drive write protected
-		CMassStorageDrive* drive = GetCheckDrive();
-		if (drive == NULL)
-			{
-			__PRINT(_L("drive == null"));
-			return EFalse;
-			}
+        {
+        __PRINT(_L("TSenseInfo::EIllegalRequest,TSenseInfo::EInvalidFieldInCdb"));
+        iSenseInfo.SetSense(TSenseInfo::EIllegalRequest,TSenseInfo::EInvalidFieldInCdb);
+        return EFalse;
+        }
+    if (request.iPageControl != TScsiServerModeSense6Req::EDefaultValues)
+        {
+        //check if drive write protected
+        CMassStorageDrive* drive = GetCheckDrive();
+        if (drive == NULL)
+            {
+            __PRINT(_L("drive == null"));
+            return EFalse;
+            }
 
 #ifdef MSDC_TESTMODE
     if (iTestParser)
@@ -978,7 +948,7 @@
 
     response.Encode(iCommandBuf);
 
-	TPtrC8 writeBuf = iCommandBuf;
-	iTransport->SetupDataIn(writeBuf);
-	return iSenseInfo.SenseOk();
-	}
+    TPtrC8 writeBuf = iCommandBuf;
+    iTransport->SetupDataIn(writeBuf);
+    return iSenseInfo.SenseOk();
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/tscsiservercmds.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/tscsiservercmds.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -27,17 +27,15 @@
 #include "tscsiserverreq.h"
 #include "tscsiservercmds.h"
 #include "debug.h"
-#include "msdebug.h"
 
 /**
 Default constructor for TSenseInfo
 */
 TSrvSenseInfo::TSrvSenseInfo()
     {
-    __MSFNLOG
     iSenseCode = ENoSense;
     iAdditional = 0;
-	iQualifier = 0;
+    iQualifier = 0;
     }
 
 /**
@@ -46,12 +44,11 @@
 @param aSenseCode sense key
 */
 void TSrvSenseInfo::SetSense(TSenseCode aSenseCode)
-	{
-    __MSFNLOG
-	iSenseCode	= static_cast<TUint8>(aSenseCode);
-	iAdditional = 0;
-	iQualifier  = 0;
-	}
+    {
+    iSenseCode  = static_cast<TUint8>(aSenseCode);
+    iAdditional = 0;
+    iQualifier  = 0;
+    }
 
 
 /**
@@ -63,12 +60,11 @@
 void TSrvSenseInfo::SetSense(TSenseCode aSenseCode,
                           TAdditionalCode aAdditional)
 
-	{
-    __MSFNLOG
-	iSenseCode = static_cast<TUint8>(aSenseCode);
-	iAdditional = static_cast<TUint8>(aAdditional);
-	iQualifier = 0;
-	}
+    {
+    iSenseCode = static_cast<TUint8>(aSenseCode);
+    iAdditional = static_cast<TUint8>(aAdditional);
+    iQualifier = 0;
+    }
 
 
 /**
@@ -81,28 +77,26 @@
 void TSrvSenseInfo::SetSense(TSenseCode aSenseCode,
                           TAdditionalCode aAdditional,
                           TUint8 aQualifier)
-	{
-    __MSFNLOG
-	iSenseCode = static_cast<TUint8>(aSenseCode);
-	iAdditional = static_cast<TUint8>(aAdditional);
-	iQualifier = aQualifier;
-	}
+    {
+    iSenseCode = static_cast<TUint8>(aSenseCode);
+    iAdditional = static_cast<TUint8>(aAdditional);
+    iQualifier = aQualifier;
+    }
 
 
 // **** TEST UNIT READY ****
 // **** REQUEST SENSE ****
 void TScsiServerRequestSenseResp::Encode(TDes8& aBuffer) const
     {
-    __MSFNSLOG
     aBuffer.FillZ(KCommandLength);
     __PRINT(_L("->PROTOCOL(SCSI) REQUEST SENSE\n"));
     //additional sense length
-	aBuffer[07] = static_cast<TUint8>(KCommandLength - 8);
+    aBuffer[07] = static_cast<TUint8>(KCommandLength - 8);
 
     aBuffer[0] = iResponseCode;
-	aBuffer[02] = static_cast<TUint8>(iSensePtr->iSenseCode);
-	aBuffer[12] = iSensePtr->iAdditional;
-	aBuffer[13] = iSensePtr->iQualifier;
+    aBuffer[02] = static_cast<TUint8>(iSensePtr->iSenseCode);
+    aBuffer[12] = iSensePtr->iAdditional;
+    aBuffer[13] = iSensePtr->iQualifier;
 
     //truncate to Allocation Length of the Request
     TUint length = iAllocationLength < KCommandLength ?
@@ -113,8 +107,7 @@
 // **** INQUIRY ****
 void TScsiServerInquiryReq::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aPtr);
+    TScsiServerReq::DecodeL(aPtr);
     iCmdDt = aPtr[1] & 0x2;
     iEvpd = aPtr[1] & 0x1;
     iPage = aPtr[2];
@@ -125,10 +118,9 @@
 
 void TScsiServerInquiryResp::Encode(TDes8& aBuffer) const
     {
-    __MSFNSLOG
     __PRINT(_L("->PROTOCOL(SCSI) INQUIRY\n"));
 
-	aBuffer.FillZ(KResponseLength);
+    aBuffer.FillZ(KResponseLength);
 
     // MSB: RMB : Removable
     if (iRemovable)
@@ -140,12 +132,12 @@
     aBuffer[3] |= (iResponseDataFormat & 0x0F);
 
     // Additional Length
-	aBuffer[4] = 0x1F;
+    aBuffer[4] = 0x1F;
 
     // Vendor ID (Vendor Specific/Logged by T10)
-	TPtr8 vendorId(&aBuffer[8], 8, 8);
-	vendorId.Fill(' ', 8);
-	vendorId.Copy(iConfig.iVendorId);
+    TPtr8 vendorId(&aBuffer[8], 8, 8);
+    vendorId.Fill(' ', 8);
+    vendorId.Copy(iConfig.iVendorId);
 
     // Product ID (Vendor Specific)
     TPtr8 productId(&aBuffer[16], 16, 16);
@@ -164,11 +156,10 @@
     }
 
 
-// ****	MODE SENSE (6) ****
+// **** MODE SENSE (6) ****
 void TScsiServerModeSense6Req::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aPtr);
+    TScsiServerReq::DecodeL(aPtr);
     iPageCode = aPtr[2] & 0x3F;
     iPageControl = static_cast<TPageControl>(aPtr[2] >> 6);
     iAllocationLength = aPtr[4];
@@ -178,7 +169,6 @@
 
 void TScsiServerModeSense6Resp::Encode(TDes8& aBuffer) const
     {
-    __MSFNSLOG
     __PRINT(_L("->PROTOCOL(SCSI) MODE SENSE (6)\n"));
     // reserve 4 bytes for Length, Media type, Device-specific parameter and
     // Block descriptor length
@@ -225,11 +215,10 @@
     aBuffer.SetLength(length);
     }
 
-// ****	START STOP UNIT ****
+// **** START STOP UNIT ****
 void TScsiServerStartStopUnitReq::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aPtr);
+    TScsiServerReq::DecodeL(aPtr);
 
     const TUint8 KStartMask = 0x01;
     const TUint8 KImmedMask = 0x01;
@@ -246,44 +235,41 @@
     }
 
 
-// ****	PREVENT MEDIA REMOVAL ****
+// **** PREVENT MEDIA REMOVAL ****
 void TScsiServerPreventMediaRemovalReq::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aPtr);
-	iPrevent = aPtr[4] & 0x01;
-	__PRINT1(_L("<-PROTOCOL(SCSI) PREVENT MEDIA REMOVAL prevent = %d\n"), iPrevent);
+    TScsiServerReq::DecodeL(aPtr);
+    iPrevent = aPtr[4] & 0x01;
+    __PRINT1(_L("<-PROTOCOL(SCSI) PREVENT MEDIA REMOVAL prevent = %d\n"), iPrevent);
     }
 
 
-// ****	READ FORMAT CAPACITIES ****
+// **** READ FORMAT CAPACITIES ****
 void TScsiServerReadFormatCapacitiesReq::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aPtr);
+    TScsiServerReq::DecodeL(aPtr);
     const TUint8* ptr = aPtr.Ptr();
     iAllocationLength = BigEndian::Get32(ptr+7);
-	__PRINT(_L("<-PROTOCOL(SCSI) READ FORMAT CAPACITIES\n"));
+    __PRINT(_L("<-PROTOCOL(SCSI) READ FORMAT CAPACITIES\n"));
     }
 
 
 void TScsiServerReadFormatCapacitiesResp::Encode(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-	__PRINT(_L("->PROTOCOL(SCSI) READ FORMAT CAPACITIES\n"));
-	aBuffer.FillZ(KResponseLength);
-	aBuffer[3] = 0x08;	// Capacity List Length
+    __PRINT(_L("->PROTOCOL(SCSI) READ FORMAT CAPACITIES\n"));
+    aBuffer.FillZ(KResponseLength);
+    aBuffer[3] = 0x08;  // Capacity List Length
 
-	aBuffer[4] = static_cast<TUint8>(iNumberBlocks >> 24);	// Number of blocks
-	aBuffer[5] = static_cast<TUint8>(iNumberBlocks >> 16);	//
-	aBuffer[6] = static_cast<TUint8>(iNumberBlocks >> 8);	//
-	aBuffer[7] = static_cast<TUint8>(iNumberBlocks);		//
+    aBuffer[4] = static_cast<TUint8>(iNumberBlocks >> 24);  // Number of blocks
+    aBuffer[5] = static_cast<TUint8>(iNumberBlocks >> 16);  //
+    aBuffer[6] = static_cast<TUint8>(iNumberBlocks >> 8);   //
+    aBuffer[7] = static_cast<TUint8>(iNumberBlocks);        //
 
-	aBuffer[8] = 0x02;	// Formatted size
+    aBuffer[8] = 0x02;  // Formatted size
 
-	aBuffer[9]  = 0x00;	// 512 Byte Blocks
-	aBuffer[10] = 0x02;	//
-	aBuffer[11] = 0x00;	//
+    aBuffer[9]  = 0x00; // 512 Byte Blocks
+    aBuffer[10] = 0x02; //
+    aBuffer[11] = 0x00; //
 
     // Truncate to Allocation Length of the Request
     // Truncate to Allocation Length of the Request
@@ -293,21 +279,19 @@
     }
 
 
-// ****	READ CAPACITY (10) ****
+// **** READ CAPACITY (10) ****
 void TScsiServerReadCapacity10Req::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aPtr);
+    TScsiServerReq::DecodeL(aPtr);
     iPmi = aPtr[8] & 0x01;
     const TUint8* ptr = aPtr.Ptr();
-	iLogicalBlockAddress = BigEndian::Get32(ptr+2);
+    iLogicalBlockAddress = BigEndian::Get32(ptr+2);
     __PRINT(_L("<-PROTOCOL(SCSI) READ CAPACITY (10)\n"));
     }
 
 
 void TScsiServerReadCapacity10Resp::Encode(TDes8& aBuffer) const
     {
-    __MSFNSLOG
     aBuffer.FillZ(KCommandLength);
 
     __PRINT3(_L("->PROTOCOL(SCSI) READ CAPACITY (10) Block size=0x%X, NumBlocks=0x%08X%08X\n"),
@@ -331,7 +315,7 @@
         aBuffer[0] = aBuffer[1] = aBuffer[2] = aBuffer[3] = 0xFF;
         }
 
-	// Block Size
+    // Block Size
     aBuffer[4] = static_cast<TUint8>(iBlockSize >> 24);
     aBuffer[5] = static_cast<TUint8>(iBlockSize >> 16);
     aBuffer[6] = static_cast<TUint8>(iBlockSize >> 8);
@@ -339,32 +323,30 @@
     }
 
 
-// ****	RdWr10 ****
+// **** RdWr10 ****
 void TScsiServerRdWr10Req::DecodeL(const TDesC8& aDes)
 {
-    __MSFNLOG
-	TScsiServerReq::DecodeL(aDes);
+    TScsiServerReq::DecodeL(aDes);
 
     // PROTECT
-	iProtect = aDes[1] >> 5;
+    iProtect = aDes[1] >> 5;
 
     const TUint8* ptr = aDes.Ptr();
     // LOGICAL BLOCK ADDRESS
-	iLogicalBlockAddress = BigEndian::Get32(ptr+2);
+    iLogicalBlockAddress = BigEndian::Get32(ptr+2);
     // TRANSFER LENGTH
-	iTransferLength = BigEndian::Get16(ptr+7);
+    iTransferLength = BigEndian::Get16(ptr+7);
 
-	__PRINT2(_L("<-PROTOCOL(SCSI) RD/WR (10) : LBA = %x, Length = %x  (blocks)\n"),
+    __PRINT2(_L("<-PROTOCOL(SCSI) RD/WR (10) : LBA = %x, Length = %x  (blocks)\n"),
              iLogicalBlockAddress, iTransferLength);
 }
 
 
-// ****	READ (10) ****
-// ****	WRITE (10) ****
-// ****	VERIFY (10) ****
+// **** READ (10) ****
+// **** WRITE (10) ****
+// **** VERIFY (10) ****
 void TScsiServerVerify10Req::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
-	TScsiServerRdWr10Req::DecodeL(aPtr);
-	iBytchk = aPtr[1] & 0x02 ? ETrue : EFalse;
+    TScsiServerRdWr10Req::DecodeL(aPtr);
+    iBytchk = aPtr[1] & 0x02 ? ETrue : EFalse;
     }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/tscsiserverreq.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/protocol/tscsiserverreq.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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,12 +24,10 @@
 #include "tscsiserverreq.h"
 #include "tscsiservercmds.h"
 #include "debug.h"
-#include "msdebug.h"
 
 TScsiServerReq* TScsiServerReq::CreateL(TScsiServerReq::TOperationCode aOperationCode,
                                         TDesC8& aDes)
     {
-    __MSFNSLOG
     TScsiServerReq* req = NULL;
 
     __SCSIPRINT1(_L("SCSI CMD 0x%x"), aOperationCode);
@@ -107,9 +105,8 @@
 
 void TScsiServerReq::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
     // OPERATION CODE
-	iOperationCode = static_cast<TOperationCode>(aPtr[0]);
+    iOperationCode = static_cast<TOperationCode>(aPtr[0]);
 
     // CONTROL byte
     TInt length = 0;
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/botcontrolinterface.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/botcontrolinterface.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -35,10 +35,7 @@
 
 #include "cusbmassstoragecontroller.h"
 #include "botcontrolinterface.h"
-
-
 #include "debug.h"
-#include "msdebug.h"
 
 TTestConfig::TTestConfig()
 :   iTestMode(ENone)
@@ -53,21 +50,19 @@
 @param aParent reference to the CBulkOnlyTransport
 */
 CBotControlInterface* CBotControlInterface::NewL(CBulkOnlyTransport& aParent)
-	{
-    __MSFNSLOG
-	CBotControlInterface* self = new(ELeave) CBotControlInterface(aParent);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CActiveScheduler::Add(self);
-	CleanupStack::Pop();
-	return self;
-	}
+    {
+    CBotControlInterface* self = new(ELeave) CBotControlInterface(aParent);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CActiveScheduler::Add(self);
+    CleanupStack::Pop();
+    return self;
+    }
 
 
 void CBotControlInterface::ConstructL()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 
 /**
@@ -76,169 +71,161 @@
 @param aParent reference to the CBulkOnlyTransport
 */
 CBotControlInterface::CBotControlInterface(CBulkOnlyTransport& aParent):
-	CActive(EPriorityStandard),
-	iParent(aParent),
-	iCurrentState(ENone)
-	{
-    __MSFNLOG
-	}
+    CActive(EPriorityStandard),
+    iParent(aParent),
+    iCurrentState(ENone)
+    {
+    }
 
 
 /**
 d'tor
 */
 CBotControlInterface::~CBotControlInterface()
-	{
-    __MSFNLOG
-	Cancel();
-	}
+    {
+    Cancel();
+    }
 
 
 /**
 Called by  CBulkOnlyTransportStart to start control interface
 */
 TInt CBotControlInterface::Start()
-	{
-    __MSFNLOG
+    {
     if (IsActive())
         {
         __PRINT(_L("Still active\n"));
         return KErrServerBusy;
         }
-	ReadEp0Data();
-	return KErrNone;
-	}
+    ReadEp0Data();
+    return KErrNone;
+    }
 
 
 /**
 Called by CBulkOnlyTransportStart to stop control interface
 */
 void CBotControlInterface::Stop()
-	{
-    __MSFNLOG
-	if (!IsActive())
-		{
-		__PRINT(_L("Not active\n"));
-		return;
-		}
+    {
+    if (!IsActive())
+        {
+        __PRINT(_L("Not active\n"));
+        return;
+        }
 
-	__PRINT(_L("\nStopping...\n"));
-	iCurrentState = ENone;
-	Cancel();
-	}
+    __PRINT(_L("\nStopping...\n"));
+    iCurrentState = ENone;
+    Cancel();
+    }
 
 
 /**
 Cancel outstanding request (if any)
 */
 void CBotControlInterface::DoCancel()
-	{
-    __MSFNLOG
-	switch(iCurrentState)
-		{
-		case EReadEp0Data:
-			iParent.Ldd().ReadCancel(EEndpoint0);
-			break;
-		case ESendMaxLun:
-			iParent.Ldd().WriteCancel(EEndpoint0);
-			break;
-		default:
-			__PRINT(_L("\nWrong state !\n"));
-			__ASSERT_DEBUG(EFalse, User::Panic(KUsbMsClientPanicCat, EMsControlInterfaceBadState));
-		}
-	}
+    {
+    switch(iCurrentState)
+        {
+        case EReadEp0Data:
+            iParent.Ldd().ReadCancel(EEndpoint0);
+            break;
+        case ESendMaxLun:
+            iParent.Ldd().WriteCancel(EEndpoint0);
+            break;
+        default:
+            __PRINT(_L("\nWrong state !\n"));
+            __ASSERT_DEBUG(EFalse, User::Panic(KUsbMsClientPanicCat, EMsControlInterfaceBadState));
+        }
+    }
 
 
 /**
 Implement CBotControlInterface state machine
 */
 void CBotControlInterface::RunL()
-	{
-    __MSFNLOG
-	if (iStatus != KErrNone)
-		{
-		__PRINT1(_L("Error %d in RunL\n"), iStatus.Int());
+    {
+    if (iStatus != KErrNone)
+        {
+        __PRINT1(_L("Error %d in RunL\n"), iStatus.Int());
 
-		//read EP0  again
-		ReadEp0Data();
-		return;
-		}
+        //read EP0  again
+        ReadEp0Data();
+        return;
+        }
 
-	switch (iCurrentState)
-		{
-	case ESendMaxLun:
-		ReadEp0Data();
-		break;
+    switch (iCurrentState)
+        {
+    case ESendMaxLun:
+        ReadEp0Data();
+        break;
 
-	case EReadEp0Data:
-		DecodeEp0Data();
-		break;
+    case EReadEp0Data:
+        DecodeEp0Data();
+        break;
 
-	default:
-		__PRINT(_L("  error: (Shouldn't end up here...)\n"));
-		__ASSERT_DEBUG(EFalse, User::Panic(KUsbMsClientPanicCat, EMsControlInterfaceBadState));
-		break;
-		}
-	}
+    default:
+        __PRINT(_L("  error: (Shouldn't end up here...)\n"));
+        __ASSERT_DEBUG(EFalse, User::Panic(KUsbMsClientPanicCat, EMsControlInterfaceBadState));
+        break;
+        }
+    }
 
 
 /**
 Post a read request to EEndpoint0 to read request header
 */
 void CBotControlInterface::ReadEp0Data()
-	{
-    __MSFNLOG
-	iParent.Ldd().Read(iStatus, EEndpoint0, iData, KRequestHdrSize);
-	iCurrentState = EReadEp0Data;
-	SetActive();
-	}
+    {
+    iParent.Ldd().Read(iStatus, EEndpoint0, iData, KRequestHdrSize);
+    iCurrentState = EReadEp0Data;
+    SetActive();
+    }
 
 
 /**
 Decode request header and do appropriate action - get max LUN info or post a reset request
 */
 void CBotControlInterface::DecodeEp0Data()
-	{
-    __MSFNLOG
-	TInt err = iRequestHeader.Decode(iData);
-	if (err != KErrNone)
-		return;
+    {
+    TInt err = iRequestHeader.Decode(iData);
+    if (err != KErrNone)
+        return;
 
     switch(iRequestHeader.iRequest)
-		{
-	//
-	// GET MAX LUN (0xFE)
-	//
+        {
+    //
+    // GET MAX LUN (0xFE)
+    //
     case TBotFunctionReqCb::EReqGetMaxLun:
-		{
-		__PRINT1(_L("DecodeEp0Data : 'Get Max LUN' Request MaxLun = %d"),iParent.MaxLun());
+        {
+        __PRINT1(_L("DecodeEp0Data : 'Get Max LUN' Request MaxLun = %d"),iParent.MaxLun());
 
         if (   iRequestHeader.iRequestType != 0xA1 //value from USB MS BOT spec
             || iRequestHeader.iIndex > 15
             || iRequestHeader.iValue != 0
             || iRequestHeader.iLength != 1)
             {
-    	    __PRINT(_L("GetMaxLun command packet check error"));
+            __PRINT(_L("GetMaxLun command packet check error"));
             iParent.Ldd().EndpointZeroRequestError();
             ReadEp0Data();  //try to get another request
             }
         else
             {
             iData.FillZ(1);  //Return only 1 byte to host
-            iData[0] = static_cast<TUint8>(iParent.MaxLun());	// Supported Units
+            iData[0] = static_cast<TUint8>(iParent.MaxLun());   // Supported Units
             iParent.Ldd().Write(iStatus, EEndpoint0, iData, 1);
 
             iCurrentState = ESendMaxLun;
             SetActive();
             }
-		}
+        }
         break;
-	//
-	// RESET (0xFF)
-	//
-	case TBotFunctionReqCb::EReqReset:
-		{
-		__PRINT(_L("DecodeEp0Data : 'Mass Storage Reset' Request"));
+    //
+    // RESET (0xFF)
+    //
+    case TBotFunctionReqCb::EReqReset:
+        {
+        __PRINT(_L("DecodeEp0Data : 'Mass Storage Reset' Request"));
         __TESTMODEPRINT("------- BOT RESET ------");
 
         if (   iRequestHeader.iRequestType != 0x21 //value from USB MS BOT spec
@@ -246,7 +233,7 @@
             || iRequestHeader.iValue != 0
             || iRequestHeader.iLength != 0)
             {
-		    __PRINT(_L("MSC Reset command packet check error"));
+            __PRINT(_L("MSC Reset command packet check error"));
             iParent.Ldd().EndpointZeroRequestError();
             ReadEp0Data();  //try to get another request
             }
@@ -257,14 +244,14 @@
             iParent.HwStart(ETrue);
             iParent.Ldd().SendEp0StatusPacket();
             }
-		}
+        }
         break;
-	//
-	// Unknown?
-	//
-	default:
-		__PRINT(_L("DecodeEp0Data : Unknown Request"));
+    //
+    // Unknown?
+    //
+    default:
+        __PRINT(_L("DecodeEp0Data : Unknown Request"));
         ReadEp0Data();  //try to get another request
         break;
         }
-	}
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/botmscserver.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/botmscserver.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -26,13 +26,10 @@
 #include "testman.h"
 #include "botmscserver.h"
 #include "debug.h"
-#include "msdebug.h"
-
-
 
 TDataTransferMan::TDataTransferMan()
-:	iReadBuf(NULL, 0),
-	iWriteBuf(NULL, 0)
+:   iReadBuf(NULL, 0),
+    iWriteBuf(NULL, 0)
     {
     }
 
@@ -50,12 +47,11 @@
 @param aData reference to the data buffer.
 */
 void TDataTransferMan::SetModeDataOut(TPtr8& aData)
-	{
-    __MSFNLOG
-	__PRINT1(_L("Length = %d  (bytes)\n"), aData.Length());
-	iReadBuf.Set(aData);
-	iMode = EDataTransferOut;
-	}
+    {
+    __PRINT1(_L("Length = %d  (bytes)\n"), aData.Length());
+    iReadBuf.Set(aData);
+    iMode = EDataTransferOut;
+    }
 
 
 /**
@@ -65,12 +61,11 @@
 @param aData reference to the data buffer.
 */
 void TDataTransferMan::SetModeDataIn(TPtrC8& aData)
-	{
-    __MSFNLOG
-	__PRINT1(_L("Length = %d  (bytes)\n"), aData.Length());
-	iWriteBuf.Set(aData);
-	iMode = EDataTransferIn;
-	}
+    {
+    __PRINT1(_L("Length = %d  (bytes)\n"), aData.Length());
+    iWriteBuf.Set(aData);
+    iMode = EDataTransferIn;
+    }
 
 
 TBotServerReq::TBotServerReq()
@@ -80,7 +75,6 @@
 
 void TBotServerReq::DecodeL(const TDesC8& aPtr)
     {
-    __MSFNLOG
     if (aPtr.Length() != KCbwLength)
         {
         User::Leave(KErrUnderflow);
@@ -88,10 +82,10 @@
 
     // Check reserved bits (must be zero)
     if ((aPtr[KCbwLunOffset] & 0xF0) || (aPtr[KCbwCbLengthOffset] & 0xE0))
-		{
-		__PRINT(_L("Reserved bits not zero\n"));
+        {
+        __PRINT(_L("Reserved bits not zero\n"));
         User::Leave(KErrArgument);
-		}
+        }
 
     iSignature = LittleEndian::Get32(&aPtr[KCbwSignatureOffset]);
     iTag = LittleEndian::Get32(&aPtr[KCbwTagOffset]);
@@ -103,7 +97,6 @@
 
 TBool TBotServerReq::IsValidCbw() const
     {
-    __MSFNSLOG
     if (iSignature != 0x43425355)
         {
         return EFalse;
@@ -115,7 +108,6 @@
 
 TBool TBotServerReq::IsMeaningfulCbw(TInt aMaxLun) const
     {
-    __MSFNSLOG
     if (iLun > aMaxLun)
         {
         return EFalse;
@@ -144,7 +136,7 @@
 
 void TBotServerResp::EncodeL(TDes8& aBuffer) const
     {
-	TUint8* ptr = const_cast<TUint8*>(aBuffer.Ptr());
+    TUint8* ptr = const_cast<TUint8*>(aBuffer.Ptr());
 
     // dCBWSignature
     ptr += KCswSignatureOffset;
@@ -240,32 +232,32 @@
  */
 TInt TBotServerFunctionReq::Decode(const TDesC8& aBuffer)
 
-	{
-	if (aBuffer.Length() < static_cast<TInt>(KRequestHdrSize))
-		{
+    {
+    if (aBuffer.Length() < static_cast<TInt>(KRequestHdrSize))
+        {
         __PRINT1(_L("TBotServerFunctionReq::Decode buffer invalid length %d"), aBuffer.Length());
-		return KErrGeneral;
-		}
+        return KErrGeneral;
+        }
 
-	iRequestType = aBuffer[0];
-	iRequest = static_cast<TEp0Request>(aBuffer[1]);
-	iValue	 = static_cast<TUint16>(aBuffer[2] + (aBuffer[3] << 8));
-	iIndex	 = static_cast<TUint16>(aBuffer[4] + (aBuffer[5] << 8));
-	iLength  = static_cast<TUint16>(aBuffer[6] + (aBuffer[7] << 8));
+    iRequestType = aBuffer[0];
+    iRequest = static_cast<TEp0Request>(aBuffer[1]);
+    iValue   = static_cast<TUint16>(aBuffer[2] + (aBuffer[3] << 8));
+    iIndex   = static_cast<TUint16>(aBuffer[4] + (aBuffer[5] << 8));
+    iLength  = static_cast<TUint16>(aBuffer[6] + (aBuffer[7] << 8));
     __PRINT5(_L("type=%d request=%d value=%d index=%d length=%d"), iRequestType,iRequest,iValue,iIndex,iLength);
 
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 
 /**
 This function determines whether data is required by the host in response
 to a message header.
 
-@return TBool	Flag indicating whether a data response required.
+@return TBool   Flag indicating whether a data response required.
 */
 TBool TBotServerFunctionReq::IsDataResponseRequired() const
 
-	{
-	return (iRequestType & 0x80) ? ETrue : EFalse;
-	}
+    {
+    return (iRequestType & 0x80) ? ETrue : EFalse;
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/cbulkonlytransport.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/transport/cbulkonlytransport.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1,4 +1,4 @@
-// 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"
@@ -36,7 +36,6 @@
 #include "mstypes.h"
 #include "botcontrolinterface.h"
 #include "debug.h"
-#include "msdebug.h"
 #include "cusbmassstorageserver.h"
 #include "cusbmassstoragecontroller.h"
 #include "drivemanager.h"
@@ -55,37 +54,35 @@
 */
 CBulkOnlyTransport* CBulkOnlyTransport::NewL(TInt aNumDrives,
                                              CUsbMassStorageController& aController)
-	{
-    __MSFNSLOG
-	if (aNumDrives <=0 || static_cast<TUint>(aNumDrives) > KUsbMsMaxDrives)
-		{
-		User::Leave(KErrArgument);
-		}
-	CBulkOnlyTransport* self = new(ELeave) CBulkOnlyTransport(aNumDrives, aController);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
+    {
+    if (aNumDrives <=0 || static_cast<TUint>(aNumDrives) > KUsbMsMaxDrives)
+        {
+        User::Leave(KErrArgument);
+        }
+    CBulkOnlyTransport* self = new(ELeave) CBulkOnlyTransport(aNumDrives, aController);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
 
 #ifdef MSDC_TESTMODE
 CBulkOnlyTransport* CBulkOnlyTransport::NewL(TInt aNumDrives,
                                              CUsbMassStorageController& aController,
                                              TTestParser* aTestParser)
-	{
-    __MSFNSLOG
-	if (aNumDrives <=0 || static_cast<TUint>(aNumDrives) > KUsbMsMaxDrives)
-		{
-		User::Leave(KErrArgument);
-		}
-	CBulkOnlyTransport* self = new(ELeave) CBulkOnlyTransport(aNumDrives,
+    {
+    if (aNumDrives <=0 || static_cast<TUint>(aNumDrives) > KUsbMsMaxDrives)
+        {
+        User::Leave(KErrArgument);
+        }
+    CBulkOnlyTransport* self = new(ELeave) CBulkOnlyTransport(aNumDrives,
                                                               aController,
                                                               aTestParser);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
 #endif
 
 
@@ -96,26 +93,24 @@
 */
 CBulkOnlyTransport::CBulkOnlyTransport(TInt aNumDrives,
                                        CUsbMassStorageController& aController):
-	CActive(EPriorityStandard),
-	iMaxLun(aNumDrives-1),
-	iController(aController),
-	iStallAllowed(ETrue)
-	{
-    __MSFNLOG
-	}
+    CActive(EPriorityStandard),
+    iMaxLun(aNumDrives-1),
+    iController(aController),
+    iStallAllowed(ETrue)
+    {
+    }
 
 #ifdef MSDC_TESTMODE
 CBulkOnlyTransport::CBulkOnlyTransport(TInt aNumDrives,
                                        CUsbMassStorageController& aController,
                                        TTestParser* aTestParser)
 :   CActive(EPriorityStandard),
-	iMaxLun(aNumDrives-1),
-	iController(aController),
-	iStallAllowed(ETrue),
+    iMaxLun(aNumDrives-1),
+    iController(aController),
+    iStallAllowed(ETrue),
     iTestParser(aTestParser)
-	{
-    __MSFNLOG
-	}
+    {
+    }
 #endif
 
 
@@ -123,27 +118,25 @@
 Constructs the CBulkOnlyTranspor object
 */
 void CBulkOnlyTransport::ConstructL()
-	{
-    __MSFNLOG
-	iBotControlInterface = CBotControlInterface::NewL(*this);
-	iDeviceStateNotifier = CActiveDeviceStateNotifier::NewL(*this);
-	CActiveScheduler::Add(this);
-	}
+    {
+    iBotControlInterface = CBotControlInterface::NewL(*this);
+    iDeviceStateNotifier = CActiveDeviceStateNotifier::NewL(*this);
+    CActiveScheduler::Add(this);
+    }
 
 
 /**
 Destructor
 */
 CBulkOnlyTransport::~CBulkOnlyTransport()
-	{
-    __MSFNLOG
-	if (iInterfaceConfigured)
-		{
-		Stop();
-		}
-	delete iBotControlInterface;
-	delete iDeviceStateNotifier;
-	}
+    {
+    if (iInterfaceConfigured)
+        {
+        Stop();
+        }
+    delete iBotControlInterface;
+    delete iDeviceStateNotifier;
+    }
 
 
 /**
@@ -153,37 +146,36 @@
 @return KErrNone if operation was completed successfully, errorcode otherwise
 */
 TInt CBulkOnlyTransport::SetupConfigurationDescriptor(TBool aUnset)
-	{
-    __MSFNLOG
-	TInt ret(KErrNone);
-	TInt configDescriptorSize(0);
+    {
+    TInt ret(KErrNone);
+    TInt configDescriptorSize(0);
 
-	iLdd.GetConfigurationDescriptorSize(configDescriptorSize);
-	if (static_cast<TUint>(configDescriptorSize) != KUsbDescSize_Config)
-		{
-		return KErrCorrupt;
-		}
+    iLdd.GetConfigurationDescriptorSize(configDescriptorSize);
+    if (static_cast<TUint>(configDescriptorSize) != KUsbDescSize_Config)
+        {
+        return KErrCorrupt;
+        }
 
-	TBuf8<KUsbDescSize_Config> configDescriptor;
-	ret = iLdd.GetConfigurationDescriptor(configDescriptor);
-	if (ret != KErrNone)
-		{
-		return ret;
-		}
+    TBuf8<KUsbDescSize_Config> configDescriptor;
+    ret = iLdd.GetConfigurationDescriptor(configDescriptor);
+    if (ret != KErrNone)
+        {
+        return ret;
+        }
 
-	// I beleive that other fields setted up during LDD initialisation
-	if (aUnset)
-		{
-		--configDescriptor[KUsbNumInterfacesOffset];
-		}
-	else
-		{
-		++configDescriptor[KUsbNumInterfacesOffset];
-		}
-	ret = iLdd.SetConfigurationDescriptor(configDescriptor);
+    // I beleive that other fields setted up during LDD initialisation
+    if (aUnset)
+        {
+        --configDescriptor[KUsbNumInterfacesOffset];
+        }
+    else
+        {
+        ++configDescriptor[KUsbNumInterfacesOffset];
+        }
+    ret = iLdd.SetConfigurationDescriptor(configDescriptor);
 
-	return ret;
-	}
+    return ret;
+    }
 
 
 /**
@@ -192,100 +184,99 @@
 @return KErrNone if operation was completed successfully, errorcode otherwise
 */
 TInt CBulkOnlyTransport::SetupInterfaceDescriptors()
-	{
-    __MSFNLOG
-	// Device caps
-	TUsbDeviceCaps d_caps;
-	TInt ret = iLdd.DeviceCaps(d_caps);
-	if (ret != KErrNone)
-		{
-		return ret;
-		}
-	TInt totalEndpoints = d_caps().iTotalEndpoints;
-	if (totalEndpoints  < KRequiredNumberOfEndpoints)
-		{
-		return KErrHardwareNotAvailable;
-		}
+    {
+    // Device caps
+    TUsbDeviceCaps d_caps;
+    TInt ret = iLdd.DeviceCaps(d_caps);
+    if (ret != KErrNone)
+        {
+        return ret;
+        }
+    TInt totalEndpoints = d_caps().iTotalEndpoints;
+    if (totalEndpoints  < KRequiredNumberOfEndpoints)
+        {
+        return KErrHardwareNotAvailable;
+        }
 
-	// Endpoint caps
-	TUsbcEndpointData data[KUsbcMaxEndpoints];
-	TPtr8 dataptr(reinterpret_cast<TUint8*>(data), sizeof(data), sizeof(data));
-	ret = iLdd.EndpointCaps(dataptr);
-	if (ret != KErrNone)
-		{
-		return ret;
-		}
+    // Endpoint caps
+    TUsbcEndpointData data[KUsbcMaxEndpoints];
+    TPtr8 dataptr(reinterpret_cast<TUint8*>(data), sizeof(data), sizeof(data));
+    ret = iLdd.EndpointCaps(dataptr);
+    if (ret != KErrNone)
+        {
+        return ret;
+        }
 
-	// Set the active interface
-	TUsbcInterfaceInfoBuf ifc;
-	TInt ep_found = 0;
-	TBool foundBulkIN = EFalse;
-	TBool foundBulkOUT = EFalse;
+    // Set the active interface
+    TUsbcInterfaceInfoBuf ifc;
+    TInt ep_found = 0;
+    TBool foundBulkIN = EFalse;
+    TBool foundBulkOUT = EFalse;
 
-	for (TInt i = 0; i < totalEndpoints ; i++)
-		{
-		const TUsbcEndpointCaps* caps = &data[i].iCaps;
-		const TInt maxPacketSize = caps->MaxPacketSize();
-		if (!foundBulkIN &&
-			(caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirIn)) == (KUsbEpTypeBulk | KUsbEpDirIn))
-			{
-			// KInEndpoint is going to be our TX (IN, write) endpoint
-			ifc().iEndpointData[0].iType = KUsbEpTypeBulk;
-			if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) == KUsbDevCapsFeatureWord1_EndpointResourceAllocV2)
-				ifc().iEndpointData[0].iFeatureWord1  = KUsbcEndpointInfoFeatureWord1_DMA|KUsbcEndpointInfoFeatureWord1_DoubleBuffering;
-			ifc().iEndpointData[0].iDir  = KUsbEpDirIn;
-			ifc().iEndpointData[0].iSize = maxPacketSize;
-			ifc().iEndpointData[0].iInterval_Hs = 0;
-			foundBulkIN = ETrue;
-			if (++ep_found == KRequiredNumberOfEndpoints)
-				{
-				break;
-				}
-			continue;
-			}
-		if (!foundBulkOUT &&
-			(caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirOut)) == (KUsbEpTypeBulk | KUsbEpDirOut))
-			{
-			// KOutEndpoint is going to be our RX (OUT, read) endpoint
-			ifc().iEndpointData[1].iType = KUsbEpTypeBulk;
-			if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) == KUsbDevCapsFeatureWord1_EndpointResourceAllocV2)
-				ifc().iEndpointData[1].iFeatureWord1  = KUsbcEndpointInfoFeatureWord1_DMA|KUsbcEndpointInfoFeatureWord1_DoubleBuffering;
-			ifc().iEndpointData[1].iDir  = KUsbEpDirOut;
-			ifc().iEndpointData[1].iSize = maxPacketSize;
-			ifc().iEndpointData[1].iInterval_Hs = 0;
-			foundBulkOUT = ETrue;
-			if (++ep_found == KRequiredNumberOfEndpoints)
-				{
-				break;
-				}
-			continue;
-			}
-		}
-	if (ep_found != KRequiredNumberOfEndpoints)
-		{
-		return KErrHardwareNotAvailable;
-		}
+    for (TInt i = 0; i < totalEndpoints ; i++)
+        {
+        const TUsbcEndpointCaps* caps = &data[i].iCaps;
+        const TInt maxPacketSize = caps->MaxPacketSize();
+        if (!foundBulkIN &&
+            (caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirIn)) == (KUsbEpTypeBulk | KUsbEpDirIn))
+            {
+            // KInEndpoint is going to be our TX (IN, write) endpoint
+            ifc().iEndpointData[0].iType = KUsbEpTypeBulk;
+            if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) == KUsbDevCapsFeatureWord1_EndpointResourceAllocV2)
+                ifc().iEndpointData[0].iFeatureWord1  = KUsbcEndpointInfoFeatureWord1_DMA|KUsbcEndpointInfoFeatureWord1_DoubleBuffering;
+            ifc().iEndpointData[0].iDir  = KUsbEpDirIn;
+            ifc().iEndpointData[0].iSize = maxPacketSize;
+            ifc().iEndpointData[0].iInterval_Hs = 0;
+            foundBulkIN = ETrue;
+            if (++ep_found == KRequiredNumberOfEndpoints)
+                {
+                break;
+                }
+            continue;
+            }
+        if (!foundBulkOUT &&
+            (caps->iTypesAndDir & (KUsbEpTypeBulk | KUsbEpDirOut)) == (KUsbEpTypeBulk | KUsbEpDirOut))
+            {
+            // KOutEndpoint is going to be our RX (OUT, read) endpoint
+            ifc().iEndpointData[1].iType = KUsbEpTypeBulk;
+            if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) == KUsbDevCapsFeatureWord1_EndpointResourceAllocV2)
+                ifc().iEndpointData[1].iFeatureWord1  = KUsbcEndpointInfoFeatureWord1_DMA|KUsbcEndpointInfoFeatureWord1_DoubleBuffering;
+            ifc().iEndpointData[1].iDir  = KUsbEpDirOut;
+            ifc().iEndpointData[1].iSize = maxPacketSize;
+            ifc().iEndpointData[1].iInterval_Hs = 0;
+            foundBulkOUT = ETrue;
+            if (++ep_found == KRequiredNumberOfEndpoints)
+                {
+                break;
+                }
+            continue;
+            }
+        }
+    if (ep_found != KRequiredNumberOfEndpoints)
+        {
+        return KErrHardwareNotAvailable;
+        }
 
-	_LIT16(string, "USB Mass Storage Interface");
-	ifc().iString = const_cast<TDesC16*>(&string);
-	ifc().iTotalEndpointsUsed = KRequiredNumberOfEndpoints;
-	ifc().iClass.iClassNum    = 0x08;	// Mass Storage
-	ifc().iClass.iSubClassNum = 0x06;	// SCSI Transparent Command Set
-	ifc().iClass.iProtocolNum = 0x50;	// Bulk Only Transport
+    _LIT16(string, "USB Mass Storage Interface");
+    ifc().iString = const_cast<TDesC16*>(&string);
+    ifc().iTotalEndpointsUsed = KRequiredNumberOfEndpoints;
+    ifc().iClass.iClassNum    = 0x08;   // Mass Storage
+    ifc().iClass.iSubClassNum = 0x06;   // SCSI Transparent Command Set
+    ifc().iClass.iProtocolNum = 0x50;   // Bulk Only Transport
 
-	TUint bandwidth_priority = (EUsbcBandwidthOUTDefault | EUsbcBandwidthINDefault);
-	if (d_caps().iHighSpeed)
-		{
-		// If this device supports USB High-speed, then we request 64KB buffers
-		// (otherwise the default 4KB ones will do).
-		bandwidth_priority = (EUsbcBandwidthOUTPlus2 | EUsbcBandwidthINPlus2);
-		// Also, tell the Protocol about it, because it might want to do some
-		// optimizing too.
-		iProtocol->ReportHighSpeedDevice();
-		}
-	ret = iLdd.SetInterface(0, ifc, bandwidth_priority);
-	return ret;
-	}
+    TUint bandwidth_priority = (EUsbcBandwidthOUTDefault | EUsbcBandwidthINDefault);
+    if (d_caps().iHighSpeed)
+        {
+        // If this device supports USB High-speed, then we request 64KB buffers
+        // (otherwise the default 4KB ones will do).
+        bandwidth_priority = (EUsbcBandwidthOUTPlus2 | EUsbcBandwidthINPlus2);
+        // Also, tell the Protocol about it, because it might want to do some
+        // optimizing too.
+        iProtocol->ReportHighSpeedDevice();
+        }
+    ret = iLdd.SetInterface(0, ifc, bandwidth_priority);
+    return ret;
+    }
 
 
 /**
@@ -295,7 +286,6 @@
 */
 void CBulkOnlyTransport::SetupDataOut(TPtr8& aData)
     {
-    __MSFNLOG
     iDataTransferMan.SetModeDataOut(aData);
     }
 
@@ -305,52 +295,49 @@
 @param aData reference to the data buffer.
 */
 void CBulkOnlyTransport::SetupDataIn(TPtrC8& aData)
-	{
+    {
     iDataTransferMan.SetModeDataIn(aData);
-	}
+    }
 
 
 TInt CBulkOnlyTransport::Start()
-	{
-    __MSFNLOG
-	TInt err = KErrNone;
+    {
+    TInt err = KErrNone;
 
-	if (!iProtocol)
-		{
-		return KErrBadHandle;   //protocol should be set up before start
-		}
+    if (!iProtocol)
+        {
+        return KErrBadHandle;   //protocol should be set up before start
+        }
 
-	if (IsActive())
-		{
-		__PRINT(_L("CBulkOnlyTransport::Start  - active before start!\n"));
-		return KErrInUse;
-		}
+    if (IsActive())
+        {
+        __PRINT(_L("CBulkOnlyTransport::Start  - active before start!\n"));
+        return KErrInUse;
+        }
 
-	if ((err = iLdd.Open(0))					!= KErrNone ||
-		(err = SetupConfigurationDescriptor()) 	!= KErrNone ||
-		(err = SetupInterfaceDescriptors())		!= KErrNone )
-		{
-		__PRINT(_L("CBulkOnlyTransport::Start  - Error during descriptors setup!\n"));
-		return err;
-		}
+    if ((err = iLdd.Open(0))                    != KErrNone ||
+        (err = SetupConfigurationDescriptor())  != KErrNone ||
+        (err = SetupInterfaceDescriptors())     != KErrNone )
+        {
+        __PRINT(_L("CBulkOnlyTransport::Start  - Error during descriptors setup!\n"));
+        return err;
+        }
 
-	iDeviceStateNotifier->Activate();  // activate notifier wich will wait until USB became configured
-	TUsbcDeviceState deviceStatus = EUsbcDeviceStateDefault;
-	err = iLdd.DeviceStatus(deviceStatus);
-	__PRINT1(_L("CBulkOnlyTransport::Start - Device status = %d\n"), deviceStatus);
-	if (err == KErrNone && deviceStatus == EUsbcDeviceStateConfigured)
-		{
-		__PRINT(_L("CBulkOnlyTransport::Start  - Starting bulk only transport\n"));
-		err = HwStart();
-		}
-	iInterfaceConfigured = ETrue;
-	return err;
-	}
+    iDeviceStateNotifier->Activate();  // activate notifier wich will wait until USB became configured
+    TUsbcDeviceState deviceStatus = EUsbcDeviceStateDefault;
+    err = iLdd.DeviceStatus(deviceStatus);
+    __PRINT1(_L("CBulkOnlyTransport::Start - Device status = %d\n"), deviceStatus);
+    if (err == KErrNone && deviceStatus == EUsbcDeviceStateConfigured)
+        {
+        __PRINT(_L("CBulkOnlyTransport::Start  - Starting bulk only transport\n"));
+        err = HwStart();
+        }
+    iInterfaceConfigured = ETrue;
+    return err;
+    }
 
 TInt CBulkOnlyTransport::HwStart(TBool aDiscard)
-	{
-    __MSFNLOG
-
+    {
     TInt lun = MaxLun();
     do
         {
@@ -358,112 +345,108 @@
         }
     while(--lun >= 0);
 
-	TInt res = iBotControlInterface->Start() ;
+    TInt res = iBotControlInterface->Start() ;
 
-	iCurrentState = ENone;
+    iCurrentState = ENone;
     iDataTransferMan.Init();
-	iStarted = ETrue;
+    iStarted = ETrue;
 
-	TUsbDeviceCaps d_caps;
-	TInt ret = iLdd.DeviceCaps(d_caps);
-	if (ret == KErrNone)
-		{
-		if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != KUsbDevCapsFeatureWord1_EndpointResourceAllocV2)
-			{
-			// Set up DMA if possible (errors are non-critical)
-			TInt err = iLdd.AllocateEndpointResource(KOutEndpoint, EUsbcEndpointResourceDMA);
-			if (err != KErrNone)
-				{
-				__PRINT1(_L("Set DMA on OUT endpoint failed with error code: %d"), err);
-				}
-			err = iLdd.AllocateEndpointResource(KInEndpoint, EUsbcEndpointResourceDMA);
-			if (err != KErrNone)
-				{
-				__PRINT1(_L("Set DMA on IN endpoint failed with error code: %d"), err);
-				}
+    TUsbDeviceCaps d_caps;
+    TInt ret = iLdd.DeviceCaps(d_caps);
+    if (ret == KErrNone)
+        {
+        if((d_caps().iFeatureWord1 & KUsbDevCapsFeatureWord1_EndpointResourceAllocV2) != KUsbDevCapsFeatureWord1_EndpointResourceAllocV2)
+            {
+            // Set up DMA if possible (errors are non-critical)
+            TInt err = iLdd.AllocateEndpointResource(KOutEndpoint, EUsbcEndpointResourceDMA);
+            if (err != KErrNone)
+                {
+                __PRINT1(_L("Set DMA on OUT endpoint failed with error code: %d"), err);
+                }
+            err = iLdd.AllocateEndpointResource(KInEndpoint, EUsbcEndpointResourceDMA);
+            if (err != KErrNone)
+                {
+                __PRINT1(_L("Set DMA on IN endpoint failed with error code: %d"), err);
+                }
 
-			// Set up Double Buffering if possible (errors are non-critical)
-			err = iLdd.AllocateEndpointResource(KOutEndpoint, EUsbcEndpointResourceDoubleBuffering);
-			if (err != KErrNone)
-				{
-				__PRINT1(_L("Set Double Buffering on OUT endpoint failed with error code: %d"), err);
-				}
-			err = iLdd.AllocateEndpointResource(KInEndpoint, EUsbcEndpointResourceDoubleBuffering);
-			if (err != KErrNone)
-				{
-				__PRINT1(_L("Set Double Buffering on IN endpoint failed with error code: %d"), err);
-				}
-			}
-		}
+            // Set up Double Buffering if possible (errors are non-critical)
+            err = iLdd.AllocateEndpointResource(KOutEndpoint, EUsbcEndpointResourceDoubleBuffering);
+            if (err != KErrNone)
+                {
+                __PRINT1(_L("Set Double Buffering on OUT endpoint failed with error code: %d"), err);
+                }
+            err = iLdd.AllocateEndpointResource(KInEndpoint, EUsbcEndpointResourceDoubleBuffering);
+            if (err != KErrNone)
+                {
+                __PRINT1(_L("Set Double Buffering on IN endpoint failed with error code: %d"), err);
+                }
+            }
+        }
 
     if (aDiscard)
-		{
-		TInt bytes;
-		const TInt err = iLdd.QueryReceiveBuffer(KOutEndpoint, bytes);
-		if (err != KErrNone || bytes <= 0)
-			{
-			__PRINT1(_L("Error: err=%d bytes=%d"), bytes);
-			}
-		else
-			{
-			__PRINT1(_L("RxBuffer has %d bytes"), bytes);
-			FlushDataOut(bytes);
-			}
-		}
+        {
+        TInt bytes;
+        const TInt err = iLdd.QueryReceiveBuffer(KOutEndpoint, bytes);
+        if (err != KErrNone || bytes <= 0)
+            {
+            __PRINT1(_L("Error: err=%d bytes=%d"), bytes);
+            }
+        else
+            {
+            __PRINT1(_L("RxBuffer has %d bytes"), bytes);
+            FlushDataOut(bytes);
+            }
+        }
 
-	ClientReadCbw();
-	return res;
-	}
+    ClientReadCbw();
+    return res;
+    }
 
 
 void CBulkOnlyTransport::HwStop()
-	{
-    __MSFNLOG
-	if (iStarted)
-		{
+    {
+    if (iStarted)
+        {
         iController.DriveManager().Disconnect();
-		Cancel();
-		iBotControlInterface->Cancel();
-		iProtocol->Cancel();
-		iStarted = EFalse;
-		}
-	}
+        Cancel();
+        iBotControlInterface->Cancel();
+        iProtocol->Cancel();
+        iStarted = EFalse;
+        }
+    }
 
 
 void CBulkOnlyTransport::HwSuspend()
-	{
-    __MSFNLOG
+    {
     iController.DriveManager().Disconnect();
-	}
+    }
 
 
 void CBulkOnlyTransport::HwResume()
-	{
-    __MSFNLOG
+    {
     iController.DriveManager().Connect();
-	}
+    }
 
 
 /**
 Stops the Bulk Only Transport
 */
 TInt CBulkOnlyTransport::Stop()
-	{
-    __MSFNLOG
-	iBotControlInterface->Cancel();
-	iDeviceStateNotifier->Cancel();
-	Cancel();
-	if  (iInterfaceConfigured)
-		{
-		iLdd.ReleaseInterface(0);
-		SetupConfigurationDescriptor(ETrue);
-		iLdd.Close();
-		}
-	iCurrentState = ENone;
-	iInterfaceConfigured = EFalse;
+    {
+    iBotControlInterface->Cancel();
+    iDeviceStateNotifier->Cancel();
+    Cancel();
+    if  (iInterfaceConfigured)
+        {
+        iLdd.ReleaseInterface(0);
+        SetupConfigurationDescriptor(ETrue);
+        iLdd.Close();
+        }
+    iCurrentState = ENone;
+    iInterfaceConfigured = EFalse;
 
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 
 /**
@@ -471,40 +454,36 @@
 @param aLength The number of bytes to read from the host.
 */
 void CBulkOnlyTransport::ClientReadCbw()
-	{
-    __MSFNLOG
-	if (IsActive())
-		{
-		__PRINT(_L("Still active\n"));
-		__ASSERT_DEBUG(EFalse, User::Panic(KUsbMsClientPanicCat, EMsBulkOnlyStillActive));
-		return;
-		}
+    {
+    if (IsActive())
+        {
+        __PRINT(_L("Still active\n"));
+        __ASSERT_DEBUG(EFalse, User::Panic(KUsbMsClientPanicCat, EMsBulkOnlyStillActive));
+        return;
+        }
 
     ReadCbw();
     }
 
 
 void CBulkOnlyTransport::ReadCbw()
-	{
-    __MSFNLOG
-	iCbwBuf.SetMax();
-	iLdd.ReadUntilShort(iStatus, KOutEndpoint, iCbwBuf, iCbwBuf.Length());
-	iCurrentState = EWaitForCBW;
-	SetActive();
-	}
+    {
+    iCbwBuf.SetMax();
+    iLdd.ReadUntilShort(iStatus, KOutEndpoint, iCbwBuf, iCbwBuf.Length());
+    iCurrentState = EWaitForCBW;
+    SetActive();
+    }
 
 
 void CBulkOnlyTransport::DoCancel()
-	{
-    __MSFNLOG
-	iLdd.WriteCancel(KInEndpoint);
-	iLdd.ReadCancel(KOutEndpoint);
-	}
+    {
+    iLdd.WriteCancel(KInEndpoint);
+    iLdd.ReadCancel(KOutEndpoint);
+    }
 
 
 void CBulkOnlyTransport::Activate(TInt aReason)
     {
-    __MSFNLOG
     SetActive();
     TRequestStatus* r = &iStatus;
     User::RequestComplete(r, aReason);
@@ -512,17 +491,16 @@
 
 
 void CBulkOnlyTransport::RunL()
-	{
-    __MSFNLOG
-	if (iStatus != KErrNone)
-		{
-		__PRINT1(_L("Error %d in RunL, halt endpoints \n"), iStatus.Int());
-		SetPermError(); //halt endpoints for reset recovery
-		return;
-		}
+    {
+    if (iStatus != KErrNone)
+        {
+        __PRINT1(_L("Error %d in RunL, halt endpoints \n"), iStatus.Int());
+        SetPermError(); //halt endpoints for reset recovery
+        return;
+        }
 
-	switch (iCurrentState)
-		{
+    switch (iCurrentState)
+        {
         case EWaitForCBW:
             __PRINT(_L("EWaitForCBW"));
             TRAPD(err, DecodeCbwL());
@@ -538,17 +516,17 @@
                 SetPermError();
                 return;
                 }
-			break;
+            break;
 
         case EHandleDataIn:
             {
             __PRINT(_L("EHandleDataIn"));
             iDataTransferMan.SetModeNoData();
 
-			if (iDataTransferMan.iDataResidue && iStallAllowed)
-				{
-				StallEndpointAndWaitForClear(KInEndpoint);
-				}
+            if (iDataTransferMan.iDataResidue && iStallAllowed)
+                {
+                StallEndpointAndWaitForClear(KInEndpoint);
+                }
 #ifdef MSDC_TESTMODE
             if (iTestParser && iTestParser->Enabled())
                 {
@@ -560,17 +538,17 @@
                     }
                 }
 #endif
-			SendCsw(iCbwTag, iDataTransferMan.iDataResidue, iCmdStatus);
+            SendCsw(iCbwTag, iDataTransferMan.iDataResidue, iCmdStatus);
             }
-			break;
+            break;
 
-		case EHandleDataOut:
-			{
+        case EHandleDataOut:
+            {
             TUint bytesWritten;
             TInt ret = iProtocol->MediaWritePacket(bytesWritten);
             iDataTransferMan.iDataResidue -= bytesWritten;
 
-			switch(ret)
+            switch(ret)
                 {
             case KErrCompletion:
                 {
@@ -667,22 +645,22 @@
                 break;  // KErrNone
                 } // switch
             }
-			break;  // EReadingData
+            break;  // EReadingData
 
-		case ESendingCSW:
-			__PRINT(_L("ESendingCSW"));
-			ReadCbw();
-			break;
+        case ESendingCSW:
+            __PRINT(_L("ESendingCSW"));
+            ReadCbw();
+            break;
 
         case EPermErr:
-			__PRINT(_L("EPermErr"));
-			StallEndpointAndWaitForClear(KInEndpoint);
+            __PRINT(_L("EPermErr"));
+            StallEndpointAndWaitForClear(KInEndpoint);
             break;
 
         default:
-			SetPermError();		// unexpected state
-		}
-	}
+            SetPermError();     // unexpected state
+        }
+    }
 
 
 /**
@@ -694,8 +672,7 @@
 
 */
 void CBulkOnlyTransport::DecodeCbwL()
-	{
-    __MSFNLOG
+    {
     TBotServerReq req;
     req.DecodeL(iCbwBuf);
 
@@ -705,10 +682,10 @@
         }
 
     TPtrC8 aData(&iCbwBuf[TBotCbw::KCbwCbOffset], TBotCbw::KMaxCbwcbLength);
-	//aData.Set(&iCbwBuf[TBotCbw::KCbwCbOffset], TBotCbw::KMaxCbwcbLength);
+    //aData.Set(&iCbwBuf[TBotCbw::KCbwCbOffset], TBotCbw::KMaxCbwcbLength);
     TUint8 lun = req.Lun();
 
-    iCbwTag  = 	req.Tag();
+    iCbwTag  =  req.Tag();
     TUint32 hostDataLength = req.DataTransferLength();
     iDataTransferMan.SetHostDataLen(hostDataLength);
 
@@ -717,68 +694,68 @@
     __PRINT4(_L("lun =%d, hostDataLength=%d, CBWtag = 0x%X\n, dataToHost=%d\n"),
              lun, hostDataLength, iCbwTag, dataToHost);
 
-	//////////////////////////////////////////////
-	TBool ret = iProtocol->DecodePacket(aData, lun);
-	//////////////////////////////////////////////
+    //////////////////////////////////////////////
+    TBool ret = iProtocol->DecodePacket(aData, lun);
+    //////////////////////////////////////////////
 
-	iStallAllowed = ETrue;
+    iStallAllowed = ETrue;
 
-	if (!ret)
-		{
-		__PRINT(_L("Command Failed\n"));
-		iCmdStatus = TBotCsw::ECommandFailed;
-		}
-	else
-		{
-		__PRINT(_L("Command Passed\n"));
-		iCmdStatus = TBotCsw::ECommandPassed;
-		}
+    if (!ret)
+        {
+        __PRINT(_L("Command Failed\n"));
+        iCmdStatus = TBotCsw::ECommandFailed;
+        }
+    else
+        {
+        __PRINT(_L("Command Passed\n"));
+        iCmdStatus = TBotCsw::ECommandPassed;
+        }
 
-	if (hostDataLength)    // Host expected data transfer
-		{
-		if (dataToHost == TBotServerReq::EDataIn)  // send data to host
-			{
+    if (hostDataLength)    // Host expected data transfer
+        {
+        if (dataToHost == TBotServerReq::EDataIn)  // send data to host
+            {
             if (!iDataTransferMan.IsModeDataIn())
-				{
-				__PRINT(_L("Write buffer was not setup\n"));
+                {
+                __PRINT(_L("Write buffer was not setup\n"));
 
-				if (hostDataLength <= KBOTMaxBufSize)
-					{
-					// Case 4 or 8"
-					iBuf.FillZ(hostDataLength);
-					iLdd.Write(iStatus, KInEndpoint, iBuf, hostDataLength);
-					SetActive();
-					iCurrentState = EHandleDataIn;
-					iStallAllowed = EFalse;
-					if (iDataTransferMan.IsModeDataOut())
-						{
+                if (hostDataLength <= KBOTMaxBufSize)
+                    {
+                    // Case 4 or 8"
+                    iBuf.FillZ(hostDataLength);
+                    iLdd.Write(iStatus, KInEndpoint, iBuf, hostDataLength);
+                    SetActive();
+                    iCurrentState = EHandleDataIn;
+                    iStallAllowed = EFalse;
+                    if (iDataTransferMan.IsModeDataOut())
+                        {
                         //read buffer WAS set up - case (8)
-						iCmdStatus = TBotCsw::EPhaseError;
-						}
-					return;
-					}
-				else
-					{
+                        iCmdStatus = TBotCsw::EPhaseError;
+                        }
+                    return;
+                    }
+                else
+                    {
                     // Use next block instead of StallEndpointAndWaitForClear(KInEndpoint);
                     FlushDataIn(hostDataLength);
-					}
+                    }
 
-				if (iDataTransferMan.IsModeDataOut())
-					{
+                if (iDataTransferMan.IsModeDataOut())
+                    {
                     //read buffer WAS set up - case (8)
-					SendCsw(iCbwTag, hostDataLength, TBotCsw::EPhaseError);
-					//don't care to reset any flag - should get reset recovery
-					}
-				else
-					{
+                    SendCsw(iCbwTag, hostDataLength, TBotCsw::EPhaseError);
+                    //don't care to reset any flag - should get reset recovery
+                    }
+                else
+                    {
                     // case (4)
-					SendCsw(iCbwTag, hostDataLength, iCmdStatus);
-					}
-				return;
-				}
+                    SendCsw(iCbwTag, hostDataLength, iCmdStatus);
+                    }
+                return;
+                }
 
 //==================
-			TInt deviceDataLength = iDataTransferMan.iWriteBuf.Length();
+            TInt deviceDataLength = iDataTransferMan.iWriteBuf.Length();
             iDataTransferMan.iDataResidue = hostDataLength - deviceDataLength;
 
 #ifdef MSDC_TESTMODE
@@ -823,8 +800,8 @@
                     }
                 }
 #endif
-			if (deviceDataLength < hostDataLength && hostDataLength <= KBOTMaxBufSize)
-				{
+            if (deviceDataLength < hostDataLength && hostDataLength <= KBOTMaxBufSize)
+                {
                 // do not pad
                 // iStallAllowed = ETrue;
                 // __PRINT1(_L("iBuf.Length=%d\n"),iBuf.Length());
@@ -842,11 +819,11 @@
                 SetActive();
                 iCurrentState = EHandleDataIn;
 
-				return;
-				}
+                return;
+                }
 
-			if (deviceDataLength == hostDataLength)
-				{
+            if (deviceDataLength == hostDataLength)
+                {
                 //case (6)[==]
 #ifdef MSDC_TESTMODE
                 if (iTestParser && iTestParser->Enabled())
@@ -860,49 +837,49 @@
                     }
 #endif
 
-				DataInWriteRequest(deviceDataLength);
-				return;
-				}
-			else if (deviceDataLength < hostDataLength)
-				{
+                DataInWriteRequest(deviceDataLength);
+                return;
+                }
+            else if (deviceDataLength < hostDataLength)
+                {
                 //case (5)[<]
-				DataInWriteRequest(deviceDataLength, ETrue);		// Send ZLP
-				return;
-				}
-			else
-				{
+                DataInWriteRequest(deviceDataLength, ETrue);        // Send ZLP
+                return;
+                }
+            else
+                {
                 // deviceDataLength > hostDataLength - case (7)
-				iCmdStatus = TBotCsw::EPhaseError;
-				iDataTransferMan.iDataResidue = 0;
-				DataInWriteRequest(hostDataLength);
-				return;
-				}
-			}
-		else  // read data from host
-			{
-			if (!iDataTransferMan.IsModeDataOut())
-				{
-				__PRINT(_L("Read buffer was not setup\n"));
+                iCmdStatus = TBotCsw::EPhaseError;
+                iDataTransferMan.iDataResidue = 0;
+                DataInWriteRequest(hostDataLength);
+                return;
+                }
+            }
+        else  // read data from host
+            {
+            if (!iDataTransferMan.IsModeDataOut())
+                {
+                __PRINT(_L("Read buffer was not setup\n"));
 
                 // Use next block instead of StallEndpointAndWaitForClear(KOutEndpoint);
                 FlushDataOut(hostDataLength);
-				if (iDataTransferMan.IsModeDataIn())
-					{
+                if (iDataTransferMan.IsModeDataIn())
+                    {
                     //case (10)
-					SendCsw(iCbwTag, hostDataLength, TBotCsw::EPhaseError);
-					}
-				else
-					{
+                    SendCsw(iCbwTag, hostDataLength, TBotCsw::EPhaseError);
+                    }
+                else
+                    {
                     // case (9)
-					SendCsw(iCbwTag, hostDataLength, iCmdStatus);
-					}
-				return;
-				}
+                    SendCsw(iCbwTag, hostDataLength, iCmdStatus);
+                    }
+                return;
+                }
 
-			TInt deviceDataLength = iDataTransferMan.iReadBuf.Length();
+            TInt deviceDataLength = iDataTransferMan.iReadBuf.Length();
 
-			if (deviceDataLength <= hostDataLength)
-				{
+            if (deviceDataLength <= hostDataLength)
+                {
                 // case (11) and (12)
 #ifdef MSDC_TESTMODE
                 TBool done = EFalse;
@@ -928,12 +905,12 @@
                     DataOutReadRequest(deviceDataLength);
                     }
 #else
-				DataOutReadRequest(deviceDataLength);
+                DataOutReadRequest(deviceDataLength);
 #endif
-				return;
-				}
-			else
-				{
+                return;
+                }
+            else
+                {
                 // case  (13)
                 /**
                  * Comment following line in order to pass compliant test.
@@ -941,7 +918,7 @@
                  * total of dCBWDataTransferLength."
                  * Here we choose to ignore incoming data.
                  */
-				//StallEndpointAndWaitForClear(KOutEndpoint); //Stall Out endpoint
+                //StallEndpointAndWaitForClear(KOutEndpoint); //Stall Out endpoint
                 if (iDataTransferMan.IsModeDataOut())
                     {
                     iDataTransferMan.SetModeNoData();
@@ -950,21 +927,21 @@
                     iProtocol->MediaWriteAbort();
                     }
                 SendCsw(iCbwTag, hostDataLength, TBotCsw::EPhaseError);
-				return;
-				}
-			}
-		}
-	else  // Host expected no data transfer
-		{
-		__PRINT(_L("No data transfer expected\n"));
-		iDataTransferMan.iDataResidue = 0;
-		if (!iDataTransferMan.IsModeNoData())
-			{
+                return;
+                }
+            }
+        }
+    else  // Host expected no data transfer
+        {
+        __PRINT(_L("No data transfer expected\n"));
+        iDataTransferMan.iDataResidue = 0;
+        if (!iDataTransferMan.IsModeNoData())
+            {
             // case (2) and (3)
-			SendCsw(iCbwTag, 0, TBotCsw::EPhaseError);
-			}
-		else
-			{
+            SendCsw(iCbwTag, 0, TBotCsw::EPhaseError);
+            }
+        else
+            {
             //case (1)
 #ifdef MSDC_TESTMODE
             if (iTestParser && iTestParser->Enabled())
@@ -984,10 +961,10 @@
                     }
                 }
 #endif
-			SendCsw(iCbwTag, 0, iCmdStatus);
-			}
-		}
-	}
+            SendCsw(iCbwTag, 0, iCmdStatus);
+            }
+        }
+    }
 
 
 /**
@@ -995,11 +972,10 @@
 Used when protocol wants to force host to initiate a reset recovery.
 */
 void CBulkOnlyTransport::SetPermError()
-	{
-    __MSFNLOG
+    {
     iCurrentState = EPermErr;
     Activate(KErrNone);
-	}
+    }
 
 
 /**
@@ -1008,13 +984,12 @@
 @param aLength amount of data (in bytes) to be send to host
 */
 void CBulkOnlyTransport::DataInWriteRequest(TUint aLength, TBool aZlpRequired)
-	{
-    __MSFNLOG
-	iLdd.Write(iStatus, KInEndpoint, iDataTransferMan.iWriteBuf, aLength, aZlpRequired);
+    {
+    iLdd.Write(iStatus, KInEndpoint, iDataTransferMan.iWriteBuf, aLength, aZlpRequired);
     iDataTransferMan.iTransportResidue -= aLength;
-	iCurrentState = EHandleDataIn;
-	SetActive();
-	}
+    iCurrentState = EHandleDataIn;
+    SetActive();
+    }
 
 
 /**
@@ -1023,13 +998,12 @@
 @param aLength amount of data (in bytes) to be received from the host
 */
 void CBulkOnlyTransport::DataOutReadRequest(TUint aLength)
-	{
-    __MSFNLOG
-	iLdd.Read(iStatus, KOutEndpoint, iDataTransferMan.iReadBuf, aLength);
-	iDataTransferMan.iTransportResidue -= aLength;
-	iCurrentState = EHandleDataOut;
+    {
+    iLdd.Read(iStatus, KOutEndpoint, iDataTransferMan.iReadBuf, aLength);
+    iDataTransferMan.iTransportResidue -= aLength;
+    iCurrentState = EHandleDataOut;
     SetActive();
-	}
+    }
 
 
 /**
@@ -1041,9 +1015,8 @@
 @param aStatus indicates the success or failure of the command.
 */
 void CBulkOnlyTransport::SendCsw(TUint aTag, TUint32 aDataResidue, TBotCsw::TCswStatus aStatus)
-	{
-    __MSFNLOG
-	__PRINT2(_L("DataResidue = %d, Status = %d \n"), aDataResidue, aStatus);
+    {
+    __PRINT2(_L("DataResidue = %d, Status = %d \n"), aDataResidue, aStatus);
     iCsw.SetLength(TBotCsw::KCswLength);
     TBotServerResp resp(iCbwTag, aDataResidue, aStatus);
 #ifdef MSDC_TESTMODE
@@ -1051,10 +1024,10 @@
 #else
     resp.EncodeL(iCsw);
 #endif
-	iLdd.Write(iStatus, KInEndpoint, iCsw, TBotCsw::KCswLength);
-	iCurrentState = ESendingCSW;
-	SetActive();
-	}
+    iLdd.Write(iStatus, KInEndpoint, iCsw, TBotCsw::KCswLength);
+    iCurrentState = ESendingCSW;
+    SetActive();
+    }
 
 
 /**
@@ -1063,10 +1036,9 @@
 @param aProtocol reference to the protocol
 */
 void CBulkOnlyTransport::RegisterProtocol(MServerProtocol& aProtocol)
-	{
-    __MSFNLOG
-	iProtocol = &aProtocol;
-	}
+    {
+    iProtocol = &aProtocol;
+    }
 
 
 /**
@@ -1075,9 +1047,9 @@
 @return reference to the controller which instantiate the CBulkOnlyTransport
 */
 CUsbMassStorageController& CBulkOnlyTransport::Controller()
-	{
-	return iController;
-	}
+    {
+    return iController;
+    }
 
 
 /**
@@ -1086,10 +1058,9 @@
 0 to a maximum LUN of 15 (Fh).
 */
 TInt CBulkOnlyTransport::MaxLun()
-	{
-    __MSFNLOG
-	return iMaxLun;
-	}
+    {
+    return iMaxLun;
+    }
 
 
 /**
@@ -1097,30 +1068,29 @@
 @return reference to USB logical driver
 */
 RDevUsbcClient& CBulkOnlyTransport::Ldd()
-	{
-	return iLdd;
-	}
+    {
+    return iLdd;
+    }
 
 
 void CBulkOnlyTransport::StallEndpointAndWaitForClear(TEndpointNumber aEndpoint)
-	{
-    __MSFNLOG
-	__ASSERT_DEBUG(aEndpoint != EEndpoint0, User::Panic(KUsbMsClientPanicCat, EMsWrongEndpoint));
+    {
+    __ASSERT_DEBUG(aEndpoint != EEndpoint0, User::Panic(KUsbMsClientPanicCat, EMsWrongEndpoint));
 
-	// Now stall this endpoint
-	__PRINT1(_L("Stalling endpoint %d"), aEndpoint);
-	__TESTMODEPRINT2("CBW Tag=0x%x: Stalling endpoint %d", iCbwTag, aEndpoint);
-	TInt r = iLdd.HaltEndpoint(aEndpoint);
-	if (r != KErrNone)
-		{
-		__PRINT2(_L("Error: stalling ep %d failed: %d"), aEndpoint, r);
-		}
-	TEndpointState ep_state;
-	TInt i = 0;
-	do
-		{
-		// Wait for 10ms before checking the ep status
-		User::After(10000);
+    // Now stall this endpoint
+    __PRINT1(_L("Stalling endpoint %d"), aEndpoint);
+    __TESTMODEPRINT2("CBW Tag=0x%x: Stalling endpoint %d", iCbwTag, aEndpoint);
+    TInt r = iLdd.HaltEndpoint(aEndpoint);
+    if (r != KErrNone)
+        {
+        __PRINT2(_L("Error: stalling ep %d failed: %d"), aEndpoint, r);
+        }
+    TEndpointState ep_state;
+    TInt i = 0;
+    do
+        {
+        // Wait for 10ms before checking the ep status
+        User::After(10000);
 
         if (aEndpoint == KInEndpoint)
             {
@@ -1138,19 +1108,19 @@
                 }
             }
 
-		iLdd.EndpointStatus(aEndpoint, ep_state);
-		if (++i >= 550)
-			{
-			// 5.5 secs should be enough (see 9.2.6.1 Request Processing Timing)
-			__PRINT1(_L("Error: Checked for ep %d de-stall for 5.5s - giving up now"), aEndpoint);
+        iLdd.EndpointStatus(aEndpoint, ep_state);
+        if (++i >= 550)
+            {
+            // 5.5 secs should be enough (see 9.2.6.1 Request Processing Timing)
+            __PRINT1(_L("Error: Checked for ep %d de-stall for 5.5s - giving up now"), aEndpoint);
             __TESTMODEPRINT1("Error: Checked for ep %d de-stall for 5.5s - giving up now", aEndpoint);
-			// We can now only hope for a Reset Recovery
-			return;
-			}
-		} while ((ep_state == EEndpointStateStalled) && iStarted);
-	__PRINT2(_L("Checked for ep %d de-stall: %d time(s)"), aEndpoint, i);
+            // We can now only hope for a Reset Recovery
+            return;
+            }
+        } while ((ep_state == EEndpointStateStalled) && iStarted);
+    __PRINT2(_L("Checked for ep %d de-stall: %d time(s)"), aEndpoint, i);
     __TESTMODEPRINT2("Checked for ep %d de-stall: %d time(s)", aEndpoint, i);
-	}
+    }
 
 
 
@@ -1160,56 +1130,54 @@
 @return The number of bytes available in the read buffer
 */
 TInt CBulkOnlyTransport::BytesAvailable()
-	{
-    __MSFNLOG
-	TInt bytes = 0;
-	TInt err = iLdd.QueryReceiveBuffer(KOutEndpoint, bytes);
-	if (err != KErrNone)
-		bytes = 0;
-	return bytes;
-	}
+    {
+    TInt bytes = 0;
+    TInt err = iLdd.QueryReceiveBuffer(KOutEndpoint, bytes);
+    if (err != KErrNone)
+        bytes = 0;
+    return bytes;
+    }
 
 
 /**
  * Read out rest data from KOutEndpoint and discard them
  */
 void CBulkOnlyTransport::FlushDataOut(TInt aLength)
-	{
-    __MSFNLOG
-	iBuf.SetMax();
-	TRequestStatus status;
-	while (aLength > 0)
-		{
-		iLdd.ReadOneOrMore(status, KOutEndpoint, iBuf, iBuf.Length());
-		User::WaitForRequest(status);
-		TInt err = status.Int();
-		if (err != KErrNone)
-			{
-			// Bad.
-			break;
-			}
-		aLength -= iBuf.Length();
-		}
-	}
+    {
+    iBuf.SetMax();
+    TRequestStatus status;
+    while (aLength > 0)
+        {
+        iLdd.ReadOneOrMore(status, KOutEndpoint, iBuf, iBuf.Length());
+        User::WaitForRequest(status);
+        TInt err = status.Int();
+        if (err != KErrNone)
+            {
+            // Bad.
+            break;
+            }
+        aLength -= iBuf.Length();
+        }
+    }
 
 
 void CBulkOnlyTransport::FlushDataIn(TInt aLength)
     {
-	iBuf.SetMax();
-	TInt c = 0;
+    iBuf.SetMax();
+    TInt c = 0;
     TInt len;
-	TRequestStatus status;
-	while (c < aLength)
-		{
+    TRequestStatus status;
+    while (c < aLength)
+        {
         len = aLength - c;
-		if (len >  KBOTMaxBufSize)
-			{
-			len = KBOTMaxBufSize;
-			}
-		iLdd.Write(status, KInEndpoint, iBuf, len);
-		User::WaitForRequest(status);
-		c +=  KBOTMaxBufSize;
-		}
+        if (len >  KBOTMaxBufSize)
+            {
+            len = KBOTMaxBufSize;
+            }
+        iLdd.Write(status, KInEndpoint, iBuf, len);
+        User::WaitForRequest(status);
+        c +=  KBOTMaxBufSize;
+        }
     }
 
 //
@@ -1217,126 +1185,119 @@
 //
 CActiveDeviceStateNotifier::CActiveDeviceStateNotifier(CBulkOnlyTransport& aParent)
 :   CActive(EPriorityStandard),
-	iParent(aParent),
-	iDeviceState(EUsbcNoState),
-	iOldDeviceState(EUsbcNoState)
-	{
-    __MSFNLOG
-	}
+    iParent(aParent),
+    iDeviceState(EUsbcNoState),
+    iOldDeviceState(EUsbcNoState)
+    {
+    }
 
 
 CActiveDeviceStateNotifier* CActiveDeviceStateNotifier::NewL(CBulkOnlyTransport& aParent)
-	{
-    __MSFNSLOG
-	CActiveDeviceStateNotifier* self = new (ELeave) CActiveDeviceStateNotifier(aParent);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CActiveScheduler::Add(self);
-	CleanupStack::Pop();									// self
-	return (self);
-	}
+    {
+    CActiveDeviceStateNotifier* self = new (ELeave) CActiveDeviceStateNotifier(aParent);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CActiveScheduler::Add(self);
+    CleanupStack::Pop();                                    // self
+    return (self);
+    }
 
 
 void CActiveDeviceStateNotifier::ConstructL()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 
 CActiveDeviceStateNotifier::~CActiveDeviceStateNotifier()
-	{
-    __MSFNLOG
-	Cancel();												// base class
-	}
+    {
+    Cancel();                                               // base class
+    }
 
 
 void CActiveDeviceStateNotifier::DoCancel()
 /**
  *
  */
-	{
-    __MSFNLOG
-	iParent.Ldd().AlternateDeviceStatusNotifyCancel();
-	}
+    {
+    iParent.Ldd().AlternateDeviceStatusNotifyCancel();
+    }
 
 
 void CActiveDeviceStateNotifier::RunL()
 /**
  *
  */
-	{
-    __MSFNLOG
-	// This displays the device state.
-	// In a real world program, the user could take here appropriate action (cancel a
-	// transfer request or whatever).
-	if (!(iDeviceState & KUsbAlternateSetting))
-		{
-		switch (iDeviceState)
-			{
-		case EUsbcDeviceStateUndefined:
-			__PRINT(_L("Device State notifier: Undefined\n"));
-			iParent.HwStop();
-			break;
-		case EUsbcDeviceStateAttached:
-			__PRINT(_L("Device State notifier: Attached\n"));
-			iParent.HwStop();
-			break;
-		case EUsbcDeviceStatePowered:
-			__PRINT(_L("Device State notifier: Powered\n"));
-			iParent.HwStop();
-			break;
-		case EUsbcDeviceStateDefault:
-			__PRINT(_L("Device State notifier: Default\n"));
-			iParent.HwStop();
-			break;
-		case EUsbcDeviceStateAddress:
-			__PRINT(_L("Device State notifier: Address\n"));
-			iParent.HwStop();
-			break;
-		case EUsbcDeviceStateConfigured:
-			__PRINT(_L("Device State notifier: Configured\n"));
-			if (iOldDeviceState == EUsbcDeviceStateSuspended)
-				{
-				iParent.HwResume();
-				}
-			else
-				{
-				iParent.HwStart();
-				}
-			break;
-		case EUsbcDeviceStateSuspended:
-			__PRINT(_L("Device State notifier: Suspended\n"));
-			if (iOldDeviceState == EUsbcDeviceStateConfigured)
-				{
-				iParent.HwSuspend();
-				}
-			break;
-		default:
-			__PRINT(_L("Device State notifier: ***BAD***\n"));
-			iParent.HwStop();
-			break;
-			}
-		iOldDeviceState = iDeviceState;
-		}
-	else if (iDeviceState & KUsbAlternateSetting)
-		{
-		__PRINT1(_L("Device State notifier: Alternate interface setting has changed: now %d\n"), iDeviceState & ~KUsbAlternateSetting);
-		}
-	Activate();
-	}
+    {
+    // This displays the device state.
+    // In a real world program, the user could take here appropriate action (cancel a
+    // transfer request or whatever).
+    if (!(iDeviceState & KUsbAlternateSetting))
+        {
+        switch (iDeviceState)
+            {
+        case EUsbcDeviceStateUndefined:
+            __PRINT(_L("Device State notifier: Undefined\n"));
+            iParent.HwStop();
+            break;
+        case EUsbcDeviceStateAttached:
+            __PRINT(_L("Device State notifier: Attached\n"));
+            iParent.HwStop();
+            break;
+        case EUsbcDeviceStatePowered:
+            __PRINT(_L("Device State notifier: Powered\n"));
+            iParent.HwStop();
+            break;
+        case EUsbcDeviceStateDefault:
+            __PRINT(_L("Device State notifier: Default\n"));
+            iParent.HwStop();
+            break;
+        case EUsbcDeviceStateAddress:
+            __PRINT(_L("Device State notifier: Address\n"));
+            iParent.HwStop();
+            break;
+        case EUsbcDeviceStateConfigured:
+            __PRINT(_L("Device State notifier: Configured\n"));
+            if (iOldDeviceState == EUsbcDeviceStateSuspended)
+                {
+                iParent.HwResume();
+                }
+            else
+                {
+                iParent.HwStart();
+                }
+            break;
+        case EUsbcDeviceStateSuspended:
+            __PRINT(_L("Device State notifier: Suspended\n"));
+            if (iOldDeviceState == EUsbcDeviceStateConfigured)
+                {
+                iParent.HwSuspend();
+                }
+            break;
+        default:
+            __PRINT(_L("Device State notifier: ***BAD***\n"));
+            iParent.HwStop();
+            break;
+            }
+        iOldDeviceState = iDeviceState;
+        }
+    else if (iDeviceState & KUsbAlternateSetting)
+        {
+        __PRINT1(_L("Device State notifier: Alternate interface setting has changed: now %d\n"), iDeviceState & ~KUsbAlternateSetting);
+        }
+    Activate();
+    }
 
 
 void CActiveDeviceStateNotifier::Activate()
 /**
  *
  */
-	{
-    __MSFNLOG
-	if (IsActive())
-		{
-		__PRINT(_L("Still active\n"));
-		return;
-		}
-	iParent.Ldd().AlternateDeviceStatusNotify(iStatus, iDeviceState);
-	SetActive();
-	}
+    {
+    if (IsActive())
+        {
+        __PRINT(_L("Still active\n"));
+        return;
+        }
+    iParent.Ldd().AlternateDeviceStatusNotify(iStatus, iDeviceState);
+    SetActive();
+    }
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/usbtestmsclient.mmh	Wed Oct 20 13:58:28 2010 +0100
+++ b/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/usbtestmsclient.mmh	Tue Nov 02 15:29:23 2010 +0000
@@ -13,53 +13,52 @@
 // Description:
 //
 
-TARGETTYPE		fsy
+TARGETTYPE              fsy
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 #ifdef SYMBIAN_OLD_EXPORT_LOCATION
 SYMBIAN_BASE_SYSTEMINCLUDE(kernel)
 #endif
 
-USERINCLUDE	./inc
-USERINCLUDE	./transport/include
-USERINCLUDE	./protocol/include
+USERINCLUDE     ./inc
+USERINCLUDE     ./transport/include
+USERINCLUDE     ./protocol/include
 
-USERINCLUDE	./transport
+USERINCLUDE     ./transport
 
-SOURCEPATH	./protocol
-SOURCE			cscsiserverprotocol.cpp
-SOURCE			tscsiserverreq.cpp
-SOURCE			tscsiservercmds.cpp
-SOURCE			testman.cpp
+SOURCEPATH      ./protocol
+SOURCE                  cscsiserverprotocol.cpp
+SOURCE                  tscsiserverreq.cpp
+SOURCE                  tscsiservercmds.cpp
+SOURCE                  testman.cpp
 
-SOURCEPATH	./transport
-SOURCE			botcontrolinterface.cpp
-SOURCE			botmscserver.cpp
-SOURCE			cbulkonlytransport.cpp
+SOURCEPATH      ./transport
+SOURCE                  botcontrolinterface.cpp
+SOURCE                  botmscserver.cpp
+SOURCE                  cbulkonlytransport.cpp
 
-SOURCEPATH	.
-SOURCE			cmassstoragefilesystem.cpp
-SOURCE			cmassstoragemountcb.cpp
-SOURCE			cusbmassstoragecontroller.cpp
-SOURCE			cusbmassstorageserver.cpp
-SOURCE			cusbmassstoragesession.cpp
-SOURCE			drivemanager.cpp
-SOURCE			drivepublisher.cpp
-SOURCE			msdebug.cpp
+SOURCEPATH      .
+SOURCE                  cmassstoragefilesystem.cpp
+SOURCE                  cmassstoragemountcb.cpp
+SOURCE                  cusbmassstoragecontroller.cpp
+SOURCE                  cusbmassstorageserver.cpp
+SOURCE                  cusbmassstoragesession.cpp
+SOURCE                  drivemanager.cpp
+SOURCE                  drivepublisher.cpp
 
-LIBRARY		efile.lib efsrv.lib euser.lib 
+LIBRARY         efile.lib efsrv.lib euser.lib
 
 
 START WINS
-BASEADDRESS		0x61000000 
+BASEADDRESS             0x61000000
 END
 
-UID		0 0x100000d6   //TODO reserve new UID
+UID             0 0x100000d6   //TODO reserve new UID
 
 unpaged
 
-#include "../../../userlibandfileserver/fileserver/group/f32caps.mmh"	// Capabilities of File Server process
-#include "../../../userlibandfileserver/fileserver/group/f32.mmh"		// Generic definitions for the whole f32 component
+#include "../../../userlibandfileserver/fileserver/group/f32caps.mmh"   // Capabilities of File Server process
+#include "../../../userlibandfileserver/fileserver/group/f32.mmh"               // Generic definitions for the whole f32 component
 
 SMPSAFE
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/testfsys/t_tfsys_notify.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,310 @@
+// Copyright (c) 1997-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:
+// f32test\testfsys\t_tfsys.cpp
+// 
+//
+
+#include "t_tfsys_notify.h"
+
+
+const TInt KMajorVersionNumber=1;
+const TInt KMinorVersionNumber=0;
+
+void CTestNotificationMountCB::FileOpenL(const TDesC& aName,TUint /*aMode*/,TFileOpen /*anOpen*/,CFileCB* /*aFile*/)
+    {
+    RDebug::Print(_L("CTestMountCB::FileOpenL - aName = %S"),&aName);
+    
+    if(aName.Match(_L("\\Wellformed_functionReplace.txt"))!= KErrNotFound) //PhantomFile_functionWrite.txt
+        {
+        CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(*this,EFsFileReplace);
+        TBuf<KMaxFileName> phantomName;
+        phantomName.Append(_L("\\"));
+        phantomName.Append(_L("PhantomFile_functionReplace.txt"));
+        TInt r = notificationInfo->SetSourceName(phantomName);
+        User::LeaveIfError(r);
+        r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+        User::LeaveIfError(r);
+        r = IssueNotification(notificationInfo);
+        User::LeaveIfError(r);
+        CFsNotificationInfo::Free(notificationInfo);
+        return;
+        }
+    else if(aName.Match(_L("\\Extended_Replaced.txt"))!= KErrNotFound) //\\Extended_Replaced.txt
+        {
+        CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(*this,EFsFileReplace);
+        TBuf<KMaxFileName> phantomName;
+        phantomName.Append(_L("\\"));
+        phantomName.Append(_L("PhantomExtended_Replaced.txt"));
+        TInt r = notificationInfo->SetSourceName(phantomName);
+        User::LeaveIfError(r);
+        r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+        User::LeaveIfError(r);
+        r = IssueNotification(notificationInfo);
+        User::LeaveIfError(r);
+        CFsNotificationInfo::Free(notificationInfo);
+        return;       
+        }
+    else if(aName.Match(_L("\\Extended_RenameMe.txt"))!= KErrNotFound) //\\PhantomExtended_Renamed.txt
+        {
+        CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(*this,EFsRename);
+        TBuf<KMaxFileName> phantomName;
+        phantomName.Append(_L("\\"));
+        phantomName.Append(_L("PhantomExtended_RenameMe.txt"));
+        TInt r = notificationInfo->SetSourceName(phantomName);
+        User::LeaveIfError(r);
+        TBuf<KMaxFileName> phantomRename;
+        phantomRename.Append(_L("\\"));
+        phantomRename.Append(_L("PhantomExtended_Renamed.txt"));
+        r = notificationInfo->SetNewName(phantomRename);
+        User::LeaveIfError(r);
+        r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+        User::LeaveIfError(r);
+        r = IssueNotification(notificationInfo);
+        User::LeaveIfError(r);
+        CFsNotificationInfo::Free(notificationInfo);
+        return;       
+        }
+    
+ 
+    }
+
+void CTestNotificationFileCB::RenameL(const TDesC& /*aNewName*/)
+    {
+    RDebug::Print(_L("CTestNotificationFileCB::RenameL - aName = %S"),iFileName);
+    
+    if(iFileName->Match(_L("\\Wellformed_functionReplace.txt"))!= KErrNotFound) //PhantomFile_functionWrite.txt
+         {
+         CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(Mount(),EFsFileRename);
+         TBuf<KMaxFileName> phantomName;
+         phantomName.Append(_L("\\"));
+         phantomName.Append(_L("PhantomFile_functionReplace.txt"));
+         TInt r = notificationInfo->SetSourceName(phantomName);
+         User::LeaveIfError(r);
+         TBuf<KMaxFileName> phantomNewName;
+         phantomNewName.Append(_L("\\"));
+         phantomNewName.Append(_L("PhantomFile_functionRename.txt"));
+         r = notificationInfo->SetNewName(phantomNewName);
+         User::LeaveIfError(r);
+         r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+         User::LeaveIfError(r);
+         r = Mount().IssueNotification(notificationInfo);
+         User::LeaveIfError(r);
+         CFsNotificationInfo::Free(notificationInfo);
+         return;
+         }
+    
+    //MALFORMED
+    if(iFileName->Match(_L("\\Malformed_functionWrite.txt"))!=KErrNotFound)
+        {
+        CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(Mount(),EFsFileRename);
+        TBuf<KMaxFileName> phantomName;
+        phantomName.Append(_L("\\"));
+        phantomName.Append(_L("Malformed_functionWrite.txt"));
+        TInt r = notificationInfo->SetSourceName(phantomName);
+        User::LeaveIfError(r);
+        // Don't set NewName - Should cause error.
+        //      SetNewName(phantomNewName);
+        r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+        User::LeaveIfError(r);
+        r = Mount().IssueNotification(notificationInfo);
+        User::LeaveIfError(r);
+        CFsNotificationInfo::Free(notificationInfo);
+        return;
+        }
+    }
+
+void CTestNotificationFileCB::WriteL(TInt /*aPos*/,TInt& /*aLength*/,const TAny* /*aDes*/,const RMessagePtr2& /*aMessage*/)
+    {
+    if(iFileName->Match(_L("\\Wellformed_functionWrite.txt"))!= KErrNotFound) //PhantomFile_functionWrite.txt
+         {
+         RDebug::Printf("CTestNotificationFileCB::WriteL - wellformed_functionWrite.txt");
+         CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(Mount(),EFsFileWrite);
+         TBuf<KMaxFileName> phantomName;
+         phantomName.Append(_L("\\"));
+         phantomName.Append(_L("PhantomFile_functionWrite.txt"));
+         TInt r = notificationInfo->SetSourceName(phantomName);
+         User::LeaveIfError(r);
+         r = notificationInfo->SetFilesize((TInt64)4);
+         User::LeaveIfError(r);
+         r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+         User::LeaveIfError(r);
+         r = Mount().IssueNotification(notificationInfo);
+         User::LeaveIfError(r);
+         CFsNotificationInfo::Free(notificationInfo);
+         return;
+         }
+    
+    //MALFORMED
+    if(iFileName->Match(_L("\\Malformed_functionWrite.txt"))!=KErrNotFound)
+        {
+        RDebug::Printf("CTestNotificationFileCB::WriteL - malformed_functionWrite.txt");
+        CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(Mount(),EFsFileWrite);
+        TBuf<KMaxFileName> phantomName;
+        phantomName.Append(_L("\\"));
+        phantomName.Append(_L("PhantomFileMalformed_functionWrite.txt"));
+        TInt r = notificationInfo->SetSourceName(phantomName);
+        User::LeaveIfError(r);
+        //We won't set filesize - which should result in an error.
+        //  SetFilesize((TInt64)4);
+        //
+        r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+        User::LeaveIfError(r);
+        r = Mount().IssueNotification(notificationInfo);
+        User::LeaveIfError(r);
+        CFsNotificationInfo::Free(notificationInfo);
+        return;
+        }
+            
+    }
+
+void CTestNotificationFileCB::SetEntryL(const TTime& /*aTime*/,TUint /*aSetAttMask*/,TUint /*aClearAttMask*/)
+    {
+    if(iFileName->Match(_L("\\Wellformed_functionAttributes.txt"))!= KErrNotFound) //PhantomFile_functionWrite.txt
+         {
+         CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(Mount(),EFsFileSetAtt);
+         TBuf<KMaxFileName> phantomName;
+         phantomName.Append(_L("\\"));
+         phantomName.Append(_L("PhantomFile_functionAttributes.txt"));
+         TInt r = notificationInfo->SetSourceName(phantomName);
+         User::LeaveIfError(r);
+         r = notificationInfo->SetAttributes(KEntryAttSystem,KEntryAttHidden);
+         User::LeaveIfError(r);
+         r = notificationInfo->SetUid(TUid::Uid(KErrUnknown));
+         User::LeaveIfError(r);
+         r = Mount().IssueNotification(notificationInfo);
+         User::LeaveIfError(r);
+         CFsNotificationInfo::Free(notificationInfo);
+         return;
+         }
+    }
+
+CTestFileSystem::CTestFileSystem()
+//
+// Constructor
+//
+	{
+	__DECLARE_NAME(_S("CNotifyTestFileSystem"));
+	}
+
+CTestFileSystem::~CTestFileSystem()
+//
+// Destructor
+//
+	{}
+
+TInt CTestFileSystem::Install()
+//
+// Install the file system
+//
+	{
+	iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KF32BuildVersionNumber);
+	TPtrC name=_L("CNotifyTestFileSystem");
+	return(SetName(&name));
+	}
+
+CMountCB* CTestFileSystem::NewMountL() const
+//
+// Create a new mount control block
+//
+	{
+	return (new(ELeave) CTestNotificationMountCB);
+	}
+
+CFileCB* CTestFileSystem::NewFileL() const
+//
+// Create a new file
+//
+	{
+	return (new(ELeave) CTestNotificationFileCB);
+	}
+
+CDirCB* CTestFileSystem::NewDirL() const
+//
+// create a new directory lister
+//
+	{
+	return (new(ELeave) CTestDirCB);
+	}
+
+CFormatCB* CTestFileSystem::NewFormatL() const
+//
+// Create a new media formatter
+//
+	{
+	return (new(ELeave) CTestFormatCB);
+	}
+
+TInt CTestFileSystem::DefaultPath(TDes& aPath) const
+//
+// Return the intial default path
+//
+	{
+	aPath=_L("C:\\");
+	return (KErrNone);
+	}
+
+
+/**
+Reports whether the specified interface is supported - if it is,
+the supplied interface object is modified to it
+
+@param aInterfaceId     The interface of interest
+@param aInterface       The interface object
+@return                 KErrNone if the interface is supported, otherwise KErrNotFound 
+
+@see CFileSystem::GetInterface()
+*/
+TInt CTestFileSystem::GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput)
+    {
+    switch(aInterfaceId)
+        {
+        case CFileSystem::EProxyDriveSupport: // The FAT Filesystem supports proxy drives
+			return KErrNone;
+
+        default:
+            return(CFileSystem::GetInterface(aInterfaceId, aInterface, aInput));
+        }
+    }
+
+CFileSystem* CTestFileSystem::NewL()
+//
+//
+//
+	{
+	CFileSystem* testFSys = new(ELeave) CTestFileSystem;
+	return testFSys;
+	}
+
+
+CTestNotificationMountCB::CTestNotificationMountCB(){};
+CTestNotificationMountCB::~CTestNotificationMountCB(){};
+CTestDirCB::CTestDirCB(){};
+CTestDirCB::~CTestDirCB(){};
+CTestNotificationFileCB::CTestNotificationFileCB(){};
+CTestNotificationFileCB::~CTestNotificationFileCB(){};
+CTestFormatCB::CTestFormatCB(){};
+CTestFormatCB::~CTestFormatCB(){};
+
+
+extern "C" {
+
+EXPORT_C CFileSystem* CreateFileSystem()
+//
+// Create a new file system
+//
+	{
+	return(CTestFileSystem::NewL());
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/f32test/testfsys/t_tfsys_notify.h	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,110 @@
+// Copyright (c) 1997-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:
+// f32test\testfsys\t_tfsys.h
+// 
+//
+
+#include <f32file.h>
+#include "common.h"
+#include <f32fsys.h>
+#include <f32ver.h>
+#include <f32dbg.h>
+#include <e32svr.h>
+#include <f32plugin.h>
+
+class CTestNotificationMountCB : public CMountCB
+	{
+public:
+	CTestNotificationMountCB();
+	~CTestNotificationMountCB();
+	void MountL(TBool /*aForceMount*/){
+	    iUniqueID=0;
+	    iSize=(TUint)2 << 30; //2GB
+	    SetVolumeName(_L("TestNotificationFS").AllocL());
+	}
+	TInt ReMount(){return KErrNone;}
+	void Dismounted(){}
+	void VolumeL(TVolumeInfo& aVolume) const{
+	    aVolume.iFree = 1 << 30;
+	}
+	void SetVolumeL(TDes& /*aName*/){ }
+	void MkDirL(const TDesC& /*aName*/){}
+	void RmDirL(const TDesC& /*aName*/){}
+	void DeleteL(const TDesC& /*aName*/){}
+	void RenameL(const TDesC& /*aName*/,const TDesC& /*aNewName*/){}
+	void ReplaceL(const TDesC& /*anOldName*/,const TDesC& /*anNewName*/){}
+	void EntryL(const TDesC& /*aName*/,TEntry& /*anEntry*/) const{}
+	void SetEntryL(const TDesC& /*aName*/,const TTime& /*aTime*/,TUint /*aSetAttMask*/,TUint /*aClearAttMask*/){}
+	void FileOpenL(const TDesC& /*aName*/,TUint /*aMode*/,TFileOpen /*anOpen*/,CFileCB* /*aFile*/);
+	void DirOpenL(const TDesC& /*aName*/,CDirCB* /*aDir*/){}
+	void RawReadL(TInt64 /*aPos*/,TInt /*aLength*/,const TAny* /*aTrg*/,TInt /*anOffset*/,const RMessagePtr2& /*aMessage*/) const{}
+	void RawWriteL(TInt64 /*aPos*/,TInt /*aLength*/,const TAny* /*aSrc*/,TInt /*anOffset*/,const RMessagePtr2& /*aMessage*/){}
+	void ReadUidL(const TDesC& /*aName*/,TEntry& /*anEntry*/) const{}
+	void GetShortNameL(const TDesC& /*aLongName*/,TDes& /*aShortName*/){}
+	void GetLongNameL(const TDesC& /*aShortName*/,TDes& /*aLongName*/){}
+	void IsFileInRom(const TDesC& /*aFileName*/,TUint8*& /*aFileStart*/){}
+	void ReadSectionL(const TDesC& /*aName*/,TInt /*aPos*/,TAny* /*aTrg*/,TInt /*aLength*/,const RMessagePtr2& /*aMessage*/){}
+	};
+
+
+
+class CTestNotificationFileCB : public CFileCB
+	{
+public:
+	CTestNotificationFileCB();
+	~CTestNotificationFileCB();
+	void RenameL(const TDesC& /*aNewName*/);
+	void ReadL(TInt /*aPos*/,TInt& /*aLength*/,const TAny* /*aDes*/,const RMessagePtr2& /*aMessage*/){}
+	void WriteL(TInt /*aPos*/,TInt& /*aLength*/,const TAny* /*aDes*/,const RMessagePtr2& /*aMessage*/);
+	TInt Address(TInt& /*aPos*/) const{return 0;}
+	void SetSizeL(TInt /*aSize*/){}
+	void SetEntryL(const TTime& /*aTime*/,TUint /*aSetAttMask*/,TUint /*aClearAttMask*/);
+	void FlushDataL(){}
+	void FlushAllL(){}
+	void CheckPos(TInt /*aPos*/){}
+	};
+
+class CTestDirCB : public CDirCB
+	{
+public:
+	CTestDirCB();
+	~CTestDirCB();
+	void ReadL(TEntry& /*anEntry*/){}
+	};
+
+class CTestFormatCB : public CFormatCB
+	{
+public:
+	CTestFormatCB();
+	~CTestFormatCB();
+	void DoFormatStepL(){}
+	};
+
+class CTestFileSystem : public CFileSystem
+	{
+public:
+	CTestFileSystem();
+	~CTestFileSystem();
+	TInt Install();
+	TInt DefaultPath(TDes& aPath) const;
+	TBusLocalDrive& DriveNumberToLocalDrive(TInt aDriveNumber);
+	TInt GetInterface(TInt aInterfaceId, TAny*& aInterface,TAny* aInput);
+private:
+	CMountCB* NewMountL() const;
+	CFileCB* NewFileL() const;
+	CDirCB* NewDirL() const;
+	CFormatCB* NewFormatL() const;
+public:
+	static CFileSystem* NewL();
+	};
--- a/userlibandfileserver/domainmgr/group/bld.inf	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/domainmgr/group/bld.inf	Tue Nov 02 15:29:23 2010 +0000
@@ -36,6 +36,10 @@
 ../bwins/domainpolicyu.def	/epoc32/include/def/bwins/domainpolicyu.def
 ../eabi/domainpolicyu.def	/epoc32/include/def/eabi/domainpolicyu.def
 
+../bmarm/domainpolicy_v2u.def	/epoc32/include/def/bmarm/domainpolicy_v2u.def
+../bwins/domainpolicy_v2u.def	/epoc32/include/def/bwins/domainpolicy_v2u.def
+../eabi/domainpolicy_v2u.def	/epoc32/include/def/eabi/domainpolicy_v2u.def
+
 PRJ_MMPFILES
 
 domaincli.mmp
Binary file userlibandfileserver/fileserver/automounter/misc/FS_Automounter_HowTo.doc has changed
--- a/userlibandfileserver/fileserver/bmarm/efileu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/bmarm/efileu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -242,3 +242,12 @@
 	Volume__C9RFsPluginR11TVolumeInfoi @ 241 NONAME R3UNUSED ; RFsPlugin::Volume(TVolumeInfo &, int) const
 	IsSequentialMode__C7CFileCB @ 242 NONAME R3UNUSED ; CFileCB::IsSequentialMode(void) const
 	DirectIOMode__7CFileCBRC12RMessagePtr2 @ 243 NONAME R3UNUSED ; CFileCB::DirectIOMode(RMessagePtr2 const &)
+	Allocate__19CFsNotificationInfoRC8CMountCBi @ 244 NONAME R3UNUSED ; CFsNotificationInfo::Allocate(CMountCB const &, int)
+	Free__19CFsNotificationInfoRP19CFsNotificationInfo @ 245 NONAME R3UNUSED ; CFsNotificationInfo::Free(CFsNotificationInfo *&)
+	IssueNotification__8CMountCBP19CFsNotificationInfo @ 246 NONAME R3UNUSED ; CMountCB::IssueNotification(CFsNotificationInfo *)
+	SetAttributes__19CFsNotificationInfoUiUi @ 247 NONAME R3UNUSED ; CFsNotificationInfo::SetAttributes(unsigned int, unsigned int)
+	SetFilesize__19CFsNotificationInfox @ 248 NONAME ; CFsNotificationInfo::SetFilesize(long long)
+	SetNewName__19CFsNotificationInfoRC7TDesC16 @ 249 NONAME R3UNUSED ; CFsNotificationInfo::SetNewName(TDesC16 const &)
+	SetSourceName__19CFsNotificationInfoRC7TDesC16 @ 250 NONAME R3UNUSED ; CFsNotificationInfo::SetSourceName(TDesC16 const &)
+	SetUid__19CFsNotificationInfoRC4TUid @ 251 NONAME R3UNUSED ; CFsNotificationInfo::SetUid(TUid const &)
+
--- a/userlibandfileserver/fileserver/bmarm/efsrvu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/bmarm/efsrvu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -375,4 +375,6 @@
 	MountFileSystem__C14CFsMountHelper @ 374 NONAME R3UNUSED ; CFsMountHelper::MountFileSystem(void) const
 	New__14CFsMountHelperR3RFsi @ 375 NONAME R3UNUSED ; CFsMountHelper::New(RFs &, int)
 	"_._14CFsMountHelper" @ 376 NONAME R3UNUSED ; CFsMountHelper::~CFsMountHelper(void)
+	DriveNumber__C15TFsNotificationRi @ 377 NONAME R3UNUSED ; TFsNotification::DriveNumber(int &) const
+	UID__C15TFsNotificationR4TUid @ 378 NONAME R3UNUSED ; TFsNotification::UID(TUid &) const
 
--- a/userlibandfileserver/fileserver/bwins/efileu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/bwins/efileu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -243,3 +243,12 @@
 	?Volume@RFsPlugin@@QBEHAAVTVolumeInfo@@H@Z @ 242 NONAME ; int RFsPlugin::Volume(class TVolumeInfo &, int) const
 	?IsSequentialMode@CFileCB@@QBEHXZ @ 243 NONAME ; int CFileCB::IsSequentialMode(void) const
 	?DirectIOMode@CFileCB@@QAEHABVRMessagePtr2@@@Z @ 244 NONAME ; int CFileCB::DirectIOMode(class RMessagePtr2 const &)
+	?Allocate@CFsNotificationInfo@@SAPAV1@ABVCMountCB@@H@Z @ 245 NONAME ; class CFsNotificationInfo * CFsNotificationInfo::Allocate(class CMountCB const &, int)
+	?SetNewName@CFsNotificationInfo@@QAEHABVTDesC16@@@Z @ 246 NONAME ; int CFsNotificationInfo::SetNewName(class TDesC16 const &)
+	?IssueNotification@CMountCB@@QAEHPAVCFsNotificationInfo@@@Z @ 247 NONAME ; int CMountCB::IssueNotification(class CFsNotificationInfo *)
+	?SetUid@CFsNotificationInfo@@QAEHABVTUid@@@Z @ 248 NONAME ; int CFsNotificationInfo::SetUid(class TUid const &)
+	?Free@CFsNotificationInfo@@SAXAAPAV1@@Z @ 249 NONAME ; void CFsNotificationInfo::Free(class CFsNotificationInfo * &)
+	?SetFilesize@CFsNotificationInfo@@QAEH_J@Z @ 250 NONAME ; int CFsNotificationInfo::SetFilesize(long long)
+	?SetSourceName@CFsNotificationInfo@@QAEHABVTDesC16@@@Z @ 251 NONAME ; int CFsNotificationInfo::SetSourceName(class TDesC16 const &)
+	?SetAttributes@CFsNotificationInfo@@QAEHII@Z @ 252 NONAME ; int CFsNotificationInfo::SetAttributes(unsigned int, unsigned int)
+
--- a/userlibandfileserver/fileserver/bwins/efsrvu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/bwins/efsrvu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -375,4 +375,6 @@
 	?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)
+	?DriveNumber@TFsNotification@@QBEHAAH@Z @ 377 NONAME ; int TFsNotification::DriveNumber(int &) const
+	?UID@TFsNotification@@QBEHAAVTUid@@@Z @ 378 NONAME ; int TFsNotification::UID(class TUid &) const
 
--- a/userlibandfileserver/fileserver/bx86/efileu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/bx86/efileu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -243,4 +243,12 @@
 	?Volume@RFsPlugin@@QBEHAAVTVolumeInfo@@H@Z @ 242 NONAME ; public: int __thiscall RFsPlugin::Volume(class TVolumeInfo &,int)const 
 	?IsSequentialMode@CFileCB@@QBEHXZ @ 243 NONAME ; public: int __thiscall CFileCB::IsSequentialMode(void)const 
 	?DirectIOMode@CFileCB@@QAEHABVRMessagePtr2@@@Z @ 244 NONAME ; int CFileCB::DirectIOMode(class RMessagePtr2 const &)
+	?Allocate@CFsNotificationInfo@@SAPAV1@ABVCMountCB@@H@Z @ 245 NONAME ; public: static class CFsNotificationInfo * __cdecl CFsNotificationInfo::Allocate(class CMountCB const &,int)
+	?Free@CFsNotificationInfo@@SAXAAPAV1@@Z @ 246 NONAME ; public: static void __cdecl CFsNotificationInfo::Free(class CFsNotificationInfo * &)
+	?IssueNotification@CMountCB@@QAEHPAVCFsNotificationInfo@@@Z @ 247 NONAME ; public: int __thiscall CMountCB::IssueNotification(class CFsNotificationInfo *)
+	?SetAttributes@CFsNotificationInfo@@QAEHII@Z @ 248 NONAME ; public: int __thiscall CFsNotificationInfo::SetAttributes(unsigned int,unsigned int)
+	?SetFilesize@CFsNotificationInfo@@QAEH_J@Z @ 249 NONAME ; public: int __thiscall CFsNotificationInfo::SetFilesize(__int64)
+	?SetNewName@CFsNotificationInfo@@QAEHABVTDesC16@@@Z @ 250 NONAME ; public: int __thiscall CFsNotificationInfo::SetNewName(class TDesC16 const &)
+	?SetSourceName@CFsNotificationInfo@@QAEHABVTDesC16@@@Z @ 251 NONAME ; public: int __thiscall CFsNotificationInfo::SetSourceName(class TDesC16 const &)
+	?SetUid@CFsNotificationInfo@@QAEHABVTUid@@@Z @ 252 NONAME ; public: int __thiscall CFsNotificationInfo::SetUid(class TUid const &)
 
--- a/userlibandfileserver/fileserver/bx86/efsrvu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/bx86/efsrvu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -1,378 +1,380 @@
 EXPORTS
-    ??0CDir@@IAE@XZ @ 1 NONAME ; protected: __thiscall CDir::CDir(void)
-    ??0CFileBase@@IAE@AAVRFs@@@Z @ 2 NONAME ; protected: __thiscall CFileBase::CFileBase(class RFs &)
-    ??0TDriveUnit@@QAE@ABVTDesC16@@@Z @ 3 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(class TDesC16 const &)
-    ??0TDriveUnit@@QAE@H@Z @ 4 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(int)
-    ??0TEntryArray@@QAE@XZ @ 5 NONAME ; public: __thiscall TEntryArray::TEntryArray(void)
-    ??0TFileText@@QAE@XZ @ 6 NONAME ; public: __thiscall TFileText::TFileText(void)
-    ??0TFindFile@@QAE@AAVRFs@@@Z @ 7 NONAME ; public: __thiscall TFindFile::TFindFile(class RFs &)
-    ??0TOpenFileScan@@QAE@AAVRFs@@@Z @ 8 NONAME ; public: __thiscall TOpenFileScan::TOpenFileScan(class RFs &)
-    ??0TParseBase@@QAE@XZ @ 9 NONAME ; public: __thiscall TParseBase::TParseBase(void)
-    ??0TParsePtr@@QAE@AAVTDes16@@@Z @ 10 NONAME ; public: __thiscall TParsePtr::TParsePtr(class TDes16 &)
-    ??0TParsePtrC@@QAE@ABVTDesC16@@@Z @ 11 NONAME ; public: __thiscall TParsePtrC::TParsePtrC(class TDesC16 const &)
-    ??0TVolumeInfo@@QAE@XZ @ 12 NONAME ; public: __thiscall TVolumeInfo::TVolumeInfo(void)
-    ??1CDir@@UAE@XZ @ 13 NONAME ; public: virtual __thiscall CDir::~CDir(void)
-    ??1CDirScan@@UAE@XZ @ 14 NONAME ; public: virtual __thiscall CDirScan::~CDirScan(void)
-    ??1CFileBase@@MAE@XZ @ 15 NONAME ; protected: virtual __thiscall CFileBase::~CFileBase(void)
-    ??4TDriveUnit@@QAEAAV0@ABVTDesC16@@@Z @ 16 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(class TDesC16 const &)
-    ??4TDriveUnit@@QAEAAV0@H@Z @ 17 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(int)
-    ??ACDir@@QBEABVTEntry@@H@Z @ 18 NONAME ; public: class TEntry const & __thiscall CDir::operator[](int)const 
-    ??ATEntryArray@@QBEABVTEntry@@H@Z @ 19 NONAME ; public: class TEntry const & __thiscall TEntryArray::operator[](int)const 
-    ?AbbreviatedPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 20 NONAME ; public: class TPtrC16  __thiscall CDirScan::AbbreviatedPath(void)
-    ?AbbreviatedPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 21 NONAME ; public: class TPtrC16  __thiscall CFileBase::AbbreviatedPath(void)
-    ?AddDir@TParseBase@@QAEHABVTDesC16@@@Z @ 22 NONAME ; public: int __thiscall TParseBase::AddDir(class TDesC16 const &)
-    ?AddFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 23 NONAME ; public: int __thiscall RFs::AddFileSystem(class TDesC16 const &)const 
-    ?AddL@CDir@@IAEXABVTEntry@@@Z @ 24 NONAME ; protected: void __thiscall CDir::AddL(class TEntry const &)
-    ?Att@RFile@@QBEHAAI@Z @ 25 NONAME ; public: int __thiscall RFile::Att(unsigned int &)const 
-    ?Att@RFs@@QBEHABVTDesC16@@AAI@Z @ 26 NONAME ; public: int __thiscall RFs::Att(class TDesC16 const &,unsigned int &)const 
-    ?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@I@Z @ 27 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int)
-    ?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@IAAVTRequestStatus@@@Z @ 28 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int,class TRequestStatus &)
-    ?BytesTransferredByCopyStep@CFileMan@@QAEHXZ @ 29 NONAME ; public: int __thiscall CFileMan::BytesTransferredByCopyStep(void)
-    ?ChangeMode@RFile@@QAEHW4TFileMode@@@Z @ 30 NONAME ; public: int __thiscall RFile::ChangeMode(enum TFileMode)
-    ?CharToDrive@RFs@@SAHVTChar@@AAH@Z @ 31 NONAME ; public: static int __cdecl RFs::CharToDrive(class TChar,int &)
-    ?CheckDisk@RFs@@QBEHABVTDesC16@@@Z @ 32 NONAME ; public: int __thiscall RFs::CheckDisk(class TDesC16 const &)const 
-    ?ClearPassword@RFs@@QAEHHABV?$TBuf8@$0BA@@@@Z @ 33 NONAME ; public: int __thiscall RFs::ClearPassword(int,class TBuf8<16> const &)
-    ?Duplicate@RFile@@QAEHABV1@W4TOwnerType@@@Z @ 34 NONAME ; public: int __thiscall RFile::Duplicate(class RFile const &,enum TOwnerType)
-    ?Close@RRawDisk@@QAEXXZ @ 35 NONAME ; public: void __thiscall RRawDisk::Close(void)
-    ?Compress@CDir@@IAEXXZ @ 36 NONAME ; protected: void __thiscall CDir::Compress(void)
-    ?Connect@RFs@@QAEHH@Z @ 37 NONAME ; public: int __thiscall RFs::Connect(int)
-    ?ConstructL@CFileBase@@IAEXXZ @ 38 NONAME ; protected: void __thiscall CFileBase::ConstructL(void)
-    ?ControlIo@RFs@@QAEHHHPAX0@Z @ 39 NONAME ; public: int __thiscall RFs::ControlIo(int,int,void *,void *)
-    ?Copy@CFileMan@@QAEHABVTDesC16@@0I@Z @ 40 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int)
-    ?Copy@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 41 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-    ?Count@CDir@@QBEHXZ @ 42 NONAME ; public: int __thiscall CDir::Count(void)const 
-    ?Count@TEntryArray@@QBEHXZ @ 43 NONAME ; public: int __thiscall TEntryArray::Count(void)const 
-    ?Create@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 44 NONAME ; public: int __thiscall RFile::Create(class RFs &,class TDesC16 const &,unsigned int)
-    ?CurrentAction@CFileMan@@QAE?AW4TAction@1@XZ @ 45 NONAME ; public: enum CFileMan::TAction  __thiscall CFileMan::CurrentAction(void)
-    ?CurrentEntry@CFileBase@@QAEABVTEntry@@XZ @ 46 NONAME ; public: class TEntry const & __thiscall CFileBase::CurrentEntry(void)
-    ?DefaultPath@RFs@@QBEHAAVTDes16@@@Z @ 47 NONAME ; public: int __thiscall RFs::DefaultPath(class TDes16 &)const 
-    ?Delete@CFileMan@@QAEHABVTDesC16@@I@Z @ 48 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int)
-    ?Delete@CFileMan@@QAEHABVTDesC16@@IAAVTRequestStatus@@@Z @ 49 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int,class TRequestStatus &)
-    ?Delete@RFs@@QAEHABVTDesC16@@@Z @ 50 NONAME ; public: int __thiscall RFs::Delete(class TDesC16 const &)
-    ?DismountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 51 NONAME ; public: int __thiscall RFs::DismountFileSystem(class TDesC16 const &,int)const 
-    ?Drive@RFs@@QBEHAAVTDriveInfo@@H@Z @ 52 NONAME ; public: int __thiscall RFs::Drive(class TDriveInfo &,int)const 
-    ?Drive@TParseBase@@QBE?AVTPtrC16@@XZ @ 53 NONAME ; public: class TPtrC16  __thiscall TParseBase::Drive(void)const 
-    ?DriveAndPath@TParseBase@@QBE?AVTPtrC16@@XZ @ 54 NONAME ; public: class TPtrC16  __thiscall TParseBase::DriveAndPath(void)const 
-    ?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@@Z @ 55 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &)const 
-    ?DrivePresent@TParseBase@@QBEHXZ @ 56 NONAME ; public: int __thiscall TParseBase::DrivePresent(void)const 
-    ?DriveToChar@RFs@@SAHHAAVTChar@@@Z @ 57 NONAME ; public: static int __cdecl RFs::DriveToChar(int,class TChar &)
-    ?Entry@RFs@@QBEHABVTDesC16@@AAVTEntry@@@Z @ 58 NONAME ; public: int __thiscall RFs::Entry(class TDesC16 const &,class TEntry &)const 
-    ?Ext@TParseBase@@QBE?AVTPtrC16@@XZ @ 59 NONAME ; public: class TPtrC16  __thiscall TParseBase::Ext(void)const 
-    ?ExtPresent@TParseBase@@QBEHXZ @ 60 NONAME ; public: int __thiscall TParseBase::ExtPresent(void)const 
-    ?ExtractL@CDir@@IAEXHAAPAV1@@Z @ 61 NONAME ; protected: void __thiscall CDir::ExtractL(int,class CDir * &)
-    ?FileSystemName@RFs@@QBEHAAVTDes16@@H@Z @ 62 NONAME ; public: int __thiscall RFs::FileSystemName(class TDes16 &,int)const 
-    ?Find@TFindFile@@QAEHXZ @ 63 NONAME ; public: int __thiscall TFindFile::Find(void)
-    ?FindByDir@TFindFile@@QAEHABVTDesC16@@0@Z @ 64 NONAME ; public: int __thiscall TFindFile::FindByDir(class TDesC16 const &,class TDesC16 const &)
-    ?FindByPath@TFindFile@@QAEHABVTDesC16@@PBV2@@Z @ 65 NONAME ; public: int __thiscall TFindFile::FindByPath(class TDesC16 const &,class TDesC16 const *)
-    ?FindWild@TFindFile@@QAEHAAPAVCDir@@@Z @ 66 NONAME ; public: int __thiscall TFindFile::FindWild(class CDir * &)
-    ?FindWildByDir@TFindFile@@QAEHABVTDesC16@@0AAPAVCDir@@@Z @ 67 NONAME ; public: int __thiscall TFindFile::FindWildByDir(class TDesC16 const &,class TDesC16 const &,class CDir * &)
-    ?FindWildByPath@TFindFile@@QAEHABVTDesC16@@PBV2@AAPAVCDir@@@Z @ 68 NONAME ; public: int __thiscall TFindFile::FindWildByPath(class TDesC16 const &,class TDesC16 const *,class CDir * &)
-    ?Flush@RFile@@QAEHXZ @ 69 NONAME ; public: int __thiscall RFile::Flush(void)
-    ?FullName@TParseBase@@QBEABVTDesC16@@XZ @ 70 NONAME ; public: class TDesC16 const & __thiscall TParseBase::FullName(void)const 
-    ?FullPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 71 NONAME ; public: class TPtrC16  __thiscall CDirScan::FullPath(void)
-    ?FullPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 72 NONAME ; public: class TPtrC16  __thiscall CFileBase::FullPath(void)
-    ?GetCurrentSource@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 73 NONAME ; public: void __thiscall CFileMan::GetCurrentSource(class TBuf<256> &)
-    ?GetCurrentTarget@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 74 NONAME ; public: void __thiscall CFileMan::GetCurrentTarget(class TBuf<256> &)
-    ?GetDir@RFs@@QBEHABVTDesC16@@ABVTUidType@@IAAPAVCDir@@@Z @ 75 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,class TUidType const &,unsigned int,class CDir * &)const 
-    ?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@1@Z @ 76 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &,class CDir * &)const 
-    ?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@@Z @ 77 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &)const 
-    ?GetDriveName@RFs@@QBEHHAAVTDes16@@@Z @ 78 NONAME ; public: int __thiscall RFs::GetDriveName(int,class TDes16 &)const 
-    ?GetLastError@CFileBase@@QAEHXZ @ 79 NONAME ; public: int __thiscall CFileBase::GetLastError(void)
-    ?GetLongName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 80 NONAME ; public: int __thiscall RFs::GetLongName(class TDesC16 const &,class TDes16 &)const 
-    ?GetMoreInfoAboutError@CFileBase@@QAE?AW4TFileManError@@XZ @ 81 NONAME ; public: enum TFileManError  __thiscall CFileBase::GetMoreInfoAboutError(void)
-    ?GetNotifyUser@RFs@@QAEHXZ @ 82 NONAME ; public: int __thiscall RFs::GetNotifyUser(void)
-    ?GetShortName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 83 NONAME ; public: int __thiscall RFs::GetShortName(class TDesC16 const &,class TDes16 &)const 
-    ?IsArchive@TEntry@@QBEHXZ @ 84 NONAME ; public: int __thiscall TEntry::IsArchive(void)const 
-    ?IsDir@TEntry@@QBEHXZ @ 85 NONAME ; public: int __thiscall TEntry::IsDir(void)const 
-    ?IsExtWild@TParseBase@@QBEHXZ @ 86 NONAME ; public: int __thiscall TParseBase::IsExtWild(void)const 
-    ?IsFileInRom@RFs@@QBEPAEABVTDesC16@@@Z @ 87 NONAME ; public: unsigned char * __thiscall RFs::IsFileInRom(class TDesC16 const &)const 
-    ?IsFileOpen@RFs@@QBEHABVTDesC16@@AAH@Z @ 88 NONAME ; public: int __thiscall RFs::IsFileOpen(class TDesC16 const &,int &)const 
-    ?IsHidden@TEntry@@QBEHXZ @ 89 NONAME ; public: int __thiscall TEntry::IsHidden(void)const 
-    ?IsKMatchAny@TParseBase@@QBEHXZ @ 90 NONAME ; public: int __thiscall TParseBase::IsKMatchAny(void)const 
-    ?IsKMatchOne@TParseBase@@QBEHXZ @ 91 NONAME ; public: int __thiscall TParseBase::IsKMatchOne(void)const 
-    ?IsNameWild@TParseBase@@QBEHXZ @ 92 NONAME ; public: int __thiscall TParseBase::IsNameWild(void)const 
-    ?IsReadOnly@TEntry@@QBEHXZ @ 93 NONAME ; public: int __thiscall TEntry::IsReadOnly(void)const 
-    ?IsRomAddress@RFs@@SAHPAX@Z @ 94 NONAME ; public: static int __cdecl RFs::IsRomAddress(void *)
-    ?IsRoot@TParseBase@@QBEHXZ @ 95 NONAME ; public: int __thiscall TParseBase::IsRoot(void)const 
-    ?IsSystem@TEntry@@QBEHXZ @ 96 NONAME ; public: int __thiscall TEntry::IsSystem(void)const 
-    ?IsValidDrive@RFs@@SAHH@Z @ 97 NONAME ; public: static int __cdecl RFs::IsValidDrive(int)
-    ?IsValidName@RFs@@QBEHABVTDesC16@@@Z @ 98 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &)const 
-    ?IsValidName@RFs@@QBEHABVTDesC16@@AAG@Z @ 99 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,unsigned short &)const 
-    ?IsWild@TParseBase@@QBEHXZ @ 100 NONAME ; public: int __thiscall TParseBase::IsWild(void)const 
-    ?LoaderHeapFunction@RFs@@QAEHHPAX0@Z @ 101 NONAME ; public: int __thiscall RFs::LoaderHeapFunction(int,void *,void *)
-    ?Lock@RFile@@QBEHHH@Z @ 102 NONAME ; public: int __thiscall RFile::Lock(int,int)const 
-    ?LockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@0H@Z @ 103 NONAME ; public: int __thiscall RFs::LockDrive(int,class TBuf8<16> const &,class TBuf8<16> const &,int)
-    ?MkDir@RFs@@QAEHABVTDesC16@@@Z @ 104 NONAME ; public: int __thiscall RFs::MkDir(class TDesC16 const &)
-    ?MkDirAll@RFs@@QAEHABVTDesC16@@@Z @ 105 NONAME ; public: int __thiscall RFs::MkDirAll(class TDesC16 const &)
-    ?Modified@RFile@@QBEHAAVTTime@@@Z @ 106 NONAME ; public: int __thiscall RFile::Modified(class TTime &)const 
-    ?Modified@RFs@@QBEHABVTDesC16@@AAVTTime@@@Z @ 107 NONAME ; public: int __thiscall RFs::Modified(class TDesC16 const &,class TTime &)const 
-    ?MountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 108 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int)const 
-    ?Move@CFileMan@@QAEHABVTDesC16@@0I@Z @ 109 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int)
-    ?Move@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 110 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-    ?Name@TDriveUnit@@QBE?AV?$TBuf@$01@@XZ @ 111 NONAME ; public: class TBuf<2>  __thiscall TDriveUnit::Name(void)const 
-    ?Name@TParseBase@@QBE?AVTPtrC16@@XZ @ 112 NONAME ; public: class TPtrC16  __thiscall TParseBase::Name(void)const 
-    ?NameAndExt@TParseBase@@QBE?AVTPtrC16@@XZ @ 113 NONAME ; public: class TPtrC16  __thiscall TParseBase::NameAndExt(void)const 
-    ?NameBuf@TParse@@MAEAAVTDes16@@XZ @ 114 NONAME ; protected: virtual class TDes16 & __thiscall TParse::NameBuf(void)
-    ?NameBuf@TParsePtr@@MAEAAVTDes16@@XZ @ 115 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtr::NameBuf(void)
-    ?NameBuf@TParsePtrC@@MAEAAVTDes16@@XZ @ 116 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtrC::NameBuf(void)
-    ?NameBufC@TParse@@MBEABVTDesC16@@XZ @ 117 NONAME ; protected: virtual class TDesC16 const & __thiscall TParse::NameBufC(void)const 
-    ?NameBufC@TParsePtr@@MBEABVTDesC16@@XZ @ 118 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtr::NameBufC(void)const 
-    ?NameBufC@TParsePtrC@@MBEABVTDesC16@@XZ @ 119 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtrC::NameBufC(void)const 
-    ?NameOrExtPresent@TParseBase@@QBEHXZ @ 120 NONAME ; public: int __thiscall TParseBase::NameOrExtPresent(void)const 
-    ?NamePresent@TParseBase@@QBEHXZ @ 121 NONAME ; public: int __thiscall TParseBase::NamePresent(void)const 
-    ?NewL@CDir@@KAPAV1@XZ @ 122 NONAME ; protected: static class CDir * __cdecl CDir::NewL(void)
-    ?NewL@CDirScan@@SAPAV1@AAVRFs@@@Z @ 123 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewL(class RFs &)
-    ?NewL@CFileMan@@SAPAV1@AAVRFs@@@Z @ 124 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &)
-    ?NewL@CFileMan@@SAPAV1@AAVRFs@@PAVMFileManObserver@@@Z @ 125 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &,class MFileManObserver *)
-    ?NewLC@CDirScan@@SAPAV1@AAVRFs@@@Z @ 126 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewLC(class RFs &)
-    ?Next@RFormat@@QAEHAAH@Z @ 127 NONAME ; public: int __thiscall RFormat::Next(int &)
-    ?Next@RFormat@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 128 NONAME ; public: void __thiscall RFormat::Next(class TPckgBuf<int> &,class TRequestStatus &)
-    ?NextL@CDirScan@@QAEXAAPAVCDir@@@Z @ 129 NONAME ; public: void __thiscall CDirScan::NextL(class CDir * &)
-    ?NextL@TOpenFileScan@@QAEXAAPAVCDir@@@Z @ 130 NONAME ; public: void __thiscall TOpenFileScan::NextL(class CDir * &)
-    ?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@@Z @ 131 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &)
-    ?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@ABVTDesC16@@@Z @ 132 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &,class TDesC16 const &)
-    ?NotifyChangeCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 133 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(class TRequestStatus &)
-    ?NotifyChangeCancel@RFs@@QAEXXZ @ 134 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(void)
-    ?NotifyFileManEnded@MFileManObserver@@UAE?AW4TControl@1@XZ @ 135 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManEnded(void)
-    ?NotifyFileManOperation@MFileManObserver@@UAE?AW4TControl@1@XZ @ 136 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManOperation(void)
-    ?NotifyFileManStarted@MFileManObserver@@UAE?AW4TControl@1@XZ @ 137 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManStarted(void)
-    ?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@ABVTUidType@@@Z @ 138 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,class TUidType const &)
-    ?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 139 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,unsigned int)
-    ?Open@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 140 NONAME ; public: int __thiscall RFile::Open(class RFs &,class TDesC16 const &,unsigned int)
-    ?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAH@Z @ 141 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &)
-    ?Open@RRawDisk@@QAEHAAVRFs@@H@Z @ 142 NONAME ; public: int __thiscall RRawDisk::Open(class RFs &,int)
-    ?Parse@RFs@@QBEHABVTDesC16@@0AAVTParse@@@Z @ 143 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TDesC16 const &,class TParse &)const 
-    ?Parse@RFs@@QBEHABVTDesC16@@AAVTParse@@@Z @ 144 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TParse &)const 
-    ?Path@TParseBase@@QBE?AVTPtrC16@@XZ @ 145 NONAME ; public: class TPtrC16  __thiscall TParseBase::Path(void)const 
-    ?PathPresent@TParseBase@@QBEHXZ @ 146 NONAME ; public: int __thiscall TParseBase::PathPresent(void)const 
-    ?PopDir@TParseBase@@QAEHXZ @ 147 NONAME ; public: int __thiscall TParseBase::PopDir(void)
-    ?Read@RDir@@QBEHAAVTEntry@@@Z @ 148 NONAME ; public: int __thiscall RDir::Read(class TEntry &)const 
-    ?Read@RDir@@QBEHAAVTEntryArray@@@Z @ 149 NONAME ; public: int __thiscall RDir::Read(class TEntryArray &)const 
-    ?Read@RDir@@QBEXAAV?$TPckg@VTEntry@@@@AAVTRequestStatus@@@Z @ 150 NONAME ; public: void __thiscall RDir::Read(class TPckg<class TEntry> &,class TRequestStatus &)const 
-    ?Read@RDir@@QBEXAAVTEntryArray@@AAVTRequestStatus@@@Z @ 151 NONAME ; public: void __thiscall RDir::Read(class TEntryArray &,class TRequestStatus &)const 
-    ?Read@RFile@@QBEHAAVTDes8@@@Z @ 152 NONAME ; public: int __thiscall RFile::Read(class TDes8 &)const 
-    ?Read@RFile@@QBEHAAVTDes8@@H@Z @ 153 NONAME ; public: int __thiscall RFile::Read(class TDes8 &,int)const 
-    ?Read@RFile@@QBEHHAAVTDes8@@@Z @ 154 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &)const 
-    ?Read@RFile@@QBEHHAAVTDes8@@H@Z @ 155 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &,int)const 
-    ?Read@RFile@@QBEXAAVTDes8@@AAVTRequestStatus@@@Z @ 156 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,class TRequestStatus &)const 
-    ?Read@RFile@@QBEXAAVTDes8@@HAAVTRequestStatus@@@Z @ 157 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,int,class TRequestStatus &)const 
-    ?Read@RFile@@QBEXHAAVTDes8@@AAVTRequestStatus@@@Z @ 158 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,class TRequestStatus &)const 
-    ?Read@RFile@@QBEXHAAVTDes8@@HAAVTRequestStatus@@@Z @ 159 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,int,class TRequestStatus &)const 
-    ?Read@_RRawDisk@@QAEHHAAVTDes8@@@Z @ 160 NONAME ; public: int __thiscall _RRawDisk::Read(int,class TDes8 &)
-    ?Read@TFileText@@QAEHAAVTDes16@@@Z @ 161 NONAME ; public: int __thiscall TFileText::Read(class TDes16 &)
-    ?ReadFileSection_RESERVED@RFs@@ABEHABVTDesC16@@HAAVTDes8@@H@Z @ 162 NONAME ; public: int __thiscall RFs::ReadFileSection_RESERVED(class TDesC16 const &,int,class TDes8 &,int)const 
-    ?RealName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 163 NONAME ; public: int __thiscall RFs::RealName(class TDesC16 const &,class TDes16 &)const 
-    ?RemoveFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 164 NONAME ; public: int __thiscall RFs::RemoveFileSystem(class TDesC16 const &)const 
-    ?Rename@CFileMan@@QAEHABVTDesC16@@0I@Z @ 165 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int)
-    ?Rename@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 166 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-    ?Rename@RFile@@QAEHABVTDesC16@@@Z @ 167 NONAME ; public: int __thiscall RFile::Rename(class TDesC16 const &)
-    ?Rename@RFs@@QAEHABVTDesC16@@0@Z @ 168 NONAME ; public: int __thiscall RFs::Rename(class TDesC16 const &,class TDesC16 const &)
-    ?Replace@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 169 NONAME ; public: int __thiscall RFile::Replace(class RFs &,class TDesC16 const &,unsigned int)
-    ?Replace@RFs@@QAEHABVTDesC16@@0@Z @ 170 NONAME ; public: int __thiscall RFs::Replace(class TDesC16 const &,class TDesC16 const &)
-    ?ResourceCount@RFs@@QBEHXZ @ 171 NONAME ; public: int __thiscall RFs::ResourceCount(void)const 
-    ?ResourceCountMarkEnd@RFs@@QBEXXZ @ 172 NONAME ; public: void __thiscall RFs::ResourceCountMarkEnd(void)const 
-    ?ResourceCountMarkStart@RFs@@QBEXXZ @ 173 NONAME ; public: void __thiscall RFs::ResourceCountMarkStart(void)const 
-    ?RmDir@CFileMan@@QAEHABVTDesC16@@@Z @ 174 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &)
-    ?RmDir@CFileMan@@QAEHABVTDesC16@@AAVTRequestStatus@@@Z @ 175 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &,class TRequestStatus &)
-    ?RmDir@RFs@@QAEHABVTDesC16@@@Z @ 176 NONAME ; public: int __thiscall RFs::RmDir(class TDesC16 const &)
-    ?RunInSeparateThreadL@CFileBase@@IAEXP6AHPAX@Z@Z @ 177 NONAME ; protected: void __thiscall CFileBase::RunInSeparateThreadL(int (__cdecl*)(void *))
-    ?RunL@CFileBase@@IAEXXZ @ 178 NONAME ; protected: void __thiscall CFileBase::RunL(void)
-    ?ScanDrive@RFs@@QBEHABVTDesC16@@@Z @ 179 NONAME ; public: int __thiscall RFs::ScanDrive(class TDesC16 const &)const 
-    ?Seek@RFile@@QBEHW4TSeek@@AAH@Z @ 180 NONAME ; public: int __thiscall RFile::Seek(enum TSeek,int &)const 
-    ?Seek@TFileText@@QAEHW4TSeek@@@Z @ 181 NONAME ; public: int __thiscall TFileText::Seek(enum TSeek)
-    ?SessionPath@RFs@@QBEHAAVTDes16@@@Z @ 182 NONAME ; public: int __thiscall RFs::SessionPath(class TDes16 &)const 
-    ?Set@RFile@@QAEHABVTTime@@II@Z @ 183 NONAME ; public: int __thiscall RFile::Set(class TTime const &,unsigned int,unsigned int)
-    ?Set@TFileText@@QAEXAAVRFile@@@Z @ 184 NONAME ; public: void __thiscall TFileText::Set(class RFile &)
-    ?Set@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 185 NONAME ; public: int __thiscall TParse::Set(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
-    ?SetAllocFailure@RFs@@QAEHH@Z @ 186 NONAME ; public: int __thiscall RFs::SetAllocFailure(int)
-    ?SetAtt@RFile@@QAEHII@Z @ 187 NONAME ; public: int __thiscall RFile::SetAtt(unsigned int,unsigned int)
-    ?SetAtt@RFs@@QAEHABVTDesC16@@II@Z @ 188 NONAME ; public: int __thiscall RFs::SetAtt(class TDesC16 const &,unsigned int,unsigned int)
-    ?SetDebugRegister@RFs@@QAEHH@Z @ 189 NONAME ; public: int __thiscall RFs::SetDebugRegister(int)
-    ?SetDefaultPath@RFs@@QAEHABVTDesC16@@@Z @ 190 NONAME ; public: int __thiscall RFs::SetDefaultPath(class TDesC16 const &)
-    ?SetDriveName@RFs@@QAEHHABVTDesC16@@@Z @ 191 NONAME ; public: int __thiscall RFs::SetDriveName(int,class TDesC16 const &)
-    ?SetEntry@RFs@@QAEHABVTDesC16@@ABVTTime@@II@Z @ 192 NONAME ; public: int __thiscall RFs::SetEntry(class TDesC16 const &,class TTime const &,unsigned int,unsigned int)
-    ?SetErrorCondition@RFs@@QAEHHH@Z @ 193 NONAME ; public: int __thiscall RFs::SetErrorCondition(int,int)
-    ?SetModified@RFile@@QAEHABVTTime@@@Z @ 194 NONAME ; public: int __thiscall RFile::SetModified(class TTime const &)
-    ?SetModified@RFs@@QAEHABVTDesC16@@ABVTTime@@@Z @ 195 NONAME ; public: int __thiscall RFs::SetModified(class TDesC16 const &,class TTime const &)
-    ?SetNoWild@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 196 NONAME ; public: int __thiscall TParse::SetNoWild(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
-    ?SetNotifyUser@RFs@@QAEXH@Z @ 197 NONAME ; public: void __thiscall RFs::SetNotifyUser(int)
-    ?SetObserver@CFileBase@@QAEXPAVMFileManObserver@@@Z @ 198 NONAME ; public: void __thiscall CFileBase::SetObserver(class MFileManObserver *)
-    ?SetScanDataL@CDirScan@@QAEXABVTDesC16@@IIW4TScanDirection@1@@Z @ 199 NONAME ; public: void __thiscall CDirScan::SetScanDataL(class TDesC16 const &,unsigned int,unsigned int,enum CDirScan::TScanDirection)
-    ?SetSessionPath@RFs@@QAEHABVTDesC16@@@Z @ 200 NONAME ; public: int __thiscall RFs::SetSessionPath(class TDesC16 const &)
-    ?SetSize@RFile@@QAEHH@Z @ 201 NONAME ; public: int __thiscall RFile::SetSize(int)
-    ?SetSubst@RFs@@QAEHABVTDesC16@@H@Z @ 202 NONAME ; public: int __thiscall RFs::SetSubst(class TDesC16 const &,int)
-    ?SetVolumeLabel@RFs@@QAEHABVTDesC16@@H@Z @ 203 NONAME ; public: int __thiscall RFs::SetVolumeLabel(class TDesC16 const &,int)
-    ?Size@RFile@@QBEHAAH@Z @ 204 NONAME ; public: int __thiscall RFile::Size(int &)const 
-    ?Sort@CDir@@QAEHI@Z @ 205 NONAME ; public: int __thiscall CDir::Sort(unsigned int)
-    ?Subst@RFs@@QBEHAAVTDes16@@H@Z @ 206 NONAME ; public: int __thiscall RFs::Subst(class TDes16 &,int)const 
-    ?Temp@RFile@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 207 NONAME ; public: int __thiscall RFile::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
-    ?ThreadId@TOpenFileScan@@QBE?AVTThreadId@@XZ @ 208 NONAME ; public: class TThreadId  __thiscall TOpenFileScan::ThreadId(void)const 
-    ?UnLock@RFile@@QBEHHH@Z @ 209 NONAME ; public: int __thiscall RFile::UnLock(int,int)const 
-    ?UnlockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@H@Z @ 210 NONAME ; public: int __thiscall RFs::UnlockDrive(int,class TBuf8<16> const &,int)
-    ?Version@RFs@@QBE?AVTVersion@@XZ @ 211 NONAME ; public: class TVersion  __thiscall RFs::Version(void)const 
-    ?Volume@RFs@@QBEHAAVTVolumeInfo@@H@Z @ 212 NONAME ; public: int __thiscall RFs::Volume(class TVolumeInfo &,int)const 
-    ?Write@RFile@@QAEHABVTDesC8@@@Z @ 213 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &)
-    ?Write@RFile@@QAEHABVTDesC8@@H@Z @ 214 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &,int)
-    ?Write@RFile@@QAEHHABVTDesC8@@@Z @ 215 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &)
-    ?Write@RFile@@QAEHHABVTDesC8@@H@Z @ 216 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &,int)
-    ?Write@RFile@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 217 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,class TRequestStatus &)
-    ?Write@RFile@@QAEXABVTDesC8@@HAAVTRequestStatus@@@Z @ 218 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,int,class TRequestStatus &)
-    ?Write@RFile@@QAEXHABVTDesC8@@AAVTRequestStatus@@@Z @ 219 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,class TRequestStatus &)
-    ?Write@RFile@@QAEXHABVTDesC8@@HAAVTRequestStatus@@@Z @ 220 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,int,class TRequestStatus &)
-    ?Write@_RRawDisk@@QAEHHAAVTDesC8@@@Z @ 221 NONAME ; public: int __thiscall _RRawDisk::Write(int,class TDesC8 &)
-    ?Write@TFileText@@QAEHABVTDesC16@@@Z @ 222 NONAME ; public: int __thiscall TFileText::Write(class TDesC16 const &)
-    ?DebugNotify@RFs@@QAEXHIAAVTRequestStatus@@@Z @ 223 NONAME ; public: void __thiscall RFs::DebugNotify(int,unsigned int,class TRequestStatus &)
-    ?NotifyDiskSpace@RFs@@QAEX_JHAAVTRequestStatus@@@Z @ 224 NONAME ; public: void __thiscall RFs::NotifyDiskSpace(__int64,int,class TRequestStatus &)
-    ?NotifyDiskSpaceCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 225 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(class TRequestStatus &)
-    ?NotifyDiskSpaceCancel@RFs@@QAEXXZ @ 226 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(void)
-    ??0TEntry@@QAE@ABV0@@Z @ 227 NONAME ; public: __thiscall TEntry::TEntry(class TEntry const &)
-    ??0TEntry@@QAE@XZ @ 228 NONAME ; public: __thiscall TEntry::TEntry(void)
-    ??4TEntry@@QAEAAV0@ABV0@@Z @ 229 NONAME ; public: class TEntry & __thiscall TEntry::operator=(class TEntry const &)
-    ??0TParse@@QAE@XZ @ 230 NONAME ; public: __thiscall TParse::TParse(void)
-    ?Drive@RFile@@QBEHAAHAAVTDriveInfo@@@Z @ 231 NONAME ; public: int __thiscall RFile::Drive(int &,class TDriveInfo &)const 
-    ?RemountDrive@RFs@@QAEHHPBVTDesC8@@I@Z @ 232 NONAME ; public: int __thiscall RFs::RemountDrive(int,class TDesC8 const *,unsigned int)
-    ?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@HAAH@Z @ 233 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,int,int &)const 
-    ?CreatePrivatePath@RFs@@QAEHH@Z @ 234 NONAME ; public: int __thiscall RFs::CreatePrivatePath(int)
-    ?PrivatePath@RFs@@QAEHAAVTDes16@@@Z @ 235 NONAME ; public: int __thiscall RFs::PrivatePath(class TDes16 &)
-    ?SetSessionToPrivate@RFs@@QAEHH@Z @ 236 NONAME ; public: int __thiscall RFs::SetSessionToPrivate(int)
-    ?FileNamesIdentical@@YAHABVTDesC16@@0@Z @ 237 NONAME ; int __cdecl FileNamesIdentical(class TDesC16 const &,class TDesC16 const &)
-    ?AddExtension@RFs@@QAEHABVTDesC16@@@Z @ 238 NONAME ; public: int __thiscall RFs::AddExtension(class TDesC16 const &)
-    ?DismountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 239 NONAME ; public: int __thiscall RFs::DismountExtension(class TDesC16 const &,int)
-    ?ExtensionName@RFs@@QAEHAAVTDes16@@HH@Z @ 240 NONAME ; public: int __thiscall RFs::ExtensionName(class TDes16 &,int,int)
-    ?MountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 241 NONAME ; public: int __thiscall RFs::MountExtension(class TDesC16 const &,int)
-    ?MountFileSystem@RFs@@QAEHABVTDesC16@@0H@Z @ 242 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int)
-    ?RemoveExtension@RFs@@QAEHABVTDesC16@@@Z @ 243 NONAME ; public: int __thiscall RFs::RemoveExtension(class TDesC16 const &)
-    ?StartupInitComplete@RFs@@QAEXAAVTRequestStatus@@@Z @ 244 NONAME ; public: void __thiscall RFs::StartupInitComplete(class TRequestStatus &)
-    ?SetLocalDriveMapping@RFs@@QAEHABVTDesC8@@@Z @ 245 NONAME ; public: int __thiscall RFs::SetLocalDriveMapping(class TDesC8 const &)
-    ?ControlIo@RFs@@QAEHHH@Z @ 246 NONAME ; public: int __thiscall RFs::ControlIo(int,int)
-    ?ControlIo@RFs@@QAEHHHAAVTDes8@@@Z @ 247 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&)   ?Adopt@RFile@@QAEHAAVRFs@@AAH@Z @ 246 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int &)
-    ?ControlIo@RFs@@QAEHHHAAVTDes8@@0@Z @ 248 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&,class TDes8&)
-    ?Adopt@RFile@@QAEHAAVRFs@@H@Z @ 249 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int)
-    ?MountFileSystem@RFs@@QAEHABVTDesC16@@0HH@Z @ 250 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int,int)
-    ?MountFileSystem@RFs@@QBEHABVTDesC16@@HH@Z @ 251 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int,int)const 
-    ?Read@RRawDisk@@QAEH_JAAVTDes8@@@Z @ 252 NONAME ; public: int __thiscall RRawDisk::Read(__int64,class TDes8 &)
-    ?Write@RRawDisk@@QAEH_JAAVTDesC8@@@Z @ 253 NONAME ; public: int __thiscall RRawDisk::Write(__int64,class TDesC8 &)
-    ?FinaliseDrives@RFs@@QAEHXZ @ 254 NONAME ; public: int __thiscall RFs::FinaliseDrives(void)
-    ?SwapFileSystem@RFs@@QBEHABVTDesC16@@0H@Z @ 255 NONAME ; public: int __thiscall RFs::SwapFileSystem(class TDesC16 const &,class TDesC16 const &,int)const 
-    ?ErasePassword@RFs@@QAEHH@Z @ 256 NONAME ; public: int __thiscall RFs::ErasePassword(int)
-    ?GetReserveAccess@RFs@@QAEHH@Z @ 257 NONAME ; public: int __thiscall RFs::GetReserveAccess(int)
-    ?ReleaseReserveAccess@RFs@@QAEHH@Z @ 258 NONAME ; public: int __thiscall RFs::ReleaseReserveAccess(int)
-    ?ReserveDriveSpace@RFs@@QAEHHH@Z @ 259 NONAME ; public: int __thiscall RFs::ReserveDriveSpace(int,int)
-    ?AdoptFromClient@RFile@@QAEHABVRMessage2@@HH@Z @ 260 NONAME ; public: int __thiscall RFile::AdoptFromClient(class RMessage2 const &,int,int)
-    ?AdoptFromCreator@RFile@@QAEHHH@Z @ 261 NONAME ; public: int __thiscall RFile::AdoptFromCreator(int,int)
-    ?AdoptFromServer@RFile@@QAEHHH@Z @ 262 NONAME ; public: int __thiscall RFile::AdoptFromServer(int,int)
-    ?TransferToClient@RFile@@QBEHABVRMessage2@@H@Z @ 263 NONAME ; public: int __thiscall RFile::TransferToClient(class RMessage2 const &,int)const 
-    ?TransferToProcess@RFile@@QBEHAAVRProcess@@HH@Z @ 264 NONAME ; public: int __thiscall RFile::TransferToProcess(class RProcess &,int,int)const 
-    ?TransferToServer@RFile@@QBEHAAVTIpcArgs@@HH@Z @ 265 NONAME ; public: int __thiscall RFile::TransferToServer(class TIpcArgs &,int,int)const 
-    ?Name@RFile@@QBEHAAVTDes16@@@Z @ 266 NONAME ; public: int __thiscall RFile::Name(class TDes16 &)const 
-    ?Close@RDir@@QAEXXZ @ 267 NONAME ; public: void __thiscall RDir::Close(void)
-    ?Close@RFile@@QAEXXZ @ 268 NONAME ; public: void __thiscall RFile::Close(void)
-    ?Close@RFormat@@QAEXXZ @ 269 NONAME ; public: void __thiscall RFormat::Close(void)
-    ?GetMediaSerialNumber@RFs@@QAEHAAV?$TBuf8@$0EA@@@H@Z @ 270 NONAME ; public: int __thiscall RFs::GetMediaSerialNumber(class TBuf8<64> &,int)
-    ?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@I@Z @ 271 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int)
-    ?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@IAAVTRequestStatus@@@Z @ 272 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
-    ?FullName@RFile@@QBEHAAVTDes16@@@Z @ 273 NONAME ; public: int __thiscall RFile::FullName(class TDes16 &)const 
-    ?AddPlugin@RFs@@QBEHABVTDesC16@@@Z @ 274 NONAME ; public: int __thiscall RFs::AddPlugin(class TDesC16 const &)const 
-    ?Close@RPlugin@@QAEXXZ @ 275 NONAME ; public: void __thiscall RPlugin::Close(void)
-    ?DismountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 276 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &)const 
-    ?DismountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 277 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int)const 
-    ?DismountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 278 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int,int)const 
-    ?DoCancel@RPlugin@@IBEXI@Z @ 279 NONAME ; protected: void __thiscall RPlugin::DoCancel(unsigned int)const 
-    ?DoControl@RPlugin@@IBEHH@Z @ 280 NONAME ; protected: int __thiscall RPlugin::DoControl(int)const 
-    ?DoControl@RPlugin@@IBEHHAAVTDes8@@0@Z @ 281 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &,class TDes8 &)const 
-    ?DoControl@RPlugin@@IBEHHAAVTDes8@@@Z @ 282 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &)const 
-    ?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@@Z @ 283 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &)const 
-    ?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@1@Z @ 284 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &,class TDes8 &)const 
-    ?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@@Z @ 285 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &)const 
-    ?MountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 286 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &)const 
-    ?MountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 287 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int)const 
-    ?MountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 288 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int,int)const 
-    ?Open@RPlugin@@QAEHAAVRFs@@H@Z @ 289 NONAME ; public: int __thiscall RPlugin::Open(class RFs &,int)
-    ?PluginName@RFs@@QAEHAAVTDes16@@HH@Z @ 290 NONAME ; public: int __thiscall RFs::PluginName(class TDes16 &,int,int)
-    ?RemovePlugin@RFs@@QBEHABVTDesC16@@@Z @ 291 NONAME ; public: int __thiscall RFs::RemovePlugin(class TDesC16 const &)const 
-    ?AllowDismount@RFs@@QBEHH@Z @ 292 NONAME ; public: int __thiscall RFs::AllowDismount(int)const 
-    ?NotifyDismount@RFs@@QBEXHAAVTRequestStatus@@W4TNotifyDismountMode@@@Z @ 293 NONAME ; public: void __thiscall RFs::NotifyDismount(int,class TRequestStatus &,enum TNotifyDismountMode)const 
-    ?NotifyDismountCancel@RFs@@QBEXAAVTRequestStatus@@@Z @ 294 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(class TRequestStatus &)const 
-    ?NotifyDismountCancel@RFs@@QBEXXZ @ 295 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(void)const 
-    ?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAHABVTDesC8@@@Z @ 296 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &,class TDesC8 const &)
-    ?SetStartupConfiguration@RFs@@QBEHHPAX0@Z @ 297 NONAME ; public: int __thiscall RFs::SetStartupConfiguration(int,void *,void *)const 
-    ?ReadCancel@RFile@@QBEXAAVTRequestStatus@@@Z @ 298 NONAME ; public: void __thiscall RFile::ReadCancel(class TRequestStatus &)const 
-    ?ReadCancel@RFile@@QBEXXZ @ 299 NONAME ; public: void __thiscall RFile::ReadCancel(void)const 
-    ?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@0HAAH@Z @ 300 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,class TDesC16 const &,int,int &)const 
-    ?SetNotifyChange@RFs@@QAEHH@Z @ 301 NONAME ; public: int __thiscall RFs::SetNotifyChange(int)
-    ?AddCompositeMount@RFs@@QBEHABVTDesC16@@HHH@Z @ 302 NONAME ; int RFs::AddCompositeMount(class TDesC16 const &, int, int, int) const
-    ?Flush@RFile@@QAEXAAVTRequestStatus@@@Z @ 303 NONAME ; public: void __thiscall RFile::Flush(class TRequestStatus &)
-    ?GetSystemDrive@RFs@@SA?AW4TDriveNumber@@XZ @ 304 NONAME ; public: static enum TDriveNumber  __cdecl RFs::GetSystemDrive(void)
-    ??0TBlockMapEntry@@QAE@XZ @ 305 NONAME ; public: __thiscall TBlockMapEntry::TBlockMapEntry(void)
-    ?BlockMap@RFile@@QBEHAAUSBlockMapInfo@@AA_J_JH@Z @ 306 NONAME ; public: int __thiscall RFile::BlockMap(struct SBlockMapInfo &,__int64 &,__int64,int)const 
-    ?SetNumberOfBlocks@TBlockMapEntry@@QAEXI@Z @ 307 NONAME ; public: void __thiscall TBlockMapEntry::SetNumberOfBlocks(unsigned int)
-    ?SetStartBlock@TBlockMapEntry@@QAEXI@Z @ 308 NONAME ; public: void __thiscall TBlockMapEntry::SetStartBlock(unsigned int)
-    ?Clamp@RFileClamp@@QAEHAAVRFile@@@Z @ 309 NONAME ; public: int __thiscall RFileClamp::Clamp(class RFile &)
-    ?Close@RFileClamp@@QAEHAAVRFs@@@Z @ 310 NONAME ; public: int __thiscall RFileClamp::Close(class RFs &)
-    ?FileSystemSubType@RFs@@QBEHHAAVTDes16@@@Z @ 311 NONAME ; public: int __thiscall RFs::FileSystemSubType(int,class TDes16 &)const 
-    ?InitialisePropertiesFile@RFs@@QBEHABVTPtrC8@@@Z @ 312 NONAME ; public: int __thiscall RFs::InitialisePropertiesFile(class TPtrC8 const &)const 
-    ?QueryVolumeInfoExt@RFs@@QBEHHW4TQueryVolumeInfoExtCmd@@AAVTDes8@@@Z @ 313 NONAME ; public: int __thiscall RFs::QueryVolumeInfoExt(int,enum TQueryVolumeInfoExtCmd,class TDes8 &)const 
-    ?VolumeIOParam@RFs@@QBEHHAAVTVolumeIOParamInfo@@@Z @ 314 NONAME ; public: int __thiscall RFs::VolumeIOParam(int,class TVolumeIOParamInfo &)const 
-    ?GetSystemDriveChar@RFs@@SA?AVTChar@@XZ @ 315 NONAME ; public: static class TChar  __cdecl RFs::GetSystemDriveChar(void)
-    ?SetSystemDrive@RFs@@QAEHW4TDriveNumber@@@Z @ 316 NONAME ; public: int __thiscall RFs::SetSystemDrive(enum TDriveNumber)
-    ?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@I@Z @ 317 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &,unsigned int)const 
-    ?SetFindMask@TFindFile@@QAEHI@Z @ 318 NONAME ; public: int __thiscall TFindFile::SetFindMask(unsigned int)
-    ?FinaliseDrive@RFs@@QBEHHW4TFinaliseDrvMode@1@@Z @ 319 NONAME ; public: int __thiscall RFs::FinaliseDrive(int,enum RFs::TFinaliseDrvMode)const 
-    ?Volume@RFs@@QBEXAAVTVolumeInfo@@HAAVTRequestStatus@@@Z @ 320 NONAME ; public: void __thiscall RFs::Volume(class TVolumeInfo &,int,class TRequestStatus &)const 
-    ?AddProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 321 NONAME ; public: int __thiscall RFs::AddProxyDrive(class TDesC16 const &)
-    ?Caps@RRawDisk@@QAEHAAVTDes8@@@Z @ 322 NONAME ABSENT ; public: int __thiscall RRawDisk::Caps(class TDes8 &)
-    ?DismountProxyDrive@RFs@@QAEHI@Z @ 323 NONAME ; public: int __thiscall RFs::DismountProxyDrive(unsigned int)
-    ?DoMountProxyDrive@RFs@@AAEHABVTIpcArgs@@@Z @ 324 NONAME ; private: int __thiscall RFs::DoMountProxyDrive(class TIpcArgs const &)
-    ?RemoveProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 325 NONAME ; public: int __thiscall RFs::RemoveProxyDrive(class TDesC16 const &)
-    ?ReadFileSection@RFs@@QBEHABVTDesC16@@_JAAVTDes8@@H@Z @ 326 NONAME ; public: int __thiscall RFs::ReadFileSection(class TDesC16 const &,__int64,class TDes8 &,int)const 
-    ?AdoptFromClient@RFile64@@QAEHABVRMessage2@@HH@Z @ 327 NONAME ; public: int __thiscall RFile64::AdoptFromClient(class RMessage2 const &,int,int)
-    ?AdoptFromCreator@RFile64@@QAEHHH@Z @ 328 NONAME ; public: int __thiscall RFile64::AdoptFromCreator(int,int)
-    ?AdoptFromServer@RFile64@@QAEHHH@Z @ 329 NONAME ; public: int __thiscall RFile64::AdoptFromServer(int,int)
-    ?Create@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 330 NONAME ; public: int __thiscall RFile64::Create(class RFs &,class TDesC16 const &,unsigned int)
-    ?FileSize@TEntry@@QBE_JXZ @ 331 NONAME ; public: __int64 __thiscall TEntry::FileSize(void)const 
-    ?Lock@RFile64@@QBEH_J0@Z @ 332 NONAME ; public: int __thiscall RFile64::Lock(__int64,__int64)const 
-    ?Open@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 333 NONAME ; public: int __thiscall RFile64::Open(class RFs &,class TDesC16 const &,unsigned int)
-    ?Read@RFile64@@QBEHIAAVTDes8@@@Z @ 334 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &)const 
-    ?Read@RFile64@@QBEHIAAVTDes8@@H@Z @ 335 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &,int)const 
-    ?Read@RFile64@@QBEH_JAAVTDes8@@@Z @ 336 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &)const 
-    ?Read@RFile64@@QBEH_JAAVTDes8@@H@Z @ 337 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &,int)const 
-    ?Read@RFile64@@QBEXIAAVTDes8@@AAVTRequestStatus@@@Z @ 338 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,class TRequestStatus &)const 
-    ?Read@RFile64@@QBEXIAAVTDes8@@HAAVTRequestStatus@@@Z @ 339 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,int,class TRequestStatus &)const 
-    ?Read@RFile64@@QBEX_JAAVTDes8@@AAVTRequestStatus@@@Z @ 340 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,class TRequestStatus &)const 
-    ?Read@RFile64@@QBEX_JAAVTDes8@@HAAVTRequestStatus@@@Z @ 341 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,int,class TRequestStatus &)const 
-    ?Replace@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 342 NONAME ; public: int __thiscall RFile64::Replace(class RFs &,class TDesC16 const &,unsigned int)
-    ?Seek@RFile64@@QBEHW4TSeek@@AA_J@Z @ 343 NONAME ; public: int __thiscall RFile64::Seek(enum TSeek,__int64 &)const 
-    ?SetSize@RFile64@@QAEH_J@Z @ 344 NONAME ; public: int __thiscall RFile64::SetSize(__int64)
-    ?Size@RFile64@@QBEHAA_J@Z @ 345 NONAME ; public: int __thiscall RFile64::Size(__int64 &)const 
-    ?Temp@RFile64@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 346 NONAME ; public: int __thiscall RFile64::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
-    ?UnLock@RFile64@@QBEH_J0@Z @ 347 NONAME ; public: int __thiscall RFile64::UnLock(__int64,__int64)const 
-    ?Write@RFile64@@QAEHIABVTDesC8@@@Z @ 348 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &)
-    ?Write@RFile64@@QAEHIABVTDesC8@@H@Z @ 349 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int)
-    ?Write@RFile64@@QAEH_JABVTDesC8@@@Z @ 350 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &)
-    ?Write@RFile64@@QAEH_JABVTDesC8@@H@Z @ 351 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &,int)
-    ?Write@RFile64@@QAEXIABVTDesC8@@AAVTRequestStatus@@@Z @ 352 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,class TRequestStatus &)
-    ?Write@RFile64@@QAEXIABVTDesC8@@HAAVTRequestStatus@@@Z @ 353 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int,class TRequestStatus &)
-    ?Write@RFile64@@QAEX_JABVTDesC8@@AAVTRequestStatus@@@Z @ 354 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,class TRequestStatus &)
-    ?Write@RFile64@@QAEX_JABVTDesC8@@HAAVTRequestStatus@@@Z @ 355 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,int,class TRequestStatus &)
-    ?IsValidName@RFs@@QAEHABVTDesC16@@AAVTNameValidParam@1@@Z @ 356 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,class RFs::TNameValidParam &)
-    ?Close@RFs@@QAEXXZ @ 357 NONAME ; public: void __thiscall RFs::Close(void)
-    ??1CFsNotify@@UAE@XZ @ 358 NONAME ; public: virtual __thiscall CFsNotify::~CFsNotify(void)
-    ?AddNotification@CFsNotify@@QAEHIABVTDesC16@@0@Z @ 359 NONAME ; public: int __thiscall CFsNotify::AddNotification(unsigned int,class TDesC16 const &,class TDesC16 const &)
-    ?Attributes@TFsNotification@@QBEHAAI0@Z @ 360 NONAME ; public: int __thiscall TFsNotification::Attributes(unsigned int &,unsigned int &)const 
-    ?CancelNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 361 NONAME ; public: int __thiscall CFsNotify::CancelNotifications(class TRequestStatus &)
-    ?FileSize@TFsNotification@@QBEHAA_J@Z @ 362 NONAME ; public: int __thiscall TFsNotification::FileSize(__int64 &)const 
-    ?NewL@CFsNotify@@SAPAV1@AAVRFs@@H@Z @ 363 NONAME ; public: static class CFsNotify * __cdecl CFsNotify::NewL(class RFs &,int)
-    ?NewName@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 364 NONAME ; public: int __thiscall TFsNotification::NewName(class TPtrC16 &)const 
-    ?NextNotification@CFsNotify@@QAEPBVTFsNotification@@XZ @ 365 NONAME ; public: class TFsNotification const * __thiscall CFsNotify::NextNotification(void)
-    ?NotificationType@TFsNotification@@QBE?AW4TFsNotificationType@1@XZ @ 366 NONAME ; public: enum TFsNotification::TFsNotificationType __thiscall TFsNotification::NotificationType(void)const 
-    ?Path@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 367 NONAME ; public: int __thiscall TFsNotification::Path(class TPtrC16 &)const 
-    ?RemoveNotifications@CFsNotify@@QAEHXZ @ 368 NONAME ; public: int __thiscall CFsNotify::RemoveNotifications(void)
-    ?RequestNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 369 NONAME ; public: int __thiscall CFsNotify::RequestNotifications(class TRequestStatus &)
-    ?SupportedFileSystemName@RFs@@QBEHAAVTDes16@@HH@Z @ 370 NONAME ; public: int __thiscall RFs::SupportedFileSystemName(class TDes16 &,int,int)const 
+	??0CDir@@IAE@XZ @ 1 NONAME ; protected: __thiscall CDir::CDir(void)
+	??0CFileBase@@IAE@AAVRFs@@@Z @ 2 NONAME ; protected: __thiscall CFileBase::CFileBase(class RFs &)
+	??0TDriveUnit@@QAE@ABVTDesC16@@@Z @ 3 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(class TDesC16 const &)
+	??0TDriveUnit@@QAE@H@Z @ 4 NONAME ; public: __thiscall TDriveUnit::TDriveUnit(int)
+	??0TEntryArray@@QAE@XZ @ 5 NONAME ; public: __thiscall TEntryArray::TEntryArray(void)
+	??0TFileText@@QAE@XZ @ 6 NONAME ; public: __thiscall TFileText::TFileText(void)
+	??0TFindFile@@QAE@AAVRFs@@@Z @ 7 NONAME ; public: __thiscall TFindFile::TFindFile(class RFs &)
+	??0TOpenFileScan@@QAE@AAVRFs@@@Z @ 8 NONAME ; public: __thiscall TOpenFileScan::TOpenFileScan(class RFs &)
+	??0TParseBase@@QAE@XZ @ 9 NONAME ; public: __thiscall TParseBase::TParseBase(void)
+	??0TParsePtr@@QAE@AAVTDes16@@@Z @ 10 NONAME ; public: __thiscall TParsePtr::TParsePtr(class TDes16 &)
+	??0TParsePtrC@@QAE@ABVTDesC16@@@Z @ 11 NONAME ; public: __thiscall TParsePtrC::TParsePtrC(class TDesC16 const &)
+	??0TVolumeInfo@@QAE@XZ @ 12 NONAME ; public: __thiscall TVolumeInfo::TVolumeInfo(void)
+	??1CDir@@UAE@XZ @ 13 NONAME ; public: virtual __thiscall CDir::~CDir(void)
+	??1CDirScan@@UAE@XZ @ 14 NONAME ; public: virtual __thiscall CDirScan::~CDirScan(void)
+	??1CFileBase@@MAE@XZ @ 15 NONAME ; protected: virtual __thiscall CFileBase::~CFileBase(void)
+	??4TDriveUnit@@QAEAAV0@ABVTDesC16@@@Z @ 16 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(class TDesC16 const &)
+	??4TDriveUnit@@QAEAAV0@H@Z @ 17 NONAME ; public: class TDriveUnit & __thiscall TDriveUnit::operator=(int)
+	??ACDir@@QBEABVTEntry@@H@Z @ 18 NONAME ; public: class TEntry const & __thiscall CDir::operator[](int)const 
+	??ATEntryArray@@QBEABVTEntry@@H@Z @ 19 NONAME ; public: class TEntry const & __thiscall TEntryArray::operator[](int)const 
+	?AbbreviatedPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 20 NONAME ; public: class TPtrC16  __thiscall CDirScan::AbbreviatedPath(void)
+	?AbbreviatedPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 21 NONAME ; public: class TPtrC16  __thiscall CFileBase::AbbreviatedPath(void)
+	?AddDir@TParseBase@@QAEHABVTDesC16@@@Z @ 22 NONAME ; public: int __thiscall TParseBase::AddDir(class TDesC16 const &)
+	?AddFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 23 NONAME ; public: int __thiscall RFs::AddFileSystem(class TDesC16 const &)const 
+	?AddL@CDir@@IAEXABVTEntry@@@Z @ 24 NONAME ; protected: void __thiscall CDir::AddL(class TEntry const &)
+	?Att@RFile@@QBEHAAI@Z @ 25 NONAME ; public: int __thiscall RFile::Att(unsigned int &)const 
+	?Att@RFs@@QBEHABVTDesC16@@AAI@Z @ 26 NONAME ; public: int __thiscall RFs::Att(class TDesC16 const &,unsigned int &)const 
+	?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@I@Z @ 27 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int)
+	?Attribs@CFileMan@@QAEHABVTDesC16@@IIABVTTime@@IAAVTRequestStatus@@@Z @ 28 NONAME ; public: int __thiscall CFileMan::Attribs(class TDesC16 const &,unsigned int,unsigned int,class TTime const &,unsigned int,class TRequestStatus &)
+	?BytesTransferredByCopyStep@CFileMan@@QAEHXZ @ 29 NONAME ; public: int __thiscall CFileMan::BytesTransferredByCopyStep(void)
+	?ChangeMode@RFile@@QAEHW4TFileMode@@@Z @ 30 NONAME ; public: int __thiscall RFile::ChangeMode(enum TFileMode)
+	?CharToDrive@RFs@@SAHVTChar@@AAH@Z @ 31 NONAME ; public: static int __cdecl RFs::CharToDrive(class TChar,int &)
+	?CheckDisk@RFs@@QBEHABVTDesC16@@@Z @ 32 NONAME ; public: int __thiscall RFs::CheckDisk(class TDesC16 const &)const 
+	?ClearPassword@RFs@@QAEHHABV?$TBuf8@$0BA@@@@Z @ 33 NONAME ; public: int __thiscall RFs::ClearPassword(int,class TBuf8<16> const &)
+	?Duplicate@RFile@@QAEHABV1@W4TOwnerType@@@Z @ 34 NONAME ; public: int __thiscall RFile::Duplicate(class RFile const &,enum TOwnerType)
+	?Close@RRawDisk@@QAEXXZ @ 35 NONAME ; public: void __thiscall RRawDisk::Close(void)
+	?Compress@CDir@@IAEXXZ @ 36 NONAME ; protected: void __thiscall CDir::Compress(void)
+	?Connect@RFs@@QAEHH@Z @ 37 NONAME ; public: int __thiscall RFs::Connect(int)
+	?ConstructL@CFileBase@@IAEXXZ @ 38 NONAME ; protected: void __thiscall CFileBase::ConstructL(void)
+	?ControlIo@RFs@@QAEHHHPAX0@Z @ 39 NONAME ; public: int __thiscall RFs::ControlIo(int,int,void *,void *)
+	?Copy@CFileMan@@QAEHABVTDesC16@@0I@Z @ 40 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int)
+	?Copy@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 41 NONAME ; public: int __thiscall CFileMan::Copy(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+	?Count@CDir@@QBEHXZ @ 42 NONAME ; public: int __thiscall CDir::Count(void)const 
+	?Count@TEntryArray@@QBEHXZ @ 43 NONAME ; public: int __thiscall TEntryArray::Count(void)const 
+	?Create@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 44 NONAME ; public: int __thiscall RFile::Create(class RFs &,class TDesC16 const &,unsigned int)
+	?CurrentAction@CFileMan@@QAE?AW4TAction@1@XZ @ 45 NONAME ; public: enum CFileMan::TAction  __thiscall CFileMan::CurrentAction(void)
+	?CurrentEntry@CFileBase@@QAEABVTEntry@@XZ @ 46 NONAME ; public: class TEntry const & __thiscall CFileBase::CurrentEntry(void)
+	?DefaultPath@RFs@@QBEHAAVTDes16@@@Z @ 47 NONAME ; public: int __thiscall RFs::DefaultPath(class TDes16 &)const 
+	?Delete@CFileMan@@QAEHABVTDesC16@@I@Z @ 48 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int)
+	?Delete@CFileMan@@QAEHABVTDesC16@@IAAVTRequestStatus@@@Z @ 49 NONAME ; public: int __thiscall CFileMan::Delete(class TDesC16 const &,unsigned int,class TRequestStatus &)
+	?Delete@RFs@@QAEHABVTDesC16@@@Z @ 50 NONAME ; public: int __thiscall RFs::Delete(class TDesC16 const &)
+	?DismountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 51 NONAME ; public: int __thiscall RFs::DismountFileSystem(class TDesC16 const &,int)const 
+	?Drive@RFs@@QBEHAAVTDriveInfo@@H@Z @ 52 NONAME ; public: int __thiscall RFs::Drive(class TDriveInfo &,int)const 
+	?Drive@TParseBase@@QBE?AVTPtrC16@@XZ @ 53 NONAME ; public: class TPtrC16  __thiscall TParseBase::Drive(void)const 
+	?DriveAndPath@TParseBase@@QBE?AVTPtrC16@@XZ @ 54 NONAME ; public: class TPtrC16  __thiscall TParseBase::DriveAndPath(void)const 
+	?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@@Z @ 55 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &)const 
+	?DrivePresent@TParseBase@@QBEHXZ @ 56 NONAME ; public: int __thiscall TParseBase::DrivePresent(void)const 
+	?DriveToChar@RFs@@SAHHAAVTChar@@@Z @ 57 NONAME ; public: static int __cdecl RFs::DriveToChar(int,class TChar &)
+	?Entry@RFs@@QBEHABVTDesC16@@AAVTEntry@@@Z @ 58 NONAME ; public: int __thiscall RFs::Entry(class TDesC16 const &,class TEntry &)const 
+	?Ext@TParseBase@@QBE?AVTPtrC16@@XZ @ 59 NONAME ; public: class TPtrC16  __thiscall TParseBase::Ext(void)const 
+	?ExtPresent@TParseBase@@QBEHXZ @ 60 NONAME ; public: int __thiscall TParseBase::ExtPresent(void)const 
+	?ExtractL@CDir@@IAEXHAAPAV1@@Z @ 61 NONAME ; protected: void __thiscall CDir::ExtractL(int,class CDir * &)
+	?FileSystemName@RFs@@QBEHAAVTDes16@@H@Z @ 62 NONAME ; public: int __thiscall RFs::FileSystemName(class TDes16 &,int)const 
+	?Find@TFindFile@@QAEHXZ @ 63 NONAME ; public: int __thiscall TFindFile::Find(void)
+	?FindByDir@TFindFile@@QAEHABVTDesC16@@0@Z @ 64 NONAME ; public: int __thiscall TFindFile::FindByDir(class TDesC16 const &,class TDesC16 const &)
+	?FindByPath@TFindFile@@QAEHABVTDesC16@@PBV2@@Z @ 65 NONAME ; public: int __thiscall TFindFile::FindByPath(class TDesC16 const &,class TDesC16 const *)
+	?FindWild@TFindFile@@QAEHAAPAVCDir@@@Z @ 66 NONAME ; public: int __thiscall TFindFile::FindWild(class CDir * &)
+	?FindWildByDir@TFindFile@@QAEHABVTDesC16@@0AAPAVCDir@@@Z @ 67 NONAME ; public: int __thiscall TFindFile::FindWildByDir(class TDesC16 const &,class TDesC16 const &,class CDir * &)
+	?FindWildByPath@TFindFile@@QAEHABVTDesC16@@PBV2@AAPAVCDir@@@Z @ 68 NONAME ; public: int __thiscall TFindFile::FindWildByPath(class TDesC16 const &,class TDesC16 const *,class CDir * &)
+	?Flush@RFile@@QAEHXZ @ 69 NONAME ; public: int __thiscall RFile::Flush(void)
+	?FullName@TParseBase@@QBEABVTDesC16@@XZ @ 70 NONAME ; public: class TDesC16 const & __thiscall TParseBase::FullName(void)const 
+	?FullPath@CDirScan@@QAE?AVTPtrC16@@XZ @ 71 NONAME ; public: class TPtrC16  __thiscall CDirScan::FullPath(void)
+	?FullPath@CFileBase@@QAE?AVTPtrC16@@XZ @ 72 NONAME ; public: class TPtrC16  __thiscall CFileBase::FullPath(void)
+	?GetCurrentSource@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 73 NONAME ; public: void __thiscall CFileMan::GetCurrentSource(class TBuf<256> &)
+	?GetCurrentTarget@CFileMan@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 74 NONAME ; public: void __thiscall CFileMan::GetCurrentTarget(class TBuf<256> &)
+	?GetDir@RFs@@QBEHABVTDesC16@@ABVTUidType@@IAAPAVCDir@@@Z @ 75 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,class TUidType const &,unsigned int,class CDir * &)const 
+	?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@1@Z @ 76 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &,class CDir * &)const 
+	?GetDir@RFs@@QBEHABVTDesC16@@IIAAPAVCDir@@@Z @ 77 NONAME ; public: int __thiscall RFs::GetDir(class TDesC16 const &,unsigned int,unsigned int,class CDir * &)const 
+	?GetDriveName@RFs@@QBEHHAAVTDes16@@@Z @ 78 NONAME ; public: int __thiscall RFs::GetDriveName(int,class TDes16 &)const 
+	?GetLastError@CFileBase@@QAEHXZ @ 79 NONAME ; public: int __thiscall CFileBase::GetLastError(void)
+	?GetLongName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 80 NONAME ; public: int __thiscall RFs::GetLongName(class TDesC16 const &,class TDes16 &)const 
+	?GetMoreInfoAboutError@CFileBase@@QAE?AW4TFileManError@@XZ @ 81 NONAME ; public: enum TFileManError  __thiscall CFileBase::GetMoreInfoAboutError(void)
+	?GetNotifyUser@RFs@@QAEHXZ @ 82 NONAME ; public: int __thiscall RFs::GetNotifyUser(void)
+	?GetShortName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 83 NONAME ; public: int __thiscall RFs::GetShortName(class TDesC16 const &,class TDes16 &)const 
+	?IsArchive@TEntry@@QBEHXZ @ 84 NONAME ; public: int __thiscall TEntry::IsArchive(void)const 
+	?IsDir@TEntry@@QBEHXZ @ 85 NONAME ; public: int __thiscall TEntry::IsDir(void)const 
+	?IsExtWild@TParseBase@@QBEHXZ @ 86 NONAME ; public: int __thiscall TParseBase::IsExtWild(void)const 
+	?IsFileInRom@RFs@@QBEPAEABVTDesC16@@@Z @ 87 NONAME ; public: unsigned char * __thiscall RFs::IsFileInRom(class TDesC16 const &)const 
+	?IsFileOpen@RFs@@QBEHABVTDesC16@@AAH@Z @ 88 NONAME ; public: int __thiscall RFs::IsFileOpen(class TDesC16 const &,int &)const 
+	?IsHidden@TEntry@@QBEHXZ @ 89 NONAME ; public: int __thiscall TEntry::IsHidden(void)const 
+	?IsKMatchAny@TParseBase@@QBEHXZ @ 90 NONAME ; public: int __thiscall TParseBase::IsKMatchAny(void)const 
+	?IsKMatchOne@TParseBase@@QBEHXZ @ 91 NONAME ; public: int __thiscall TParseBase::IsKMatchOne(void)const 
+	?IsNameWild@TParseBase@@QBEHXZ @ 92 NONAME ; public: int __thiscall TParseBase::IsNameWild(void)const 
+	?IsReadOnly@TEntry@@QBEHXZ @ 93 NONAME ; public: int __thiscall TEntry::IsReadOnly(void)const 
+	?IsRomAddress@RFs@@SAHPAX@Z @ 94 NONAME ; public: static int __cdecl RFs::IsRomAddress(void *)
+	?IsRoot@TParseBase@@QBEHXZ @ 95 NONAME ; public: int __thiscall TParseBase::IsRoot(void)const 
+	?IsSystem@TEntry@@QBEHXZ @ 96 NONAME ; public: int __thiscall TEntry::IsSystem(void)const 
+	?IsValidDrive@RFs@@SAHH@Z @ 97 NONAME ; public: static int __cdecl RFs::IsValidDrive(int)
+	?IsValidName@RFs@@QBEHABVTDesC16@@@Z @ 98 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &)const 
+	?IsValidName@RFs@@QBEHABVTDesC16@@AAG@Z @ 99 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,unsigned short &)const 
+	?IsWild@TParseBase@@QBEHXZ @ 100 NONAME ; public: int __thiscall TParseBase::IsWild(void)const 
+	?LoaderHeapFunction@RFs@@QAEHHPAX0@Z @ 101 NONAME ; public: int __thiscall RFs::LoaderHeapFunction(int,void *,void *)
+	?Lock@RFile@@QBEHHH@Z @ 102 NONAME ; public: int __thiscall RFile::Lock(int,int)const 
+	?LockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@0H@Z @ 103 NONAME ; public: int __thiscall RFs::LockDrive(int,class TBuf8<16> const &,class TBuf8<16> const &,int)
+	?MkDir@RFs@@QAEHABVTDesC16@@@Z @ 104 NONAME ; public: int __thiscall RFs::MkDir(class TDesC16 const &)
+	?MkDirAll@RFs@@QAEHABVTDesC16@@@Z @ 105 NONAME ; public: int __thiscall RFs::MkDirAll(class TDesC16 const &)
+	?Modified@RFile@@QBEHAAVTTime@@@Z @ 106 NONAME ; public: int __thiscall RFile::Modified(class TTime &)const 
+	?Modified@RFs@@QBEHABVTDesC16@@AAVTTime@@@Z @ 107 NONAME ; public: int __thiscall RFs::Modified(class TDesC16 const &,class TTime &)const 
+	?MountFileSystem@RFs@@QBEHABVTDesC16@@H@Z @ 108 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int)const 
+	?Move@CFileMan@@QAEHABVTDesC16@@0I@Z @ 109 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int)
+	?Move@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 110 NONAME ; public: int __thiscall CFileMan::Move(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+	?Name@TDriveUnit@@QBE?AV?$TBuf@$01@@XZ @ 111 NONAME ; public: class TBuf<2>  __thiscall TDriveUnit::Name(void)const 
+	?Name@TParseBase@@QBE?AVTPtrC16@@XZ @ 112 NONAME ; public: class TPtrC16  __thiscall TParseBase::Name(void)const 
+	?NameAndExt@TParseBase@@QBE?AVTPtrC16@@XZ @ 113 NONAME ; public: class TPtrC16  __thiscall TParseBase::NameAndExt(void)const 
+	?NameBuf@TParse@@MAEAAVTDes16@@XZ @ 114 NONAME ; protected: virtual class TDes16 & __thiscall TParse::NameBuf(void)
+	?NameBuf@TParsePtr@@MAEAAVTDes16@@XZ @ 115 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtr::NameBuf(void)
+	?NameBuf@TParsePtrC@@MAEAAVTDes16@@XZ @ 116 NONAME ; protected: virtual class TDes16 & __thiscall TParsePtrC::NameBuf(void)
+	?NameBufC@TParse@@MBEABVTDesC16@@XZ @ 117 NONAME ; protected: virtual class TDesC16 const & __thiscall TParse::NameBufC(void)const 
+	?NameBufC@TParsePtr@@MBEABVTDesC16@@XZ @ 118 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtr::NameBufC(void)const 
+	?NameBufC@TParsePtrC@@MBEABVTDesC16@@XZ @ 119 NONAME ; protected: virtual class TDesC16 const & __thiscall TParsePtrC::NameBufC(void)const 
+	?NameOrExtPresent@TParseBase@@QBEHXZ @ 120 NONAME ; public: int __thiscall TParseBase::NameOrExtPresent(void)const 
+	?NamePresent@TParseBase@@QBEHXZ @ 121 NONAME ; public: int __thiscall TParseBase::NamePresent(void)const 
+	?NewL@CDir@@KAPAV1@XZ @ 122 NONAME ; protected: static class CDir * __cdecl CDir::NewL(void)
+	?NewL@CDirScan@@SAPAV1@AAVRFs@@@Z @ 123 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewL(class RFs &)
+	?NewL@CFileMan@@SAPAV1@AAVRFs@@@Z @ 124 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &)
+	?NewL@CFileMan@@SAPAV1@AAVRFs@@PAVMFileManObserver@@@Z @ 125 NONAME ; public: static class CFileMan * __cdecl CFileMan::NewL(class RFs &,class MFileManObserver *)
+	?NewLC@CDirScan@@SAPAV1@AAVRFs@@@Z @ 126 NONAME ; public: static class CDirScan * __cdecl CDirScan::NewLC(class RFs &)
+	?Next@RFormat@@QAEHAAH@Z @ 127 NONAME ; public: int __thiscall RFormat::Next(int &)
+	?Next@RFormat@@QAEXAAV?$TPckgBuf@H@@AAVTRequestStatus@@@Z @ 128 NONAME ; public: void __thiscall RFormat::Next(class TPckgBuf<int> &,class TRequestStatus &)
+	?NextL@CDirScan@@QAEXAAPAVCDir@@@Z @ 129 NONAME ; public: void __thiscall CDirScan::NextL(class CDir * &)
+	?NextL@TOpenFileScan@@QAEXAAPAVCDir@@@Z @ 130 NONAME ; public: void __thiscall TOpenFileScan::NextL(class CDir * &)
+	?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@@Z @ 131 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &)
+	?NotifyChange@RFs@@QAEXW4TNotifyType@@AAVTRequestStatus@@ABVTDesC16@@@Z @ 132 NONAME ; public: void __thiscall RFs::NotifyChange(enum TNotifyType,class TRequestStatus &,class TDesC16 const &)
+	?NotifyChangeCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 133 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(class TRequestStatus &)
+	?NotifyChangeCancel@RFs@@QAEXXZ @ 134 NONAME ; public: void __thiscall RFs::NotifyChangeCancel(void)
+	?NotifyFileManEnded@MFileManObserver@@UAE?AW4TControl@1@XZ @ 135 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManEnded(void)
+	?NotifyFileManOperation@MFileManObserver@@UAE?AW4TControl@1@XZ @ 136 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManOperation(void)
+	?NotifyFileManStarted@MFileManObserver@@UAE?AW4TControl@1@XZ @ 137 NONAME ; public: virtual enum MFileManObserver::TControl  __thiscall MFileManObserver::NotifyFileManStarted(void)
+	?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@ABVTUidType@@@Z @ 138 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,class TUidType const &)
+	?Open@RDir@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 139 NONAME ; public: int __thiscall RDir::Open(class RFs &,class TDesC16 const &,unsigned int)
+	?Open@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 140 NONAME ; public: int __thiscall RFile::Open(class RFs &,class TDesC16 const &,unsigned int)
+	?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAH@Z @ 141 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &)
+	?Open@RRawDisk@@QAEHAAVRFs@@H@Z @ 142 NONAME ; public: int __thiscall RRawDisk::Open(class RFs &,int)
+	?Parse@RFs@@QBEHABVTDesC16@@0AAVTParse@@@Z @ 143 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TDesC16 const &,class TParse &)const 
+	?Parse@RFs@@QBEHABVTDesC16@@AAVTParse@@@Z @ 144 NONAME ; public: int __thiscall RFs::Parse(class TDesC16 const &,class TParse &)const 
+	?Path@TParseBase@@QBE?AVTPtrC16@@XZ @ 145 NONAME ; public: class TPtrC16  __thiscall TParseBase::Path(void)const 
+	?PathPresent@TParseBase@@QBEHXZ @ 146 NONAME ; public: int __thiscall TParseBase::PathPresent(void)const 
+	?PopDir@TParseBase@@QAEHXZ @ 147 NONAME ; public: int __thiscall TParseBase::PopDir(void)
+	?Read@RDir@@QBEHAAVTEntry@@@Z @ 148 NONAME ; public: int __thiscall RDir::Read(class TEntry &)const 
+	?Read@RDir@@QBEHAAVTEntryArray@@@Z @ 149 NONAME ; public: int __thiscall RDir::Read(class TEntryArray &)const 
+	?Read@RDir@@QBEXAAV?$TPckg@VTEntry@@@@AAVTRequestStatus@@@Z @ 150 NONAME ; public: void __thiscall RDir::Read(class TPckg<class TEntry> &,class TRequestStatus &)const 
+	?Read@RDir@@QBEXAAVTEntryArray@@AAVTRequestStatus@@@Z @ 151 NONAME ; public: void __thiscall RDir::Read(class TEntryArray &,class TRequestStatus &)const 
+	?Read@RFile@@QBEHAAVTDes8@@@Z @ 152 NONAME ; public: int __thiscall RFile::Read(class TDes8 &)const 
+	?Read@RFile@@QBEHAAVTDes8@@H@Z @ 153 NONAME ; public: int __thiscall RFile::Read(class TDes8 &,int)const 
+	?Read@RFile@@QBEHHAAVTDes8@@@Z @ 154 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &)const 
+	?Read@RFile@@QBEHHAAVTDes8@@H@Z @ 155 NONAME ; public: int __thiscall RFile::Read(int,class TDes8 &,int)const 
+	?Read@RFile@@QBEXAAVTDes8@@AAVTRequestStatus@@@Z @ 156 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,class TRequestStatus &)const 
+	?Read@RFile@@QBEXAAVTDes8@@HAAVTRequestStatus@@@Z @ 157 NONAME ; public: void __thiscall RFile::Read(class TDes8 &,int,class TRequestStatus &)const 
+	?Read@RFile@@QBEXHAAVTDes8@@AAVTRequestStatus@@@Z @ 158 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,class TRequestStatus &)const 
+	?Read@RFile@@QBEXHAAVTDes8@@HAAVTRequestStatus@@@Z @ 159 NONAME ; public: void __thiscall RFile::Read(int,class TDes8 &,int,class TRequestStatus &)const 
+	?Read@_RRawDisk@@QAEHHAAVTDes8@@@Z @ 160 NONAME ; public: int __thiscall _RRawDisk::Read(int,class TDes8 &)
+	?Read@TFileText@@QAEHAAVTDes16@@@Z @ 161 NONAME ; public: int __thiscall TFileText::Read(class TDes16 &)
+	?ReadFileSection_RESERVED@RFs@@ABEHABVTDesC16@@HAAVTDes8@@H@Z @ 162 NONAME ; public: int __thiscall RFs::ReadFileSection_RESERVED(class TDesC16 const &,int,class TDes8 &,int)const 
+	?RealName@RFs@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 163 NONAME ; public: int __thiscall RFs::RealName(class TDesC16 const &,class TDes16 &)const 
+	?RemoveFileSystem@RFs@@QBEHABVTDesC16@@@Z @ 164 NONAME ; public: int __thiscall RFs::RemoveFileSystem(class TDesC16 const &)const 
+	?Rename@CFileMan@@QAEHABVTDesC16@@0I@Z @ 165 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int)
+	?Rename@CFileMan@@QAEHABVTDesC16@@0IAAVTRequestStatus@@@Z @ 166 NONAME ; public: int __thiscall CFileMan::Rename(class TDesC16 const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+	?Rename@RFile@@QAEHABVTDesC16@@@Z @ 167 NONAME ; public: int __thiscall RFile::Rename(class TDesC16 const &)
+	?Rename@RFs@@QAEHABVTDesC16@@0@Z @ 168 NONAME ; public: int __thiscall RFs::Rename(class TDesC16 const &,class TDesC16 const &)
+	?Replace@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 169 NONAME ; public: int __thiscall RFile::Replace(class RFs &,class TDesC16 const &,unsigned int)
+	?Replace@RFs@@QAEHABVTDesC16@@0@Z @ 170 NONAME ; public: int __thiscall RFs::Replace(class TDesC16 const &,class TDesC16 const &)
+	?ResourceCount@RFs@@QBEHXZ @ 171 NONAME ; public: int __thiscall RFs::ResourceCount(void)const 
+	?ResourceCountMarkEnd@RFs@@QBEXXZ @ 172 NONAME ; public: void __thiscall RFs::ResourceCountMarkEnd(void)const 
+	?ResourceCountMarkStart@RFs@@QBEXXZ @ 173 NONAME ; public: void __thiscall RFs::ResourceCountMarkStart(void)const 
+	?RmDir@CFileMan@@QAEHABVTDesC16@@@Z @ 174 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &)
+	?RmDir@CFileMan@@QAEHABVTDesC16@@AAVTRequestStatus@@@Z @ 175 NONAME ; public: int __thiscall CFileMan::RmDir(class TDesC16 const &,class TRequestStatus &)
+	?RmDir@RFs@@QAEHABVTDesC16@@@Z @ 176 NONAME ; public: int __thiscall RFs::RmDir(class TDesC16 const &)
+	?RunInSeparateThreadL@CFileBase@@IAEXP6AHPAX@Z@Z @ 177 NONAME ; protected: void __thiscall CFileBase::RunInSeparateThreadL(int (__cdecl*)(void *))
+	?RunL@CFileBase@@IAEXXZ @ 178 NONAME ; protected: void __thiscall CFileBase::RunL(void)
+	?ScanDrive@RFs@@QBEHABVTDesC16@@@Z @ 179 NONAME ; public: int __thiscall RFs::ScanDrive(class TDesC16 const &)const 
+	?Seek@RFile@@QBEHW4TSeek@@AAH@Z @ 180 NONAME ; public: int __thiscall RFile::Seek(enum TSeek,int &)const 
+	?Seek@TFileText@@QAEHW4TSeek@@@Z @ 181 NONAME ; public: int __thiscall TFileText::Seek(enum TSeek)
+	?SessionPath@RFs@@QBEHAAVTDes16@@@Z @ 182 NONAME ; public: int __thiscall RFs::SessionPath(class TDes16 &)const 
+	?Set@RFile@@QAEHABVTTime@@II@Z @ 183 NONAME ; public: int __thiscall RFile::Set(class TTime const &,unsigned int,unsigned int)
+	?Set@TFileText@@QAEXAAVRFile@@@Z @ 184 NONAME ; public: void __thiscall TFileText::Set(class RFile &)
+	?Set@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 185 NONAME ; public: int __thiscall TParse::Set(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
+	?SetAllocFailure@RFs@@QAEHH@Z @ 186 NONAME ; public: int __thiscall RFs::SetAllocFailure(int)
+	?SetAtt@RFile@@QAEHII@Z @ 187 NONAME ; public: int __thiscall RFile::SetAtt(unsigned int,unsigned int)
+	?SetAtt@RFs@@QAEHABVTDesC16@@II@Z @ 188 NONAME ; public: int __thiscall RFs::SetAtt(class TDesC16 const &,unsigned int,unsigned int)
+	?SetDebugRegister@RFs@@QAEHH@Z @ 189 NONAME ; public: int __thiscall RFs::SetDebugRegister(int)
+	?SetDefaultPath@RFs@@QAEHABVTDesC16@@@Z @ 190 NONAME ; public: int __thiscall RFs::SetDefaultPath(class TDesC16 const &)
+	?SetDriveName@RFs@@QAEHHABVTDesC16@@@Z @ 191 NONAME ; public: int __thiscall RFs::SetDriveName(int,class TDesC16 const &)
+	?SetEntry@RFs@@QAEHABVTDesC16@@ABVTTime@@II@Z @ 192 NONAME ; public: int __thiscall RFs::SetEntry(class TDesC16 const &,class TTime const &,unsigned int,unsigned int)
+	?SetErrorCondition@RFs@@QAEHHH@Z @ 193 NONAME ; public: int __thiscall RFs::SetErrorCondition(int,int)
+	?SetModified@RFile@@QAEHABVTTime@@@Z @ 194 NONAME ; public: int __thiscall RFile::SetModified(class TTime const &)
+	?SetModified@RFs@@QAEHABVTDesC16@@ABVTTime@@@Z @ 195 NONAME ; public: int __thiscall RFs::SetModified(class TDesC16 const &,class TTime const &)
+	?SetNoWild@TParse@@QAEHABVTDesC16@@PBV2@1@Z @ 196 NONAME ; public: int __thiscall TParse::SetNoWild(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)
+	?SetNotifyUser@RFs@@QAEXH@Z @ 197 NONAME ; public: void __thiscall RFs::SetNotifyUser(int)
+	?SetObserver@CFileBase@@QAEXPAVMFileManObserver@@@Z @ 198 NONAME ; public: void __thiscall CFileBase::SetObserver(class MFileManObserver *)
+	?SetScanDataL@CDirScan@@QAEXABVTDesC16@@IIW4TScanDirection@1@@Z @ 199 NONAME ; public: void __thiscall CDirScan::SetScanDataL(class TDesC16 const &,unsigned int,unsigned int,enum CDirScan::TScanDirection)
+	?SetSessionPath@RFs@@QAEHABVTDesC16@@@Z @ 200 NONAME ; public: int __thiscall RFs::SetSessionPath(class TDesC16 const &)
+	?SetSize@RFile@@QAEHH@Z @ 201 NONAME ; public: int __thiscall RFile::SetSize(int)
+	?SetSubst@RFs@@QAEHABVTDesC16@@H@Z @ 202 NONAME ; public: int __thiscall RFs::SetSubst(class TDesC16 const &,int)
+	?SetVolumeLabel@RFs@@QAEHABVTDesC16@@H@Z @ 203 NONAME ; public: int __thiscall RFs::SetVolumeLabel(class TDesC16 const &,int)
+	?Size@RFile@@QBEHAAH@Z @ 204 NONAME ; public: int __thiscall RFile::Size(int &)const 
+	?Sort@CDir@@QAEHI@Z @ 205 NONAME ; public: int __thiscall CDir::Sort(unsigned int)
+	?Subst@RFs@@QBEHAAVTDes16@@H@Z @ 206 NONAME ; public: int __thiscall RFs::Subst(class TDes16 &,int)const 
+	?Temp@RFile@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 207 NONAME ; public: int __thiscall RFile::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
+	?ThreadId@TOpenFileScan@@QBE?AVTThreadId@@XZ @ 208 NONAME ; public: class TThreadId  __thiscall TOpenFileScan::ThreadId(void)const 
+	?UnLock@RFile@@QBEHHH@Z @ 209 NONAME ; public: int __thiscall RFile::UnLock(int,int)const 
+	?UnlockDrive@RFs@@QAEHHABV?$TBuf8@$0BA@@@H@Z @ 210 NONAME ; public: int __thiscall RFs::UnlockDrive(int,class TBuf8<16> const &,int)
+	?Version@RFs@@QBE?AVTVersion@@XZ @ 211 NONAME ; public: class TVersion  __thiscall RFs::Version(void)const 
+	?Volume@RFs@@QBEHAAVTVolumeInfo@@H@Z @ 212 NONAME ; public: int __thiscall RFs::Volume(class TVolumeInfo &,int)const 
+	?Write@RFile@@QAEHABVTDesC8@@@Z @ 213 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &)
+	?Write@RFile@@QAEHABVTDesC8@@H@Z @ 214 NONAME ; public: int __thiscall RFile::Write(class TDesC8 const &,int)
+	?Write@RFile@@QAEHHABVTDesC8@@@Z @ 215 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &)
+	?Write@RFile@@QAEHHABVTDesC8@@H@Z @ 216 NONAME ; public: int __thiscall RFile::Write(int,class TDesC8 const &,int)
+	?Write@RFile@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 217 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,class TRequestStatus &)
+	?Write@RFile@@QAEXABVTDesC8@@HAAVTRequestStatus@@@Z @ 218 NONAME ; public: void __thiscall RFile::Write(class TDesC8 const &,int,class TRequestStatus &)
+	?Write@RFile@@QAEXHABVTDesC8@@AAVTRequestStatus@@@Z @ 219 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,class TRequestStatus &)
+	?Write@RFile@@QAEXHABVTDesC8@@HAAVTRequestStatus@@@Z @ 220 NONAME ; public: void __thiscall RFile::Write(int,class TDesC8 const &,int,class TRequestStatus &)
+	?Write@_RRawDisk@@QAEHHAAVTDesC8@@@Z @ 221 NONAME ; public: int __thiscall _RRawDisk::Write(int,class TDesC8 &)
+	?Write@TFileText@@QAEHABVTDesC16@@@Z @ 222 NONAME ; public: int __thiscall TFileText::Write(class TDesC16 const &)
+	?DebugNotify@RFs@@QAEXHIAAVTRequestStatus@@@Z @ 223 NONAME ; public: void __thiscall RFs::DebugNotify(int,unsigned int,class TRequestStatus &)
+	?NotifyDiskSpace@RFs@@QAEX_JHAAVTRequestStatus@@@Z @ 224 NONAME ; public: void __thiscall RFs::NotifyDiskSpace(__int64,int,class TRequestStatus &)
+	?NotifyDiskSpaceCancel@RFs@@QAEXAAVTRequestStatus@@@Z @ 225 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(class TRequestStatus &)
+	?NotifyDiskSpaceCancel@RFs@@QAEXXZ @ 226 NONAME ; public: void __thiscall RFs::NotifyDiskSpaceCancel(void)
+	??0TEntry@@QAE@ABV0@@Z @ 227 NONAME ; public: __thiscall TEntry::TEntry(class TEntry const &)
+	??0TEntry@@QAE@XZ @ 228 NONAME ; public: __thiscall TEntry::TEntry(void)
+	??4TEntry@@QAEAAV0@ABV0@@Z @ 229 NONAME ; public: class TEntry & __thiscall TEntry::operator=(class TEntry const &)
+	??0TParse@@QAE@XZ @ 230 NONAME ; public: __thiscall TParse::TParse(void)
+	?Drive@RFile@@QBEHAAHAAVTDriveInfo@@@Z @ 231 NONAME ; public: int __thiscall RFile::Drive(int &,class TDriveInfo &)const 
+	?RemountDrive@RFs@@QAEHHPBVTDesC8@@I@Z @ 232 NONAME ; public: int __thiscall RFs::RemountDrive(int,class TDesC8 const *,unsigned int)
+	?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@HAAH@Z @ 233 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,int,int &)const 
+	?CreatePrivatePath@RFs@@QAEHH@Z @ 234 NONAME ; public: int __thiscall RFs::CreatePrivatePath(int)
+	?PrivatePath@RFs@@QAEHAAVTDes16@@@Z @ 235 NONAME ; public: int __thiscall RFs::PrivatePath(class TDes16 &)
+	?SetSessionToPrivate@RFs@@QAEHH@Z @ 236 NONAME ; public: int __thiscall RFs::SetSessionToPrivate(int)
+	?FileNamesIdentical@@YAHABVTDesC16@@0@Z @ 237 NONAME ; int __cdecl FileNamesIdentical(class TDesC16 const &,class TDesC16 const &)
+	?AddExtension@RFs@@QAEHABVTDesC16@@@Z @ 238 NONAME ; public: int __thiscall RFs::AddExtension(class TDesC16 const &)
+	?DismountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 239 NONAME ; public: int __thiscall RFs::DismountExtension(class TDesC16 const &,int)
+	?ExtensionName@RFs@@QAEHAAVTDes16@@HH@Z @ 240 NONAME ; public: int __thiscall RFs::ExtensionName(class TDes16 &,int,int)
+	?MountExtension@RFs@@QAEHABVTDesC16@@H@Z @ 241 NONAME ; public: int __thiscall RFs::MountExtension(class TDesC16 const &,int)
+	?MountFileSystem@RFs@@QAEHABVTDesC16@@0H@Z @ 242 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int)
+	?RemoveExtension@RFs@@QAEHABVTDesC16@@@Z @ 243 NONAME ; public: int __thiscall RFs::RemoveExtension(class TDesC16 const &)
+	?StartupInitComplete@RFs@@QAEXAAVTRequestStatus@@@Z @ 244 NONAME ; public: void __thiscall RFs::StartupInitComplete(class TRequestStatus &)
+	?SetLocalDriveMapping@RFs@@QAEHABVTDesC8@@@Z @ 245 NONAME ; public: int __thiscall RFs::SetLocalDriveMapping(class TDesC8 const &)
+	?ControlIo@RFs@@QAEHHH@Z @ 246 NONAME ; public: int __thiscall RFs::ControlIo(int,int)
+	?ControlIo@RFs@@QAEHHHAAVTDes8@@@Z @ 247 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&)   ?Adopt@RFile@@QAEHAAVRFs@@AAH@Z @ 246 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int &)
+	?ControlIo@RFs@@QAEHHHAAVTDes8@@0@Z @ 248 NONAME ; public: int __thiscall RFs::ControlIo(int,int,class TDes8&,class TDes8&)
+	?Adopt@RFile@@QAEHAAVRFs@@H@Z @ 249 NONAME ; public: int __thiscall RFile::Adopt(class RFs &,int)
+	?MountFileSystem@RFs@@QAEHABVTDesC16@@0HH@Z @ 250 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,class TDesC16 const &,int,int)
+	?MountFileSystem@RFs@@QBEHABVTDesC16@@HH@Z @ 251 NONAME ; public: int __thiscall RFs::MountFileSystem(class TDesC16 const &,int,int)const 
+	?Read@RRawDisk@@QAEH_JAAVTDes8@@@Z @ 252 NONAME ; public: int __thiscall RRawDisk::Read(__int64,class TDes8 &)
+	?Write@RRawDisk@@QAEH_JAAVTDesC8@@@Z @ 253 NONAME ; public: int __thiscall RRawDisk::Write(__int64,class TDesC8 &)
+	?FinaliseDrives@RFs@@QAEHXZ @ 254 NONAME ; public: int __thiscall RFs::FinaliseDrives(void)
+	?SwapFileSystem@RFs@@QBEHABVTDesC16@@0H@Z @ 255 NONAME ; public: int __thiscall RFs::SwapFileSystem(class TDesC16 const &,class TDesC16 const &,int)const 
+	?ErasePassword@RFs@@QAEHH@Z @ 256 NONAME ; public: int __thiscall RFs::ErasePassword(int)
+	?GetReserveAccess@RFs@@QAEHH@Z @ 257 NONAME ; public: int __thiscall RFs::GetReserveAccess(int)
+	?ReleaseReserveAccess@RFs@@QAEHH@Z @ 258 NONAME ; public: int __thiscall RFs::ReleaseReserveAccess(int)
+	?ReserveDriveSpace@RFs@@QAEHHH@Z @ 259 NONAME ; public: int __thiscall RFs::ReserveDriveSpace(int,int)
+	?AdoptFromClient@RFile@@QAEHABVRMessage2@@HH@Z @ 260 NONAME ; public: int __thiscall RFile::AdoptFromClient(class RMessage2 const &,int,int)
+	?AdoptFromCreator@RFile@@QAEHHH@Z @ 261 NONAME ; public: int __thiscall RFile::AdoptFromCreator(int,int)
+	?AdoptFromServer@RFile@@QAEHHH@Z @ 262 NONAME ; public: int __thiscall RFile::AdoptFromServer(int,int)
+	?TransferToClient@RFile@@QBEHABVRMessage2@@H@Z @ 263 NONAME ; public: int __thiscall RFile::TransferToClient(class RMessage2 const &,int)const 
+	?TransferToProcess@RFile@@QBEHAAVRProcess@@HH@Z @ 264 NONAME ; public: int __thiscall RFile::TransferToProcess(class RProcess &,int,int)const 
+	?TransferToServer@RFile@@QBEHAAVTIpcArgs@@HH@Z @ 265 NONAME ; public: int __thiscall RFile::TransferToServer(class TIpcArgs &,int,int)const 
+	?Name@RFile@@QBEHAAVTDes16@@@Z @ 266 NONAME ; public: int __thiscall RFile::Name(class TDes16 &)const 
+	?Close@RDir@@QAEXXZ @ 267 NONAME ; public: void __thiscall RDir::Close(void)
+	?Close@RFile@@QAEXXZ @ 268 NONAME ; public: void __thiscall RFile::Close(void)
+	?Close@RFormat@@QAEXXZ @ 269 NONAME ; public: void __thiscall RFormat::Close(void)
+	?GetMediaSerialNumber@RFs@@QAEHAAV?$TBuf8@$0EA@@@H@Z @ 270 NONAME ; public: int __thiscall RFs::GetMediaSerialNumber(class TBuf8<64> &,int)
+	?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@I@Z @ 271 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int)
+	?Copy@CFileMan@@QAEHABVRFile@@ABVTDesC16@@IAAVTRequestStatus@@@Z @ 272 NONAME ; public: int __thiscall CFileMan::Copy(class RFile const &,class TDesC16 const &,unsigned int,class TRequestStatus &)
+	?FullName@RFile@@QBEHAAVTDes16@@@Z @ 273 NONAME ; public: int __thiscall RFile::FullName(class TDes16 &)const 
+	?AddPlugin@RFs@@QBEHABVTDesC16@@@Z @ 274 NONAME ; public: int __thiscall RFs::AddPlugin(class TDesC16 const &)const 
+	?Close@RPlugin@@QAEXXZ @ 275 NONAME ; public: void __thiscall RPlugin::Close(void)
+	?DismountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 276 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &)const 
+	?DismountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 277 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int)const 
+	?DismountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 278 NONAME ; public: int __thiscall RFs::DismountPlugin(class TDesC16 const &,int,int)const 
+	?DoCancel@RPlugin@@IBEXI@Z @ 279 NONAME ; protected: void __thiscall RPlugin::DoCancel(unsigned int)const 
+	?DoControl@RPlugin@@IBEHH@Z @ 280 NONAME ; protected: int __thiscall RPlugin::DoControl(int)const 
+	?DoControl@RPlugin@@IBEHHAAVTDes8@@0@Z @ 281 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &,class TDes8 &)const 
+	?DoControl@RPlugin@@IBEHHAAVTDes8@@@Z @ 282 NONAME ; protected: int __thiscall RPlugin::DoControl(int,class TDes8 &)const 
+	?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@@Z @ 283 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &)const 
+	?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@1@Z @ 284 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &,class TDes8 &)const 
+	?DoRequest@RPlugin@@IBEXHAAVTRequestStatus@@AAVTDes8@@@Z @ 285 NONAME ; protected: void __thiscall RPlugin::DoRequest(int,class TRequestStatus &,class TDes8 &)const 
+	?MountPlugin@RFs@@QBEHABVTDesC16@@@Z @ 286 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &)const 
+	?MountPlugin@RFs@@QBEHABVTDesC16@@H@Z @ 287 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int)const 
+	?MountPlugin@RFs@@QBEHABVTDesC16@@HH@Z @ 288 NONAME ; public: int __thiscall RFs::MountPlugin(class TDesC16 const &,int,int)const 
+	?Open@RPlugin@@QAEHAAVRFs@@H@Z @ 289 NONAME ; public: int __thiscall RPlugin::Open(class RFs &,int)
+	?PluginName@RFs@@QAEHAAVTDes16@@HH@Z @ 290 NONAME ; public: int __thiscall RFs::PluginName(class TDes16 &,int,int)
+	?RemovePlugin@RFs@@QBEHABVTDesC16@@@Z @ 291 NONAME ; public: int __thiscall RFs::RemovePlugin(class TDesC16 const &)const 
+	?AllowDismount@RFs@@QBEHH@Z @ 292 NONAME ; public: int __thiscall RFs::AllowDismount(int)const 
+	?NotifyDismount@RFs@@QBEXHAAVTRequestStatus@@W4TNotifyDismountMode@@@Z @ 293 NONAME ; public: void __thiscall RFs::NotifyDismount(int,class TRequestStatus &,enum TNotifyDismountMode)const 
+	?NotifyDismountCancel@RFs@@QBEXAAVTRequestStatus@@@Z @ 294 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(class TRequestStatus &)const 
+	?NotifyDismountCancel@RFs@@QBEXXZ @ 295 NONAME ; public: void __thiscall RFs::NotifyDismountCancel(void)const 
+	?Open@RFormat@@QAEHAAVRFs@@ABVTDesC16@@IAAHABVTDesC8@@@Z @ 296 NONAME ; public: int __thiscall RFormat::Open(class RFs &,class TDesC16 const &,unsigned int,int &,class TDesC8 const &)
+	?SetStartupConfiguration@RFs@@QBEHHPAX0@Z @ 297 NONAME ; public: int __thiscall RFs::SetStartupConfiguration(int,void *,void *)const 
+	?ReadCancel@RFile@@QBEXAAVTRequestStatus@@@Z @ 298 NONAME ; public: void __thiscall RFile::ReadCancel(class TRequestStatus &)const 
+	?ReadCancel@RFile@@QBEXXZ @ 299 NONAME ; public: void __thiscall RFile::ReadCancel(void)const 
+	?MountFileSystemAndScan@RFs@@QBEHABVTDesC16@@0HAAH@Z @ 300 NONAME ; public: int __thiscall RFs::MountFileSystemAndScan(class TDesC16 const &,class TDesC16 const &,int,int &)const 
+	?SetNotifyChange@RFs@@QAEHH@Z @ 301 NONAME ; public: int __thiscall RFs::SetNotifyChange(int)
+	?AddCompositeMount@RFs@@QBEHABVTDesC16@@HHH@Z @ 302 NONAME ; int RFs::AddCompositeMount(class TDesC16 const &, int, int, int) const
+	?Flush@RFile@@QAEXAAVTRequestStatus@@@Z @ 303 NONAME ; public: void __thiscall RFile::Flush(class TRequestStatus &)
+	?GetSystemDrive@RFs@@SA?AW4TDriveNumber@@XZ @ 304 NONAME ; public: static enum TDriveNumber  __cdecl RFs::GetSystemDrive(void)
+	??0TBlockMapEntry@@QAE@XZ @ 305 NONAME ; public: __thiscall TBlockMapEntry::TBlockMapEntry(void)
+	?BlockMap@RFile@@QBEHAAUSBlockMapInfo@@AA_J_JH@Z @ 306 NONAME ; public: int __thiscall RFile::BlockMap(struct SBlockMapInfo &,__int64 &,__int64,int)const 
+	?SetNumberOfBlocks@TBlockMapEntry@@QAEXI@Z @ 307 NONAME ; public: void __thiscall TBlockMapEntry::SetNumberOfBlocks(unsigned int)
+	?SetStartBlock@TBlockMapEntry@@QAEXI@Z @ 308 NONAME ; public: void __thiscall TBlockMapEntry::SetStartBlock(unsigned int)
+	?Clamp@RFileClamp@@QAEHAAVRFile@@@Z @ 309 NONAME ; public: int __thiscall RFileClamp::Clamp(class RFile &)
+	?Close@RFileClamp@@QAEHAAVRFs@@@Z @ 310 NONAME ; public: int __thiscall RFileClamp::Close(class RFs &)
+	?FileSystemSubType@RFs@@QBEHHAAVTDes16@@@Z @ 311 NONAME ; public: int __thiscall RFs::FileSystemSubType(int,class TDes16 &)const 
+	?InitialisePropertiesFile@RFs@@QBEHABVTPtrC8@@@Z @ 312 NONAME ; public: int __thiscall RFs::InitialisePropertiesFile(class TPtrC8 const &)const 
+	?QueryVolumeInfoExt@RFs@@QBEHHW4TQueryVolumeInfoExtCmd@@AAVTDes8@@@Z @ 313 NONAME ; public: int __thiscall RFs::QueryVolumeInfoExt(int,enum TQueryVolumeInfoExtCmd,class TDes8 &)const 
+	?VolumeIOParam@RFs@@QBEHHAAVTVolumeIOParamInfo@@@Z @ 314 NONAME ; public: int __thiscall RFs::VolumeIOParam(int,class TVolumeIOParamInfo &)const 
+	?GetSystemDriveChar@RFs@@SA?AVTChar@@XZ @ 315 NONAME ; public: static class TChar  __cdecl RFs::GetSystemDriveChar(void)
+	?SetSystemDrive@RFs@@QAEHW4TDriveNumber@@@Z @ 316 NONAME ; public: int __thiscall RFs::SetSystemDrive(enum TDriveNumber)
+	?DriveList@RFs@@QBEHAAV?$TBuf8@$0BK@@@I@Z @ 317 NONAME ; public: int __thiscall RFs::DriveList(class TBuf8<26> &,unsigned int)const 
+	?SetFindMask@TFindFile@@QAEHI@Z @ 318 NONAME ; public: int __thiscall TFindFile::SetFindMask(unsigned int)
+	?FinaliseDrive@RFs@@QBEHHW4TFinaliseDrvMode@1@@Z @ 319 NONAME ; public: int __thiscall RFs::FinaliseDrive(int,enum RFs::TFinaliseDrvMode)const 
+	?Volume@RFs@@QBEXAAVTVolumeInfo@@HAAVTRequestStatus@@@Z @ 320 NONAME ; public: void __thiscall RFs::Volume(class TVolumeInfo &,int,class TRequestStatus &)const 
+	?AddProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 321 NONAME ; public: int __thiscall RFs::AddProxyDrive(class TDesC16 const &)
+	?Caps@RRawDisk@@QAEHAAVTDes8@@@Z @ 322 NONAME ABSENT ; public: int __thiscall RRawDisk::Caps(class TDes8 &)
+	?DismountProxyDrive@RFs@@QAEHI@Z @ 323 NONAME ; public: int __thiscall RFs::DismountProxyDrive(unsigned int)
+	?DoMountProxyDrive@RFs@@AAEHABVTIpcArgs@@@Z @ 324 NONAME ; private: int __thiscall RFs::DoMountProxyDrive(class TIpcArgs const &)
+	?RemoveProxyDrive@RFs@@QAEHABVTDesC16@@@Z @ 325 NONAME ; public: int __thiscall RFs::RemoveProxyDrive(class TDesC16 const &)
+	?ReadFileSection@RFs@@QBEHABVTDesC16@@_JAAVTDes8@@H@Z @ 326 NONAME ; public: int __thiscall RFs::ReadFileSection(class TDesC16 const &,__int64,class TDes8 &,int)const 
+	?AdoptFromClient@RFile64@@QAEHABVRMessage2@@HH@Z @ 327 NONAME ; public: int __thiscall RFile64::AdoptFromClient(class RMessage2 const &,int,int)
+	?AdoptFromCreator@RFile64@@QAEHHH@Z @ 328 NONAME ; public: int __thiscall RFile64::AdoptFromCreator(int,int)
+	?AdoptFromServer@RFile64@@QAEHHH@Z @ 329 NONAME ; public: int __thiscall RFile64::AdoptFromServer(int,int)
+	?Create@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 330 NONAME ; public: int __thiscall RFile64::Create(class RFs &,class TDesC16 const &,unsigned int)
+	?FileSize@TEntry@@QBE_JXZ @ 331 NONAME ; public: __int64 __thiscall TEntry::FileSize(void)const 
+	?Lock@RFile64@@QBEH_J0@Z @ 332 NONAME ; public: int __thiscall RFile64::Lock(__int64,__int64)const 
+	?Open@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 333 NONAME ; public: int __thiscall RFile64::Open(class RFs &,class TDesC16 const &,unsigned int)
+	?Read@RFile64@@QBEHIAAVTDes8@@@Z @ 334 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &)const 
+	?Read@RFile64@@QBEHIAAVTDes8@@H@Z @ 335 NONAME ; public: int __thiscall RFile64::Read(unsigned int,class TDes8 &,int)const 
+	?Read@RFile64@@QBEH_JAAVTDes8@@@Z @ 336 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &)const 
+	?Read@RFile64@@QBEH_JAAVTDes8@@H@Z @ 337 NONAME ; public: int __thiscall RFile64::Read(__int64,class TDes8 &,int)const 
+	?Read@RFile64@@QBEXIAAVTDes8@@AAVTRequestStatus@@@Z @ 338 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,class TRequestStatus &)const 
+	?Read@RFile64@@QBEXIAAVTDes8@@HAAVTRequestStatus@@@Z @ 339 NONAME ; public: void __thiscall RFile64::Read(unsigned int,class TDes8 &,int,class TRequestStatus &)const 
+	?Read@RFile64@@QBEX_JAAVTDes8@@AAVTRequestStatus@@@Z @ 340 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,class TRequestStatus &)const 
+	?Read@RFile64@@QBEX_JAAVTDes8@@HAAVTRequestStatus@@@Z @ 341 NONAME ; public: void __thiscall RFile64::Read(__int64,class TDes8 &,int,class TRequestStatus &)const 
+	?Replace@RFile64@@QAEHAAVRFs@@ABVTDesC16@@I@Z @ 342 NONAME ; public: int __thiscall RFile64::Replace(class RFs &,class TDesC16 const &,unsigned int)
+	?Seek@RFile64@@QBEHW4TSeek@@AA_J@Z @ 343 NONAME ; public: int __thiscall RFile64::Seek(enum TSeek,__int64 &)const 
+	?SetSize@RFile64@@QAEH_J@Z @ 344 NONAME ; public: int __thiscall RFile64::SetSize(__int64)
+	?Size@RFile64@@QBEHAA_J@Z @ 345 NONAME ; public: int __thiscall RFile64::Size(__int64 &)const 
+	?Temp@RFile64@@QAEHAAVRFs@@ABVTDesC16@@AAV?$TBuf@$0BAA@@@I@Z @ 346 NONAME ; public: int __thiscall RFile64::Temp(class RFs &,class TDesC16 const &,class TBuf<256> &,unsigned int)
+	?UnLock@RFile64@@QBEH_J0@Z @ 347 NONAME ; public: int __thiscall RFile64::UnLock(__int64,__int64)const 
+	?Write@RFile64@@QAEHIABVTDesC8@@@Z @ 348 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &)
+	?Write@RFile64@@QAEHIABVTDesC8@@H@Z @ 349 NONAME ; public: int __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int)
+	?Write@RFile64@@QAEH_JABVTDesC8@@@Z @ 350 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &)
+	?Write@RFile64@@QAEH_JABVTDesC8@@H@Z @ 351 NONAME ; public: int __thiscall RFile64::Write(__int64,class TDesC8 const &,int)
+	?Write@RFile64@@QAEXIABVTDesC8@@AAVTRequestStatus@@@Z @ 352 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,class TRequestStatus &)
+	?Write@RFile64@@QAEXIABVTDesC8@@HAAVTRequestStatus@@@Z @ 353 NONAME ; public: void __thiscall RFile64::Write(unsigned int,class TDesC8 const &,int,class TRequestStatus &)
+	?Write@RFile64@@QAEX_JABVTDesC8@@AAVTRequestStatus@@@Z @ 354 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,class TRequestStatus &)
+	?Write@RFile64@@QAEX_JABVTDesC8@@HAAVTRequestStatus@@@Z @ 355 NONAME ; public: void __thiscall RFile64::Write(__int64,class TDesC8 const &,int,class TRequestStatus &)
+	?IsValidName@RFs@@QAEHABVTDesC16@@AAVTNameValidParam@1@@Z @ 356 NONAME ; public: int __thiscall RFs::IsValidName(class TDesC16 const &,class RFs::TNameValidParam &)
+	?Close@RFs@@QAEXXZ @ 357 NONAME ; public: void __thiscall RFs::Close(void)
+	??1CFsNotify@@UAE@XZ @ 358 NONAME ; public: virtual __thiscall CFsNotify::~CFsNotify(void)
+	?AddNotification@CFsNotify@@QAEHIABVTDesC16@@0@Z @ 359 NONAME ; public: int __thiscall CFsNotify::AddNotification(unsigned int,class TDesC16 const &,class TDesC16 const &)
+	?Attributes@TFsNotification@@QBEHAAI0@Z @ 360 NONAME ; public: int __thiscall TFsNotification::Attributes(unsigned int &,unsigned int &)const 
+	?CancelNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 361 NONAME ; public: int __thiscall CFsNotify::CancelNotifications(class TRequestStatus &)
+	?FileSize@TFsNotification@@QBEHAA_J@Z @ 362 NONAME ; public: int __thiscall TFsNotification::FileSize(__int64 &)const 
+	?NewL@CFsNotify@@SAPAV1@AAVRFs@@H@Z @ 363 NONAME ; public: static class CFsNotify * __cdecl CFsNotify::NewL(class RFs &,int)
+	?NewName@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 364 NONAME ; public: int __thiscall TFsNotification::NewName(class TPtrC16 &)const 
+	?NextNotification@CFsNotify@@QAEPBVTFsNotification@@XZ @ 365 NONAME ; public: class TFsNotification const * __thiscall CFsNotify::NextNotification(void)
+	?NotificationType@TFsNotification@@QBE?AW4TFsNotificationType@1@XZ @ 366 NONAME ; public: enum TFsNotification::TFsNotificationType __thiscall TFsNotification::NotificationType(void)const 
+	?Path@TFsNotification@@QBEHAAVTPtrC16@@@Z @ 367 NONAME ; public: int __thiscall TFsNotification::Path(class TPtrC16 &)const 
+	?RemoveNotifications@CFsNotify@@QAEHXZ @ 368 NONAME ; public: int __thiscall CFsNotify::RemoveNotifications(void)
+	?RequestNotifications@CFsNotify@@QAEHAAVTRequestStatus@@@Z @ 369 NONAME ; public: int __thiscall CFsNotify::RequestNotifications(class TRequestStatus &)
+	?SupportedFileSystemName@RFs@@QBEHAAVTDes16@@HH@Z @ 370 NONAME ; public: int __thiscall RFs::SupportedFileSystemName(class TDes16 &,int,int)const 
 	??1CFsMountHelper@@UAE@XZ @ 371 NONAME ; public: virtual __thiscall CFsMountHelper::~CFsMountHelper(void)
 	?DismountFileSystem@CFsMountHelper@@QBEHXZ @ 372 NONAME ; public: int __thiscall CFsMountHelper::DismountFileSystem(void)const 
 	?DismountFileSystem@CFsMountHelper@@QBEXAAVTRequestStatus@@W4TFsDismountMode@1@@Z @ 373 NONAME ; public: void __thiscall CFsMountHelper::DismountFileSystem(class TRequestStatus &,enum CFsMountHelper::TFsDismountMode)const 
 	?GetMountProperties@CFsMountHelper@@QAEHXZ @ 374 NONAME ; public: int __thiscall CFsMountHelper::GetMountProperties(void)
 	?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)
+	?DriveNumber@TFsNotification@@QBEHAAH@Z @ 377 NONAME ; public: int __thiscall TFsNotification::DriveNumber(int &)const 
+	?UID@TFsNotification@@QBEHAAVTUid@@@Z @ 378 NONAME ; public: int __thiscall TFsNotification::UID(class TUid &)const 
 
--- a/userlibandfileserver/fileserver/eabi/efileu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/eabi/efileu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -315,4 +315,14 @@
 	_ZNK9RFsPlugin6VolumeER11TVolumeInfoi @ 314 NONAME
 	_ZNK7CFileCB16IsSequentialModeEv @ 315 NONAME
 	_ZN7CFileCB12DirectIOModeERK12RMessagePtr2 @ 316 NONAME
+	_ZN19CFsNotificationInfo10SetNewNameERK7TDesC16 @ 317 NONAME
+	_ZN19CFsNotificationInfo11SetFilesizeEx @ 318 NONAME
+	_ZN19CFsNotificationInfo13SetAttributesEjj @ 319 NONAME
+	_ZN19CFsNotificationInfo13SetSourceNameERK7TDesC16 @ 320 NONAME
+	_ZN19CFsNotificationInfo4FreeERPS_ @ 321 NONAME
+	_ZN19CFsNotificationInfo6SetUidERK4TUid @ 322 NONAME
+	_ZN19CFsNotificationInfo8AllocateERK8CMountCBi @ 323 NONAME
+	_ZN8CMountCB17IssueNotificationEP19CFsNotificationInfo @ 324 NONAME
+	_ZTI19CFsNotificationInfo @ 325 NONAME
+	_ZTV19CFsNotificationInfo @ 326 NONAME
 
--- a/userlibandfileserver/fileserver/eabi/efsrvu.def	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/eabi/efsrvu.def	Tue Nov 02 15:29:23 2010 +0000
@@ -418,4 +418,6 @@
 	_ZNK14CFsMountHelper15MountFileSystemEv @ 417 NONAME
 	_ZNK14CFsMountHelper18DismountFileSystemER14TRequestStatusNS_15TFsDismountModeE @ 418 NONAME
 	_ZNK14CFsMountHelper18DismountFileSystemEv @ 419 NONAME
+	_ZNK15TFsNotification11DriveNumberERi @ 420 NONAME
+	_ZNK15TFsNotification3UIDER4TUid @ 421 NONAME
 
--- a/userlibandfileserver/fileserver/group/f32caps.mmh	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/group/f32caps.mmh	Tue Nov 02 15:29:23 2010 +0000
@@ -18,4 +18,4 @@
 // Capabilities of File Server process
 //
 
-CAPABILITY TCB ProtServ DiskAdmin AllFiles PowerMgmt CommDD
\ No newline at end of file
+CAPABILITY TCB ProtServ DiskAdmin AllFiles PowerMgmt CommDD
--- a/userlibandfileserver/fileserver/group/release.txt	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/group/release.txt	Tue Nov 02 15:29:23 2010 +0000
@@ -1,3 +1,42 @@
+Version 2.00.4011
+=================
+(Made by fadhliM 28/10/2010)
+
+1.	stmansfi
+	1.	ou1cimx1#630606 (KHS) 10.1 pre_build: winscw Emulator doesn't boot up with devicesrv-bh1ido#mcl_201041
+
+
+Version 2.00.4010
+=================
+(Made by fadhliM 25/10/2010)
+
+1.	niccox
+	1.	ou1cimx1#614344 Phone reboots when connecting external USB hard disk with two partitions to it
+
+
+Version 2.00.4009
+=================
+(Made by fadhliM 25/10/2010)
+
+1.	michcox
+	1.	Release Plan 590182	Files deployment over Virtual File System to PlatSim from Carbide
+		REQ 428-2409	PlatSim development environment enhancements
+		SUB 417-70025	Files deployment over Virtual File System to PlatSim from Carbide
+
+2.	migubarr
+	1.	ou1cimx1#627410 Atlantisry21x T_NOTIFY F32test case failed on e drive 
+
+
+Version 2.00.4008
+=================
+(Made by fadhliM 25/10/2010)
+
+1.	migubarr, niccox
+	1.	Release Plan 590599 428-1323 Instrument File Server
+		REQ 428-1323	Instrument file server caching, media drivers and USB Mass Storage
+		SUB 417-76706	Instrument File Server caching
+
+
 Version 2.00.4007
 =================
 (Made by fadhliM 15/10/2010)
--- a/userlibandfileserver/fileserver/inc/f32dbg.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32dbg.h	Tue Nov 02 15:29:23 2010 +0000
@@ -195,6 +195,8 @@
 const TInt KControlIoSimulateMemoryLow=KMaxTInt-28;
 const TInt KControlIoStopSimulateMemoryLow=KMaxTInt-29;
 
+const TInt KControlIoHeapCellCount=KMaxTInt-30;
+
 const TInt KNCDebugNotifierValue=-500000;	// between 0 and 1 second
 
 GLREF_D TInt DebugNCNotifier;
--- a/userlibandfileserver/fileserver/inc/f32fsys.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32fsys.h	Tue Nov 02 15:29:23 2010 +0000
@@ -564,6 +564,169 @@
 	friend class TFsControlIo;			// for access to LocateDrives()
 #endif
 	};
+	
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION 
+    typedef TFsNotification::TFsNotificationType TNotificationType;
+#else
+    typedef TInt TNotificationType;
+#endif
+__ASSERT_COMPILE(sizeof(TNotificationType) == sizeof(TInt));
+
+class CFsNotificationInfoBody; 	//Forward-declaration
+class CFsClientMessageRequest; 	//Forward-declaration
+class TParsePtrC;				//Forward-declaration
+template <class T> class CFsPool; //Forward-declaration
+
+class CFsNotificationInfo : public CBase
+    {
+public:
+
+    /**
+     * For construction from File systems / CMountCBs
+     * 
+     * Provides a CFsNotificationInfo to populate. Populate with the change information.
+     * Supply this object to CMountCB::IssueNotification.
+     * 
+     * Once CMountCB::IssueNotification has been called,
+     * free the object by passing it to CFsNotificationInfo::Free
+     * (i.e. Do not call delete on the object)
+     * 
+     * @param aMount The mount control block which is issuing this notification
+     * @param aFunction The function as defined in TFsMessage, f32plugin.h, such as EFsFileWrite. 
+     * 
+     * @return  A CFsNotificationInfo* which may be populated with notification info.
+     *          Will return NULL in error conditions.
+     * 
+     * @see CMountCB::IssueNotification
+     * @see CFsNotificationInfo::Free
+     */
+    IMPORT_C static CFsNotificationInfo* Allocate(const CMountCB& aMount, TInt aFunction);
+    
+    /**
+     * Free CFsNotificationInfo objects allocated by CFsNotificationInfo::Allocate with this function.
+     * 
+     * On return aNotificationInfo will be set to NULL.
+     */
+    IMPORT_C static void Free(CFsNotificationInfo*& aNotificationInfo);
+    
+    //Set data:
+    
+    /**
+     * Set the source name for the changes. 
+     * This is the name of the file/directory that has changed.
+     * 
+     * "drive-letter:" is not to be included.
+     * 
+     * e.g.  "x:\\myfile.txt" is incorrect
+     *       "\\myfile.txt"   is correct.
+     */
+    IMPORT_C TInt SetSourceName(const TDesC& aSrc);
+    
+    /**
+     * Set the new name for the file. 
+     * This is the new name of the file in the case of a rename.
+     * 
+     * "drive-letter:" is not to be included.
+     */
+    IMPORT_C TInt SetNewName(const TDesC& aDest);
+    
+    /**
+     * In the case of a File Write or File Set Size operation being notified,
+     * the new file size of the file must be provided.
+     */
+    IMPORT_C TInt SetFilesize(TInt64 aFilesize);
+    
+    /**
+     * In the case of a change of attributes, the set and cleared attributes must be provided.
+     * (If these are not known, then the current attributes can be provided to aSet and
+     * inverse of the current attributes can be provided to aCleared.
+     */
+    IMPORT_C TInt SetAttributes(TUint aSet,TUint aCleared);
+
+    /**
+     * Set the UID of the process that has caused the change.
+     * 
+     */
+    IMPORT_C TInt SetUid(const TUid& aUid);
+    
+
+    
+    //******************************************** 
+    // File server internal :
+    //********************************************
+    
+    static CFsNotificationInfo* Allocate(CFsMessageRequest& aRequest);
+    static CFsNotificationInfo* Allocate(TInt aFunction, TInt aDrive);
+    
+    //Initialise notification object pool
+    static TInt Initialise();
+    
+    //Getters
+    TInt SetDriveNumber(TInt aDriveNumber);
+    void SetRequest(CFsRequest*);
+    TInt Function();
+    TInt DriveNumber();
+    TParsePtrC& Source();
+    TParsePtrC& NewName();
+    CFsRequest* Request();
+    TInt64* Data();    
+    TUid& Uid();
+    TNotificationType& NotificationType();
+    TBool DestDriveIsSet();
+    
+    /*
+     * This is the source length including the drive and colon
+     * which isn't actually saved as part of the stored source
+     */
+    TInt SourceSize();
+    /*
+     * This is the new name length including the drive and colon
+     * which may (or may not (- see below)) be actually part of the stored newname.
+	 *
+	 * "Drive:" is stored when the notification request originates from a
+	 * file server client and the drive could be different to the source's drive.
+	 *
+	 * In the case of a request originating from a CMountCB::IssueNotification call,
+	 * the CMountCB does not know about drive letters and only operates on a single
+	 * drive so in this case the "drive:" is missing.
+     */
+    TInt NewNameSize();
+    
+    static void NotificationType(TInt aFunction,TNotificationType& aNotificationType);
+    static void PathName(CFsClientMessageRequest& aRequest, TParsePtrC& aName);
+    static void NewPathName(CFsClientMessageRequest& aRequest, TParsePtrC& aName);
+    static TInt NotificationSize(CFsNotificationInfo& aRequest);
+    static TInt TypeToIndex(TNotificationType aType);
+    static TNotificationType NotificationType(TInt& aIndex);
+    static TInt DriveNumber(const TPtrC& aPath);
+    static void Attributes(CFsMessageRequest& aRequest, TUint& aSet, TUint& aClear);
+    static TInt64 FileSize(CFsMessageRequest& aRequest);
+    static TInt ValidateNotification(CFsNotificationInfo& aNotificationInfo);
+    static void SetData(CFsMessageRequest* aRequest, CFsNotificationInfo* aNotificationInfo);
+    static TUint NotifyType(TInt aFunction);
+
+private:
+    //Don't delete instances, free them.
+    virtual ~CFsNotificationInfo();
+    CFsNotificationInfo& operator=(CFsNotificationInfo& aNotification); //to prevent copying
+    
+    // called from New
+    CFsNotificationInfo();                  
+    
+    //Used to populate NotificationInfoPool
+    static CFsNotificationInfo* New();
+
+    //Called after construction/allocation from pool
+    TInt Init(TInt aFunction, TInt aDriveNumber);
+    
+    //Resets notification
+    void CleanNotification(); 
+    
+    CFsNotificationInfoBody* iBody;
+    friend class FsNotify;
+    friend class CFsPool<CFsNotificationInfo>; //For access to ~CFsNotificationInfo for compilation purposes
+    };
+
 
 class CFileCB;
 class CDirCB;
@@ -1395,9 +1558,36 @@
 	// calls GetInterface() with tracepoints added
 	TInt GetInterfaceTraced(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
 
-
-    
-
+public:
+	/*
+	 * This function is provided for file systems to issue notifications to file server clients
+	 * that have registered for notifications using the RFs::NotifyChange and CFsNotify client-side APIs.
+	 * 
+	 * @param aNotificationInfo This object should contain the relevant Source (and if appropriate, NewName)
+	 *                          as well as any other required information.
+	 *                          
+	 *                          The Source provided should be a fullpath of the form:
+	 *                                 \[path\]directory\      - in the case of changes to a directory
+	 *                                 \[path\]filename.ext    - in the case of changes to a file
+	 *
+	 *                          The drive letter information is not to be included.
+	 *                          
+	 *                          In the case of 'File Write' or 'File Set Size' operations, the resulting file size must be set.
+	 *						    @see CFsNotificationInfo::SetFileSize
+	 *
+	 *                          In the case of a attributes change, the attributes set and cleared must be set.
+	 *						    @see CFsNotificationInfo::SetAttributes
+	 *
+	 *							All CFsNotificationInfo objects must have a Uid set. This is the Uid of the 
+	 *							process which caused the change. i.e. A photo browser may wish to know if it was the camera app
+	 *							or the photo editor which has caused a change. @see CFsNotificationInfo::SetUID							
+	 *
+	 *                          @see class TFsNotification.
+	 *                                     
+	 * @return Symbian Standard error code. KErrNone on success.
+	 */
+	IMPORT_C TInt IssueNotification(CFsNotificationInfo* aNotificationInfo);
+	
 private:
     void SetFileSystem(CFileSystem* aFS);
 
@@ -2041,7 +2231,7 @@
 	void InitL();
 	inline CFileCB& File();
 
-	// For serialising aync requests 
+	// For serialising async requests 
 	TBool RequestStart(CFsMessageRequest* aRequest);
 	void RequestEnd(CFsMessageRequest* aRequest);
 	TBool RequestInProgress() const;
--- a/userlibandfileserver/fileserver/inc/f32notification.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32notification.h	Tue Nov 02 15:29:23 2010 +0000
@@ -115,13 +115,16 @@
 
 	/*
 	 * @returns The Drive Number associated with the Path.
+	 */
 	IMPORT_C TInt DriveNumber(TInt& aDriveNumber) const;
-	 */
-	
+
 	/*
 	 * @returns the UID of the process that caused this change.
+	 *          NB, the UID of the process causing the change is not always available
+	 *			such as when memory cards are physically removed.
+	 */
 	IMPORT_C TInt UID(TUid& aUID) const;
-	 */
+	 
 private:
 	//Declared private to prevent construction
 	TFsNotification();
@@ -182,7 +185,7 @@
 		 * CFsNotify stores notifications in a buffer. 
 		 * Clients of CFsNotify must specify how large this buffer should be.
 		 * 
-		 * As a guideline: Notification objects in the buffer typically have a 8byte header,
+		 * As a guideline: Notification objects in the buffer typically have a 12-byte header,
 		 * followed by a word aligned string containing the fullname of the file that has changed.
 		 * In the case of a rename notification both the original and the new fullnames are stored.
 		 *
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Tue Nov 02 15:29:23 2010 +0000
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=4007;
+const TInt KF32BuildVersionNumber=4011;
 //
 #endif
--- a/userlibandfileserver/fileserver/sfile/efile.mmh	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/efile.mmh	Tue Nov 02 15:29:23 2010 +0000
@@ -48,8 +48,9 @@
 SOURCE			 sf_memory_man.cpp sf_memory_client.cpp
 SOURCE			 sf_plugin_shim.cpp
 SOURCE			 sf_notifier_handlers.cpp
+SOURCE			 sf_pool.cpp
 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
-SOURCE			 sf_pool.cpp sf_notifier.cpp
+SOURCE			  sf_notifier.cpp
 #endif
 
 #ifdef WINS
--- a/userlibandfileserver/fileserver/sfile/sf_cache_man.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_cache_man.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -42,6 +42,10 @@
 #include <e32math.h>
 #endif
 
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "sf_cache_manTraces.h"
+#endif
+
 #define CACHE_NUM_TO_ADDR(n) (iBase + (n << iCacheLineSizeLog2))
 #define ADDR_TO_CACHELINE_ADDR(a) ((((a - iBase) >> iCacheLineSizeLog2) << iCacheLineSizeLog2) + iBase)
 #define ADDR_TO_INDEX(a) ((a - iBase) >> iCacheLineSizeLog2)
@@ -189,7 +193,7 @@
 	TInt r = UserHal::MemoryInfo(meminfo);
 	__ASSERT_ALWAYS(r==KErrNone,Fault(EMemoryInfoFailed));
 
-	iLowMemoryThreshold = (meminfo().iTotalRamInBytes * TGlobalFileCacheSettings::LowMemoryThreshold()) / 100;
+	iLowMemoryThreshold = (meminfo().iTotalRamInBytes  / 100) * TGlobalFileCacheSettings::LowMemoryThreshold();
 	__CACHE_PRINT4(_L("CACHEMAN: totalRAM %d freeRAM %d KDefaultLowMemoryThresholdPercent %d iLowMemoryThreshold %d"), 
 		meminfo().iTotalRamInBytes, meminfo().iFreeRamInBytes, KDefaultLowMemoryThreshold, iLowMemoryThreshold);
 	__CACHE_PRINT1(_L("CACHEMAN: iCacheSize %d"), iCacheSize);
@@ -199,6 +203,13 @@
 	r = iChunk.Create(createInfo);
 	User::LeaveIfError(r);
 
+#ifdef	OST_TRACE_COMPILER_IN_USE
+	TName chunkName = iChunk.Name();
+	OstTraceData(TRACE_FILECACHE_MANAGER, FILECACHEMAN_CHUNK_NAME, "Chunk name %S", chunkName.Ptr(), chunkName.Length()<<1);
+	OstTraceExt5(TRACE_FILECACHE_MANAGER, FILECACHEMAN_CHUNK_PARM, 
+		"totalRAM %d freeRAM %d KDefaultLowMemoryThresholdPercent %d iLowMemoryThreshold %d iCacheSize %d", 
+		meminfo().iTotalRamInBytes, meminfo().iFreeRamInBytes, KDefaultLowMemoryThreshold, iLowMemoryThreshold, iCacheSize);
+#endif	// OST_TRACE_COMPILER_IN_USE
 	
 	TInt mm = UserSvr::HalFunction(EHalGroupKernel, EKernelHalMemModelInfo, 0, 0) & EMemModelTypeMask;
 	if (mm < EMemModelTypeFlexible)
@@ -309,6 +320,7 @@
 	iStats.iFreeCount = iFreeQueue.Count();
 	iStats.iUsedCount = iUsedQueue.Count();
 	iStats.iLockedSegmentCount = iLockedSegmentCount;
+	iStats.iAllocatedSegmentCount = iAllocatedSegmentCount;
 	iStats.iFilesOnClosedQueue = TClosedFileUtils::Count();
 	__ASSERT_DEBUG(iStats.iFreeCount >= 0, Fault(EInvalidStats));
 	__ASSERT_DEBUG(iStats.iUsedCount >= 0, Fault(EInvalidStats));
@@ -349,6 +361,7 @@
 	if (iMemoryLow || (meminfo().iFreeRamInBytes < iLowMemoryThreshold))
 		{
 		__CACHE_PRINT(_L("CACHEMAN: free RAM below threshold !!!"));
+		OstTrace0(TRACE_FILECACHE_MANAGER, FILECACHEMAN_LOW_MEM, "Free RAM below threshold");
 		return KErrNoMemory;
 		}
 
@@ -361,6 +374,8 @@
 	if (SimulatedFailure(iAllocFailureCount))
 		{
 		__CACHE_PRINT(_L("CACHEMAN: simulating allocation failure"));
+		OstTrace0(TRACE_FILECACHE_MANAGER, FILECACHEMAN_SIMULATING_ALLOC_FAILURE, "Simulating alloc failure");
+
 		CacheUnlock();
 		return KErrNoMemory;
 		}
@@ -414,6 +429,8 @@
 	// Remove from free queue
 	iFreeQueue.Remove(0);
 
+	OstTraceExt2(TRACE_FILECACHE_MANAGER, FILECACHEMAN_ALLOC_CACHELINE, "cachelines: free %d used %d", iFreeQueue.Count(), iUsedQueue.Count());
+
 	// RChunk will lock segments initially unless explicitly unlocked
 
 	cacheLine->iLockCount++;
@@ -905,6 +922,7 @@
 	__ASSERT_ALWAYS(r == KErrNone, Fault(EAppendToFreeQueueFailed));
 
 	__CACHE_PRINT2(_L("CACHEMAN: FreeCacheLine, iFreeQueue %d iUsedQueue %d"), iFreeQueue.Count(), iUsedQueue.Count());
+	OstTraceExt2(TRACE_FILECACHE_MANAGER, FILECACHEMAN_FREE_CACHELINE, "cachelines: free %d used %d", iFreeQueue.Count(), iUsedQueue.Count());
 	}
 
 
@@ -984,6 +1002,8 @@
 	if (SimulatedFailure(iLockFailureCount))
 		{
 		__CACHE_PRINT(_L("CACHEMAN: simulating lock failure"));
+		OstTrace0(TRACE_FILECACHE_MANAGER, FILECACHEMAN_SIMULATING_LOCK_FAILURE, "Simulating lock failure");
+
 		r = KErrNotFound;
 		}
 #endif
@@ -991,10 +1011,14 @@
 	if (r == KErrNone)
 		{
 		iLockedSegmentCount+= aSegmentCount;
+
+		OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_LOCK_SEGMENTS, "Locked segments %d", iLockedSegmentCount);
 		}
 	else
 		{
 		__CACHE_PRINT(_L("CACHEMAN: LOCK FAILED"));
+		OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_LOCK_FAILURE, "Failure r %d", r);
+
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		iStats.iLockFailureCount++;
 #endif
@@ -1012,6 +1036,8 @@
 	if (r == KErrNone)
 		{
 		iLockedSegmentCount-= aSegmentCount;
+
+		OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_UNLOCK_SEGMENTS, "Locked segments %d", iLockedSegmentCount);
 		}
 	else
 		{
@@ -1027,6 +1053,8 @@
 	if (SimulatedFailure(iCommitFailureCount))
 		{
 		__CACHE_PRINT(_L("CACHEMAN: simulating commit failure "));
+		OstTrace0(TRACE_FILECACHE_MANAGER, FILECACHEMAN_SIMULATING_COMMIT_FAILURE, "Simulating commit failure");
+
 		return KErrNoMemory;
 		}
 #endif
@@ -1038,13 +1066,15 @@
 	if (r == KErrNone)
 		{
 		iLockedSegmentCount+= aSegmentCount;
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-		iStats.iAllocatedSegmentCount+= aSegmentCount;
-#endif
+		iAllocatedSegmentCount+= aSegmentCount;
+
+		OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_COMMIT_SEGMENTS, "Allocated segments %d", iAllocatedSegmentCount);
 		}
 	else
 		{
 		__CACHE_PRINT(_L("CACHEMAN: COMMIT FAILED"));
+		OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_COMMIT_FAILURE, "Failure r %d", r);
+
 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
 		iStats.iCommitFailureCount++;
 #endif
@@ -1064,9 +1094,9 @@
 	__CACHE_PRINT3(_L("CACHEMAN: DECOMMIT: %08X %d %d, "), aAddr, aSegmentCount, r);
 	if (r == KErrNone)
 		{
-#if defined(_DEBUG) || defined(_DEBUG_RELEASE)
-		iStats.iAllocatedSegmentCount-= aSegmentCount;
-#endif
+		iAllocatedSegmentCount-= aSegmentCount;
+
+		OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_DECOMMIT_SEGMENTS, "Allocated segments %d", iAllocatedSegmentCount);
 		}
 	else
 		{
@@ -1081,13 +1111,15 @@
 void CCacheManager::SimulateLockFailureMode(TBool aEnable)
 	{
 	iSimulateLockFailureMode = aEnable;
-__CACHE_PRINT1(_L("CACHEMAN: SimulateLockFailureMode: %d, "), iSimulateLockFailureMode);
+
+	__CACHE_PRINT1(_L("CACHEMAN: SimulateLockFailureMode: %d, "), iSimulateLockFailureMode);
+	OstTrace1(TRACE_FILECACHE_MANAGER, FILECACHEMAN_SIMULATE_LOCK_FAILURE_MODE, "aEnable %d", aEnable);
 	}
 
 void CCacheManager::AllocateMaxSegments(TBool aEnable)
 	{
 	iAllocateMaxSegments = aEnable;
-__CACHE_PRINT1(_L("CACHEMAN: iAllocateMaxSegments: %d, "), iAllocateMaxSegments);
+	__CACHE_PRINT1(_L("CACHEMAN: iAllocateMaxSegments: %d, "), iAllocateMaxSegments);
 	}
 
 TBool CCacheManager::AllocateMaxSegments()
--- a/userlibandfileserver/fileserver/sfile/sf_cache_man.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_cache_man.h	Tue Nov 02 15:29:23 2010 +0000
@@ -198,6 +198,7 @@
 	TInt iSegmentsPerCacheLine;
 
 	TInt iLockedSegmentCount;
+	TInt iAllocatedSegmentCount;
 
 	RChunk iChunk;
 	TBool iSimulateLockFailureMode;
--- a/userlibandfileserver/fileserver/sfile/sf_dat.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_dat.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -27,6 +27,7 @@
 CFsObjectCon* RawDisks;
 CFsObjectCon* Extensions;
 CFsObjectCon* ProxyDrives;
+CFsPool<CFsNotificationInfo>* NotificationInfoPool;
 
 CServerFs* TheFileServer;
 TDrive TheDrives[KMaxDrives];
--- a/userlibandfileserver/fileserver/sfile/sf_debug.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_debug.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -622,6 +622,14 @@
             TInt r=aRequest->Write(2,pkgBuf);
             return r;
             }
+
+		case KControlIoHeapCellCount:
+			{
+            TPckgBuf<TInt> pkgBuf(User::Allocator().Count());
+            TInt r=aRequest->Write(2,pkgBuf);
+            return r;
+			}
+
         // Check if the file is in 'file sequential/non-rugged file' mode
         case KControlIoIsFileSequential:
         	{
--- a/userlibandfileserver/fileserver/sfile/sf_dir.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_dir.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -149,7 +149,7 @@
 	TInt r=ParseSubstPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysDirOpen,&KCapFsPriDirOpen, __PLATSEC_DIAGNOSTIC_STRING("Dir Open"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysDirOpen,&KCapFsPriDirOpen, __PLATSEC_DIAGNOSTIC_STRING("Dir Open"));
 	if(r != KErrNone)
 		return r;
 	return KErrNone;
--- a/userlibandfileserver/fileserver/sfile/sf_drv.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_drv.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -1452,10 +1452,16 @@
 			if (pFileCache)
 				{
 				pFileCache = pFileCache->ReNewL(*pFileShare);	// NB may return NULL if caching not enabled
+
+				OstTraceExt3(TRACE_FILECACHE, FILECACHE_RENEW_FILE_CACHE1, "ReNew FileCache %x File %x drive %u", (TUint) pFileCache, (TUint) &pFileShare->File(), (TUint) DriveNumber());
+				OstTraceData(TRACE_FILECACHE, FILECACHE_RENEW_FILE_CACHE2, "Name %S", pFileShare->File().iFileNameF->Ptr(), pFileShare->File().iFileNameF->Length()<<1);
 				}
 			else
 				{
 				pFileCache = CFileCache::NewL(*pFileShare);		// NB may return NULL if caching not enabled
+
+				OstTraceExt3(TRACE_FILECACHE, FILECACHE_NEW_FILE_CACHE1, "New FileCache %x FileCB %x drive %u", (TUint) pFileCache, (TUint) &pFileShare->File(), (TUint) DriveNumber());
+				OstTraceData(TRACE_FILECACHE, FILECACHE_NEW_FILE_CACHE2, "Name %S", pFileShare->File().iFileNameF->Ptr(), pFileShare->File().iFileNameF->Length()<<1);
 				}
 			if (pFileCache)
 				// Set the cached size to be the same as the uncached size
--- a/userlibandfileserver/fileserver/sfile/sf_file.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_file.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -290,7 +290,7 @@
 	TInt r=ParseNoWildSubstCheckPtr0(aRequest,aRequest->Src());
  	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysFileCreate,&KCapFsPriFileCreate,&KCapFsROFileCreate, __PLATSEC_DIAGNOSTIC_STRING("Create File")); 
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysFileCreate,&KCapFsPriFileCreate,&KCapFsROFileCreate, __PLATSEC_DIAGNOSTIC_STRING("Create File")); 
 	if (r!=KErrNone)
 		return(r);
 	if (OpenOnDriveZOnly)
@@ -320,7 +320,7 @@
 	TInt r=ParseNoWildSubstCheckPtr0(aRequest,aRequest->Src());
  	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysFileReplace,&KCapFsPriFileReplace,&KCapFsROFileReplace, __PLATSEC_DIAGNOSTIC_STRING("Replace File")); 
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysFileReplace,&KCapFsPriFileReplace,&KCapFsROFileReplace, __PLATSEC_DIAGNOSTIC_STRING("Replace File")); 
 	if (r!=KErrNone)
 		return(r);
 
@@ -419,7 +419,7 @@
 
 	if(ComparePrivate(thisPath))
 		{
-		if(! SIDCheck(aRequest,thisPath))
+		if(! SIDCheck(aRequest->Message(),thisPath))
 			{
 			if(!KCapFsPriFileOpen.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_MESSAGE("File Open in private path")))
 				return KErrPermissionDenied;
@@ -492,7 +492,7 @@
 	TInt r=ParseNoWildSubstCheckPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysIsFileOpen,&KCapFsPriIsFileOpen, __PLATSEC_DIAGNOSTIC_STRING("Is File Open")); 
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysIsFileOpen,&KCapFsPriIsFileOpen, __PLATSEC_DIAGNOSTIC_STRING("Is File Open")); 
 	return(r);
 	}
 
@@ -628,7 +628,7 @@
 	TInt r=ParseNoWildSubstPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("Temp File")); 
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("Temp File")); 
 	if (r!=KErrNone)
 		return(r);
 	if (aRequest->Src().NameOrExtPresent())
@@ -1496,9 +1496,6 @@
 	CFileCache* fileCache = share->File().FileCache();
 	if (fileCache && (r = fileCache->FlushDirty(aRequest)) != CFsRequest::EReqActionComplete)
 	    {
-		//To be used in notification framework
-	    //CFsMessageRequest& msgRequest = (CFsMessageRequest&)*aRequest;
-	    //msgRequest.iUID = msgRequest.Message().Identity();
 		return r;
 	    }
 
@@ -1950,7 +1947,7 @@
 		return(KErrBadName);
 	if (IsIllegalFullName(aRequest->Dest().FullName().Mid(2)))
 		return(KErrBadName);
-	r=PathCheck(aRequest,aRequest->Dest().FullName().Mid(2),&KCapFsSysFileRename,&KCapFsPriFileRename,&KCapFsROFileRename, __PLATSEC_DIAGNOSTIC_STRING("File Rename"));
+	r=PathCheck(aRequest->Message(),aRequest->Dest().FullName().Mid(2),&KCapFsSysFileRename,&KCapFsPriFileRename,&KCapFsROFileRename, __PLATSEC_DIAGNOSTIC_STRING("File Rename"));
 	return(r);
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_file_cache.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_file_cache.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -241,6 +241,7 @@
 	CleanupClosePushL(*fileCache);
 	fileCache->ConstructL(aShare);
 	CleanupStack::Pop(1, fileCache);
+
 	return fileCache;
 	}
 
@@ -305,6 +306,8 @@
 	delete iCacheClient;
 
 	delete iFileNameF;
+
+	OstTraceExt2(TRACE_FILECACHE, FILECACHE_DELETE, "fileCache %x fileCB %x", (TUint) this, (TUint) iFileCB);
 	}
 
 
@@ -316,6 +319,8 @@
 
 TInt CFileCache::DirtyTimerEvent(TAny* aFileCache)
 	{
+	OstTrace1(TRACE_FILECACHE, FILECACHE_DIRTY_DATA_TIMER_EXPIRY, "fileCache %x", (TUint) aFileCache);
+
 	// Cannot report errors here
 	// coverity [unchecked_value]
 	(void)((CFileCache*) aFileCache)->FlushDirty();
@@ -340,7 +345,9 @@
 		__ASSERT_DEBUG(!iDirtyDataOwner, Fault(EClosingDirtyFile));
 		}
 #endif
-		
+
+	// there should be no dirty data (see assert above) but clean up just in case
+	MarkFileClean();
 		
 	__CACHE_PRINT2(_L("CFileCache::Close() iFileCB %08X IsClosed %d"), 
 		iFileCB, TClosedFileUtils::IsClosed(this));
@@ -350,6 +357,8 @@
 		!TClosedFileUtils::IsClosed(this) && 
 		IsDriveThread())
 		{
+		OstTrace1(TRACE_FILECACHE, FILECACHE_MODE_TO_CLOSEQ, "Moving to close queue, fileCache %x", (TUint) this);
+
 		// add to ClosedFiles container
 		__CACHE_PRINT1(_L("CLOSEDFILES: Adding %S\n"), &iFileCB->FileNameF() );
 		TRAP(r, TClosedFileUtils::AddL(this, ETrue));
@@ -567,6 +576,10 @@
 	if (r != KErrNone)
 		return;
 
+	TRACETHREADID(aMsgRequest.Message());
+	OstTraceExt5(TRACE_FILECACHE, FILECACHE_READ_AHEAD, "Issue read ahead, clientThreadId %x fileCache %x pos %x:%x len %d", 
+		 (TUint) threadId, (TUint) this, (TUint) I64HIGH(iReadAheadPos), (TUint) I64LOW(iReadAheadPos), iReadAheadLen);
+
 	r = newRequest->PushOperation(
 		iReadAheadPos, 
 		iReadAheadLen,
@@ -840,6 +853,11 @@
 					if (totalLen > iCacheSize)
 						{
 						TInt len = totalLen - iCacheSize;
+
+						TRACETHREADID(aMsgRequest.Message());
+						OstTraceExt5(TRACE_FILECACHE, FILECACHE_READ_UNCACHED1, "Read, media to client, clientThreadId %x fileCache %x pos %x:%x len %d", 
+							 (TUint) threadId, (TUint) this, (TUint) I64HIGH(currentPos), (TUint) I64LOW(currentPos), (TUint) len);
+
 						TInt r = aMsgRequest.PushOperation(
 							currentPos, len, 
 							(TDesC8*) currentOperation->iReadWriteArgs.iData, currentOffset,
@@ -891,6 +909,11 @@
 
 					// read into cache segment(s)
 					__CACHE_PRINT2(_L("CACHEFILE: read pos %ld, readLen %d"), segmentStartPos, readLen);
+
+					TRACETHREADID(aMsgRequest.Message());
+					OstTraceExt5(TRACE_FILECACHE, FILECACHE_READ_CACHED1, "Read, media to cache, clientThreadId %x fileCache %x pos %x:%x len %d", 
+						 (TUint) threadId, (TUint) this, (TUint) I64HIGH(segmentStartPos), (TUint) I64LOW(segmentStartPos), (TUint) readLen);
+
 					TInt r = aMsgRequest.PushOperation(
 						segmentStartPos, readLen, addr, 0,
 						CompleteRead, 
@@ -924,6 +947,10 @@
 					// if addr is NULL then this is a read ahead request
 					if (currentOperation->iReadWriteArgs.iData != NULL)
 						{
+						TRACETHREADID(aMsgRequest.Message());
+						OstTraceExt5(TRACE_FILECACHE, FILECACHE_READ_COPY, "Read, cache to client, clientThreadId %x fileCache %x pos %x:%x len %d", 
+							 (TUint) threadId, (TUint) this, (TUint) I64HIGH(currentPos), (TUint) I64LOW(currentPos), (TUint) len);
+
 						if (currentOperation->iClientRequest)
 							{
 							__ASSERT_DEBUG (aMsgRequest.Message().Handle() != NULL, Fault(EMsgAlreadyCompleted));
@@ -978,6 +1005,10 @@
 				addr = (TUint8*) currentOperation->iScratchValue0;
 				readLen = (TInt) currentOperation->iScratchValue1;
 				
+				TRACETHREADID(aMsgRequest.Message());
+				OstTraceExt3(TRACE_FILECACHE, FILECACHE_READ_COMPLETE, "Read, media to cache, clientThreadId %x fileCache %x r %d", 
+					 (TUint) threadId, (TUint) this, (TUint) (TUint) lastError);
+
 				aMsgRequest.CurrentOperation().iState = EStCopyToClient;
 				}
 				break;
@@ -1027,6 +1058,11 @@
 
 				aMsgRequest.ReStart();
 				UpdateSharePosition(aMsgRequest, *currentOperation);
+
+				TRACETHREADID(aMsgRequest.Message());
+				OstTraceExt5(TRACE_FILECACHE, FILECACHE_READ_UNCACHED2, "Read media to client, clientThreadId %x fileCache %x pos %x:%x len %d", 
+					 (TUint) threadId, (TUint) this, (TUint) I64HIGH(currentPos), (TUint) I64LOW(currentPos), (TUint) totalLen);
+
 				return retCode;
 
 
@@ -1205,6 +1241,11 @@
 					iCacheClient->Purge(ETrue);
 
 					TInt len = totalLen - iCacheSize;
+
+					TRACETHREADID(aMsgRequest.Message());
+					OstTraceExt5(TRACE_FILECACHE, FILECACHE_WRITE_UNCACHED1, "Write, client to media, clientThreadId %x fileCache %x pos %x:%x len %d", 
+						 (TUint) threadId, (TUint) this, (TUint) I64HIGH(currentPos), (TUint) I64LOW(currentPos), (TUint) len);
+
 					TInt r = aMsgRequest.PushOperation(
 						currentPos, len, 
 						(TDesC8*) currentOperation->iReadWriteArgs.iData, currentOffset,
@@ -1394,6 +1435,11 @@
 #pragma warning( default : 4244 )
 #endif
 				__ASSERT_DEBUG (aMsgRequest.Message().Handle() != NULL, Fault(EMsgAlreadyCompleted));					
+
+				TRACETHREADID(aMsgRequest.Message());
+				OstTraceExt5(TRACE_FILECACHE, FILECACHE_READ_CACHED2, "Read, media to cache, clientThreadId %x fileCache %x pos %x:%x len %d", 
+					 (TUint) threadId, (TUint) this, (TUint) I64HIGH(readPos), (TUint) I64LOW(readPos), (TUint) readLen);
+
 				TInt r = aMsgRequest.PushOperation(
 					readPos, readLen, readAddr, 0, 
 					CompleteWrite,
@@ -1446,6 +1492,11 @@
 					__ASSERT_DEBUG (aMsgRequest.Message().Handle() != NULL, Fault(EMsgAlreadyCompleted));
 					// copy from user buffer to cache buffer
 					TInt writeError = KErrNone;
+
+					TRACETHREADID(aMsgRequest.Message());
+					OstTraceExt5(TRACE_FILECACHE, FILECACHE_WRITE_COPY, "Write, client to cache, clientThreadId %x fileCache %x pos %x:%x len %d", 
+						 (TUint) threadId, (TUint) this, (TUint) I64HIGH(currentPos), (TUint) I64LOW(currentPos), (TUint) writeLen);
+
 					if (currentOperation->iClientRequest)
 						{
 						TPtr8 ptr(addr+offset, writeLen, writeLen);
@@ -1549,14 +1600,20 @@
 				currentOperation->iState = EStReStart;
 
 			case EStReStart:
-
+				{
 				__ASSERT_DEBUG(retCode == CFsRequest::EReqActionBusy || retCode == CFsRequest::EReqActionContinue, Fault(EBadRetCode));
 
 				aMsgRequest.ReStart();
 				UpdateSharePosition(aMsgRequest, *currentOperation);
 				if (currentOperation->iClientRequest)
 					currentOperation->iReadWriteArgs.iPos = currentOperation->iClientPosition; // NB maybe KCurrentPosition64
+
+				TRACETHREADID(aMsgRequest.Message());
+				OstTraceExt5(TRACE_FILECACHE, FILECACHE_WRITE_UNCACHED2, "Write, client to media, clientThreadId %x fileCache %x pos %x:%x len %d", 
+					 (TUint) threadId, (TUint) this, (TUint) I64HIGH(currentPos), (TUint) I64LOW(currentPos), (TUint) totalLen);
+
 				return retCode;
+				}
 
 			case EStEnd:
 				return retCode;
@@ -1566,7 +1623,7 @@
 
 
 
-TInt CFileCache::AllocateRequest(CFsClientMessageRequest*& aNewRequest, TBool aWrite, CSessionFs* aSession)
+TInt CFileCache::AllocateRequest(CFsClientMessageRequest*& aNewRequest, TBool aWrite, CSessionFs* aSession,TUid aUid)
 	{
 
 	RLocalMessage msgNew;
@@ -1575,7 +1632,7 @@
 	if (r != KErrNone)
 		return r;
 
-	aNewRequest->Set(msgNew, oP, aSession);
+	aNewRequest->Set(msgNew, oP, aSession, aUid);
 	aNewRequest->SetDrive(iDrive);
 	
 	// read-aheads and write-dirty requests should not be posted to plugins
@@ -1604,14 +1661,21 @@
 
 	CFsClientMessageRequest* newRequest = NULL;
 
+#if defined (OST_TRACE_COMPILER_IN_USE)
+	RMessage2 msgOld;
+	if (aOldRequest)
+		msgOld = const_cast<RMessage2&> (aOldRequest->Message());
+	TRACETHREADID(msgOld);
+	OstTraceExt2(TRACE_FILECACHE, FILECACHE_FLUSH_DIRTY, "clientThreadId %x fileCache %x", (TUint) threadId, (TUint) this);
+#endif	// if defined (OST_TRACE_COMPILER_IN_USE)
+
+
 	TInt r = DoFlushDirty(newRequest, aOldRequest, EFlushAll);
 
 	iLock.Signal();
 
 	if (newRequest)
 	    {
-		//To be used in notification framework.
-	    //newRequest->iUID = aOldRequest->Message().Identity();
 		newRequest->Dispatch();
 	    }
 
@@ -1696,8 +1760,8 @@
 	CSessionFs* session = aOldRequest && aOldRequest->Session() ? aOldRequest->Session() : iDirtyDataOwner;
 
 	__ASSERT_ALWAYS(session, Fault(EFlushingWithSessionNull));
-
-	TInt r = AllocateRequest(aNewRequest, ETrue, session);
+	
+	TInt r = AllocateRequest(aNewRequest, ETrue, session, (aOldRequest) ? aOldRequest->Uid() : TUid::Null());
 	if (r != KErrNone)
 		return r;
 	
@@ -1883,6 +1947,9 @@
 				currentOperation->Set(pos, len, addr, 0, EStWriteToDiskComplete);
 				if (pos < iSize64)
 					{
+					OstTraceExt4(TRACE_FILECACHE, FILECACHE_WRITE_DIRTY, "Write, cache to media, fileCache %x pos %x:%x len %d", 
+						 (TUint) this, (TUint) I64HIGH(pos), (TUint) I64LOW(pos), (TUint) len);
+
 					TInt r = aMsgRequest.PushOperation(
 						pos, len, addr, 0,
 						CompleteFlushDirty, 
@@ -1909,6 +1976,10 @@
 					iDrive->Dismount();
 					}
 #endif
+				TRACETHREADID(aMsgRequest.Message());
+				OstTraceExt3(TRACE_FILECACHE, FILECACHE_FLUSH_DIRTY_COMPLETE, "Write, cache to media, clientThreadId %x fileCache %x r %d", 
+					 (TUint) threadId, (TUint) this, (TUint) lastError);
+
 				pos = currentOperation->iReadWriteArgs.iPos;
 				iCacheClient->UnlockSegments(pos);
 				}
@@ -2129,7 +2200,11 @@
 	CDriveThread* driveThread=NULL;
 	TInt r = FsThreadManager::GetDriveThread(iDriveNum, &driveThread);
 	if(r == KErrNone && driveThread != NULL)
+		{
+		OstTrace1(TRACE_FILECACHE, FILECACHE_STARTING_DIRTY_DATA_TIMER, "Starting dirty data timer() fileCache %x", (TUint) this);
+
 		iDirtyTimer.Start(driveThread, iDirtyDataFlushTime);
+		}
 	}
 
 //----------------------------------------------------------------------------
@@ -2294,6 +2369,14 @@
 		driveCacheSettings->iClosedFileKeepAliveTime,
 		driveCacheSettings->iDirtyDataFlushTime);
 	
+	OstTraceExt5(TRACE_FILECACHE, FILECACHE_SETTINGS, 
+		"Drive %d Flags %x CacheSize %d FileCacheReadAsync %d FairSchedulingLen %d ", 
+		(TUint) aDriveNumber,
+		(TUint) driveCacheSettings->iFlags, 
+		(TUint) driveCacheSettings->iCacheSize, 
+		(TUint) driveCacheSettings->iFileCacheReadAsync,
+		(TUint) driveCacheSettings->iFairSchedulingLen);
+
 	return KErrNone;
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_file_cache.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_file_cache.h	Tue Nov 02 15:29:23 2010 +0000
@@ -91,7 +91,7 @@
 	static TInt CompleteFlushDirty(CFsRequest* aMsgRequest);
 	TInt FlushDirtySm(CFsMessageRequest& aMsgRequest);
 
-	TInt AllocateRequest(CFsClientMessageRequest*& aNewRequest, TBool aWrite, CSessionFs* aSession = NULL);
+	TInt AllocateRequest(CFsClientMessageRequest*& aNewRequest, TBool aWrite, CSessionFs* aSession = NULL,TUid aUid = KNullUid);
 
 	void DoReadAhead(CFsMessageRequest& aMsgRequest, TUint aMode);
 
--- a/userlibandfileserver/fileserver/sfile/sf_local.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_local.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -500,11 +500,14 @@
 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION	
 		if(FsNotificationManager::IsInitialised())
 			{
+		    CFsNotificationInfo* notificationInfo = CFsNotificationInfo::Allocate(EFsDismountFileSystem,aDrive);
 			__PRINT3(_L("LocalDrives::CompleteDriveNotifications() Initialised=%d, Count=%d, Drive=%d"),FsNotificationManager::IsInitialised(),FsNotificationManager::Count(), aDrive);
 			TBuf<2> driveDes;
 			driveDes.Append((TChar)aDrive+(TChar)'A');
 			driveDes.Append((TChar)':');
-			FsNotificationManager::HandleChange(NULL,driveDes,TFsNotification::EMediaChange);
+			notificationInfo->SetSourceName(driveDes);
+			FsNotificationManager::HandleChange(*notificationInfo);
+			CFsNotificationInfo::Free(notificationInfo);
 			}
 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION		
 
--- a/userlibandfileserver/fileserver/sfile/sf_main.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_main.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -166,7 +166,7 @@
 		aMessage.Complete(r);
 		return;
 		}
-	pR->Set(aMessage, oP, this);
+	pR->Set(aMessage, oP, this, aMessage.Identity());
 	__PRINT4TEMP(_L("***** Received Message sess %08x req %08x func 0x%x - %S"), this, pR, ipcFunction, GetFunctionName(ipcFunction));
 	pR->Dispatch();
 	}
@@ -485,6 +485,11 @@
 
 	// initialise notification information
 	FsNotify::Initialise();
+	
+	// initialise notification pool
+	r = CFsNotificationInfo::Initialise();
+	__ASSERT_ALWAYS(r==KErrNone,Fault(ENotifyPoolCreation));
+	
 	// initialise local drive specific information
 	LocalDrives::Initialise();
 
--- a/userlibandfileserver/fileserver/sfile/sf_mnt.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_mnt.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -19,7 +19,7 @@
 #include "sf_mntTraces.h"
 #endif
 
-
+#include "sf_notifier.h"
 
 
 /**
@@ -453,6 +453,22 @@
     }
 
 
+EXPORT_C TInt CMountCB::IssueNotification(CFsNotificationInfo* aNotificationInfo)
+    {
+    //Validate Notification
+    TInt r = CFsNotificationInfo::ValidateNotification(*aNotificationInfo);
+    if(r != KErrNone)
+        return r;
+    
+    //Target RFs::NotifyChange
+    FsNotify::HandleChange(*aNotificationInfo);
+    
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+    //Target CFsNotify
+    FsNotificationManager::HandleChange(*aNotificationInfo);
+#endif
+    return KErrNone;
+    }
 
 
 
--- a/userlibandfileserver/fileserver/sfile/sf_nbs.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_nbs.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -82,7 +82,7 @@
 	TInt r=ParseSubstPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysMkDir,&KCapFsPriMkDir,&KCapFsROMkDir, __PLATSEC_DIAGNOSTIC_STRING("Make Directory"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysMkDir,&KCapFsPriMkDir,&KCapFsROMkDir, __PLATSEC_DIAGNOSTIC_STRING("Make Directory"));
 	return(r);
 	}
 
@@ -110,7 +110,7 @@
 	TInt r=ParseSubstPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysRmDir,&KCapFsPriRmDir,&KCapFsRORmDir, __PLATSEC_DIAGNOSTIC_STRING("Remove Directory"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysRmDir,&KCapFsPriRmDir,&KCapFsRORmDir, __PLATSEC_DIAGNOSTIC_STRING("Remove Directory"));
 	return(r);
 	}
 
@@ -132,7 +132,7 @@
 	TInt r=ParseNoWildSubstCheckPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysDelete,&KCapFsPriDelete,&KCapFsRODelete, __PLATSEC_DIAGNOSTIC_STRING("Delete"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysDelete,&KCapFsPriDelete,&KCapFsRODelete, __PLATSEC_DIAGNOSTIC_STRING("Delete"));
 	return(r);
 	}
 
@@ -159,13 +159,13 @@
 	TInt r=ParseNoWildSubstCheckPathPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysRename,&KCapFsPriRename,&KCapFsRORename, __PLATSEC_DIAGNOSTIC_STRING("File Server Rename"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysRename,&KCapFsPriRename,&KCapFsRORename, __PLATSEC_DIAGNOSTIC_STRING("File Server Rename"));
 	if(r!=KErrNone)
 		return(r);
 	TDrive* pOldDrive=aRequest->Drive();
 	if ((r=ParseNoWildSubstCheckPathPtr1(aRequest,aRequest->Dest()))!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Dest().FullName().Mid(2),&KCapFsSysRename,&KCapFsPriRename,&KCapFsRORename, __PLATSEC_DIAGNOSTIC_STRING("File Server Rename"));	
+	r=PathCheck(aRequest->Message(),aRequest->Dest().FullName().Mid(2),&KCapFsSysRename,&KCapFsPriRename,&KCapFsRORename, __PLATSEC_DIAGNOSTIC_STRING("File Server Rename"));	
 	if(r == KErrNone)
 		{
 		if (pOldDrive!=aRequest->Drive())
@@ -197,13 +197,13 @@
 	TInt r=ParseNoWildSubstCheckPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysReplace,&KCapFsPriReplace,&KCapFsROReplace, __PLATSEC_DIAGNOSTIC_STRING("File Server Replace"));	
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysReplace,&KCapFsPriReplace,&KCapFsROReplace, __PLATSEC_DIAGNOSTIC_STRING("File Server Replace"));	
 	if(r!=KErrNone)
 		return(r);
 	TDrive* pOldDrive=aRequest->Drive();
 	if ((r=ParseNoWildSubstCheckPtr1(aRequest,aRequest->Dest()))!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Dest().FullName().Mid(2),&KCapFsSysReplace,&KCapFsPriReplace,&KCapFsROReplace, __PLATSEC_DIAGNOSTIC_STRING("File Server Replace"));	
+	r=PathCheck(aRequest->Message(),aRequest->Dest().FullName().Mid(2),&KCapFsSysReplace,&KCapFsPriReplace,&KCapFsROReplace, __PLATSEC_DIAGNOSTIC_STRING("File Server Replace"));	
 	if(r == KErrNone)
 		{
 		if (pOldDrive!=aRequest->Drive())
@@ -242,7 +242,7 @@
 
 	// Check the capabilites but always allow the entry to be read for private, system and 
 	// resource directories as long as there are no sub folders or files specified
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsEntry, __PLATSEC_DIAGNOSTIC_STRING("Entry"), ETrue);	
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsEntry, __PLATSEC_DIAGNOSTIC_STRING("Entry"), ETrue);	
 
 	return(r);
 	}
@@ -277,7 +277,7 @@
 	TInt r=ParseNoWildSubstCheckPathPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
- 	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysSetEntry,&KCapFsPriSetEntry,&KCapFsROSetEntry, __PLATSEC_DIAGNOSTIC_STRING("Set Entry"));	
+ 	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysSetEntry,&KCapFsPriSetEntry,&KCapFsROSetEntry, __PLATSEC_DIAGNOSTIC_STRING("Set Entry"));	
 	return(r);
 	}
 
@@ -390,7 +390,7 @@
 	TInt r=ParseNoWildSubstFileCheckPtr1(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysReadFileSection,&KCapFsPriReadFileSection, __PLATSEC_DIAGNOSTIC_STRING("Read File Section"));	
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysReadFileSection,&KCapFsPriReadFileSection, __PLATSEC_DIAGNOSTIC_STRING("Read File Section"));	
 	return(r);
 	}
 
@@ -481,7 +481,7 @@
 	TInt r=ParseNoWildSubstCheckPathPtr0(aRequest,aRequest->Src());	
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysGetShortName,&KCapFsPriGetShortName, __PLATSEC_DIAGNOSTIC_STRING("Get Short Name"));	
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysGetShortName,&KCapFsPriGetShortName, __PLATSEC_DIAGNOSTIC_STRING("Get Short Name"));	
 	return(r);
 	}
 
@@ -508,7 +508,7 @@
 	TInt r=ParseNoWildSubstCheckPathPtr0(aRequest,aRequest->Src());	
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysGetLongName,&KCapFsPriGetLongName, __PLATSEC_DIAGNOSTIC_STRING("Get Long Name"));	
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysGetLongName,&KCapFsPriGetLongName, __PLATSEC_DIAGNOSTIC_STRING("Get Long Name"));	
 	return(r);
 	}
 
@@ -537,7 +537,7 @@
 	TInt r=ParseNoWildSubstCheckPathPtr0(aRequest,aRequest->Src());	
 	if (r!=KErrNone)
 		return (r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysIsFileInRom,&KCapFsPriIsFileInRom, __PLATSEC_DIAGNOSTIC_STRING("Is File In Rom"));	
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysIsFileInRom,&KCapFsPriIsFileInRom, __PLATSEC_DIAGNOSTIC_STRING("Is File In Rom"));	
 	return(r);
 	}
 
--- a/userlibandfileserver/fileserver/sfile/sf_notifier.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_notifier.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -24,20 +24,21 @@
 CFsPool<CFsNotificationBlock>* FsNotificationManager::iPool;
 
 
-CFsNotificationPathFilter* CFsNotificationPathFilter::NewL(const TDesC& aPath, const TDesC& aFilename)
+CFsNotificationPathFilter* CFsNotificationPathFilter::NewL(const TDesC& aPath, const TDesC& aFilename, TInt aDriveNum)
 	{
 	CFsNotificationPathFilter* self = new (ELeave) CFsNotificationPathFilter();
 	CleanupStack::PushL(self);
-	self->ConstructL(aPath,aFilename);
+	self->ConstructL(aPath,aFilename,aDriveNum);
 	CleanupStack::Pop(self);
 	return self;
 	}
 
-void CFsNotificationPathFilter::ConstructL(const TDesC& aPath, const TDesC& aFilename)
+void CFsNotificationPathFilter::ConstructL(const TDesC& aPath, const TDesC& aFilename, TInt aDriveNum)
 	{
 	//Allocate the path and filename
 	iPath = aPath.AllocL();
 	iFilename = aFilename.AllocL();	
+	iDriveNum = aDriveNum;
 	}
 
 CFsNotificationPathFilter::~CFsNotificationPathFilter()
@@ -176,7 +177,7 @@
 			if(filterTypeCount)
 				{
 				//Remove this type from the filter register
-				TFsNotification::TFsNotificationType type = FsNotificationHelper::NotificationType(filterType);
+				TFsNotification::TFsNotificationType type = CFsNotificationInfo::NotificationType(filterType);
 				FsNotificationManager::SetFilterRegister(type,EFalse,filterTypeCount);
 				}
 			filterList.Reset();
@@ -188,8 +189,6 @@
 		currentDriveFilters = (TFsNotificationTypeDriveArray*)iterator.NextValue();
 		}
 	iDrivesTypesFiltersMap.Close();
-	iPathFilterList.ResetAndDestroy();
-	iPathFilterList.Close();
 	return KErrNone;
 	}
 
@@ -197,10 +196,8 @@
 	{
 	__PRINT(_L("CFsNotifyRequest::AddFilterL"));
 
-	iPathFilterList.AppendL(aFilter);
-	
 	//Get the drive number to so know which drive array to add the filter(s) to.
-	TInt driveNum = FsNotificationHelper::DriveNumber(aFilter->iPath->Des()); 
+	TInt driveNum = aFilter->iDriveNum; 
 	
 	TInt notifyType = 1; 
 	TInt r = KErrNone;
@@ -213,7 +210,7 @@
 			TFsNotificationTypeFilter typeFilter;
 			typeFilter.iNotificationType = (TFsNotification::TFsNotificationType) notifyType;
 			typeFilter.iPathFilter = aFilter;
-			TInt index = FsNotificationHelper::TypeToIndex(typeFilter.iNotificationType);
+			TInt index = CFsNotificationInfo::TypeToIndex(typeFilter.iNotificationType);
 			
 			//If the per-drive-filterLists have not
 			//been set up yet then do so now.
@@ -256,6 +253,11 @@
 	return iClientMsg.Handle();
 	}
 
+const RMessage2& CFsNotifyRequest::BufferMessage()
+    {
+    return iBufferMsg;
+    }
+
 void CFsNotifyRequest::CloseNotification()
 	{
 	__PRINT(_L("CFsNotifyRequest::CloseNotification()"));
@@ -328,7 +330,7 @@
 			User::LeaveIfError(iChainLock.CreateLocal());	
 			}
 		iNotifyRequests = TheContainer->CreateL();
-		iPool = CFsPool<CFsNotificationBlock>::New(KNotificationPoolSize);
+		iPool = CFsPool<CFsNotificationBlock>::New(KNotificationPoolSize,CFsNotificationBlock::New);
 		User::LeaveIfNull(iPool);
 		}
 	}
@@ -336,7 +338,7 @@
 void FsNotificationManager::SetFilterRegister(TUint aFilter, TBool aAdd, TInt aCount)
 	{
 	__PRINT2(_L("FsNotificationManager::SetFilterRegister(aFilter=%u,aAdd=%d)"),aFilter,aAdd);
-	TInt index = FsNotificationHelper::TypeToIndex((TFsNotification::TFsNotificationType)aFilter);
+	TInt index = CFsNotificationInfo::TypeToIndex((TFsNotification::TFsNotificationType)aFilter);
 	TInt& fr = FsNotificationManager::FilterRegister(index);
 	__ASSERT_DEBUG((aAdd) ? fr >= 0 : fr > 0,Fault(ENotificationFault));
 	fr+= aAdd ? aCount : -aCount; 
@@ -400,9 +402,9 @@
 	}
 
 //Get the notification type based on the TFsMessage function
-void FsNotificationHelper::NotificationType(TInt aFunction,TFsNotification::TFsNotificationType& aNotificationType)
+void CFsNotificationInfo::NotificationType(TInt aFunction,TNotificationType& aNotificationType)
 	{
-	__PRINT(_L("FsNotificationHelper::NotificationType"));
+	__PRINT(_L("CFsNotificationInfo::NotificationType"));
 	switch(aFunction)
 		{
 		case EFsFileWrite:
@@ -486,258 +488,7 @@
 	}
 
 
-//=====FsNotificationManager===========================
  
-//Get the path of the file, folder or drive name based on the TFsMessage function
-void FsNotificationHelper::PathName(CFsClientMessageRequest& aRequest, TDes& aPath)
-	{
-	__PRINT(_L("FsNotificationHelper::PathName"));
-	//Get the notification type
-	TInt function = aRequest.Operation()->Function();
-	
-	//Get the filename(s)
-	switch(function)
-		{
-		case EFsFileWrite:			//EParseSrc | EFileShare
-		case EFsFileSetSize:		//EParseSrc | EFileShare
-		case EFsFileSetAtt:			//EParseDst | EParseSrc, - should not use these; has share.
-		case EFsFileSet:
-		case EFsFileWriteDirty:		//EFileShare
-			{
-			CFileShare* share = NULL;
-			CFileCB* file = NULL;
-			GetFileFromScratch(&aRequest,share,file);	
-			aPath.Append(file->DriveNumber() + 'A');
-			aPath.Append(':');
-			aPath.Append(file->FileName().Des());
-			break;
-			}
-		case EFsFileCreate:			//EParseSrc
-		case EFsDelete:				//EParseSrc
-		case EFsSetEntry:			//EParseSrc,
-		case EFsFileRename:			//EParseDst | EParseSrc,
-		case EFsRename:				//EParseDst | EParseSrc,
-		case EFsReplace:			//EParseDst | EParseSrc,
-		case EFsFileReplace:		//EParseSrc
-			{
-			aPath.Copy(aRequest.Src().FullName());
-			break;
-			}
-        case EFsRmDir:              //EParseSrc
-        case EFsMkDir:              //EParseSrc
-            {
-            aPath.Copy(aRequest.Src().DriveAndPath());
-            break;
-            }
-		case EFsFormatNext:			//EParseSrc
-		case EFsDismountFileSystem: //0
-		case EFsMountFileSystem:	//0
-		case EFsSetVolume:			//0
-		case EFsSetDriveName:		//ESync
-		case EFsRawDiskWrite:		//EParseSrc
-		case EFsMountFileSystemScan:
-			{
-			_LIT(KFormatDrive,"?:");
-			TBuf<2> drive;
-			drive.Append(KFormatDrive);
-			drive[0] = TText(aRequest.Drive()->DriveNumber() + 'A');
-			aPath.Copy(drive);
-			break;
-			}
-		default:
-			ASSERT(0);
-			break;
-		}
-	}
-
-//Get the new path of the file, folder or drive name based on the TFsMessage function
-void FsNotificationHelper::NewPathName(CFsClientMessageRequest& aRequest, TPtrC& aNewPath)
-	{
-	__PRINT(_L("FsNotificationHelper::NewPathName"));
-	//Get the notification type
-	TInt function = aRequest.Operation()->Function();
-
-	//Get the filename(s)
-	switch(function)
-		{
-		case EFsFileRename:			//EParseDst | EParseSrc,
-		case EFsRename:				//EParseDst | EParseSrc,
-		case EFsReplace:			//EParseDst | EParseSrc,
-			{
-			aNewPath.Set(aRequest.Dest().FullName());
-			break;
-			}
-		case EFsSetDriveName:		//ESync
-			{
-			TFileName name;
-			aRequest.ReadL(KMsgPtr1, name);
-			aNewPath.Set(name);
-			break;
-			}
-		case EFsSetVolume:			//0
-			{
-			TFileName name;
-			aRequest.ReadL(KMsgPtr0, name);
-			aNewPath.Set(name);
-			break;
-			}
-		default:
-			{
-			ASSERT(0);
-			break;
-			}
-		}
-	}
-
-//Get the size of the notification based on its type
-TInt FsNotificationHelper::NotificationSize(CFsClientMessageRequest& aRequest, TFsNotification::TFsNotificationType aNotificationType, const TDesC& aName)
-	{
-	__PRINT(_L("FsNotificationHelper::NotificationSize"));
-	
-	/*
-	 * If there are no new names, the order of the data in the buffer is:
-	 * Word1   : NotificationSize (2 bytes) , PathSize (2 bytes)
-	 * Word2   : NotificationType (Lower 2 bytes)
-	 * Word(s) : Path (TText8) , [Any sub-class members]
-	 * 
-	 * Else for notification types ERename, EVolumeName and EDriveName the order is:
-	 * Word1   : NotificationSize (2 bytes) , PathSize (2 bytes)
-	 * Word2   : NewNameSize (2 bytes) , NotificationType (2 bytes)
-	 * Word(s) : Path (TText8) , NewName (TText8)
-	 * 
-	 * EOverflow size: KNotificationHeaderSize
-	 */	
-	
-	TInt size = KNotificationHeaderSize + Align4(aName.Size());
-	
-	switch(aNotificationType)
-		{
-		//NewName
- 		case TFsNotification::ERename:
-		case TFsNotification::EVolumeName:
-		case TFsNotification::EDriveName:
-			{
-			TPtrC dest;
-			NewPathName(aRequest,dest);
-			size += Align4(dest.Size()); 
-			break;
-			}
-		case TFsNotification::EFileChange:
-			{
-			size += sizeof(TInt64);
-			break;
-			}
-		case TFsNotification::EAttribute:
-			{
-			size += sizeof(TUint64);
-			break;
-			}
-		case TFsNotification::ECreate: 
-		case TFsNotification::EDelete:
-		case TFsNotification::EMediaChange:
-			{
-			break;
-			}
-		default:
-			{
-			ASSERT(0);
-			break;
-			}
-		}
-	return (TUint16) size;
-	}
-
-TFsNotification::TFsNotificationType FsNotificationHelper::NotificationType(TInt& aIndex)
-	{
-	__PRINT(_L("FsNotificationHelper::NotificationType(TInt)"));
-	__ASSERT_DEBUG(aIndex < KNumRegisterableFilters, Fault(ENotificationFault));
-	
-	switch(aIndex) //No break statements here on purpose
-		{
-		case 7 : return TFsNotification::EMediaChange;
-		case 6 : return TFsNotification::EDriveName;
-		case 5 : return TFsNotification::EVolumeName;
-		case 4 : return TFsNotification::EDelete;
-		case 3 : return TFsNotification::EAttribute;
-		case 2 : return TFsNotification::ECreate;
-		case 1 : return TFsNotification::ERename;
-		case 0 : return TFsNotification::EFileChange;
-		default: ASSERT(0); return (TFsNotification::TFsNotificationType) 0;
-		}
-	}
-
-//Get the array index of the notification based on its type
-TInt FsNotificationHelper::TypeToIndex(TFsNotification::TFsNotificationType aType)
-	{
-	__PRINT(_L("FsNotificationHelper::ArrayIndex"));
-
-	TInt index = 0; 
-	switch(aType) //No break statements here on purpose
-		{
-		case TFsNotification::EMediaChange: index++;
-		case TFsNotification::EDriveName:	index++;
-		case TFsNotification::EVolumeName:	index++;
-		case TFsNotification::EDelete:	 	index++;
-		case TFsNotification::EAttribute:	index++;
-		case TFsNotification::ECreate:	 	index++;
-		case TFsNotification::ERename:	 	index++;
-		case TFsNotification::EFileChange:	// skip;
-		default: break;
-		}
-	__ASSERT_DEBUG(index < KNumRegisterableFilters, Fault(ENotificationFault));
-	return index;
-	}
-
-TInt FsNotificationHelper::DriveNumber(const TPtrC& aPath)
-	{
-	if(aPath.Length() >= 2 && ((TChar)aPath[1])==(TChar)':')
-		{
-		TChar driveChar = ((TChar)aPath[0]);
-		driveChar.UpperCase();
-		TInt driveNum = driveChar-(TChar)'A'; 
-		return driveNum;
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-//Get the attributes set and cleared
-void FsNotificationHelper::Attributes(CFsClientMessageRequest& aRequest, TUint& aSet, TUint& aClear)
-	{
-	__PRINT(_L("FsNotificationHelper::Attributes"));
-
-	TInt function = aRequest.Operation()->Function();
-	const RMessage2& msg = aRequest.Message();
-
-	switch(function)
-		{
-		case EFsFileSet:
-			{
-			aSet = msg.Int1();
-			aClear = msg.Int2();
-			break;
-			}
-		case EFsFileSetAtt:
-			{
-			aSet = msg.Int0();
-			aClear = msg.Int1();
-			break;
-			}
-		case EFsSetEntry:
-			{
-			aSet = msg.Int2();
-			aClear = msg.Int3();
-			break;
-			}
-		default:
-			{
-			ASSERT(0);
-			break;
-			}
-		}
-	}
 
 
 TBool CFsNotifyRequest::ValidateNotification(TInt aNotificationSize, TInt& aServerTail)
@@ -898,7 +649,7 @@
 // If there is a iClientMsg then this is the first time this
 // has been called since the client called RequestNotifications.
 // In this situation we complete the client request.
-TInt CFsNotifyRequest::NotifyChange(CFsClientMessageRequest* aRequest,const TDesC& aName, TFsNotification::TFsNotificationType aNotificationType, CFsNotificationBlock& aBlock)
+TInt CFsNotifyRequest::NotifyChange(CFsNotificationInfo* aRequest, CFsNotificationBlock& aBlock)
 	{
 	/*
 	 * Different notification types have different data associated with them.
@@ -920,8 +671,8 @@
 	
 	__PRINT(_L("CFsNotifyRequest::NotifyChange()"));
 
-	TInt notificationSize = FsNotificationHelper::NotificationSize(*aRequest,aNotificationType,aName);
-	
+    TInt notificationSize = CFsNotificationInfo::NotificationSize(*aRequest);
+    
 	iClientSyncLock.Wait();
 	iTailSemaphore.Wait();
 	
@@ -936,16 +687,23 @@
 	//We can store the size of the notification 
 	//and the size of the name in the same word.
 	
+	TBuf<2> driveBuf;
+	driveBuf.SetLength(2);
+    TChar driveLetter = 'A';
+    RFs::DriveToChar(aRequest->DriveNumber(),driveLetter);
+    driveBuf[0] = (TText)driveLetter;
+    driveBuf[1] = (TText)':';
+	
 	TUint16 nameLen = 0;	//Overflow has no name
 	TInt notifSize = KNotificationHeaderSize;
 	if(!overflow)
 		{
-		nameLen = (TUint16)aName.Size();
+        nameLen = (TUint16)aRequest->SourceSize();
 		notifSize = notificationSize;
 		}
 	else 
 		{
-		aNotificationType = TFsNotification::EOverflow;
+        aRequest->NotificationType() = TFsNotification::EOverflow;
 		}	
 
 	iServerTail = tail + notifSize;
@@ -958,62 +716,47 @@
 	memcpy((TText8*)aBlock.Data()+writeOffset,&sizeNameLen,sizeof(TUint));
 	writeOffset+=sizeof(TUint);
 
-	TPtrC newName;
-	
-	if (aNotificationType == TFsNotification::ERename ||
-		aNotificationType == TFsNotification::EVolumeName ||
-		aNotificationType == TFsNotification::EDriveName)
-		{
-		FsNotificationHelper::NewPathName(*aRequest,newName);
-		//Store NewNameSize and notification Type (Word2)
-		TUint typeNewNameLen = ((TUint16)newName.Size() << 16) | (TUint16)aNotificationType;
+    if (aRequest->NotificationType() == TFsNotification::ERename ||
+        aRequest->NotificationType() == TFsNotification::EVolumeName ||
+        aRequest->NotificationType() == TFsNotification::EDriveName)
+        {
+        //Store NewNameSize and notification Type (Word2)
+        TUint typeNewNameLen = ((TUint16)aRequest->NewNameSize() << 16) | (TUint16)aRequest->NotificationType();
 		memcpy((TText8*)aBlock.Data()+writeOffset,&typeNewNameLen,sizeof(TUint));
 		}
 	else
 		{
 		//Store notification Type (Word2)
-		memcpy((TText8*)aBlock.Data()+writeOffset,&aNotificationType,sizeof(TUint));
+        memcpy((TText8*)aBlock.Data()+writeOffset,&aRequest->NotificationType(),sizeof(TUint));
 		}
 	writeOffset+=sizeof(TUint);
 	
-	CFileShare* share = NULL;
-    CFileCB* file = NULL;
-    if(aRequest) //Don't always have a request such as when called from localdrives.
-        {
-        GetFileFromScratch(aRequest, share, file);
-        }
-    
     //
     //Store UID
-    /*
-	TUid uid;
-	uid.iUid = KErrUnknown;
-	if(aRequest && aRequest->Operation()->iFunction == EFsFileWriteDirty)
-	    {
-	    uid = aRequest->iUID;
-	    }
-	else if(aRequest)
-	    {
-	    uid = aRequest->Message().Identity();
-	    }
-	memcpy((TText8*)aBlock.Data()+writeOffset,&uid.iUid,sizeof(TUint32));
+	memcpy((TText8*)aBlock.Data()+writeOffset,&aRequest->Uid().iUid,sizeof(TUint32));
 	writeOffset+=sizeof(TUint32);
-	*/
+	
 	
 	if(!overflow)
 		{
 		//Store Name (Word3)
-		memcpy((TText8*)aBlock.Data()+writeOffset,aName.Ptr(),aName.Size());
-		writeOffset += Align4(aName.Size());
-		
+	    {
+	    //Store driveColon
+	    if(aRequest->NotificationType()!=TFsNotification::EMediaChange)
+	        {
+	        memcpy((TText8*)aBlock.Data()+writeOffset,driveBuf.Ptr(),driveBuf.Size());
+	        writeOffset += driveBuf.Size(); //NB: Not Align4'd deliberately.
+	        }
+	    memcpy((TText8*)aBlock.Data()+writeOffset,aRequest->Source().FullName().Ptr(),aRequest->Source().FullName().Size());
+	    writeOffset += Align4(aRequest->Source().FullName().Size());
+	    }
 
-		switch (aNotificationType)
+        switch (aRequest->NotificationType())
 			{
 			case TFsNotification::EFileChange:
+			case TFsNotification::EAttribute:
 				{
-				TInt64 size = 0;
-				size = file->CachedSize64();
-				memcpy((TText8*)aBlock.Data()+writeOffset,&size,sizeof(TInt64));
+                memcpy((TText8*)aBlock.Data()+writeOffset,aRequest->Data(),sizeof(TInt64));
 				writeOffset += sizeof(TInt64);
 				break;
 				}
@@ -1022,20 +765,19 @@
 			case TFsNotification::EDriveName:
 				{
 				//Store NewName
-				memcpy((TText8*)aBlock.Data()+writeOffset,newName.Ptr(),newName.Size());
-				writeOffset += Align4(newName.Size());
+				
+				if(!aRequest->DestDriveIsSet())
+				    {
+				    //This means that the notification has come from a Mount rather than from FileServer
+				    //It also means that the new name will have the same drive letter as the source.
+				    memcpy((TText8*)aBlock.Data()+writeOffset,driveBuf.Ptr(),driveBuf.Size());
+				    writeOffset += driveBuf.Size(); //NB: Not Align4'd deliberately.
+				    }
+                memcpy((TText8*)aBlock.Data()+writeOffset,aRequest->NewName().FullName().Ptr(),aRequest->NewName().FullName().Size());
+                writeOffset += Align4(aRequest->NewName().FullName().Size());
 				break;
 				}
-			case TFsNotification::EAttribute:
-				{
-				TUint set=0;
-				TUint clear=0;
-				FsNotificationHelper::Attributes(*aRequest,set,clear);
-				TUint64 att = MAKE_TUINT64(set,clear);
-				memcpy((TText8*)aBlock.Data()+writeOffset,&att,sizeof(TUint64));
-				writeOffset += sizeof(TUint64);
-				break;
-				}
+
 			default:
 				{
 				break;
@@ -1085,107 +827,71 @@
 //A change has occurred in f32 represented by this
 //request object. Work out which CfsNotify’s are interested
 // (if any) and call CfsNotifyRequest::NotifyChange.
-void FsNotificationManager::HandleChange(CFsClientMessageRequest* aRequest,const TDesC& aOperationName, TFsNotification::TFsNotificationType aType)
-	{
-	__PRINT2(_L("FsNotificationManager::HandleChange() aRequest=0x%x, aType=%d"),&aRequest,aType);
-
-	Lock(); //ToDo: Read Lock (Read/Write Lock)	
-	if(Count())
-		{
-		//Only search while there are filters of this type set up.
-		TInt index = FsNotificationHelper::TypeToIndex(aType);
-		TInt& filterCount = FsNotificationManager::FilterRegister(index);
-		TInt seenFilter = filterCount; //Number of requests set up for this type
-		
-		//Iterate CFsNotifyRequests
-		TInt count = iNotifyRequests->Count();
-		
-		if(aType == TFsNotification::EMediaChange)
-			seenFilter = count;
-		
-		//If there aren't any requests then breakout
-		if(count == 0)
-			{
-			Unlock();
-			return;
-			}
-		
-		TInt driveNum = FsNotificationHelper::DriveNumber(aOperationName); 
+void FsNotificationManager::HandleChange(CFsNotificationInfo& aRequest)
+    {
+    __PRINT2(_L("FsNotificationManager::HandleChange() aNotificationInfo=0x%x,NotificationType=%d"),&aRequest,aRequest.NotificationType());
+    if(Count())
+        {
+        Lock(); //ToDo: Read Lock (Read/Write Lock) 
+        if(Count())
+            {
+            //Only search while there are filters of this type set up.
+            TInt index = CFsNotificationInfo::TypeToIndex(aRequest.NotificationType());
+            TInt& filterCount = FsNotificationManager::FilterRegister(index);
+            TInt seenFilter = filterCount; //Number of requests set up for this type
+            
+            //Iterate CFsNotifyRequests
+            TInt count = iNotifyRequests->Count();
+            
+            if(aRequest.NotificationType() == TFsNotification::EMediaChange)
+                seenFilter = count;
+            
+            //If there aren't any requests then breakout
+            if(count == 0)
+                {
+                Unlock();
+                return;
+                }
+            
+            //For every notification request(i.e. every CFsNotify client-side).
+            for(TInt i=0; i<count && seenFilter; ++i)
+                {
+                CFsNotifyRequest* notifyRequest = (CFsNotifyRequest*)(*iNotifyRequests)[i];
+                CFsNotifyRequest::TNotifyRequestStatus status = notifyRequest->ActiveStatus();
+                if(! (status==CFsNotifyRequest::EActive || 
+                      status==CFsNotifyRequest::EOutstanding))
+                    {
+                    //Not active; check next notification request
+                    continue;
+                    }
+                
+                //Check whether we are interested in this change.
+                //Get the filters associated with this operation on this drive
+                TFsNotificationTypeArray* filterList = notifyRequest->FilterTypeList(aRequest.DriveNumber(),index);
+                DoHandleChange(filterList,seenFilter,aRequest,notifyRequest);
 
-		//For every notification request.
-		for(TInt i=0; i<count && seenFilter; ++i)
-			{
-			CFsNotifyRequest* notifyRequest = (CFsNotifyRequest*)(*iNotifyRequests)[i];
-			CFsNotifyRequest::TNotifyRequestStatus status = notifyRequest->ActiveStatus();
-			if(! (status==CFsNotifyRequest::EActive || 
-				  status==CFsNotifyRequest::EOutstanding))
-				{
-				//Not active; check next notification request
-				continue;
-				}
-			
-			//Check whether we are interested in this change.
-			//Get the filters associated with this operation on this drive
-			TFsNotificationTypeArray* filterList = notifyRequest->FilterTypeList(driveNum,index);
-			DoHandleChange(filterList,seenFilter,aRequest,notifyRequest,aOperationName,aType);
-
-			if(aType==TFsNotification::EMediaChange)
-				continue; //next request
-			
-			//If there are still filters to check
-			if(seenFilter)
-				{
-				//Check changes that are not tied to a particular drive
-				filterList = notifyRequest->FilterTypeList(KErrNotFound,index);
-				DoHandleChange(filterList,seenFilter,aRequest,notifyRequest,aOperationName,aType);
-				}
-			}
-		}
-	Unlock();
-	}
-
-//A change has occurred in f32 represented by this
-//request object. Work out which CfsNotify’s are interested
-// (if any) and call CfsNotifyRequest::NotifyChange.
-void FsNotificationManager::HandleChange(CFsClientMessageRequest& aRequest, TFsNotification::TFsNotificationType aType)
-	{
-	__PRINT(_L("FsNotificationManager::HandleChange"));
-	TFileName currentOperationsName;
-	FsNotificationHelper::PathName(aRequest, currentOperationsName);
-	if(currentOperationsName.Length())
-		HandleChange(&aRequest,currentOperationsName,aType);
-	}
-
-//A change has occurred in f32 represented by this
-//request object. Work out which CfsNotify’s are interested
-// (if any) and call CfsNotifyRequest::NotifyChange.
-void FsNotificationManager::HandleChange(CFsClientMessageRequest& aRequest)
-	{
-	if(Count() && aRequest.Message().Handle() != KLocalMessageHandle)
-		{
-		__PRINT(_L("FsNotificationManager::HandleChange"));
-		TFsNotification::TFsNotificationType operationNotificationType;
-		FsNotificationHelper::NotificationType(aRequest.FsFunction(), operationNotificationType);
-		HandleChange(aRequest,operationNotificationType);
-		}
-	}
+                if(aRequest.NotificationType()==TFsNotification::EMediaChange)
+                    continue; //next request
+                
+                //If there are still filters to check
+                if(seenFilter)
+                    {
+                    //Check changes that are not tied to a particular drive
+                    filterList = notifyRequest->FilterTypeList(KErrNotFound,index);
+                    DoHandleChange(filterList,seenFilter,aRequest,notifyRequest);
+                    }
+                }
+            }
+        Unlock();
+        }
+    }
 
 
 ////
 #else
 ////
 
-void FsNotificationManager::HandleChange(CFsClientMessageRequest* ,const TDesC&, TFsNotification::TFsNotificationType)
-	{
-	return;
-	}
-
-void FsNotificationManager::HandleChange(CFsClientMessageRequest& , TFsNotification::TFsNotificationType)
-	{
-	return;
-	}
-
-void FsNotificationManager::HandleChange(CFsClientMessageRequest&)
+void FsNotificationManager::HandleChange(CFsNotificationInfo&)
 	{
 	return;
 	}
@@ -1193,10 +899,11 @@
 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
 
 //Called from FsNotificationManager::DoHandleChange
-FsNotificationManager::TFsNotificationFilterMatch FsNotificationManager::DoMatchFilter(CFsClientMessageRequest* aRequest, const TDesC& aOperationName,CFsNotificationPathFilter& aFilter)
+FsNotificationManager::TFsNotificationFilterMatch FsNotificationManager::DoMatchFilter(const RMessage2& aMessage, const TDesC& aOperationName,CFsNotificationPathFilter& aFilter)
     {
     TFsNotificationFilterMatch filterMatch = EDifferent;
     TParsePtrC parseOp(aOperationName);
+    
     TPtrC pathOpDes = parseOp.DriveAndPath();
     TPtrC nameOpDes = parseOp.NameAndExt();
     TInt pathLength = aFilter.iPath->Des().Length();
@@ -1210,7 +917,7 @@
     else //if no path filter was set up
         // then we need to ensure we don't notify on data-caged areas which we shouldn't
         {
-        TInt r = PathCheck(aRequest,aOperationName.Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("FsNotificationManager::DoHandleChange"));
+        TInt r = PathCheck(aMessage,aOperationName.Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("FsNotificationManager::DoHandleChange"));
         if(r != KErrNone)
             return EContinue; //next filter
         }
@@ -1228,8 +935,9 @@
     return filterMatch;
     }
 
-// This is called on a per drive basis.
-void FsNotificationManager::DoHandleChange(TFsNotificationTypeArray* aFilterTypeArray,TInt& aSeenFilter, CFsClientMessageRequest* aRequest, CFsNotifyRequest* aNotifyRequest, const TDesC& aOperationName, TFsNotification::TFsNotificationType& aType)
+// The aFilterTypeArray is an array for the filters that target the current drive (only).
+// This is called on a per client (CFsNotify) basis.
+void FsNotificationManager::DoHandleChange(TFsNotificationTypeArray* aFilterTypeArray,TInt& aSeenFilter, CFsNotificationInfo& aNotificationInfo, CFsNotifyRequest* aNotifyRequest)
 	{		
 	__PRINT(_L("FsNotificationManager::DoHandleChange()"));
 	
@@ -1238,36 +946,39 @@
 	
 	TInt numFilters = aFilterTypeArray->Count();
 	
-	if(aType == TFsNotification::EMediaChange)
-		numFilters = 1; //Only need to notify once per drive.
-		
-	//For every filter in this request
+    if(aNotificationInfo.NotificationType() == TFsNotification::EMediaChange)
+        numFilters = 1; //Only need to notify once per client for EMediaChange.
+        
+    //For every filter in this request (CFsNotify)
 	for(TInt j = 0; j < numFilters;++j)
 		{
 		//Is the correct notification type
 		aSeenFilter--;
 		
 		TBool filterMatch = EDifferent;
-		if(aType != TFsNotification::EMediaChange)
+        if(aNotificationInfo.NotificationType()  != TFsNotification::EMediaChange)
 			{
 			CFsNotificationPathFilter& filter = *(((*aFilterTypeArray)[j]).iPathFilter);
-			__PRINT2(_L("FsNotificationManager::DoHandleChange() operationName=%S, filterName=%S"),&aOperationName,filter.iPath);
-			
-			filterMatch = DoMatchFilter(aRequest,aOperationName,filter);
+            __PRINT2(_L("FsNotificationManager::DoHandleChange() operationName=%S, filterName=%S"),&aNotificationInfo.Source().FullName(),filter.iPath);
+            
+			//buferMsg here is the message of the client *recieving* the notification
+            const RMessage2& bufferMsg = aNotifyRequest->BufferMessage();
+            filterMatch = DoMatchFilter(bufferMsg,aNotificationInfo.Source().FullName(),filter);
 			if(filterMatch == FsNotificationManager::EContinue)
 			    continue; //triggers for data cages
 			
 			//We need to check for changes coming in to a directory when its rename
-			if(aType == TFsNotification::ERename && filterMatch==FsNotificationManager::EDifferent)  
+            if(aNotificationInfo.NotificationType() == TFsNotification::ERename && filterMatch==FsNotificationManager::EDifferent)  
                 {
-                TPtrC aDestinationNamePtrC;
-                FsNotificationHelper::NewPathName(*aRequest,aDestinationNamePtrC);
-                __PRINT2(_L("FsNotificationManager::DoHandleChange() destinationName=%S, filterName=%S"),&aDestinationNamePtrC,filter.iPath);
-                filterMatch = DoMatchFilter(aRequest,aDestinationNamePtrC,filter);
+                __PRINT2(_L("FsNotificationManager::DoHandleChange() destinationName=%S, filterName=%S"),&aNotificationInfo.NewName().FullName(),filter.iPath);
+                if(aNotificationInfo.DestDriveIsSet())
+                    filterMatch = DoMatchFilter(bufferMsg,aNotificationInfo.NewName().FullName().Mid(2),filter);
+                else
+                    filterMatch = DoMatchFilter(bufferMsg,aNotificationInfo.NewName().FullName(),filter);
                 }
 			}
 
-		if(filterMatch || (aType == TFsNotification::EMediaChange))//Match or MediaChange (report regardless of filters)
+        if(filterMatch || (aNotificationInfo.NotificationType() == TFsNotification::EMediaChange))//Match or MediaChange (report regardless of filters)
 			{
 			//Matching - Handle change
 			
@@ -1275,7 +986,7 @@
 			//So that we can do IPC from a single place.
 			CFsNotificationBlock* block = iPool->Allocate();
 				
-			TInt r = aNotifyRequest->NotifyChange(aRequest,aOperationName,aType,*block);
+            TInt r = aNotifyRequest->NotifyChange(&aNotificationInfo,*block);
 				
 			//Free block
 			iPool->Free(block);
--- a/userlibandfileserver/fileserver/sfile/sf_notifier.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_notifier.h	Tue Nov 02 15:29:23 2010 +0000
@@ -51,12 +51,13 @@
 class CFsNotificationPathFilter
 	{
 public:
-	static CFsNotificationPathFilter* NewL(const TDesC& aPath, const TDesC& aFilename);
+	static CFsNotificationPathFilter* NewL(const TDesC& aPath, const TDesC& aFilename, TInt aDriveNum);
 	~CFsNotificationPathFilter();
 private:
-	void ConstructL(const TDesC& aPath, const TDesC& aFilename);
+	void ConstructL(const TDesC& aPath, const TDesC& aFilename, TInt aDriveNum);
 	CFsNotificationPathFilter();
 public:
+	TInt iDriveNum;
 	HBufC* iPath;
 	HBufC* iFilename;
 	};
@@ -119,7 +120,7 @@
 	
 	/*
 	 * Returns the RArray<TFsNotificationFilter> for an index
-	 * as returned from FsNotificationHelper::TypeToIndex()
+	 * as returned from CFsNotificationInfo::TypeToIndex()
 	 */
 	TFsNotificationTypeArray* FilterTypeList(TInt aDrive,TInt aIndex);
 	
@@ -157,11 +158,8 @@
 	 * notification of this operation to the client.
 	 * 
 	 * Calling of this function means that we are notifying about this operation. (all checks passed)
-	 * 
-	 * aRequest can be NULL when the request doesn't come from the file server 
-	 * (such as when a media card is removed)
 	 */
-	TInt NotifyChange(CFsClientMessageRequest* aRequest, const TDesC& aName, TFsNotification::TFsNotificationType aNotificationType, CFsNotificationBlock& aBlock);
+	TInt NotifyChange(CFsNotificationInfo* aRequest, CFsNotificationBlock& aBlock);
 		
 	/*
 	 * This function performs the IPC to the client's buffer.
@@ -174,6 +172,9 @@
 	//Simple getter
 	TInt ClientMsgHandle();
 	
+	//Platsec needs to check against the path with a message of the *receiving* client. 
+	const RMessage2& BufferMessage();
+	
 private:
 	CFsNotifyRequest();
 	void ConstructL();
@@ -216,15 +217,7 @@
 	 * Each index of the TFsNotificationTypeDriveArray is a TFsNotificationTypeArray
 	 */
 	RHashMap<TInt,TFsNotificationTypeDriveArray> iDrivesTypesFiltersMap;
-	
-	/*
-	 * The iPathFilterList is an RPointerArray of CFsNotificationPathFilters.
-	 * 
-	 * These are normally only accessed via a TFsNotificationTypeFilter (via iDrivesTypesFiltersMap),
-	 * not via this array directly.
-	 */
-	RPointerArray<CFsNotificationPathFilter> iPathFilterList;
-	
+		
 	RMessage2 iBufferMsg; //To update buffer
 	RMessage2 iClientMsg; //client notification request
 	
@@ -270,24 +263,6 @@
 	};
 
 /**
- * Helper class to get certain attributes from or about a particular operation to used in a notification
- * 
- * @internalTechnology
- */
-class FsNotificationHelper
-	{
-public:
-	static void NotificationType(TInt aFunction,TFsNotification::TFsNotificationType& aNotificationType);
-	static void PathName(CFsClientMessageRequest& aRequest, TDes& aName);
-	static void NewPathName(CFsClientMessageRequest& aRequest, TPtrC& aName);
-	static TInt NotificationSize(CFsClientMessageRequest& aRequest, TFsNotification::TFsNotificationType aNotificationType, const TDesC& aName);
-	static TInt TypeToIndex(TFsNotification::TFsNotificationType aType);
-	static TFsNotification::TFsNotificationType NotificationType(TInt& aIndex);
-	static TInt DriveNumber(const TPtrC& aPath);
-	static void Attributes(CFsClientMessageRequest& aRequest, TUint& aSet, TUint& aClear);
-	};
-
-/**
  * The FsNotificationManager is a static object
  * 
  *@internalTechnology
@@ -307,26 +282,8 @@
 	 * Work out which CFsNotifyRequests are interested
 	 * (if any) and call CFsNotifyRequest::NotifyChange.
 	 */
-	static void HandleChange(CFsClientMessageRequest& aRequest);
-	
-	/* A change has occurred represented by this request.
-	 * Work out which CFsNotifyRequests are interested
-	 * (if any) and call CFsNotifyRequest::NotifyChange.
-	 * 
-	 * This override is used directly when we want to force a particular notification type
-	 */
-	static void HandleChange(CFsClientMessageRequest& aRequest, TFsNotification::TFsNotificationType aType);
+	static void HandleChange(CFsNotificationInfo& aRequest);
 	
-	/* 
-	 * This override is used directly when we want to specify the current operation's name (src) and notification type.
-	 * 
-	 * aRequest can be NULL when the request doesn't come from the file server 
-	 * such as when a media card is removed, see LocalDrives::CompleteDriveNotifications
-	 * 
-	 * @See LocalDrives::CompleteDriveNotifications(TInt aDrive)
-	 */
-	static void HandleChange(CFsClientMessageRequest* aRequest, const TDesC& aOperationName, TFsNotification::TFsNotificationType aType);
-
 	//Initialise iNotifyRequests and iStaticNotification
 	static void OpenL();
 	static TBool IsInitialised();
@@ -350,7 +307,7 @@
 	static void SetFilterRegister(TUint aFilter, TBool aAdd, TInt aCount = 1);
 	/*
 	 * Get the number of registers filters set up on a particular type.
-	 * @param aIndex the TFsNotificationType's index as determined from FsNotificationHelper::TypeToIndex
+	 * @param aIndex the TFsNotificationType's index as determined from CFsNotificationInfo::TypeToIndex
 	 */
 	static TInt& FilterRegister(TInt aIndex);
 
@@ -386,13 +343,13 @@
     /*
      * Checks whether aOperation matches the filter name and/or path set in aFilter. 
      */
-    static TFsNotificationFilterMatch DoMatchFilter(CFsClientMessageRequest* aRequest, const TDesC& aOperationName,CFsNotificationPathFilter& aFilter);
+    static TFsNotificationFilterMatch DoMatchFilter(const RMessage2& aMessage, const TDesC& aOperationName,CFsNotificationPathFilter& aFilter);
     
 	/*
 	 * Iterates filters for a particular drive.
 	 * Called from HandleChange
 	 */
-	static void DoHandleChange(TFsNotificationTypeArray* aFilterTypeArray, TInt& aSeenFilter, CFsClientMessageRequest* aRequest, CFsNotifyRequest* aNotifyRequest, const TDesC& aOperationName, TFsNotification::TFsNotificationType& aType);
+	static void DoHandleChange(TFsNotificationTypeArray* aFilterTypeArray, TInt& aSeenFilter, CFsNotificationInfo& aNotificationInfo, CFsNotifyRequest* aNotifyRequest);
 	
 	/*
 	 * Stores the CFsNotifyRequests
--- a/userlibandfileserver/fileserver/sfile/sf_notifier_handlers.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_notifier_handlers.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -261,7 +261,7 @@
 		}
 	
 	if(path.Length() >= 2)
-		r=PathCheck(aRequest,path.Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("Notification Add Filter"));
+		r=PathCheck(aRequest->Message(),path.Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("Notification Add Filter"));
 	return r;
 	}
 
@@ -284,14 +284,32 @@
 	__PRINT2(_L("TFsNotificationAdd::AddNotification() path=%S, filename=%S"),&path,&filename);
 	
 	//If this is a path starting with 'drive-letter:'
-	TInt driveNum = FsNotificationHelper::DriveNumber(path);
-	if(path.Length() >= 2 && (driveNum < 0 || driveNum > 25) && ((TChar)driveNum)!=((TChar)'?') && ((TChar)path[1])==(TChar)':')
-		{
-		return KErrPathNotFound;
-		}
+	TInt driveNum = CFsNotificationInfo::DriveNumber(path);
+	if(path.Length() >= 2)
+	    {
+	    if(path[1] != (TText)':')
+	        {
+	        if(path[0]!=(TText)'*')
+	            {
+	            return KErrPathNotFound;
+	            }
+	        }
+	    else // 2nd char is ':' 
+	        {
+	        if(driveNum < EDriveA  || driveNum > EDriveZ)
+	            {
+	            if(path[0]!=(TText)'?')
+	                return KErrPathNotFound;
+	            }
+	        }
+	    }
 
 	CleanupStack::PushL(notifyRequest);
-	CFsNotificationPathFilter* filter = CFsNotificationPathFilter::NewL(path,filename);
+	TPtrC pathPtr(path);
+	if(driveNum!=KErrNotFound || ((path.Length() >=1) && path[0]=='?'))
+	    //Remove the drive: part of the the path if it's got one.
+	    pathPtr.Set(path.Mid(2));
+	CFsNotificationPathFilter* filter = CFsNotificationPathFilter::NewL(pathPtr,filename,driveNum);
 
 	//Bitmask of filter types
 	TUint filterMask = (TUint) aRequest->Message().Int0();
--- a/userlibandfileserver/fileserver/sfile/sf_notify.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_notify.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -16,14 +16,866 @@
 //
 
 #include "sf_std.h"
+#include "sf_notifier.h"
+#include "sf_pool.h"
 
-
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+#include <f32notification.h>
+#endif
 
 TChangeQue FsNotify::iChangeQues[KMaxNotifyQues];
 TDiskSpaceQue FsNotify::iDiskSpaceQues[KMaxDiskQues];
 TDebugQue FsNotify::iDebugQue;
 TDismountNotifyQue FsNotify::iDismountNotifyQue;
 
+_LIT(KEmptyString,"");
+
+CFsNotificationInfoBody::CFsNotificationInfoBody()
+: iSrc(KEmptyString),
+  iSrcBuf(KEmptyString),
+  iDest(KEmptyString),
+  iDestDriveStored(EFalse),
+  iFunction(KErrNotFound),
+  iData(KErrNotFound), 
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+  iNotificationType(TFsNotification::EOverflow),
+#else
+  iNotificationType(KErrNotFound),
+#endif
+  iUid(TUid::Null())
+    {
+    }
+
+CFsNotificationInfo::CFsNotificationInfo()
+    {
+    }
+
+/*
+ * These do not get deleted, they get Freed via CFsNotificationInfo::Free.
+ */
+CFsNotificationInfo::~CFsNotificationInfo()
+    {
+    Fault(ENotificationInfoDeletion);
+    }
+
+TInt CFsNotificationInfo::Init(TInt aFunction, TInt aDriveNum)
+    {
+    //Clean notification before use
+    CleanNotification();
+    
+    iBody->iFunction = aFunction;
+    TInt err = SetDriveNumber(aDriveNum);
+    if(err != KErrNone)
+        {
+        return err;
+        }
+ 
+    //Set notification type
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+    CFsNotificationInfo::NotificationType(iBody->iFunction, iBody->iNotificationType);
+#else
+    iBody->iNotificationType = KErrNotSupported;
+#endif   
+    return KErrNone;
+    }
+
+void CFsNotificationInfo::CleanNotification()
+    {
+    //Clear all variables 
+    TParsePtrC empty(KEmptyString);
+    memcpy(&iBody->iSrc,&empty,sizeof(TParsePtrC));
+    memcpy(&iBody->iDest,&empty,sizeof(TParsePtrC));
+    iBody->iData = KErrNotFound;
+    iBody->iRequest = NULL;
+    iBody->iDriveNumber = KErrNotFound;
+    iBody->iUid = TUid::Null();
+    iBody->iDestDriveStored = EFalse;
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+    iBody->iNotificationType=TFsNotification::EOverflow;
+#else
+    iBody->iNotificationType=KErrNotFound;
+#endif
+    }
+
+EXPORT_C CFsNotificationInfo* CFsNotificationInfo::Allocate(const CMountCB& aMount, TInt aFunction)
+    {
+    CFsNotificationInfo* info = NotificationInfoPool->Allocate();
+    __ASSERT_DEBUG(info,User::Panic(_L("CFsNotificationInfo::Allocate, Could not allocate"),KErrNotFound));
+    
+    TInt driveNum = aMount.Drive().DriveNumber();
+    __ASSERT_ALWAYS((driveNum >= EDriveA && driveNum <= EDriveZ), User::Panic(_L("CFsNotificationInfo::Allocate - Invalid Drive Num"),KErrArgument));
+    TInt err = info->Init(aFunction,driveNum);
+    if(err != KErrNone)
+        {
+        Free(info);
+        return NULL;
+        }
+    return info;
+    }
+
+
+CFsNotificationInfo* CFsNotificationInfo::Allocate(CFsMessageRequest& aRequest)
+    {
+    //Get a notification Info block from the pool.
+    CFsNotificationInfo* notificationInfo = NotificationInfoPool->Allocate();
+    
+    //Set the function and call Init.
+    TInt function = aRequest.Operation()->Function();
+    notificationInfo->iBody->iFunction = function;
+    TInt err = notificationInfo->Init(function,aRequest.DriveNumber());
+    if(err != KErrNone)
+        {
+        CFsNotificationInfo::Free(notificationInfo);
+        return NULL;
+        }
+
+    //Set request
+    notificationInfo->SetRequest(&aRequest);
+
+	//Set UID
+    notificationInfo->SetUid(aRequest.Uid()); 
+
+    //Set notification type
+#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+    CFsNotificationInfo::SetData(&aRequest,notificationInfo);
+#endif    
+    
+    CFsClientMessageRequest& msgRequest = (CFsClientMessageRequest&)aRequest;
+    
+    //Get and store Src
+    CFsNotificationInfo::PathName(msgRequest,notificationInfo->Source());
+    
+	//Get and store NewName/Dest
+    switch(function)
+        {
+        case EFsFileRename:
+        case EFsRename:    
+        case EFsReplace:   
+        case EFsSetDriveName:
+        case EFsSetVolume:
+            {
+            CFsNotificationInfo::NewPathName((CFsClientMessageRequest&)aRequest,notificationInfo->NewName());
+            notificationInfo->iBody->iDestDriveStored = ETrue;
+            }
+        default:
+            break;
+        }
+    return notificationInfo;
+    }
+
+CFsNotificationInfo* CFsNotificationInfo::Allocate(TInt aFunction, TInt aDrive)
+    {
+    //Get a notification Info block from the pool.
+    CFsNotificationInfo* notificationInfo = NotificationInfoPool->Allocate();
+    
+    //Set the function and call Init.
+    notificationInfo->iBody->iFunction = aFunction;
+    TInt err = notificationInfo->Init(aFunction,aDrive);
+    if(err != KErrNone)
+        {
+        CFsNotificationInfo::Free(notificationInfo);
+        return NULL;
+        }
+    
+    //Set request (NULL)
+    notificationInfo->SetRequest(NULL);
+	
+	//Set UID (KNullUid)
+    notificationInfo->SetUid(TUid::Null());
+    return notificationInfo;
+    }
+
+EXPORT_C void CFsNotificationInfo::Free(CFsNotificationInfo*& aNotificationInfo)
+    {
+    __ASSERT_DEBUG(aNotificationInfo,User::Panic(_L("CFsNotificationInfo::Free - KErrArgument"), KErrArgument));
+    NotificationInfoPool->Free(aNotificationInfo);    
+    aNotificationInfo = NULL;
+    }
+
+
+TInt CFsNotificationInfo::Initialise()
+    {
+    //Have to trap as sf_main.cpp commonInitialize doesn't.
+    TRAPD(r, NotificationInfoPool = CFsPool<CFsNotificationInfo>::New(KMaxDrives,CFsNotificationInfo::New));
+    if(r != KErrNone)
+        return r;
+    if(!NotificationInfoPool)
+        return KErrNoMemory;
+    return KErrNone;
+    }
+
+CFsNotificationInfo* CFsNotificationInfo::New()
+    {
+    CFsNotificationInfo* info = new CFsNotificationInfo;
+    __ASSERT_ALWAYS(info,Fault(ENotifyPoolCreation));
+    info->iBody = new CFsNotificationInfoBody();
+    __ASSERT_ALWAYS(info->iBody,Fault(ENotifyPoolCreation));
+    return info;
+    }
+
+EXPORT_C TInt CFsNotificationInfo::SetSourceName(const TDesC& aSrc)
+    {
+    //Add the aSrc to a TParsePtrC (no copying the filename)
+    TParsePtrC sourceParsePtr(aSrc);
+    
+    if(sourceParsePtr.DrivePresent() || !sourceParsePtr.FullName().Length())
+        return KErrArgument;
+    
+    switch(iBody->iFunction)
+        {
+
+        case EFsFileWrite:          //EParseSrc | EFileShare
+        case EFsFileSetSize:        //EParseSrc | EFileShare
+        case EFsFileSetAtt:         //EParseDst | EParseSrc, - should not use these; has share.
+        case EFsFileSet:            //EParseSrc | EFileShare
+        case EFsFileSetModified:    //EParseSrc | EFileShare - new
+        case EFsFileWriteDirty:     //EFileShare
+        case EFsFileCreate:         //EParseSrc
+        case EFsFileTemp:           //EParseSrc - new
+        case EFsFileRename:         //EParseDst | EParseSrc,
+        case EFsFileReplace:        //EParseSrc
+            {
+            //Should look like this:  \[path\]filename
+            if(!sourceParsePtr.Name().Length())
+                {
+                return KErrArgument;
+                }
+            break;
+            }
+        case EFsDelete:             //EParseSrc
+        case EFsSetEntry:           //EParseSrc,
+        case EFsRename:             //EParseDst | EParseSrc,
+        case EFsReplace:            //EParseDst | EParseSrc,
+            {
+            if(!sourceParsePtr.PathPresent() && !sourceParsePtr.NamePresent())
+                {
+                return KErrArgument;
+                }
+            break;
+            }
+        case EFsRmDir:              //EParseSrc
+        case EFsMkDir:              //EParseSrc
+            {
+            if(!sourceParsePtr.PathPresent())
+                {
+                return KErrArgument;
+                }
+            break;
+            }
+      /*case EFsFormatNext:         //EParseSrc
+        case EFsDismountFileSystem: //0
+        case EFsMountFileSystem:    //0
+        case EFsSetVolume:          //0
+        case EFsSetDriveName:       //ESync
+        case EFsRawDiskWrite:       //EParseSrc
+        case EFsMountFileSystemScan: */
+        default:
+            {
+            __ASSERT_DEBUG(EFalse,User::Panic(_L("CFsNotificationInfo::SetSourceName Invalid Operation"),KErrArgument));
+            return KErrNotSupported;
+            }
+        }
+    memcpy(&iBody->iSrc,&sourceParsePtr,sizeof(TParsePtrC));
+    return KErrNone;
+    }
+
+EXPORT_C TInt CFsNotificationInfo::SetNewName(const TDesC& aDest)
+    {
+    //Add the aSrc to a TParsePtr for some validation without copying the filename
+    TParsePtrC destParsePtr(aDest);
+    
+    if(destParsePtr.DrivePresent() || !destParsePtr.FullName().Length())
+        return KErrArgument;
+    
+    switch(iBody->iFunction)
+        {
+        case EFsFileRename:         //EParseDst | EParseSrc,
+        case EFsRename:             //EParseDst | EParseSrc,
+        case EFsReplace:            //EParseDst | EParseSrc,
+            {
+            if(!destParsePtr.PathPresent() && !destParsePtr.NamePresent())
+                {
+                return KErrArgument;
+                }
+            break;
+            }
+        case EFsSetDriveName:
+        case EFsSetVolume:
+            {
+            if(!destParsePtr.NamePresent())
+                {
+                return KErrArgument;
+                }
+            break;
+            }            
+        default:
+            {
+            __ASSERT_DEBUG(ETrue,User::Panic(_L("CFsNotificationInfo::SetNewName Invalid Operation"),KErrArgument));
+            }
+        }
+    
+    memcpy(&iBody->iDest,&destParsePtr,sizeof(TParsePtrC));
+    return KErrNone;
+    }
+
+EXPORT_C TInt CFsNotificationInfo::SetFilesize(TInt64 aFilesize)
+    {
+    if(aFilesize<0)
+        return KErrArgument;
+    
+    iBody->iData = aFilesize;
+    return KErrNone;
+    }
+EXPORT_C TInt CFsNotificationInfo::SetAttributes(TUint aSet,TUint aCleared)
+    {
+    iBody->iData = MAKE_TUINT64(aSet,aCleared);
+    return KErrNone;
+    }
+
+EXPORT_C TInt CFsNotificationInfo::SetUid(const TUid& aUid)
+    {
+    iBody->iUid = aUid;
+    return KErrNone;
+    }
+
+
+TInt CFsNotificationInfo::SetDriveNumber(TInt aDriveNumber) 
+    {
+    if(aDriveNumber >= EDriveA && aDriveNumber <= EDriveZ)
+        {
+        iBody->iDriveNumber = aDriveNumber;
+        return KErrNone;
+        }
+    return KErrArgument;    
+    }
+void CFsNotificationInfo::SetRequest(CFsRequest* aRequest)
+    {
+    iBody->iRequest = aRequest;
+    }
+TInt CFsNotificationInfo::Function() 
+    { return iBody->iFunction; }
+TInt CFsNotificationInfo::DriveNumber() 
+    { return iBody->iDriveNumber; }
+TParsePtrC& CFsNotificationInfo::Source() 
+    {
+    switch(iBody->iFunction)
+        {
+        case EFsFormatNext:         //EParseSrc
+        case EFsDismountFileSystem: //0
+        case EFsMountFileSystem:    //0
+        case EFsSetVolume:          //0
+        case EFsSetDriveName:       //ESync
+        case EFsRawDiskWrite:       //EParseSrc
+        case EFsMountFileSystemScan:
+            {
+            _LIT(KFormatDrive,"?:");
+            iBody->iSrcBuf = KFormatDrive;
+            iBody->iSrcBuf[0] = TText(DriveNumber() + 'A');
+            TParsePtrC parse(iBody->iSrcBuf);
+            memcpy(&iBody->iSrc,&parse,sizeof(TParsePtrC));
+            }
+        }
+    return iBody->iSrc;
+    }
+TParsePtrC& CFsNotificationInfo::NewName() 
+    { return iBody->iDest; }
+CFsRequest* CFsNotificationInfo::Request() 
+    { return iBody->iRequest; }
+TInt64* CFsNotificationInfo::Data() 
+    { return &iBody->iData; }
+TUid& CFsNotificationInfo::Uid()
+    { return iBody->iUid; }
+TNotificationType& CFsNotificationInfo::NotificationType()
+    { return iBody->iNotificationType; }
+TBool CFsNotificationInfo::DestDriveIsSet()
+    { return iBody->iDestDriveStored; }
+TInt CFsNotificationInfo::SourceSize()
+    {
+    TInt size = Source().FullName().Size();
+    if(NotificationType()!=TFsNotification::EMediaChange    &&
+       NotificationType()!=TFsNotification::EDriveName      && 
+       NotificationType()!=TFsNotification::EVolumeName)
+        {
+        size += sizeof(TText)*2;
+        }
+    return size;    
+    }
+TInt CFsNotificationInfo::NewNameSize()
+    {
+    TInt size = NewName().FullName().Size();
+    if(!DestDriveIsSet())
+        size += sizeof(TText)*2;
+    return size;  
+    }
+
+//Get the path of the file, folder or drive name based on the TFsMessage function
+void CFsNotificationInfo::PathName(CFsClientMessageRequest& aRequest, TParsePtrC& aPath)
+    {
+    __PRINT(_L("CFsNotificationInfo::PathName"));
+    //Get the notification type
+    TInt function = aRequest.Operation()->Function();
+    
+    //Get the filename(s)
+    switch(function)
+        {
+        case EFsFileWrite:          //EParseSrc | EFileShare
+        case EFsFileSetSize:        //EParseSrc | EFileShare
+        case EFsFileSetAtt:         //EParseDst | EParseSrc, - should not use these; has share.
+        case EFsFileSet:            //EParseSrc | EFileShare
+        case EFsFileSetModified:    //EParseSrc | EFileShare - new
+        case EFsFileWriteDirty:     //EFileShare
+            {
+            CFileShare* share = NULL;
+            CFileCB* file = NULL;
+            GetFileFromScratch(&aRequest,share,file);
+            TParsePtrC ptrC(file->iFileName->Des());
+            memcpy(&aPath,&ptrC,sizeof(TParsePtrC));
+            break;
+            }
+        case EFsFileCreate:         //EParseSrc
+        case EFsFileTemp:           //EParseSrc - new
+        case EFsDelete:             //EParseSrc
+        case EFsSetEntry:           //EParseSrc,
+        case EFsFileRename:         //EParseDst | EParseSrc,
+        case EFsRename:             //EParseDst | EParseSrc,
+        case EFsReplace:            //EParseDst | EParseSrc,
+        case EFsFileReplace:        //EParseSrc
+            {
+            TParsePtrC parsePtrC(aRequest.Src().FullName().Mid(2)); //Don't want drive letter
+            memcpy(&aPath,&parsePtrC,sizeof(TParsePtrC));
+            break;
+            }
+        case EFsRmDir:              //EParseSrc
+        case EFsMkDir:              //EParseSrc
+            {
+            TParsePtrC parsePtrC(aRequest.Src().Path());
+            memcpy(&aPath,&parsePtrC,sizeof(TParsePtrC));
+            break;
+            
+            //aPath.Set(aRequest.Src().DriveAndPath(),NULL,NULL);
+            //break;
+            }
+        case EFsFormatNext:         //EParseSrc
+        case EFsDismountFileSystem: //0
+        case EFsMountFileSystem:    //0
+        case EFsSetVolume:          //0
+        case EFsSetDriveName:       //ESync
+        case EFsRawDiskWrite:       //EParseSrc
+        case EFsLockDrive:
+        case EFsUnlockDrive:
+        case EFsReserveDriveSpace:
+        case EFsMountFileSystemScan:
+            {
+            break;
+            }
+        default:
+            ASSERT(0);
+            break;
+        }
+    }
+
+//Get the new path of the file, folder or drive name based on the TFsMessage function
+void CFsNotificationInfo::NewPathName(CFsClientMessageRequest& aRequest, TParsePtrC& aNewPath)
+    {
+    __PRINT(_L("CFsNotificationInfo::NewPathName"));
+    //Get the notification type
+    TInt function = aRequest.Operation()->Function();
+
+    //Get the filename(s)
+    switch(function)
+        {
+        case EFsFileRename:         //EParseDst | EParseSrc,
+        case EFsRename:             //EParseDst | EParseSrc,
+        case EFsReplace:            //EParseDst | EParseSrc,
+            {
+            //We must provide the drive letter too as in the case
+            //of the file being monitored being renamed to a 
+            //different drive.
+            //In that case we need to provide the new drive letter to the client.
+            TParsePtrC ptrC(aRequest.Dest().FullName());
+            memcpy(&aNewPath,&ptrC,sizeof(TParsePtrC));
+            break;
+            }
+        case EFsSetVolume:          //EParseDst
+        case EFsSetDriveName:       //ESync | EParseDst
+            {
+            TParsePtrC ptrC(aRequest.Dest().FullName());
+            memcpy(&aNewPath,&ptrC,sizeof(TParsePtrC));
+            break;
+            }
+        default:
+            {
+            ASSERT(0);
+            }
+        }
+    }
+
+//Get the size of the notification based on its type
+TInt CFsNotificationInfo::NotificationSize(CFsNotificationInfo& aRequest)
+    {
+    __PRINT(_L("CFsNotificationInfo::NotificationSize"));
+    
+    /*
+     * If there are no new names, the order of the data in the buffer is:
+     * Word1   : NotificationSize (2 bytes) , PathSize (2 bytes)
+     * Word2   : NotificationType (Lower 2 bytes)
+     * Word3   : UID
+     * Word(s) : Path (TText8) , [Any sub-class members]
+     * 
+     * Else for notification types ERename, EVolumeName and EDriveName the order is:
+     * Word1   : NotificationSize (2 bytes) , PathSize (2 bytes)
+     * Word2   : NewNameSize (2 bytes) , NotificationType (2 bytes)
+     * Word3   : UID
+     * Word(s) : Path (TText8) , NewName (TText8)
+     * 
+     * EOverflow size: KNotificationHeaderSize
+     */ 
+    
+    //Size of the filename +(with '<drive>:')
+    TInt size = KNotificationHeaderSize + Align4(aRequest.SourceSize());
+    
+    switch(aRequest.NotificationType())
+        {
+        //NewName
+        case TFsNotification::ERename:
+        case TFsNotification::EVolumeName:
+        case TFsNotification::EDriveName:
+            {
+            if(!aRequest.NewName().FullName().Length())
+                __ASSERT_ALWAYS(false,User::Panic(_L("CFsNotificationInfo::NotificationSize"),KErrArgument));
+            
+            size += Align4(aRequest.NewNameSize());
+            break;
+            }
+        case TFsNotification::EFileChange:
+            {
+            size += sizeof(TInt64);
+            break;
+            }
+        case TFsNotification::EAttribute:
+            {
+            size += sizeof(TUint64);
+            break;
+            }
+        case TFsNotification::ECreate: 
+        case TFsNotification::EDelete:
+        case TFsNotification::EMediaChange:
+            {
+            break;
+            }
+        default:
+            {
+            ASSERT(0);
+            break;
+            }
+        }
+    return (TUint16) size;
+    }
+
+
+TNotificationType CFsNotificationInfo::NotificationType(TInt& aIndex)
+    {
+    __PRINT(_L("CFsNotificationInfo::NotificationType(TInt)"));
+    __ASSERT_DEBUG(aIndex < KNumRegisterableFilters, Fault(ENotificationFault));
+    
+    switch(aIndex) //No break statements here on purpose
+        {
+        case 7 : return TFsNotification::EMediaChange;
+        case 6 : return TFsNotification::EDriveName;
+        case 5 : return TFsNotification::EVolumeName;
+        case 4 : return TFsNotification::EDelete;
+        case 3 : return TFsNotification::EAttribute;
+        case 2 : return TFsNotification::ECreate;
+        case 1 : return TFsNotification::ERename;
+        case 0 : return TFsNotification::EFileChange;
+        default: ASSERT(0); return (TFsNotification::TFsNotificationType) 0;
+        }
+    }
+
+//Get the array index of the notification based on its type
+TInt CFsNotificationInfo::TypeToIndex(TNotificationType aType)
+    {
+    __PRINT(_L("CFsNotificationInfo::ArrayIndex"));
+
+    TInt index = 0; 
+    switch(aType) //No break statements here on purpose
+        {
+        case TFsNotification::EMediaChange: index++;
+        case TFsNotification::EDriveName:   index++;
+        case TFsNotification::EVolumeName:  index++;
+        case TFsNotification::EDelete:      index++;
+        case TFsNotification::EAttribute:   index++;
+        case TFsNotification::ECreate:      index++;
+        case TFsNotification::ERename:      index++;
+        case TFsNotification::EFileChange:  // skip;
+        default: break;
+        }
+    __ASSERT_DEBUG(index < KNumRegisterableFilters, Fault(ENotificationFault));
+    return index;
+    }
+
+TInt CFsNotificationInfo::DriveNumber(const TPtrC& aPath)
+    {
+    if(aPath.Length() >= 1)
+        {
+        TInt drive;
+        TInt r = RFs::CharToDrive(aPath[0],drive);
+        if(r!=KErrNone)
+            return KErrNotFound;
+        return drive;
+        }
+    return KErrNotFound;
+    }
+
+//Get the attributes set and cleared
+void CFsNotificationInfo::Attributes(CFsMessageRequest& aRequest, TUint& aSet, TUint& aClear)
+    {
+    __PRINT(_L("CFsNotificationInfo::Attributes"));
+
+    TInt function = aRequest.Operation()->Function();
+    const RMessage2& msg = aRequest.Message();
+
+    //Client notification
+    switch(function)
+        {
+        case EFsFileSet:
+            {
+            aSet = msg.Int1();
+            aClear = msg.Int2();
+            break;
+            }
+        case EFsFileSetAtt:
+            {
+            aSet = msg.Int0();
+            aClear = msg.Int1();
+            break;
+            }
+        case EFsSetEntry:
+            {
+            aSet = msg.Int2();
+            aClear = msg.Int3();
+            break;
+            }
+        default:
+            {
+            ASSERT(0);
+            break;
+            }
+        }
+    }
+
+TInt64 CFsNotificationInfo::FileSize(CFsMessageRequest& aRequest)
+    {
+    CFileShare* share = NULL;
+    CFileCB* file = NULL;
+    GetFileFromScratch(&aRequest, share, file);
+    TInt64 size = file->CachedSize64();
+    return size;
+    }
+
+
+void CFsNotificationInfo::SetData(CFsMessageRequest* aRequest, CFsNotificationInfo* aNotificationInfo)
+    {
+    TInt function = aRequest->Operation()->Function();
+    
+    switch(function)
+        {
+        case EFsFileWrite:
+        case EFsFileWriteDirty:
+        case EFsFileSetSize:
+            {
+            aNotificationInfo->SetFilesize(FileSize(*aRequest));
+            break;
+            }
+        case EFsSetEntry:
+        case EFsFileSetAtt:
+        case EFsFileSet:
+            {
+            TUint set = 0;
+            TUint clear = 0;
+            Attributes(*aRequest,set,clear);
+            *(aNotificationInfo->Data())= MAKE_TUINT64(set,clear);
+            break;
+            }
+        default:
+            {
+            return;
+            }
+        }
+    }
+
+TInt CFsNotificationInfo::ValidateNotification(CFsNotificationInfo& aNotificationInfo)
+    {
+    //Validate UID
+    if(aNotificationInfo.Uid() == TUid::Null())
+        {
+        __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Uid not set"),KErrArgument));
+        return KErrArgument;
+        }
+   
+    switch(aNotificationInfo.Function())
+        {
+        case EFsFileWrite:
+        case EFsFileWriteDirty:
+        case EFsFileSetSize:
+            {
+            if(*aNotificationInfo.Data() == -1)
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - File size not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(!aNotificationInfo.Source().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Source Name not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(aNotificationInfo.NewName().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - New Name set in err"),KErrArgument));
+                return KErrArgument;
+                }
+            break;
+            }
+        case EFsRename:
+        case EFsFileRename:
+        case EFsReplace:
+        case EFsSetVolume:
+        case EFsSetDriveName:
+            {
+            if(!aNotificationInfo.Source().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Source Name not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(!aNotificationInfo.NewName().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - New Name not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(*aNotificationInfo.Data() != -1)
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Data set in err"),KErrArgument));
+                return KErrArgument;
+                }
+            break;
+            }
+        case EFsMkDir:
+        case EFsFileCreate:
+        case EFsFileReplace:
+        case EFsDelete:
+        case EFsRmDir:
+            {
+            if(!aNotificationInfo.Source().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Source Name not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(aNotificationInfo.NewName().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - New Name set in err"),KErrArgument));
+                return KErrArgument;
+                }
+            if(*aNotificationInfo.Data() != -1)
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Data set in err"),KErrArgument));
+                return KErrArgument;
+                }
+            break;
+            }
+        case EFsFileSetAtt:
+        case EFsFileSet:
+        case EFsSetEntry:
+            {
+            if(!aNotificationInfo.Source().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Source Name not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(*aNotificationInfo.Data() == -1)
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Attributes not set"),KErrArgument));
+                return KErrArgument;
+                }
+            if(aNotificationInfo.NewName().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - New Name set in err"),KErrArgument));
+                return KErrArgument;
+                }               
+            break;
+            }
+        case EFsDismountFileSystem:
+        case EFsMountFileSystem:
+        case EFsFormatNext:
+        case EFsRawDiskWrite:
+        case EFsMountFileSystemScan:
+            {
+            if(aNotificationInfo.NewName().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - New Name set in err"),KErrArgument));
+                return KErrArgument;
+                }               
+            if(aNotificationInfo.Source().FullName().Length())
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Source Name set in err"),KErrArgument));
+                return KErrArgument;
+                }
+            if(*aNotificationInfo.Data() != -1)
+                {
+                __ASSERT_DEBUG(false,User::Panic(_L("::ValidateNotification - Data set in err"),KErrArgument));
+                return KErrArgument;
+                }
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    return KErrNone;
+    }
+
+TUint CFsNotificationInfo::NotifyType(TInt aFunction)
+//
+//  Convert aFunction that caused the notification to a 
+//  value corresponding to the correct TNotifyType enum  
+//
+    {
+    switch (aFunction)
+        {
+        case EFsFileCreate:
+        case EFsFileReplace:
+        case EFsDelete:
+        case EFsReplace:
+        case EFsFileRename:
+            return(ENotifyFile|ENotifyEntry);   
+        case EFsMkDir:
+        case EFsRmDir:
+            return(ENotifyDir|ENotifyEntry);    
+        case EFsRename:                 
+            return(ENotifyDir|ENotifyFile|ENotifyEntry);                    
+        case EFsSetVolume:                  
+            return(ENotifyDisk|ENotifyEntry);   
+        case EFsFileSet:
+        case EFsFileSetAtt:
+        case EFsFileSetModified:
+        case EFsFileSetSize:
+        case EFsSetEntry:
+            return(ENotifyAttributes);  
+        case EFsFileWrite:
+        case EFsFileWriteDirty:
+            return(ENotifyWrite);   
+        case EFsRawDiskWrite:
+        case EFsLockDrive:
+        case EFsUnlockDrive:
+            return(ENotifyDisk);    
+        case EFsFileTemp:       
+        case EFsSetDriveName:
+            return(ENotifyAll); 
+        default:
+            return(0);
+        }
+    }
+
 void CNotifyInfo::Initialise(TInfoType aType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession)
 //
 //
@@ -67,16 +919,16 @@
 	CNotifyInfo::Initialise(EStdChange,aStatus,aMessage,aSession);
 	}
 
-TUint CStdChangeInfo::RequestNotifyType(CFsRequest* aRequest)
+TUint CStdChangeInfo::RequestNotifyType(CFsNotificationInfo* aRequest)
 //
 // return notification type for the request
 //
 	{
-	TUint notifyType=aRequest->Operation()->NotifyType();
-	if(aRequest->Operation()->Function()==EFsRename)
+    TUint notifyType=CFsNotificationInfo::NotifyType(aRequest->Function());
+    if(aRequest->Function()==EFsRename)
 		{
 		__ASSERT_DEBUG(notifyType==(ENotifyDir|ENotifyFile|ENotifyEntry),Fault(EStdChangeRequestType));
-		if(aRequest->Src().NamePresent())
+        if(aRequest->Source().NamePresent())
 			notifyType=ENotifyFile|ENotifyEntry;
 		else
 			notifyType=ENotifyDir|ENotifyEntry;
@@ -84,12 +936,13 @@
 	return(notifyType);						
 	}
 
-TBool CStdChangeInfo::IsMatching(CFsRequest* aRequest)
+
+TBool CStdChangeInfo::IsMatching(CFsNotificationInfo* aNotificationInfo)
 //
 // return ETrue if operation type of request matches that of change notification
 //
-	{
-	if((iChangeType&ENotifyAll) || (iChangeType&aRequest->Operation()->NotifyType()))
+    {
+    if((iChangeType&ENotifyAll) || (iChangeType&CFsNotificationInfo::NotifyType(aNotificationInfo->Function())))
 		return(ETrue);
 	else
 		return(EFalse);
@@ -107,17 +960,17 @@
 	}
 
 
-TBool CExtChangeInfo::IsMatching(CFsRequest* aRequest)
+TBool CExtChangeInfo::IsMatching(CFsNotificationInfo* aRequest)
 //
 // return ETrue if operation notify type of request matches that of change notification
 // and paths match
 //
-	{
-	TInt function=aRequest->Operation()->Function();
+    {
+    TInt function=aRequest->Function();
 	//	if a rename occurred inform any requests if their path has been changed regardless of the notification type
 	if(function==EFsRename)				
 		{		
-		TBuf<KMaxFileName> renamePath=aRequest->Src().FullName().Mid(2);		
+        TBuf<KMaxFileName> renamePath=aRequest->Source().FullName();        
 		renamePath+=_L("*");
 		if (iName.MatchF(renamePath)!=KErrNotFound)	
 			return(ETrue);
@@ -127,18 +980,14 @@
 	//Special case where the dir the notifier is setup on has just been created
 	if(function==EFsMkDir)	
 		{		
-		TInt notDrive;
-		RFs::CharToDrive(aRequest->Src().Drive()[0],notDrive);	//can not fail as the drive letter has been parsed already
-		if(aRequest->Src().Path().MatchF(iName) == 0 && aRequest->DriveNumber() == notDrive)
+        if(aRequest->Source().Path().MatchF(iName) == 0)
 			return ETrue;
 		}
 	
-	//Special case where  the File the notifier is setup on has just been created by temp as the name is not known unti it has been created
+	//Special case where  the File the notifier is setup on has just been created by temp as the name is not known until it has been created
 	if(function==EFsRename||function==EFsFileOpen||function==EFsFileCreate||function==EFsFileReplace)
 		{
-		TInt notDrive;
-		RFs::CharToDrive(aRequest->Src().Drive()[0],notDrive);	//can not fail as the drive letter has been parsed already
-		if(aRequest->Src().FullName().Mid(2).MatchF(iName) == 0 && aRequest->DriveNumber() == notDrive)
+        if(aRequest->Source().FullName().MatchF(iName) == 0)
 			return ETrue;
 		}
 	
@@ -162,13 +1011,10 @@
 			TBuf<KMaxFileName> root=iName;
 			root+=_L("*");	
 			
-			// NB share may be NULL if file server has initiated a flush of the file cache
-			CFileShare* share;
-			CFileCB* fileCache;
-			GetFileFromScratch(aRequest, share, fileCache);
-			if (share && share->File().FileName().MatchF(root) != KErrNotFound)
-				return(ETrue);
-
+                if (aRequest->Source().FullName().MatchF(root) != KErrNotFound)
+                    {
+                    return(ETrue);
+                    }
 			}
 			break;
 			case EFsSetDriveName:
@@ -186,18 +1032,26 @@
 				TBuf<KMaxFileName> root = iName;
 				root+=_L("*");	
 				
-				if(aRequest->Src().FullName().Mid(2).MatchF(root)!=KErrNotFound)
+                if(aRequest->Source().FullName().MatchF(root)!=KErrNotFound)
 					return(ETrue);	
 				else if(function==EFsRename||function==EFsReplace||function==EFsFileRename)
 					{
 					// - rename/replace causes the file/path to disappear
-					if(aRequest->Dest().FullName().Mid(2).MatchF(root)!=KErrNotFound)
+				    TPtrC newName;
+				    if(aRequest->DestDriveIsSet())
+				        newName.Set(aRequest->NewName().FullName().Mid(2));
+				    else
+				        newName.Set(aRequest->NewName().FullName());
+                    if(newName.MatchF(root)!=KErrNotFound)
 						{
 						return(ETrue);
 						}
 
 					// - rename/replace causes the file/path to arrive
-					root=aRequest->Dest().FullName().Mid(2);
+                    if(aRequest->DestDriveIsSet())
+                        root=aRequest->NewName().FullName().Mid(2);
+                    else
+                        root=aRequest->NewName().FullName();
 					root+=_L("*");
 
 					if (iName.MatchF(root)!=KErrNotFound)
@@ -416,7 +1270,7 @@
 	iQLock.Signal();
 	}
 
-void TChangeQue::CheckChange(CFsRequest* aRequest)
+void TChangeQue::CheckChange(CFsNotificationInfo& aRequest)
 //
 // complete any notification in que that matches aRequest
 //
@@ -429,9 +1283,9 @@
 		__ASSERT_DEBUG(info->Type()==CNotifyInfo::EStdChange||info->Type()==CNotifyInfo::EExtChange,Fault(EChangeQueType));
 		TBool isMatching;
 		if(info->Type()==CNotifyInfo::EStdChange)
-			isMatching=((CStdChangeInfo*)info)->IsMatching(aRequest);
+			isMatching=((CStdChangeInfo*)info)->IsMatching(&aRequest);
 		else
-			isMatching=((CExtChangeInfo*)info)->IsMatching(aRequest);
+			isMatching=((CExtChangeInfo*)info)->IsMatching(&aRequest);
 		if(isMatching)
 			{
 			__PRINT1(_L("TChangeQue::CheckChange()-Matching info=0x%x"),info);
@@ -842,17 +1696,18 @@
 	return(KErrNone);
 	}
 
-void FsNotify::HandleChange(CFsRequest* aRequest,TInt aDrive)
+
+void FsNotify::HandleChange(CFsNotificationInfo& aNotificationInfo)
 //
 // Check whether any change notifications need to be completed due to aRequest on aDrive
 //
-	{
-	__PRINT2(_L("FsNotify::HandleChange() aRequest=0x%x, aDrive=%d"),aRequest,aDrive);
-	if(!aRequest->IsChangeNotify())
-		return;
-	iChangeQues[ChangeIndex(aDrive)].CheckChange(aRequest);
-	iChangeQues[ChangeIndex(KDriveInvalid)].CheckChange(aRequest);
-	}
+    {
+    __PRINT1(_L("FsNotify::HandleChange(TFsNotificationInfo) DriveNumber=%d"),aNotificationInfo.DriveNumber());
+    if(aNotificationInfo.Request() && !aNotificationInfo.Request()->IsChangeNotify())
+        return;
+    iChangeQues[ChangeIndex(aNotificationInfo.DriveNumber())].CheckChange(aNotificationInfo);
+    iChangeQues[ChangeIndex(KDriveInvalid)].CheckChange(aNotificationInfo);
+    }
 	
 
 void FsNotify::HandleDiskSpace(CFsRequest* aRequest,TInt aDrive)
--- a/userlibandfileserver/fileserver/sfile/sf_ops.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_ops.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -165,48 +165,6 @@
 		}
 	}
 
-TUint TOperation::NotifyType() const
-//
-//	Convert operation that caused the notification to a 
-//	value corresponding to the correct TNotifyType enum  
-//
-	{
-	switch (iFunction)
-		{
-	case EFsFileCreate:
-	case EFsFileReplace:
-	case EFsDelete:
-	case EFsReplace:
-	case EFsFileRename:
-		return(ENotifyFile|ENotifyEntry);	
-	case EFsMkDir:
-	case EFsRmDir:
-		return(ENotifyDir|ENotifyEntry);	
-	case EFsRename:					
-		return(ENotifyDir|ENotifyFile|ENotifyEntry);					
-	case EFsSetVolume:					
-		return(ENotifyDisk|ENotifyEntry);	
-	case EFsFileSet:
-	case EFsFileSetAtt:
-	case EFsFileSetModified:
-	case EFsFileSetSize:
-	case EFsSetEntry:
-		return(ENotifyAttributes);	
-	case EFsFileWrite:
-	case EFsFileWriteDirty:
-		return(ENotifyWrite);	
-	case EFsRawDiskWrite:
-	case EFsLockDrive:
-	case EFsUnlockDrive:
-		return(ENotifyDisk);	
-	case EFsFileTemp:		
-	case EFsSetDriveName:
-		return(ENotifyAll);	
-	default:
-		return(0);
-		}
-	}
-
 TBool TOperation::IsCompleted() const
 //
 //
--- a/userlibandfileserver/fileserver/sfile/sf_ops.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_ops.h	Tue Nov 02 15:29:23 2010 +0000
@@ -34,7 +34,7 @@
 		{	EFsDriveList,				ESync,								&TFsDriveList::Initialise,					NULL,								&TFsDriveList::DoRequestL					},
 		{	EFsDrive,					ESync,								&TFsDrive::Initialise,						NULL,								&TFsDrive::DoRequestL						},
 		{	EFsVolume,					0,									&TFsVolume::Initialise,						NULL,								&TFsVolume::DoRequestL						, MSG0(EVolumeInfo)},
-		{	EFsSetVolume,				0,									&TFsSetVolume::Initialise,					NULL,								&TFsSetVolume::DoRequestL					},
+		{	EFsSetVolume,				EParseDst, 									&TFsSetVolume::Initialise,					NULL,								&TFsSetVolume::DoRequestL					},
 		{	EFsSubst,					ESync,								&TFsSubst::Initialise,						NULL,								&TFsSubst::DoRequestL						},
 		{	EFsSetSubst,				ESync | EParseSrc,					&TFsSetSubst::Initialise,					NULL,								&TFsSetSubst::DoRequestL					},
 		{	EFsRealName,				ESync | EParseSrc,					&TFsRealName::Initialise,					NULL,								&TFsRealName::DoRequestL					},
@@ -51,7 +51,7 @@
 		{	EFsEntry,					EParseSrc,							&TFsEntry::Initialise,						NULL,								&TFsEntry::DoRequestL						, MSG0(EName) | MSG1(EEntry)},
 		{	EFsSetEntry,				EParseSrc,							&TFsSetEntry::Initialise,					NULL,								&TFsSetEntry::DoRequestL					, MSG0(EName) | MSG1(ETime) | MSG2(ESetAtt) | MSG3(EClearAtt)},
 		{	EFsGetDriveName,			ESync,								&TFsGetDriveName::Initialise,				NULL,								&TFsGetDriveName::DoRequestL				},
-		{	EFsSetDriveName,			ESync,								&TFsSetDriveName::Initialise,				NULL,								&TFsSetDriveName::DoRequestL				},
+		{	EFsSetDriveName,			ESync | EParseDst,								&TFsSetDriveName::Initialise,				NULL,								&TFsSetDriveName::DoRequestL				},
 		{	EFsFormatSubClose,			ESync,								&TFsSubClose::Initialise,					NULL,								&TFsSubClose::DoRequestL					},
 		{	EFsDirSubClose,				ESync,								&TFsSubClose::Initialise,					NULL,								&TFsSubClose::DoRequestL					},
 		{	EFsFileSubClose,			EFileShare | EFsDspObj,				&TFsSubClose::Initialise,					NULL,								&TFsSubClose::DoRequestL					},
--- a/userlibandfileserver/fileserver/sfile/sf_pool.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_pool.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -23,13 +23,13 @@
 //=====CFsPool=============================
 
 template <class T>
-CFsPool<T>* CFsPool<T>::New(TInt aPoolSize)
+CFsPool<T>* CFsPool<T>::New(TInt aPoolSize, T*(*aNewFunction)())
 	{
 	CFsPool<T>* pool = new CFsPool<T>();
 	if(!pool)
 		return NULL;
 	
-	TInt r = pool->Construct(aPoolSize);
+	TInt r = pool->Construct(aPoolSize,aNewFunction);
 	if(r!=KErrNone)
 		{
 		delete pool;
@@ -46,20 +46,20 @@
 	}
 
 template <class T>
-TInt CFsPool<T>::Construct(TInt aPoolSize)
+TInt CFsPool<T>::Construct(TInt aPoolSize,T*(*aNewFunction)())
 	{
-	TInt r = iPoolLock.CreateLocal(KNotificationPoolSize);
+	TInt r = iPoolLock.CreateLocal(aPoolSize);
 	if(r != KErrNone)
 			return r;
 	
-	r = iFreeList.Reserve(KNotificationPoolSize);
+	r = iFreeList.Reserve(aPoolSize);
 	if(r != KErrNone)
 		return r;
 	
 	TInt i = 0;
 	while(i < aPoolSize)
 		{
-		T* t = T::New();
+		T* t = aNewFunction();
 		if(!t)
 			{
 			return KErrNoMemory;
@@ -120,9 +120,9 @@
 	iPoolLock.Signal();
 	}
 
+//These are needed here because the compiler needs to know which types will be 
+//instantiating the template (because it's in a separate file)
 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION	
-//This is needed here because the compiler needs to know which types will be 
-//instantiating the template (because it's in a separate file)
 template class CFsPool<CFsNotificationBlock>;
 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION	
-
+template class CFsPool<CFsNotificationInfo>;
--- a/userlibandfileserver/fileserver/sfile/sf_pool.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_pool.h	Tue Nov 02 15:29:23 2010 +0000
@@ -27,13 +27,14 @@
 class CFsPool
 	{
 public:
-	static CFsPool<T>* New(TInt aPoolSize);
+   
+	static CFsPool<T>* New(TInt aPoolSize,T*(*aNewFunction)());
 	~CFsPool();
 	
 	/*
 	 * Allocate returns a pointer of class T.
 	 * The pointer returned is removed from the pool.
-	 * When the pool is empty this function will wait.
+	 * WAITs when the pool is empty.
 	 */
 	T* Allocate();
 	
@@ -44,7 +45,7 @@
 	void Free(T* aBlock);
 private:
 	CFsPool();
-	TInt Construct(TInt aPoolSize);
+	TInt Construct(TInt aPoolSize,T*(*aNewFunction)());
 	
 	void Lock();
 	void Unlock();
--- a/userlibandfileserver/fileserver/sfile/sf_request.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_request.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -471,6 +471,19 @@
 	return(-1);
 	}
 
+/*
+ * Gets the UID of the client 
+ */
+TUid CFsRequest::Uid()
+    {
+    return TUid::Null();
+    }
+
+TUid CFsMessageRequest::Uid()
+    {
+    return iUID;
+    }
+
 
 TBool CFsMessageRequest::IsNotifierSpecific() const
 	{
@@ -910,11 +923,12 @@
 	}
 
 	
-void CFsMessageRequest::Set(const RMessage2& aMessage,const TOperation& aOperation,CSessionFs* aSession)
+void CFsMessageRequest::Set(const RMessage2& aMessage,const TOperation& aOperation,CSessionFs* aSession, TUid aUid)
 //
 //
 //
 	{
+    iUID = aUid;
 	iCurrentPlugin=NULL;
 	iMessage=aMessage;
 	iDrive=NULL;
@@ -924,11 +938,6 @@
 	EnablePostIntercept(ETrue);
 	}
 
-void CFsMessageRequest::Set(const TOperation& aOperation)
-	{
-	iOperation=const_cast<TOperation*>(&aOperation);
-	}
-
 void CFsMessageRequest::Process()
 //
 // Process the request - (passing to a plugin or a drive thread)
@@ -1326,10 +1335,46 @@
 
 	if(aError==KErrNone)
 		{
+	    //Get a notificationInfo block (freed again after notification complete)
+	    CFsNotificationInfo* notificationInfo = NULL; 
+	    
 		if(!(FsNotify::IsChangeQueEmpty(driveNumber)))
-			FsNotify::HandleChange(this,driveNumber);
-	
+		    {
+		    if(CFsNotificationInfo::NotifyType(Operation()->Function()))
+		        {
+		        notificationInfo = CFsNotificationInfo::Allocate(*this); 
+		        if(notificationInfo)
+		            FsNotify::HandleChange(*notificationInfo);
+		        }
+		    }
+
+		
 #ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
+		
+		if(!FsNotificationManager::IsInitialised())
+		    {
+	        if(notificationInfo)
+	            {
+	            CFsNotificationInfo::Free(notificationInfo);
+	            }
+		    return;
+		    }
+		
+        if(!notificationInfo)
+            {
+            TFsNotification::TFsNotificationType type;
+            CFsNotificationInfo::NotificationType(Operation()->Function(),type);
+            if(type)
+                {
+                notificationInfo = CFsNotificationInfo::Allocate(*this);
+                if(!notificationInfo)
+                    return;
+                }
+            else
+                {
+                return;
+                }
+            }
 		if 	(iOperation->iFunction == EFsFileWrite)
 			{
 			CFileShare* share = (CFileShare*) this->ScratchValue();
@@ -1339,29 +1384,19 @@
 			// Manage notifications for write with no cache or a write-through
 			if (!fileCache || !fileCache->IsDirty())
 				{
-				FsNotificationManager::HandleChange((CFsClientMessageRequest&)*this);
+				FsNotificationManager::HandleChange(*notificationInfo);
 				}
 			}
-		else if((iOperation->iFunction == EFsFileWriteDirty) && FsNotificationManager::IsInitialised())
-			{
-			CFileShare* share;
-			CFileCB* file;
-			GetFileFromScratch(this, share, file);
-
-			TFileName path;
-			path.Append(file->DriveNumber() + 'A');
-			path.Append(':');
-			path.Append(file->FileName().Des());
-			
-			// Manage notifications for write with caching enabled
-			FsNotificationManager::HandleChange((CFsClientMessageRequest*)this, path, TFsNotification::EFileChange);
-			}
 		else if(IsNotifierSupported())
 			{
-			FsNotificationManager::HandleChange((CFsClientMessageRequest&)*this);
+			FsNotificationManager::HandleChange(*notificationInfo);
 			}
 #endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
-		}
+		
+		//Free the notificationInfo block
+		if(notificationInfo)
+		    CFsNotificationInfo::Free(notificationInfo);
+		}// Err==KErrNone
 	}
 
 void CFsMessageRequest::DoNotifyDiskSpace(TInt aError)
@@ -1782,7 +1817,7 @@
 void CFsMessageRequest::SetOperationFunc(TInt aFunction)
 	{
 	const TOperation& oP = OperationArray[aFunction];
-	Set(oP);
+	iOperation = const_cast<TOperation*>(&oP);
 	// modified because some requests were set to PostInitialise. They are set to DoRequest in Dispatch anyway, so this is possibly ok?
 	//__ASSERT_ALWAYS(iReqState == EReqStateDoRequest, Fault(EInvalidMsgState));
 	}
--- a/userlibandfileserver/fileserver/sfile/sf_ses.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_ses.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -375,13 +375,13 @@
 TInt TFsSetDriveName::DoRequestL(CFsRequest* aRequest)
 	{
 	TInt driveNum=aRequest->Drive()->DriveNumber();
-	TFileName driveName;
-	aRequest->ReadL(KMsgPtr1,driveName);
+
 
 //	Validate name - return KErrBadName if it contains illegal characters such as
 //	* ? / | > <
 
-	TNameChecker checker(driveName);
+    TPtrC driveName(aRequest->Dest().FullName());
+    TNameChecker checker(driveName);
 	TText badChar;
 	if (checker.IsIllegalName(badChar))
 		return(KErrBadName);
@@ -398,7 +398,7 @@
 		}
 	if (TheDriveNames[driveNum]==NULL || TheDriveNames[driveNum]->Des().MaxLength()<len)
 		return(KErrNoMemory);
-	*TheDriveNames[driveNum]=driveName;
+	*TheDriveNames[driveNum]=aRequest->Dest().FullName();
 	return(KErrNone);
 	}
 
@@ -407,6 +407,13 @@
 	TInt r=ValidateDrive(aRequest->Message().Int0(),aRequest);
 	if (r!=KErrNone)
 		return(r);
+	
+    TFileName driveName;
+    aRequest->ReadL(KMsgPtr1,driveName);
+	r = aRequest->Dest().Set(driveName,NULL,NULL);
+	if (r!=KErrNone)
+		return(r);
+	
 	if (!KCapFsSetDriveName.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Set Drive Name")))
 		return KErrPermissionDenied;
 	return KErrNone;
--- a/userlibandfileserver/fileserver/sfile/sf_std.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_std.h	Tue Nov 02 15:29:23 2010 +0000
@@ -34,7 +34,7 @@
 #include "sf_func.h"
 #include <f32plugin.h>
 #include "f32trace.h"
-
+#include "sf_pool.h"
 
 #define __PRINT1TEMP_ALWAYS(t,a) {{TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}}
 #define __PRINT2TEMP_ALWAYS(t,a,b) {{TBuf<KMaxFileName>temp(b);RDebug::Print(t,a,&temp);}}
@@ -455,6 +455,8 @@
 	EFsObjectOpen,
 	EContainerHeapCorruptionOnRemove,
 	ESessionOpenError,
+	ENotifyPoolCreation,
+	ENotificationInfoDeletion
 	};
 
 
@@ -1006,7 +1008,6 @@
 	TBool IsChangeNotify() const;
 	TBool IsDiskSpaceNotify() const;
 	TBool IsWrite() const;
-	TUint NotifyType() const;
 	TBool IsCompleted() const;
 	TBool IsOpenSubSess() const; //used to allocate for close as well as open task for subsessions
 	TBool IsCloseSubSess() const;
@@ -1209,8 +1210,10 @@
 	inline TInt FsFunction();
 	void Close();	// close the session & dispatch object this request is using
 
-public:
 	CFsRequest();
+	
+	virtual TUid Uid();
+	
 protected:
 	inline void Set(const TOperation& aOperation,CSessionFs* aSession);
 	inline void Set(CSessionFs* aSession);
@@ -1262,8 +1265,7 @@
 	{
 public:
 	void Set(const RMessage2& aMessage,CSessionFs* aSession);
-	void Set(const RMessage2& aMessage,const TOperation& aOperation,CSessionFs* aSession);
-	void Set(const TOperation& aOperation);
+	void Set(const RMessage2& aMessage,const TOperation& aOperation,CSessionFs* aSession, TUid aUid = TUid::Null());
 	inline void SetPostInitialise(TFsRequestFunc aCacheFunction);
 	//
 	inline void SetMessage(RMessage2& aMessage);
@@ -1305,8 +1307,7 @@
 	TBool IsPluginRequest();
 	static inline CFsMessageRequest* RequestFromMessage(const RMessagePtr2& aMessage);
 	
-   // UID of the process to touching the file. (To be used in notification framework).
-   // TUid iUID;
+	virtual TUid Uid();
 private:
 	void DoNotify(TInt aError);
 	void DoNotifyDiskSpace(TInt aError);
@@ -1327,6 +1328,7 @@
 private:
 	TMsgOperation* iCurrentOperation;
 	TInt iLastError;
+    TUid iUID;//UID of the process this message belongs to
 	};
 
 
@@ -1486,8 +1488,8 @@
 	{
 public:
 	void Initialise(TNotifyType aChangeType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession);
-	TUint RequestNotifyType(CFsRequest* aRequest);
-	TBool IsMatching(CFsRequest* aRequest);
+	TUint RequestNotifyType(CFsNotificationInfo* aRequest);
+	TBool IsMatching(CFsNotificationInfo* aRequest);
 protected:
 	TNotifyType iChangeType;
 	};
@@ -1496,7 +1498,7 @@
 	{
 public:
 	void Initialise(TNotifyType aChangeType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession,const TDesC& aName);
-	TBool IsMatching(CFsRequest* aRequest);
+	TBool IsMatching(CFsNotificationInfo* aRequest);
 private:
 	TFileName iName;
 	};
@@ -1557,7 +1559,7 @@
 	TInt AddNotify(CNotifyInfo* aInfo);
 	TBool CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus=NULL);
 	void CancelAll(TInt aCompletionCode);
-	void CheckChange(CFsRequest* aRequest);
+	void CheckChange(CFsNotificationInfo& aNotificationInfo);
 	TBool IsEmpty();
 	};
 
@@ -1598,6 +1600,30 @@
 	TBool HandlePendingDismount(CSessionFs* aSession, TInt aDrive);
 	};
 
+class CFsNotificationInfo;
+
+class CFsNotificationInfoBody : public CBase
+    {
+public:
+    CFsNotificationInfoBody();
+private:    
+    TParsePtrC iSrc;
+    TBuf<2> iSrcBuf;
+    TParsePtrC iDest;
+    TBool iDestDriveStored;
+    TInt iDriveNumber;
+    TInt iFunction;
+    CFsRequest* iRequest; //Can be NULL
+    
+    //CFsNotify framework
+    TInt64 iData;
+    TNotificationType iNotificationType;
+    TUid iUid;
+    
+    friend class CFsNotificationInfo;
+    };
+
+
 class FsNotify
 	{
 public:
@@ -1607,7 +1633,7 @@
 	static TInt AddDebug(CNotifyInfo* aDebugInfo);
 	static TInt AddDismountNotify(CNotifyInfo* aDismountNotifyInfo);
 	static void DiskChange(TInt aDrive);
-	static void HandleChange(CFsRequest* aRequest,TInt aDrive);
+	static void HandleChange(CFsNotificationInfo& aNotificationInfo);
 	static void HandleDiskSpace(CFsRequest* aRequest,TInt aDrive);
 	static void HandleDiskSpace(TInt aDrive, TInt64& aFreeSpace);
 	static void HandleDebug(TUint aFunction);
@@ -1689,6 +1715,7 @@
 extern CFsObjectCon* RawDisks;
 extern CFsObjectCon* Extensions;
 extern CFsObjectCon* ProxyDrives;
+extern CFsPool<CFsNotificationInfo>* NotificationInfoPool;
 
 extern CKernEventNotifier* TheKernEventNotifier;
 
@@ -1767,18 +1794,18 @@
  TBool CompareResource(const TDesC & aThePath);
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
- TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const char* aDiag);
- TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, const char* aDiag);
- TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath,const TSecurityPolicy* aCap, const char* aDiag, TBool aExactMatchAllowed = EFalse);
+ TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const char* aDiag);
+ TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, const char* aDiag);
+ TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath,const TSecurityPolicy* aCap, const char* aDiag, TBool aExactMatchAllowed = EFalse);
 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
- TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, OnlyCreateWithNull aDiag);
- TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, OnlyCreateWithNull aDiag); 
- TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath,const TSecurityPolicy* aCap, OnlyCreateWithNull aDiag, TBool aExactMatchAllowed = EFalse);
+ TInt PathCheck(const RMessage2& aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, OnlyCreateWithNull aDiag);
+ TInt PathCheck(const RMessage2& aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, OnlyCreateWithNull aDiag); 
+ TInt PathCheck(const RMessage2& aRequest, const TDesC& aThePath,const TSecurityPolicy* aCap, OnlyCreateWithNull aDiag, TBool aExactMatchAllowed = EFalse);
 #endif //!__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
 
  TBool ComparePrivate(const TDesC & aThePath);
  TBool CompareSystem(const TDesC & aThePath);
- TBool SIDCheck(CFsRequest* aRequest, const TDesC& aThePath);
+ TBool SIDCheck(const RMessage2& aMessage, const TDesC& aThePath);
  TBool ComparePaths(const TDesC& aPath1,const TDesC& aPath2);
  TUint32 CalcNameHash(const TDesC& aName);
 
--- a/userlibandfileserver/fileserver/sfile/sf_svr.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_svr.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -211,7 +211,7 @@
 			return(ret);
 		}
 	aRequest->SetScratchValue(monitorAllDrives);
-	ret = PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsNotifyChangeEx, __PLATSEC_DIAGNOSTIC_STRING("Extended Change Notifier"));		
+	ret = PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsNotifyChangeEx, __PLATSEC_DIAGNOSTIC_STRING("Extended Change Notifier"));		
 	return(ret);
 	}
 
@@ -594,13 +594,9 @@
     if(r != KErrNone)
         return r;
 
-	TFileName volumeName;
-	aRequest->ReadL(KMsgPtr0,volumeName);
-	if (volumeName.Length()>KMaxVolumeNameLength)	//	KMaxVolumeNameLength = 11 
-		return(KErrBadName);
-	
     //	Validate name - return KErrBadName if it contains illegal characters such as * ? / | > <
-	TNameChecker checker(volumeName);
+    TPtrC volumeName(aRequest->Dest().FullName());
+    TNameChecker checker(volumeName);
 	TText badChar;
 	if (checker.IsIllegalName(badChar))
 		return(KErrBadName);
@@ -617,6 +613,17 @@
 	TInt r=ValidateDriveDoSubst(aRequest->Message().Int1(),aRequest);
 	if (r!=KErrNone)
 		return(r);
+	TFileName volumeName;
+	TRAP(r,aRequest->ReadL(KMsgPtr0,volumeName));
+	if(r!=KErrNone)
+	    return r;
+    if (volumeName.Length()>KMaxVolumeNameLength)   //  KMaxVolumeNameLength = 11 
+        return(KErrBadName);
+    
+	r = aRequest->Dest().Set(volumeName,NULL,NULL);
+	if(r!=KErrNone)
+	    return r;
+	
 	if (!KCapFsSetVolume.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Set Volume")))
 		return KErrPermissionDenied;
 	return KErrNone;
@@ -671,7 +678,7 @@
 		pD->SetSubstedDrive(NULL);
 		return(KErrNone);
 		}
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysSetSubst,&KCapFsPriSetSubst,&KCapFsROSetSubst, __PLATSEC_DIAGNOSTIC_STRING("Set Subst"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysSetSubst,&KCapFsPriSetSubst,&KCapFsROSetSubst, __PLATSEC_DIAGNOSTIC_STRING("Set Subst"));
 	if (r!=KErrNone)
 		return(r);
 	if (pD->Att()&(KDriveAttLocal|KDriveAttRom|KDriveAttRedirected|KDriveAttSubsted))
@@ -710,7 +717,7 @@
 	TInt r=ParseSubstPtr0(aRequest,aRequest->Src());
 	if (r!=KErrNone)
 		return(r);
-	r=PathCheck(aRequest,aRequest->Src().FullName().Mid(2),&KCapFsSysRealName,&KCapFsPriRealName, __PLATSEC_DIAGNOSTIC_STRING("Real Name"));
+	r=PathCheck(aRequest->Message(),aRequest->Src().FullName().Mid(2),&KCapFsSysRealName,&KCapFsPriRealName, __PLATSEC_DIAGNOSTIC_STRING("Real Name"));
 	if (r!=KErrNone)
 		return(r);
 	TFileName substName;
@@ -869,7 +876,7 @@
 	TInt r=ParsePathPtr0(aRequest,parse);	
 	if (r!=KErrNone && r!=KErrInUse)
 		return(r);
-	r=PathCheck(aRequest,parse.FullName().Mid(2),&KCapFsSysSetSessionPath,&KCapFsPriSetSessionPath, __PLATSEC_DIAGNOSTIC_STRING("Set Session Path"));
+	r=PathCheck(aRequest->Message(),parse.FullName().Mid(2),&KCapFsSysSetSessionPath,&KCapFsPriSetSessionPath, __PLATSEC_DIAGNOSTIC_STRING("Set Session Path"));
 	if (r!=KErrNone)
 		return(r);
 	if (IsIllegalFullName(parse.FullName()))
--- a/userlibandfileserver/fileserver/sfile/sf_utl.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfile/sf_utl.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -133,14 +133,14 @@
 	return ETrue;
 	}
 
-TBool SIDCheck(CFsRequest* aRequest, const TDesC& aThePath)
+TBool SIDCheck(const RMessage2& aMessage, const TDesC& aThePath)
 //
 //	Compare the Private/XXXXXXXX/ portion of a path be accessed to make sure it matches the process SID 
 //
 	{
 	if(aThePath.Length() >= KPrivateLengthCheck)
 		{
-		TSecureId appUID = aRequest->Message().SecureId();
+        TSecureId appUID = aMessage.SecureId();
 		TBuf<KSIDLength+1> dirName;
 		dirName.AppendNumFixedWidth(appUID.iId, EHex, 8);
 	
@@ -155,16 +155,16 @@
 	}
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
-TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, const char* aDiag)
+TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, const char* aDiag)
 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
-TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, OnlyCreateWithNull /*aDiag*/)
+TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const TSecurityPolicy* aROCap, OnlyCreateWithNull /*aDiag*/)
 #endif //!__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
 //
 //	Compare the parsed path with protected path names path must be parsed b4 using
 //
 	{
 
-	if(aRequest->Message().Handle() == KLocalMessageHandle)
+	if(aMessage.Handle() == KLocalMessageHandle)
 		return KErrNone;
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
@@ -185,11 +185,11 @@
 
 	if(ComparePrivate(aThePath))
 		{	
-		if(SIDCheck(aRequest, aThePath))
+		if(SIDCheck(aMessage, aThePath))
 			return KErrNone;	
 		else
 			{
-			if(aPriCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+			if(aPriCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 				return KErrNone;
 			else
 				return KErrPermissionDenied;
@@ -197,14 +197,14 @@
 		}
 	else if(CompareSystem(aThePath))
 		{
-		if(aSysCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+		if(aSysCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 			return KErrNone;
 		else
 			return KErrPermissionDenied;
 		}
 	else if(CompareResource(aThePath))
 		{
-		if(aROCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+		if(aROCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 			return KErrNone;
 		else
 			return KErrPermissionDenied;
@@ -214,16 +214,16 @@
  	}
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
-TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const char* aDiag) 
+TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, const char* aDiag) 
 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
-TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, OnlyCreateWithNull /*aDiag*/) 
+TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aSysCap, const TSecurityPolicy* aPriCap, OnlyCreateWithNull /*aDiag*/) 
 #endif //!__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
 //
 //	Compare the parsed path with protected path names path must be parsed b4 using
 //
 	{
 
-	if(aRequest->Message().Handle() == KLocalMessageHandle)
+	if(aMessage.Handle() == KLocalMessageHandle)
 		return KErrNone;
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
@@ -244,11 +244,11 @@
 
 	if(ComparePrivate(aThePath))
 		{	
-		if(SIDCheck(aRequest, aThePath))
+		if(SIDCheck(aMessage, aThePath))
 			return KErrNone;	
 		else
 			{
-			if(aPriCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+			if(aPriCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 				return KErrNone;
 			else
 				return KErrPermissionDenied;
@@ -256,7 +256,7 @@
 		}
 	else if(CompareSystem(aThePath))
 		{
-		if(aSysCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+		if(aSysCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 			return KErrNone;
 		else
 			return KErrPermissionDenied;
@@ -266,16 +266,16 @@
  	}
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
-TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aCap, const char* aDiag, TBool aExactMatchAllowed) 
+TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aCap, const char* aDiag, TBool aExactMatchAllowed) 
 #else //__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
-TInt PathCheck(CFsRequest* aRequest, const TDesC& aThePath, const TSecurityPolicy* aCap, OnlyCreateWithNull /*aDiag*/, TBool aExactMatchAllowed) 
+TInt PathCheck(const RMessage2& aMessage, const TDesC& aThePath, const TSecurityPolicy* aCap, OnlyCreateWithNull /*aDiag*/, TBool aExactMatchAllowed) 
 #endif //!__REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
 //
 //	Compare the parsed path with protected path names path must be parsed b4 using
 //
 	{
 
-	if(aRequest->Message().Handle() == KLocalMessageHandle)
+	if(aMessage.Handle() == KLocalMessageHandle)
 		return KErrNone;
 
 #ifndef __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
@@ -296,11 +296,11 @@
 
 	if(ComparePrivate(aThePath))
 		{	
-		if(SIDCheck(aRequest, aThePath))
+		if(SIDCheck(aMessage, aThePath))
 			return KErrNone;	
 		else
 			{
-			if(aCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+			if(aCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 				return KErrNone;
 			else if (aExactMatchAllowed && aThePath.Length() <= KPrivateLength + 1)
 				return KErrNone;
@@ -310,7 +310,7 @@
 		}
 	else if(CompareSystem(aThePath))
 		{
-		if(aCap->CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING(diagout)))
+		if(aCap->CheckPolicy(aMessage, __PLATSEC_DIAGNOSTIC_STRING(diagout)))
 			return KErrNone;
 		else if (aExactMatchAllowed && aThePath.Length() <= KSystemLength + 1)
 			return KErrNone;
--- a/userlibandfileserver/fileserver/sfsrv/cl_notification.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfsrv/cl_notification.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -179,7 +179,7 @@
  * Word2   : NewNameSize (2 bytes) , NotificationType (2 bytes)
  * Word3   : UID
  * Word(s) : Path (TText8) , [Any sub-class members]
-
+ */
 EXPORT_C TInt TFsNotification::DriveNumber(TInt& aDriveNumber) const
 	{
 	TPtrC path(NULL,0);
@@ -193,7 +193,7 @@
 		}
 	return r;
 	}
-	*/
+	
 
 /*
  * The order of the data in the buffer is:
@@ -201,14 +201,14 @@
  * Word2   : NewNameSize (2 bytes) , NotificationType (2 bytes)
  * Word3   : UID
  * Word(s) : Path (TText8) , [Any sub-class members]
-
+ */
 EXPORT_C TInt TFsNotification::UID(TUid& aUID) const
     {
     TUint* word3 = PtrAdd((TUint*)this, sizeof(TUint)*2);
     aUID.iUid = *word3;
     return KErrNone; 
     }
-	*/
+	
 
 
 CFsNotificationList* CFsNotificationList::NewL(TInt aBufferSize)
@@ -321,12 +321,34 @@
 	}
 
 EXPORT_C TInt CFsNotify::AddNotification(TUint aNotificationType, const TDesC& aPath, const TDesC& aFilename)
-	{
-	if(aNotificationType == 0 || (aPath.Length() <= 0 && aFilename.Length() <= 0))
-		return KErrArgument;
+    {
+    TInt pathLength = aPath.Length();
+    if(aNotificationType == 0 || (pathLength <= 0 && aFilename.Length() <= 0))
+        return KErrArgument;
+
+    //Validate path.
+    //Paths must be fully formed. i.e. with a valid or wild drive letter.
+    if(pathLength)
+        {
+        if(aPath[0] != '*' && aPath[0] != '?')
+            {
+            TInt drive = KErrNotFound;
+            TInt r = RFs::CharToDrive(aPath[0],drive);
 
-	return iBody->iFsNotify.AddNotification(aNotificationType, aPath, aFilename);
-	}
+            if(r!=KErrNone)
+                return KErrPathNotFound;
+            if(drive < EDriveA || drive > EDriveZ)
+                return KErrPathNotFound;
+            if(pathLength < 2)
+                return KErrPathNotFound;
+            else if(aPath[1] != ':')
+                return KErrPathNotFound;
+            }
+        }
+
+
+    return iBody->iFsNotify.AddNotification(aNotificationType, aPath, aFilename);
+    }
 
 //Removes notification request, does not close session
 EXPORT_C TInt CFsNotify::RemoveNotifications()
@@ -450,19 +472,17 @@
 	return KErrNotSupported;
 	}
 
-/*
 EXPORT_C TInt TFsNotification::DriveNumber(TInt&) const
 	{
 	Panic(ENotificationPanic);
 	return KErrNotSupported;
 	}
 	
-EXPORT_C TInt TFsNotification::UID(TUid& aUID) const
+EXPORT_C TInt TFsNotification::UID(TUid&) const
     {
  	Panic(ENotificationPanic);
 	return KErrNotSupported;
     }
-*/
 
 EXPORT_C CFsNotify* CFsNotify::NewL(RFs& , TInt)
 	{
--- a/userlibandfileserver/fileserver/sfsrv/cl_notification.h	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/sfsrv/cl_notification.h	Tue Nov 02 15:29:23 2010 +0000
@@ -61,15 +61,12 @@
  * All types have the following data and are aligned in the buffer like so:
  * Word1 : Size (TUint16 - upper 2 bytes) , NameLength (TUint16 - lower 2 bytes),
  * Word2 : Type (TUint - 4 bytes)
- * [not yet supported - Word3 : UID (TUint32 - 4 Bytes) ]
+ * Word3 : UID (TUint32 - 4 Bytes) 
  * 
  @internalTechnology
  @released
  */
-const TInt KNotificationHeaderSize = (sizeof(TUint16)*2)+(sizeof(TUint));
-//
-//When UID is added:
-//const TInt KNotificationHeaderSize = (sizeof(TUint16)*2)+(sizeof(TUint))+sizeof(TUint32);
+const TInt KNotificationHeaderSize = (sizeof(TUint16)*2)+sizeof(TUint)+sizeof(TUint32);
 
 /*
  * This is the minimum allowed size of the buffer set by the client that is
--- a/userlibandfileserver/fileserver/shostmassstorage/client/debug.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// 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"
-// 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
-*/
-
-#ifndef DEBUG_H
-#define DEBUG_H
-
-#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#include <e32debug.h>
-#endif
-
-// #define _USBMS_DEBUG_PRINT_ 
-// #define _MSDEVICE_DEBUG_PRINT_
-
-#if defined(_USBMS_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-/** Trace - format string  */
-#define __PRINT(t) {RDebug::Print(t);}
-/** Trace - format string with 1 param */
-#define __PRINT1(t,a) {RDebug::Print(t,a);}
-/** Trace - format string with 2 params */
-#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
-/** Trace - format string with 3 params */
-#define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-/** Trace - format string with 4 params */
-#define __PRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-/** Trace - format string with 5 params */
-#define __PRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-
-
-_LIT(KMsgIn, ">>%S\n");
-_LIT(KMsgOut,"<<%S\n");
-
-class TMSLogFn
-{
-	protected:
-	TBuf<100> iName;
-
-	public:
-	TMSLogFn(const TDesC& aName){iName = aName; RDebug::Print(KMsgIn, &iName);};
-	~TMSLogFn(){RDebug::Print(KMsgOut, &iName);};
-};
-
-#define __FNLOG(name) TMSLogFn __fn_log__(_L(name))
-
-#else
-
-/** NULL definition */
-#define __PRINT(t)
-/** NULL definition */
-#define __PRINT1(t,a)
-/** NULL definition */
-#define __PRINT2(t,a,b)
-/** NULL definition */
-#define __PRINT3(t,a,b,c)
-/** NULL definition */
-#define __PRINT4(t,a,b,c,d)
-/** NULL definition */
-#define __PRINT5(t,a,b,c,d,e)
-/** NULL definition */
-#define __FNLOG(name)
-#endif
-
-
-#if defined (_MSDEVICE_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define __MSDEVPRINT(t) {RDebug::Print(t);}
-#define __MSDEVPRINT1(t,a) {RDebug::Print(t,a);}
-#define __MSDEVPRINT2(t,a,b) {RDebug::Print(t,a,b);}
-#else
-#define __MSDEVPRINT(t)
-#define __MSDEVPRINT1(t,a)
-#define __MSDEVPRINT2(t,a,b)
-#endif // _MSDEVICE_DEBUG_PRINT_
-
-#endif // DEBUG_H
--- a/userlibandfileserver/fileserver/shostmassstorage/client/hostmsclient.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/client/hostmsclient.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -16,24 +16,26 @@
 // 
 //
 
-TARGET			usbhostmsclient.dll
+TARGET		usbhostmsclient.dll
 
-TARGETTYPE		dll
+TARGETTYPE	dll
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 USERINCLUDE	.
 USERINCLUDE	../shared
+USERINCLUDE	traces
 SOURCEPATH	.
 
-SOURCE	rusbhostmslogicalunit.cpp
-SOURCE	rusbhostmsdevice.cpp
+SOURCE		rusbhostmslogicalunit.cpp
+SOURCE		rusbhostmsdevice.cpp
 
 LIBRARY		efsrv.lib euser.lib hal.lib usbdescriptors.lib usbdi_utils.lib
 
-CAPABILITY TCB  ProtServ DiskAdmin AllFiles PowerMgmt CommDD NetworkControl WriteDeviceData
+CAPABILITY	TCB ProtServ DiskAdmin AllFiles PowerMgmt CommDD NetworkControl WriteDeviceData
 
-//MACRO _USBMS_DEBUG_PRINT_
+deffile		../../~/usbhostms.def
 
-deffile ../../~/usbhostms.def
+UID			0x20036401	
+VENDORID	0x70000001
 
 SMPSAFE
--- a/userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmsdevice.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmsdevice.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -22,14 +22,18 @@
 #include <f32file.h>
 
 #include "rusbhostmsdevice.h"
-#include "debug.h"
 #include "msgservice.h"
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "rusbhostmsdeviceTraces.h"
+#endif
+
+
 _LIT(KFileSystem, "FAT");
 
 TVersion RUsbHostMsDevice::Version() const
     {
-	__FNLOG("RUsbHostMsDevice::Version");
     return(TVersion(KUsbHostMsSrvMajorVersionNumber,
                     KUsbHostMsSrvMinorVersionNumber,
                     KUsbHostMsSrvBuildVersionNumber));
@@ -38,7 +42,6 @@
 
 TInt RUsbHostMsDevice::StartServer()
     {
-	__FNLOG("RUsbHostMsDevice::StartServer");
     TInt r;
     RProcess server;
 
@@ -48,7 +51,8 @@
     // Create the server process
     if((r=server.Create(KUsbHostMsServerName,KNullDesC,serverUid)) != KErrNone)
         {
-        __PRINT1(_L("Server process create = %d\n"), r);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSDEVICE_10,
+                  "Server process create = %d", r);
         return r;
         }
 
@@ -61,7 +65,7 @@
         }
     else
         {
-		server.SetPriority(EPriorityHigh);
+        server.SetPriority(EPriorityHigh);
         server.Resume(); // start the server
         }
 
@@ -96,7 +100,6 @@
 */
 EXPORT_C void RUsbHostMsDevice::Add(const THostMassStorageConfig& aConfig, TRequestStatus& aStatus)
     {
-	__FNLOG("RUsbHostMsDevice::Add");
     TInt err = KErrNone;
 
     err = CreateSession(KUsbHostMsServerName, Version(), 128, EIpcSession_GlobalSharable);
@@ -119,39 +122,41 @@
             }
         }
 
-	TRequestStatus* statusPtr = &aStatus;
+    TRequestStatus* statusPtr = &aStatus;
     if(err == KErrNone)
         {
         // Create a session handle that can be passed via IPC to another process
         // (also being shared by other threads in the current process)
-		err = ShareProtected();
+        err = ShareProtected();
         if(err == KErrNone)
             {
             // synchronous call to register the interface
-			TPckg<THostMassStorageConfig> pckg(aConfig);
-	        err = SendReceive(EUsbHostMsRegisterInterface, TIpcArgs(&pckg));
-			if(err != KErrNone)
-				{
-		        User::RequestComplete(statusPtr, err);
-				}
-			else
-				{
-	            // Asynchronous call to initialise the interface
-				SendReceive(EUsbHostMsInitialiseInterface, TIpcArgs(NULL), aStatus);
-				}
-			}
+            TPckg<THostMassStorageConfig> pckg(aConfig);
+            err = SendReceive(EUsbHostMsRegisterInterface, TIpcArgs(&pckg));
+            if(err != KErrNone)
+                {
+                User::RequestComplete(statusPtr, err);
+                }
+            else
+                {
+                // Asynchronous call to initialise the interface
+                SendReceive(EUsbHostMsInitialiseInterface, TIpcArgs(NULL), aStatus);
+                }
+            }
         else
             {
             Close(); // Close the session handle
-            __PRINT1(_L("Could not create a sharable session handle %d\n"), err);
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSDEVICE_11,
+                      "Could not create a sharable session handle %d", err);
             User::RequestComplete(statusPtr, err);
             }
         }
     else
         {
-		// Check whether the error is in starting the server or in creating the
+        // Check whether the error is in starting the server or in creating the
         // session
-        __PRINT1(_L("Creating server/session failed with %d\n"), err);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSDEVICE_12,
+                  "Creating server/session failed with %d", err);
         User::RequestComplete(statusPtr, err);
         }
     }
@@ -165,18 +170,17 @@
 */
 EXPORT_C void RUsbHostMsDevice::Remove()
     {
-	// Note: Here, at present we use only the interface token. But we still take
+    // Note: Here, at present we use only the interface token. But we still take
     // THostMassStorageConfig as parameter for future needs
-	__FNLOG("RUsbHostMsDevice::Remove");
-	_LIT(KUsbHostMsClientPanicCat, "usbhostmsclient");
+    _LIT(KUsbHostMsClientPanicCat, "usbhostmsclient");
+
+    TInt r = SendReceive(EUsbHostMsUnRegisterInterface);
 
-	TInt r = SendReceive(EUsbHostMsUnRegisterInterface);
-
-	r = SendReceive(EUsbHostMsFinalCleanup);
-	if(r != KErrNone)
-		{
-		User::Panic(KUsbHostMsClientPanicCat ,KErrCouldNotDisconnect);
-		}
+    r = SendReceive(EUsbHostMsFinalCleanup);
+    if(r != KErrNone)
+        {
+        User::Panic(KUsbHostMsClientPanicCat ,KErrCouldNotDisconnect);
+        }
     Close(); // Close the session handle
     }
 
@@ -195,63 +199,64 @@
 */
 EXPORT_C TInt RUsbHostMsDevice::GetNumLun(TUint32& aNumLuns)
     {
-	__FNLOG("RUsbHostMsDevice::GetNumLun");
     TPckg<TUint32> pckg(aNumLuns);
     return SendReceive(EUsbHostMsGetNumLun,TIpcArgs(&pckg));
     }
 
 
 EXPORT_C TInt RUsbHostMsDevice::MountLun(TUint32 aLunId, TInt aDriveNum)
-	{
-	__FNLOG("RUsbHostMsDevice::MountLun");
-    __MSDEVPRINT2(_L(">>> RUsbHostMsDevice::MountLun Drv=%d LUN=%d"), aDriveNum, aLunId);
-	RFs TheFs;
-	TInt r = TheFs.Connect();
-	if(r == KErrNone)
-		{
-		TPckgBuf<TMassStorageUnitInfo> unitPkg;
-		unitPkg().iLunID = aLunId;
+    {
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_MSDEV, RUSBHOSTMSDEVICE_13,
+              ">>> RUsbHostMsDevice::MountLun Drv=%d LUN=%d", aDriveNum, aLunId);
+    RFs TheFs;
+    TInt r = TheFs.Connect();
+    if(r == KErrNone)
+        {
+        TPckgBuf<TMassStorageUnitInfo> unitPkg;
+        unitPkg().iLunID = aLunId;
 
-		r = TheFs.MountProxyDrive(aDriveNum, _L("usbhostms"), &unitPkg, *this);
-        __MSDEVPRINT1(_L("MountProxyDrive %d"), r);
-		if(r >= KErrNone)
-			{
-			r = TheFs.MountFileSystem(KFileSystem, aDriveNum);
-            __MSDEVPRINT1(_L("MountFileSystem %d"), r);
-			if(r != KErrNone && r != KErrNotReady && r != KErrCorrupt && r != KErrNotSupported)
-				{
-				TheFs.DismountFileSystem(KFileSystem, aDriveNum);
-				TheFs.DismountProxyDrive(aDriveNum);
-				}
-			}
-		TheFs.Close();
-		}
-	return r;
-	}
+        r = TheFs.MountProxyDrive(aDriveNum, _L("usbhostms"), &unitPkg, *this);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_MSDEV, RUSBHOSTMSDEVICE_14,
+                  "MountProxyDrive %d", r);
+        if(r >= KErrNone)
+            {
+            r = TheFs.MountFileSystem(KFileSystem, aDriveNum);
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_MSDEV, RUSBHOSTMSDEVICE_15,
+                      "MountFileSystem %d", r);
+            if(r != KErrNone && r != KErrNotReady && r != KErrCorrupt && r != KErrNotSupported)
+                {
+                TheFs.DismountFileSystem(KFileSystem, aDriveNum);
+                TheFs.DismountProxyDrive(aDriveNum);
+                }
+            }
+        TheFs.Close();
+        }
+    return r;
+    }
 
 EXPORT_C TInt RUsbHostMsDevice::DismountLun(TInt aDriveNum)
-	{
-	__FNLOG("RUsbHostMsDevice::DismountLun");
-    __MSDEVPRINT1(_L(">>> RUsbHostMsDevice::DismountLun Drv=%d"), aDriveNum);
-	RFs TheFs;
-	TInt r;
-	r = TheFs.Connect();
-	if(r == KErrNone)
-		{
-		r = TheFs.DismountFileSystem(KFileSystem, aDriveNum);
-		if(r != KErrNone)
-			{
-			// dismount failed - attempt a forced dismount
-			TRequestStatus stat;
-			TheFs.NotifyDismount(aDriveNum, stat, EFsDismountForceDismount);
-			User::WaitForRequest(stat);
-			r = stat.Int();
-			}
-		if(r == KErrNone)
-			{
-			r = TheFs.DismountProxyDrive(aDriveNum);
-			}
-		TheFs.Close();
-		}
-	return r;
-	}
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_MSDEV, RUSBHOSTMSDEVICE_20,
+              ">>> RUsbHostMsDevice::DismountLun Drv=%d", aDriveNum);
+    RFs TheFs;
+    TInt r;
+    r = TheFs.Connect();
+    if(r == KErrNone)
+        {
+        r = TheFs.DismountFileSystem(KFileSystem, aDriveNum);
+        if(r != KErrNone)
+            {
+            // dismount failed - attempt a forced dismount
+            TRequestStatus stat;
+            TheFs.NotifyDismount(aDriveNum, stat, EFsDismountForceDismount);
+            User::WaitForRequest(stat);
+            r = stat.Int();
+            }
+        if(r == KErrNone)
+            {
+            r = TheFs.DismountProxyDrive(aDriveNum);
+            }
+        TheFs.Close();
+        }
+    return r;
+    }
--- a/userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/client/rusbhostmslogicalunit.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -23,19 +23,24 @@
 #include "msgservice.h"
 #include "rusbhostmsdevice.h"
 #include "rusbhostmslogicalunit.h"
-#include "debug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "rusbhostmslogicalunitTraces.h"
+#endif
+
 
 TVersion RUsbHostMsLogicalUnit::Version() const
-	{
-	return(TVersion(KUsbHostMsSrvMajorVersionNumber,
+    {
+    return(TVersion(KUsbHostMsSrvMajorVersionNumber,
                     KUsbHostMsSrvMinorVersionNumber,
                     KUsbHostMsSrvBuildVersionNumber));
-	}
+    }
 
 EXPORT_C RUsbHostMsLogicalUnit::RUsbHostMsLogicalUnit()
-	{
-	// Intentionally left blank
-	}
+    {
+    // Intentionally left blank
+    }
 
 /**
 Send a command to initialise the Mass Storage device.
@@ -48,24 +53,25 @@
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::Initialise(const RMessage2& aMsg,
                                                 TInt aDevHandleIndex,
-												TUint32 aLun)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::Initialise");
-	TInt r = dev.Open(aMsg, aDevHandleIndex);
-	if (r != KErrNone)
-		{
-		__PRINT1(_L("Session handle can not be opened %d"),r);
-		return r;
-		}
+                                                TUint32 aLun)
+    {
+    TInt r = dev.Open(aMsg, aDevHandleIndex);
+    if (r != KErrNone)
+        {
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_11,
+                  "Session handle can not be opened %d", r);
+        return r;
+        }
 
-	r = CreateSubSession(dev, EUsbHostMsRegisterLun, TIpcArgs(aLun));
-	if (r != KErrNone)
-		{
-		__PRINT1(_L("SubSession creation failed %d"),r);
-		return r;
-		}
-	return r;
-	}
+    r = CreateSubSession(dev, EUsbHostMsRegisterLun, TIpcArgs(aLun));
+    if (r != KErrNone)
+        {
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_12,
+                  "SubSession creation failed %d", r);
+        return r;
+        }
+    return r;
+    }
 
 
 /**
@@ -76,27 +82,27 @@
 @param aTrg Buffer to copy data to
 
 @return TInt KErrNone, if the send operation is successful;
-	KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
-	KErrNoMemory, if there is insufficient memory available.
+    KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
+    KErrNoMemory, if there is insufficient memory available.
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::Read(TInt64 aPos, TInt aLength, TDes8& aTrg)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::Read");
+    {
+    TReadWrite data;
+    data.iPos = aPos;
+    data.iLen = aLength;
 
-	TReadWrite data;
-	data.iPos = aPos;
-	data.iLen = aLength;
-
-	__PRINT2(_L("pos = 0x%lx, len = x%x"), data.iPos, data.iLen);
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_21,
+                 "pos = 0x%x %x, len = x%x", I64HIGH(data.iPos), I64LOW(data.iPos), data.iLen);
 
-	TPckg<TReadWrite> pckg(data);
-	/* We handle the message asynchronously in the thread modelled MSC */
-	TRequestStatus	status;
-	SendReceive(EUsbHostMsRead, TIpcArgs(&pckg, &aTrg), status);
-	User::WaitForRequest(status);
-    __PRINT2(_L("pos = 0x%lx, len = x%x"), data.iPos, data.iLen);
-	return status.Int();
-	}
+    TPckg<TReadWrite> pckg(data);
+    /* We handle the message asynchronously in the thread modelled MSC */
+    TRequestStatus  status;
+    SendReceive(EUsbHostMsRead, TIpcArgs(&pckg, &aTrg), status);
+    User::WaitForRequest(status);
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_22,
+                 "pos = 0x%x %x, len = x%x", I64HIGH(data.iPos), I64LOW(data.iPos), data.iLen);
+    return status.Int();
+    }
 
 
 /**
@@ -107,27 +113,27 @@
 @param aTrg Buffer to copy data from
 
 @return TInt KErrNone, if the send operation is successful;
-	KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
-	KErrNoMemory, if there is insufficient memory available.
+    KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
+    KErrNoMemory, if there is insufficient memory available.
 available.
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::Write(TInt64 aPos, TInt aLength, const TDesC8& aTrg)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::Write");
+    {
+    TReadWrite data;
+    data.iPos = aPos;
+    data.iLen = aLength;
 
-	TReadWrite data;
-	data.iPos = aPos;
-	data.iLen = aLength;
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_23,
+                 "pos = 0x%x %x, len = x%x", I64HIGH(data.iPos), I64LOW(data.iPos), data.iLen);
 
-	__PRINT2(_L("pos = 0x%lx, len = x%x"), data.iPos, data.iLen);
 
-	TPckg<TReadWrite> pckg(data);
-	/* We handle the message asynchronously in the thread modelled MSC */
-	TRequestStatus	status;
-	SendReceive(EUsbHostMsWrite, TIpcArgs(&aTrg, &pckg), status);
-	User::WaitForRequest(status);
-	return status.Int();
-	}
+    TPckg<TReadWrite> pckg(data);
+    /* We handle the message asynchronously in the thread modelled MSC */
+    TRequestStatus  status;
+    SendReceive(EUsbHostMsWrite, TIpcArgs(&aTrg, &pckg), status);
+    User::WaitForRequest(status);
+    return status.Int();
+    }
 
 
 /**
@@ -137,27 +143,26 @@
 @param aLength Number of Bytes
 
 @return TInt KErrNone, if the send operation is successful;
-	KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
-	KErrNoMemory, if there is insufficient memory available.
+    KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
+    KErrNoMemory, if there is insufficient memory available.
 available.
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::Erase(TInt64 aPos, TInt aLength)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::Erase");
+    {
+    TReadWrite data;
+    data.iPos = aPos;
+    data.iLen = aLength;
 
-	TReadWrite data;
-	data.iPos = aPos;
-	data.iLen = aLength;
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_24,
+                 "pos = 0x%x %x, len = x%x", I64HIGH(data.iPos), I64LOW(data.iPos), data.iLen);
 
-	__PRINT2(_L("pos = 0x%lx, len = x%x"), data.iPos, data.iLen);
-
-	TPckg<TReadWrite> pckg(data);
-	/* We handle the message asynchronously in the thread modelled MSC */
-	TRequestStatus	status;
-	SendReceive(EUsbHostMsErase, TIpcArgs(&pckg), status);
-	User::WaitForRequest(status);
-	return status.Int();
-	}
+    TPckg<TReadWrite> pckg(data);
+    /* We handle the message asynchronously in the thread modelled MSC */
+    TRequestStatus  status;
+    SendReceive(EUsbHostMsErase, TIpcArgs(&pckg), status);
+    User::WaitForRequest(status);
+    return status.Int();
+    }
 
 
 /**
@@ -171,17 +176,15 @@
 available.
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::Caps(TCapsInfo& aCapsInfo)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::Caps");
-
+    {
     TPckg<TCapsInfo> data(aCapsInfo);
 
-	/* We handle the message asynchronously in the thread modelled MSC */
-	TRequestStatus	status;
-	SendReceive(EUsbHostMsCapacity, TIpcArgs(&data),status);
-	User::WaitForRequest(status);
-	return status.Int();
-	}
+    /* We handle the message asynchronously in the thread modelled MSC */
+    TRequestStatus  status;
+    SendReceive(EUsbHostMsCapacity, TIpcArgs(&data),status);
+    User::WaitForRequest(status);
+    return status.Int();
+    }
 
 /**
 Request notification of media change to the file server
@@ -189,26 +192,22 @@
 @param aChanged The descriptor pointing to iChanged flag in TDrive to be updated
 when error occurs during read or write.
 @param aStatus The request status This is set to KErrNone on completion, or KErrCancel when the logical unit is closed;
-	KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
-	KErrNoMemory, if there is insufficient memory available.
+    KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available;
+    KErrNoMemory, if there is insufficient memory available.
 @return None
 */
 EXPORT_C void RUsbHostMsLogicalUnit::NotifyChange(TDes8& aChanged, TRequestStatus &aStatus)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::NotifyChange");
-
-	SendReceive(EUsbHostMsNotifyChange, TIpcArgs(&aChanged), aStatus);
-	}
+    {
+    SendReceive(EUsbHostMsNotifyChange, TIpcArgs(&aChanged), aStatus);
+    }
 
 /**
 Request to suspend the logical unit associated with this drive
 */
 EXPORT_C void RUsbHostMsLogicalUnit::SuspendLun()
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::SuspendLun");
-
-	SendReceive(EUsbHostMsSuspendLun, TIpcArgs(NULL));
-	}
+    {
+    SendReceive(EUsbHostMsSuspendLun, TIpcArgs(NULL));
+    }
 
 /**
 Close the sub-session.
@@ -216,13 +215,11 @@
 @return TInt KErrNone
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::UnInitialise()
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::UnInitialise");
-
-	CloseSubSession(EUsbHostMsUnRegisterLun);
-	dev.Close();
-	return KErrNone;
-	}
+    {
+    CloseSubSession(EUsbHostMsUnRegisterLun);
+    dev.Close();
+    return KErrNone;
+    }
 
 
 /**
@@ -236,19 +233,17 @@
 available.
 */
 EXPORT_C TInt RUsbHostMsLogicalUnit::ForceRemount(TUint aFlags)
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::ForceRemount");
-
-	__PRINT1(_L("flags = %d"), aFlags);
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, RUSBHOSTMSLOGICALUNIT_25,
+              "flags = %d", aFlags);
 
-	TRequestStatus	status;
-	SendReceive(EUsbHostMsForceRemount, TIpcArgs(aFlags), status);
-	User::WaitForRequest(status);
-	return status.Int();
-	}
+    TRequestStatus  status;
+    SendReceive(EUsbHostMsForceRemount, TIpcArgs(aFlags), status);
+    User::WaitForRequest(status);
+    return status.Int();
+    }
 
 EXPORT_C void RUsbHostMsLogicalUnit::NotifyChangeCancel()
-	{
-	__FNLOG("RUsbHostMsLogicalUnit::NotifyChangeCancel");
-	SendReceive(EUsbHostMsCancelChangeNotifier, TIpcArgs(NULL));
-	}
+    {
+    SendReceive(EUsbHostMsCancelChangeNotifier, TIpcArgs(NULL));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/shostmassstorage/client/traces/OstTraceDefinitions.h	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 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:
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/debug.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-// Copyright (c) 2008-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:
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include "debug.h"
-
-#ifdef FUNCTION_TRACE_ENABLED
-
-_LIT8(KFnMsgSIn, ">>\t%S\r\n");
-_LIT8(KFnMsgSOut,"<<\t%S\r\n");
-_LIT8(KFnMsgIn, ">>[0x%08x]\t%S\r\n");
-_LIT8(KFnMsgOut,"<<[0x%08x]\t%S\r\n");
-
-TLogStaticFn::TLogStaticFn(const TDesC8& aFunctionName)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KFnMsgSIn, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TLogStaticFn::~TLogStaticFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KFnMsgSOut, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TLogFn::TLogFn(const TDesC8& aFunctionName, void* aThisPointer)
-:   iThisPointer(aThisPointer)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KFnMsgIn, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TLogFn::~TLogFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KFnMsgOut, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-#endif
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/debug.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-// 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"
-// 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
-*/
-
-#ifndef PXY_DEBUG_H
-#define PXY_DEBUG_H
-
-// #define _HOST_DEBUG_PRINT_
-// #define _PROXY_DEBUG_PRINT_
-// #define _PROXY_FN_TRACE_
-
-#if defined(_PROXY_FN_TRACE_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define FUNCTION_TRACE_ENABLED
-#endif
-
-#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#include <e32debug.h>
-#endif
-
-#ifdef FUNCTION_TRACE_ENABLED
-/**
-Logging function to be used with static functions. Prints the function string on
-function entry and exit.
-*/
-class TLogStaticFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-
-    TLogStaticFn(const TDesC8& aFunctionName);
-
-	~TLogStaticFn();
-
-protected:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-    };
-
-
-/**
-Logging function which prints the function string on function entry and exit.
-*/
-class TLogFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-	TLogFn(const TDesC8& aFunctionName, void* aThisPointer);
-
-	~TLogFn();
-
-private:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-	void* iThisPointer;
-    };
-
-#define __MSFNLOG TLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this);
-#define __MSFNSLOG TLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__));
-#else	// FUNCTION_TRACE_ENABLED
-#define __MSFNSLOG
-#define __MSFNLOG
-#endif		// FUNCTION_TRACE_ENABLED
-
-
-#if defined (_PROXY_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define __PXYPRINT(t) {RDebug::Print(t);}
-#define __PXYPRINT1(t,a) {RDebug::Print(t,a);}
-#define __PXYPRINT2(t,a,b) {RDebug::Print(t,a,b);}
-#define __PXYPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-#define __PXYPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-#define __PXYPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-#define __PXYPRINT8BIT1(t,a) {TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}
-#define __PXYPRINT1TEMP(t,a) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}
-#else
-#define __PXYPRINT(t)
-#define __PXYPRINT1(t,a)
-#define __PXYPRINT2(t,a,b)
-#define __PXYPRINT3(t,a,b,c)
-#define __PXYPRINT4(t,a,b,c,d)
-#define __PXYPRINT5(t,a,b,c,d,e)
-#define __PXYPRINT8BIT1(t,a)
-#define __PXYPRINT1TEMP(t,a)
-#endif // _PROXY_DEBUG_PRINT_
-
-#if defined(_HOST_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define __HOSTPRINT(t) {RDebug::Print(t);}
-#define __HOSTPRINT1(t,a) {RDebug::Print(t,a);}
-#define __HOSTPRINT2(t,a,b) {RDebug::Print(t,a,b);}
-#define __HOSTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-#define __HOSTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-#define __HOSTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-#define __HOSTPRINT8BIT1(t,a) {TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}
-#define __HOSTPRINT1TEMP(t,a) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}
-static const TUint KBlockSize = 0x200;
-#else
-#define __HOSTPRINT(t)
-#define __HOSTPRINT1(t,a)
-#define __HOSTPRINT2(t,a,b)
-#define __HOSTPRINT3(t,a,b,c)
-#define __HOSTPRINT4(t,a,b,c,d)
-#define __HOSTPRINT5(t,a,b,c,d,e)
-#define __HOSTPRINT8BIT1(t,a)
-#define __HOSTPRINT1TEMP(t,a)
-#endif // _HOST_DEBUG_PRINT_
-
-#endif // PXY_DEBUG_H
-
-
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsfactory.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsfactory.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -23,44 +23,45 @@
 
 #include "hostusbmsproxy.h"
 #include "hostusbmsfactory.h"
-#include "debug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "hostusbmsfactoryTraces.h"
+#endif
+
+
 
 CUsbHostMsProxyDriveFactory::CUsbHostMsProxyDriveFactory()
-	{
-	__MSFNSLOG
-	}
+    {
+    }
 
 CUsbHostMsProxyDriveFactory::~CUsbHostMsProxyDriveFactory()
-	{
-	__MSFNSLOG
-	}
+    {
+    }
 
 TInt CUsbHostMsProxyDriveFactory::Install()
-	{
-	__MSFNSLOG
-	_LIT(KLoggerName,"usbhostms");
-	return SetName(&KLoggerName);
-	}
+    {
+    _LIT(KLoggerName,"usbhostms");
+    return SetName(&KLoggerName);
+    }
 
 TInt CUsbHostMsProxyDriveFactory::CreateProxyDrive(CProxyDrive*& aMountProxyDrive,CMountCB* aMount)
-	{
-	__MSFNSLOG
+    {
     aMountProxyDrive = new CUsbHostMsProxyDrive(aMount,this);
     return (aMountProxyDrive==NULL) ? KErrNoMemory : KErrNone;
-	}
+    }
 
 
 extern "C" {
 
 
-/* 
+/*
 Create the proxy drive factory object for the usbhost mass storage proxy
 */
 EXPORT_C CExtProxyDriveFactory* CreateFileSystem()
-	{
-	__MSFNSLOG
-	return new CUsbHostMsProxyDriveFactory();
-	}
+    {
+    return new CUsbHostMsProxyDriveFactory();
+    }
 }
 
 /*
@@ -68,39 +69,39 @@
 This function issues an application session request (through publish and subscribe) to the USB manager.
 Upon USB Manager receiving this application session request in consent with the USB watcher application,
 the Bus request is passed to the OTG  component to bringup the VBus, thus enumerating the mass storage
-devices Upon enumerating the FDF will communicate with the Mount Manager which will allocate mass storage 
+devices Upon enumerating the FDF will communicate with the Mount Manager which will allocate mass storage
 drives for the logical units and continues drive access through the Usb host mass storage proxy drive.
 
 Ps: Note that the this request cant be handled by the MSC since, in the scenario where MSC is not running
 initially, the request will try to create the process. Creation of process will involve the file server inturn
 to load the MSC binary (.exe) to run. Since the RMessages are handled sequentially, the file server would not
-be able to service the request until the AsyncEnuerate is completed. Where, the process creation will wait 
+be able to service the request until the AsyncEnuerate is completed. Where, the process creation will wait
 for the rendezvous to complete creating the deadlock situation. Hence the application session request is handled
 in the factory object itself!
 */
 void CUsbHostMsProxyDriveFactory::AsyncEnumerate()
 {
-	__MSFNSLOG
-
-	RProperty prop;
-	TInt ret;
+    RProperty prop;
+    TInt ret;
 
-	/* The property category is the USB manager */
-	const TUid KUidUsbManCategory={0x101fe1db};
-	/* The Key used is #6 for the Usb request session */
-	const TInt KUsbRequestSessionProperty = 6;
+    /* The property category is the USB manager */
+    const TUid KUidUsbManCategory={0x101fe1db};
+    /* The Key used is #6 for the Usb request session */
+    const TInt KUsbRequestSessionProperty = 6;
 
-	/* By this time the property should be available and allow us to get the handle.
-		If the property is not created (for some reason), we do not have anything to do */
-	ret = prop.Attach(KUidUsbManCategory, KUsbRequestSessionProperty);
-    __PXYPRINT1(_L("Property attach returned %d"),ret);
-	if(ret == KErrNone)
+    /* By this time the property should be available and allow us to get the handle.
+        If the property is not created (for some reason), we do not have anything to do */
+    ret = prop.Attach(KUidUsbManCategory, KUsbRequestSessionProperty);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSFACTORY_11,
+              "Property attach returned %d", ret);
+    if(ret == KErrNone)
     {
-		/* The Usb Manager does not evaluate the value passed through this property. 
-			We pass 1 (an arbitary value) for completion */
-		ret = prop.Set(KUidUsbManCategory, KUsbRequestSessionProperty, 1); 
-	     __PXYPRINT1(_L("Property set returned %d"),ret);
-		prop.Close();
-	}
+        /* The Usb Manager does not evaluate the value passed through this property.
+            We pass 1 (an arbitary value) for completion */
+        ret = prop.Set(KUidUsbManCategory, KUsbRequestSessionProperty, 1);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSFACTORY_12,
+                  "Property set returned %d", ret);
+        prop.Close();
+    }
 }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -22,24 +22,27 @@
 #include <f32fsys.h>
 
 #include "hostusbmsproxy.h"
-#include "debug.h"
+#include "tmbr.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+static const TUint KBlockSize = 0x200;
+#include "hostusbmsproxyTraces.h"
+#endif
 
 
 CUsbHostMsProxyDrive::CUsbHostMsProxyDrive(CMountCB* aMount, CExtProxyDriveFactory* aDevice)
 :   CExtProxyDrive(aMount,aDevice)
-	{
-	__MSFNSLOG
-	}
+    {
+    }
 
 CUsbHostMsProxyDrive::~CUsbHostMsProxyDrive()
-	{
-	__MSFNSLOG
-	iUsbHostMsLun.UnInitialise();
-	}
+    {
+    iUsbHostMsLun.UnInitialise();
+    }
 
 TInt CUsbHostMsProxyDrive::InitialiseOffset(TCapsInfo& aCapsInfo)
-	{
-	__MSFNSLOG
+    {
     RBuf8 partitionInfo;
     TInt r;
     TRAP(r, partitionInfo.CreateL(aCapsInfo.iBlockLength));
@@ -48,172 +51,136 @@
         return r;
         }
 
-	r = iUsbHostMsLun.Read(0, aCapsInfo.iBlockLength, partitionInfo);
-	if (r != KErrNone)
+    r = iUsbHostMsLun.Read(0, aCapsInfo.iBlockLength, partitionInfo);
+    if (r != KErrNone)
         {
-		__PXYPRINT1(_L("!! Reading medium failed with %d !!"), r);
-        partitionInfo.Close();
-		return r;
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_10,
+                  "!! Reading medium failed with %d !!", r);
         }
-	TUint8* buffer = const_cast<TUint8*>(partitionInfo.Ptr());
-
-	// Read of the first sector successful so check for a Master Boot Record
-	if (*(reinterpret_cast<TUint16*>(&buffer[KMBRSignatureOffset]))!= KMBRSignature)
-		{
-		__PXYPRINT(_L("MBR not present"));
-        iMsDataMemMap.Reset();
-        }
-	else
-		{
-		// Move the partition entries to a 4 byte boundary
-		memcpy(&buffer[0],&buffer[KMBRFirstPartitionOffset],(sizeof(TMBRPartitionEntry)<<2));
-		// Search for a x86 default boot partition - let this be the first
-		TMBRPartitionEntry* pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
+    else
+        {
+        TMBRPartitionEntry partitionEntry;
+        TInt partitionCount = TMbr::GetPartition(partitionInfo, partitionEntry);
 
-		TInt firstValidPartitionCount = -1;
-		TInt defaultPartitionNumber = -1;
-		TInt partitionCount = 0;
-		for (TInt i = 0; i < KMBRMaxPrimaryPartitions; i++, pe++)
-			{
-			if (pe->IsValidDosPartition() || pe->IsValidFAT32Partition() || pe->IsValidExFATPartition())
-				{
-				__PXYPRINT(_L("Found a Valid Partition"));
-				partitionCount++;
-
-				if (firstValidPartitionCount < 0)
-					firstValidPartitionCount = i;
+        if (partitionCount == 0)
+            {
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_11,
+                      "No partition found");
+            iMsDataMemMap.InitDataArea(0, aCapsInfo.iNumberOfBlocks, aCapsInfo.iBlockLength);
+            OstTraceExt3(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_12,
+                         "iFirstSector = x%x iNumSectors = x%x iSectorSize = x%x",
+                         0,
+                         aCapsInfo.iNumberOfBlocks,
+                         aCapsInfo.iBlockLength);
 
-				if (pe->iX86BootIndicator == KBootIndicatorBootable)
-                    {
-					defaultPartitionNumber = i;
-					break;
-                    }
-				}
-			else
-				{
-				__PXYPRINT(_L("!! Invalid Partition !!"));
-				}
-			}
-
-		// Check the validity of the partition address boundaries
-	    if (partitionCount > 0)
-		    {
-            __PXYPRINT1(_L("Using Partition %d"), partitionCount);
-			pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
-            TInt partitionIndex = firstValidPartitionCount;
-            if (defaultPartitionNumber > 0)
-                {
-                partitionIndex = defaultPartitionNumber;
-                }
-
-            TMBRPartitionEntry& partitionEntry = pe[partitionIndex];
-
-			iMsDataMemMap.InitDataArea(partitionEntry.iFirstSector,
+            }
+        else if (partitionCount > 0)
+            {
+            iMsDataMemMap.InitDataArea(partitionEntry.iFirstSector,
                                        partitionEntry.iNumSectors,
                                        aCapsInfo.iBlockLength);
-			__PXYPRINT2(_L("paritioncount = %d defaultpartition = %d"),
-						partitionCount, partitionIndex);
-			__PXYPRINT3(_L("iFirstSector = x%x iNumSectors = x%x iSectorSize = x%x"),                         
-						partitionEntry.iFirstSector,
-						partitionEntry.iNumSectors,
-                        aCapsInfo.iBlockLength);
-			}
-		else
-			{
-            __PXYPRINT(_L("No partition found"));
-			iMsDataMemMap.InitDataArea(0, aCapsInfo.iNumberOfBlocks, aCapsInfo.iBlockLength);
-			__PXYPRINT3(_L("iFirstSector = x%x iNumSectors = x%x iSectorSize = x%x"),
-						0, 
-                        aCapsInfo.iNumberOfBlocks,
-                        aCapsInfo.iBlockLength);
-			}
-		}
+            OstTraceExt3(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_13,
+                         "iFirstSector = x%x iNumSectors = x%x iSectorSize = x%x",
+                         partitionEntry.iFirstSector,
+                         partitionEntry.iNumSectors,
+                         aCapsInfo.iBlockLength);
+            }
+        else    // MBR is not valid
+            {
+            iMsDataMemMap.Reset();
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_14,
+                      "MBR not present");
+            }
+        }
+    partitionInfo.Close();
+    return r;
+    }
 
-    partitionInfo.Close();
-	return KErrNone;
-	}
 
 /**
 Initialise the proxy drive.
 @return system wide error code.
 */
 TInt CUsbHostMsProxyDrive::Initialise()
-	{
-	__MSFNSLOG
-    __HOSTPRINT(_L(">>> CUsbHostMsProxyDrive::Initialise()"));
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_20,
+              ">>> CUsbHostMsProxyDrive::Initialise()");
 
-	if(Mount())
-		{
-		// as we can't currently handle remounting devices that have
-		// been removed by unplugging the USB cable, disable critical notifiers
-		// as there's no point in asking the user to re-insert the disk.
-		Mount()->SetNotifyOff();
-		}
+    if(Mount())
+        {
+        // as we can't currently handle remounting devices that have
+        // been removed by unplugging the USB cable, disable critical notifiers
+        // as there's no point in asking the user to re-insert the disk.
+        Mount()->SetNotifyOff();
+        }
 
     // Check for media presence
-	TCapsInfo capsInfo;
-	TInt err = iUsbHostMsLun.Caps(capsInfo);
+    TCapsInfo capsInfo;
+    TInt err = iUsbHostMsLun.Caps(capsInfo);
 
     if (err == KErrNone && capsInfo.iMediaType == EMediaHardDisk)
         {
         err = InitialiseOffset(capsInfo);
         }
 
-    __HOSTPRINT1(_L("<<< CUsbHostMsProxyDrive::Initialise() err = %d"), err);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_21,
+              "<<< CUsbHostMsProxyDrive::Initialise() err = %d", err);
     return err;
-	}
+    }
 
 TInt CUsbHostMsProxyDrive::SetInfo(const RMessage2 &msg, TAny* aMessageParam2, TAny* aMessageParam3)
     {
-	__MSFNSLOG
-    __HOSTPRINT(_L(">>> CUsbHostMsProxyDrive::SetInfo()"));
-	TMassStorageUnitInfo iUnitInfo;
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_22,
+              ">>> CUsbHostMsProxyDrive::SetInfo()");
+    TMassStorageUnitInfo iUnitInfo;
     TPckg<TMassStorageUnitInfo> infoPckg(iUnitInfo);
-	TRAPD(err, msg.ReadL(2, infoPckg));
+    TRAPD(err, msg.ReadL(2, infoPckg));
 
-	if(err != KErrNone)
-		{
-		__PXYPRINT1(_L("Cant read from the RMessage %d"), err);
-        __HOSTPRINT1(_L("<<< CUsbHostMsProxyDrive::SetInfo() err = %d"), err);
-		return err;
-		}
+    if(err != KErrNone)
+        {
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_23,
+                  "Cant read from the RMessage %d", err);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_24,
+                  "<<< CUsbHostMsProxyDrive::SetInfo() err = %d", err);
+        return err;
+        }
 
-	err = iUsbHostMsLun.Initialise(msg, 3, iUnitInfo.iLunID);
-	if(err != KErrNone)
-		{
-		__PXYPRINT1(_L("Initialising logical unit failed %d"), err);
-        __HOSTPRINT1(_L("<<< CUsbHostMsProxyDrive::SetInfo() err = %d"), err);
-		return err;
-		}
+    err = iUsbHostMsLun.Initialise(msg, 3, iUnitInfo.iLunID);
+    if(err != KErrNone)
+        {
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_25,
+                  "Initialising logical unit failed %d", err);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_26,
+                  "<<< CUsbHostMsProxyDrive::SetInfo() err = %d", err);
+        return err;
+        }
 
-    __HOSTPRINT1(_L("<<< CUsbHostMsProxyDrive::SetInfo() err = %d"), err);
-	return err;
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_27,
+              "<<< CUsbHostMsProxyDrive::SetInfo() err = %d", err);
+    return err;
     }
 
 TInt CUsbHostMsProxyDrive::Dismounted()
-	{
-	__MSFNSLOG
-	return KErrNone;
-	}
+    {
+    return KErrNone;
+    }
 
 TInt CUsbHostMsProxyDrive::Enlarge(TInt /*aLength*/)
-	{
-	__MSFNSLOG
-	return KErrNotSupported;
-	}
+    {
+    return KErrNotSupported;
+    }
 
 
 TInt CUsbHostMsProxyDrive::ReduceSize(TInt /*aPos*/, TInt /*aLength*/)
-	{
-	__MSFNSLOG
-	return KErrNotSupported;
-	}
+    {
+    return KErrNotSupported;
+    }
 
-#define GetIndex(msg, aAddress, aIndex)			\
-	aIndex = msg.Ptr0() == aAddress ? 0 :				\
-				msg.Ptr1() == aAddress ? 1 :			\
-					msg.Ptr1() == aAddress ? 2 :		\
-						msg.Ptr1() == aAddress ? 3 : -1;
+#define GetIndex(msg, aAddress, aIndex)         \
+    aIndex = msg.Ptr0() == aAddress ? 0 :               \
+                msg.Ptr1() == aAddress ? 1 :            \
+                    msg.Ptr1() == aAddress ? 2 :        \
+                        msg.Ptr1() == aAddress ? 3 : -1;
 
 /**
 Read from the proxy drive.
@@ -228,113 +195,125 @@
 */
 TInt CUsbHostMsProxyDrive::Read(TInt64 aPos, TInt aLength,
                                 const TAny* aTrg, TInt aThreadHandle, TInt aOffset)
-	{
-	__MSFNSLOG
-    __HOSTPRINT4(_L("\n>>> HOST Read Pos=0x%lx LBA=0x%lx 0x%x 0x%x"),
-                 aPos, aPos/KBlockSize, aLength, aOffset);
+    {
+    OstTraceExt4(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_300,
+                 ">>> HOST Read Pos=0x%x %x LBA=0x%x %x",
+                 I64HIGH(aPos), I64LOW(aPos), I64HIGH(aPos/KBlockSize), I64LOW(aPos/KBlockSize));
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_301,
+                 ">>> Len 0x%x Offset 0x%x",
+                 (TUint)aLength, (TUint)aOffset);
 
-	TBool localMessage = (aThreadHandle == KLocalMessageHandle);
+    TBool localMessage = (aThreadHandle == KLocalMessageHandle);
 
-	//
-	// Set file position to where we want to read...
-	//
-	if(!localMessage)
-		{
-		RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-		localMessage = (msg.Handle() == KLocalMessageHandle);
-		}
+    //
+    // Set file position to where we want to read...
+    //
+    if(!localMessage)
+        {
+        RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+        localMessage = (msg.Handle() == KLocalMessageHandle);
+        }
 
-	TInt index = 0;
-	if (!localMessage)
-		{
-		RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-		GetIndex(msg, aTrg, index);
+    TInt index = 0;
+    if (!localMessage)
+        {
+        RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+        GetIndex(msg, aTrg, index);
 
-		if (index < 0)
+        if (index < 0)
             {
-            __HOSTPRINT1(_L("<<< HOST Read ret=%d"), KErrArgument);
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_302,
+                      "<<< HOST Read ret=%d", KErrArgument);
             return KErrArgument;
             }
-		}
+        }
 
-	/* Calculate the end position */
-	TInt64 end = aPos + static_cast<TInt64>(aLength);
+    /* Calculate the end position */
+    TInt64 end = aPos + static_cast<TInt64>(aLength);
 
-	/* check whether there is enough source data to write to the destination descriptor */
-	TInt64 truncate;
-	if(localMessage)
-		{
-		truncate = aLength - (((TPtr8* )aTrg)->MaxLength() - aOffset);
-	    __PXYPRINT1(_L("Descriptor length: %08x"), ((TPtr8* )aTrg)->MaxLength());
-		}
-	else
-		{
-		RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-		truncate = aLength - (msg.GetDesMaxLength(index) - aOffset);
-	    __PXYPRINT1(_L("Descriptor length: %08x"), msg.GetDesMaxLength(index));
-		}
+    /* check whether there is enough source data to write to the destination descriptor */
+    TInt64 truncate;
+    if(localMessage)
+        {
+        truncate = aLength - (((TPtr8* )aTrg)->MaxLength() - aOffset);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_303,
+                  "Descriptor length: %08x", ((TPtr8* )aTrg)->MaxLength());
+        }
+    else
+        {
+        RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+        truncate = aLength - (msg.GetDesMaxLength(index) - aOffset);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_304,
+                  "Descriptor length: %08x", msg.GetDesMaxLength(index));
+        }
 
-	__PXYPRINT1(_L("Offset: %08x"), aOffset);
-	__PXYPRINT1(_L("Truncate: 0x%lx"), truncate);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_305,
+              "Offset: %08x", aOffset);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_306,
+              "Truncate: 0x%lx", truncate);
 
-	if (truncate > 0)
-		{
-		end -= truncate;
-		}
+    if (truncate > 0)
+        {
+        end -= truncate;
+        }
 
-	iBuf.SetMax();
+    iBuf.SetMax();
     TInt r;
     TInt64 mediaPos;
-	while (aPos < end)
+    while (aPos < end)
         {
-		TInt len = end - aPos;
+        TInt len = end - aPos;
         mediaPos = aPos;
         r = iMsDataMemMap.CheckBlockInRange(mediaPos, len);
         if (r != KErrNone)
             {
-            __HOSTPRINT1(_L("<<< HOST Read ret=%d"), r);
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_307,
+                      "<<< HOST Read ret=%d", r);
             return r;
             }
 
-		if (localMessage)
-			{
-			TPtr8* pTrgPtr = (TPtr8*)aTrg;
-			TPtr8 trgDes((TUint8*)(pTrgPtr->MidTPtr(aOffset).Ptr()), pTrgPtr->MaxLength() - aOffset);
-			r = iUsbHostMsLun.Read(mediaPos, len, trgDes);
-			if (r != KErrNone)
-				return r;
-			pTrgPtr->SetLength(aOffset + trgDes.Length());
-			}
-		else
-			{
-			if (len > iBuf.MaxLength())
-				len = iBuf.MaxLength();
+        if (localMessage)
+            {
+            TPtr8* pTrgPtr = (TPtr8*)aTrg;
+            TPtr8 trgDes((TUint8*)(pTrgPtr->MidTPtr(aOffset).Ptr()), pTrgPtr->MaxLength() - aOffset);
+            r = iUsbHostMsLun.Read(mediaPos, len, trgDes);
+            if (r != KErrNone)
+                return r;
+            pTrgPtr->SetLength(aOffset + trgDes.Length());
+            }
+        else
+            {
+            if (len > iBuf.MaxLength())
+                len = iBuf.MaxLength();
 
             r = iUsbHostMsLun.Read(mediaPos, len, iBuf);
-			if (r != KErrNone)
+            if (r != KErrNone)
                 {
-                __HOSTPRINT1(_L("<<< HOST Read ret=%d"), r);
+                OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_308,
+                          "<<< HOST Read ret=%d", r);
                 return r;
                 }
 
-			iBuf.SetLength(len);
+            iBuf.SetLength(len);
 
-			RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-			r = msg.Write(index, iBuf, aOffset);
-			if (r != KErrNone)
+            RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+            r = msg.Write(index, iBuf, aOffset);
+            if (r != KErrNone)
                 {
-                __HOSTPRINT1(_L("<<< HOST Read ret=%d"), r);
+                OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_309,
+                          "<<< HOST Read ret=%d", r);
                 return r;
                 }
-			}
+            }
 
         aPos += len;
         aOffset += len;
         }
 
-    __HOSTPRINT1(_L("<<< HOST Read ret=%d"), KErrNone);
-	return KErrNone;
-	}
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_310,
+              "<<< HOST Read ret=%d", KErrNone);
+    return KErrNone;
+    }
 
 
 /**
@@ -351,10 +330,9 @@
 */
 TInt CUsbHostMsProxyDrive::Read(TInt64 aPos, TInt aLength,
                                 const TAny* aTrg, TInt aThreadHandle, TInt aOffset, TInt /* aFlags */)
-	{
-	__MSFNSLOG
-	return Read(aPos, aLength, aTrg, aThreadHandle, aOffset);
-	}
+    {
+    return Read(aPos, aLength, aTrg, aThreadHandle, aOffset);
+    }
 
 /**
 Read from the proxy drive.
@@ -366,12 +344,12 @@
 @return system wide error code.
 */
 TInt CUsbHostMsProxyDrive::Read(TInt64 aPos, TInt aLength, TDes8& aTrg)
-	{
-	__MSFNSLOG
-    __HOSTPRINT3(_L("\n>>> HOST Read Pos=0x%lx LBA=0x%lx 0x%x"),
-                 aPos, aPos/KBlockSize, aLength);
-	return iUsbHostMsLun.Read(iMsDataMemMap.GetDataPos(aPos), aLength, aTrg);
-	}
+    {
+    OstTraceExt5(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_40,
+                 ">>> HOST Read Pos=0x%x %x LBA=0x%x %x 0x%x",
+                 I64HIGH(aPos), I64LOW(aPos), I64HIGH(aPos/KBlockSize), I64LOW(aPos/KBlockSize), aLength);
+    return iUsbHostMsLun.Read(iMsDataMemMap.GetDataPos(aPos), aLength, aTrg);
+    }
 
 /**
 Write to the proxy drive.
@@ -386,110 +364,122 @@
 */
 TInt CUsbHostMsProxyDrive::Write(TInt64 aPos, TInt aLength,
                                  const TAny* aSrc, TInt aThreadHandle, TInt aOffset)
-	{
-	//
-	// Set file position to where we want to write...
-	//
-	__MSFNSLOG
-    __HOSTPRINT4(_L("\n>>> HOST Write Pos=0x%lx LBA=0%lx 0x%x 0x%x"),
-                 aPos, aPos/KBlockSize, aLength, aOffset);
+    {
+    //
+    // Set file position to where we want to write...
+    //
+    OstTraceExt4(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_50,
+                 ">>> HOST Write Pos=0x%x %x LBA=0%x %x",
+                 I64HIGH(aPos), I64LOW(aPos), I64HIGH(aPos/KBlockSize), I64LOW(aPos/KBlockSize));
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_501,
+                 "Len=0x%x Offset=0x%x",
+                 (TUint)aLength, (TUint)aOffset);
 
-	TBool localMessage = (aThreadHandle == KLocalMessageHandle);
+    TBool localMessage = (aThreadHandle == KLocalMessageHandle);
 
-	if(!localMessage)
-		{
-		RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-		localMessage = (msg.Handle() == KLocalMessageHandle);
-		}
+    if(!localMessage)
+        {
+        RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+        localMessage = (msg.Handle() == KLocalMessageHandle);
+        }
 
-	TInt index = 0;
-	if(!localMessage)
-		{
-		RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-		GetIndex(msg, aSrc, index);
+    TInt index = 0;
+    if(!localMessage)
+        {
+        RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+        GetIndex(msg, aSrc, index);
 
-		if (index < 0)
-			return KErrArgument;
-		}
+        if (index < 0)
+            return KErrArgument;
+        }
 
-	/* Calculate the end position */
-	TInt64 end =  aPos + static_cast<TInt64>(aLength);
-	/* check whether there is enough source data to read */
-	TInt64 truncate;
-	if (localMessage)
-		{
-		truncate = aLength - (((TPtr8* )aSrc)->Length() - aOffset);
-	    __PXYPRINT1(_L("Descriptor length: %08x"), ((TPtr8* )aSrc)->Length());
-		}
-	else
-		{
-		RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-		truncate = aLength - (msg.GetDesLength(index) - aOffset);
-	    __PXYPRINT1(_L("Descriptor length: %08x"), msg.GetDesLength(index));
-		}
+    /* Calculate the end position */
+    TInt64 end =  aPos + static_cast<TInt64>(aLength);
+    /* check whether there is enough source data to read */
+    TInt64 truncate;
+    if (localMessage)
+        {
+        truncate = aLength - (((TPtr8* )aSrc)->Length() - aOffset);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_51,
+                  "Descriptor length: %08x", ((TPtr8* )aSrc)->Length());
+        }
+    else
+        {
+        RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+        truncate = aLength - (msg.GetDesLength(index) - aOffset);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_52,
+                  "Descriptor length: %08x", msg.GetDesLength(index));
+        }
 
-	__PXYPRINT1(_L("Offset: %08x"), aOffset);
-	__PXYPRINT1(_L("Truncate: 0x%lx"), truncate);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_53,
+              "Offset: %08x", aOffset);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_PROXY, HOSTUSBMSPROXY_54,
+              "Truncate: 0x%lx", truncate);
 
-	/* if truncate is > 0  we are short of source data as claimed by the aLength. Hence adjust the 'end' */
-	if (truncate > 0)
-		{
-		end -= truncate;
-		}
+    /* if truncate is > 0  we are short of source data as claimed by the aLength. Hence adjust the 'end' */
+    if (truncate > 0)
+        {
+        end -= truncate;
+        }
 
-	iBuf.SetMax();
+    iBuf.SetMax();
 
     TInt r;
     TInt64 mediaPos;
-	while (aPos < end)
+    while (aPos < end)
         {
-		TInt len = end - aPos;
+        TInt len = end - aPos;
         mediaPos = aPos;
         r = iMsDataMemMap.CheckBlockInRange(mediaPos, len);
         if (r != KErrNone)
             {
-            __HOSTPRINT1(_L("<<< HOST Write ret=%d"), r);
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_55,
+                      "<<< HOST Write ret=%d", r);
             return r;
             }
 
-		if (localMessage)
-			{
-			r = iUsbHostMsLun.Write(mediaPos, len, ((TPtr8*)aSrc)->MidTPtr(aOffset));
+        if (localMessage)
+            {
+            r = iUsbHostMsLun.Write(mediaPos, len, ((TPtr8*)aSrc)->MidTPtr(aOffset));
 
-			if (r != KErrNone)
+            if (r != KErrNone)
                 {
-                __HOSTPRINT1(_L("<<< HOST Write ret=%d"), r);
+                OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_56,
+                          "<<< HOST Write ret=%d", r);
                 return r;
                 }
-			}
-		else
-			{
-			if (len > iBuf.Length())
-				len = iBuf.Length();
+            }
+        else
+            {
+            if (len > iBuf.Length())
+                len = iBuf.Length();
 
-			RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
-			r = msg.Read(index, iBuf, aOffset);
-			if (r != KErrNone)
+            RMessage2 msg(*(RMessagePtr2 *) &aThreadHandle);
+            r = msg.Read(index, iBuf, aOffset);
+            if (r != KErrNone)
                 {
-                __HOSTPRINT1(_L("<<< HOST Write ret=%d"), r);
+                OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_57,
+                          "<<< HOST Write ret=%d", r);
                 return r;
                 }
 
-			r = iUsbHostMsLun.Write(mediaPos, len, iBuf);
-			if (r != KErrNone)
+            r = iUsbHostMsLun.Write(mediaPos, len, iBuf);
+            if (r != KErrNone)
                 {
-                __HOSTPRINT1(_L("<<< HOST Write ret=%d"), r);
+                OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_58,
+                          "<<< HOST Write ret=%d", r);
                 return r;
                 }
-			}
+            }
 
         aPos += len;
         aOffset += len;
         }
 
-    __HOSTPRINT1(_L("<<< HOST Write ret=%d"), KErrNone);
-	return KErrNone;
-	}
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_59,
+              "<<< HOST Write ret=%d", KErrNone);
+    return KErrNone;
+    }
 
 
 /**
@@ -506,10 +496,9 @@
 */
 TInt CUsbHostMsProxyDrive::Write(TInt64 aPos, TInt aLength,
                                  const TAny* aSrc, TInt aThreadHandle, TInt aOffset, TInt /* aFlags */)
-	{
-	__MSFNSLOG
-	return Write(aPos, aLength, aSrc, aThreadHandle, aOffset);
-	}
+    {
+    return Write(aPos, aLength, aSrc, aThreadHandle, aOffset);
+    }
 
 /**
 Write to the proxy drive.
@@ -520,12 +509,12 @@
 @return system wide error code.
 */
 TInt CUsbHostMsProxyDrive::Write(TInt64 aPos,const TDesC8& aSrc)
-	{
-	__MSFNSLOG
-    __HOSTPRINT3(_L("\n>>> HOST Write Pos=0x%lx LBA=0x%lx 0x%x"),
-                 aPos, aPos/KBlockSize, aSrc.Length());
-	return iUsbHostMsLun.Write(iMsDataMemMap.GetDataPos(aPos), aSrc.Length(), aSrc);
-	}
+    {
+    OstTraceExt5(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_60,
+                 ">>> HOST Write Pos=0x%x %x LBA=0x%x %x Len=0x%x",
+                 I64HIGH(aPos), I64LOW(aPos), I64HIGH(aPos/KBlockSize), I64LOW(aPos/KBlockSize), aSrc.Length());
+    return iUsbHostMsLun.Write(iMsDataMemMap.GetDataPos(aPos), aSrc.Length(), aSrc);
+    }
 
 
 /**
@@ -536,87 +525,95 @@
 @return system wide error code
 */
 TInt CUsbHostMsProxyDrive::Caps(TDes8& anInfo)
-	{
-	__MSFNSLOG
-    __HOSTPRINT(_L(">>> HOST Caps"));
-	TLocalDriveCapsV6Buf caps;
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_70,
+              ">>> HOST Caps");
+    TLocalDriveCapsV6Buf caps;
     caps.FillZ();
 
     TLocalDriveCapsV6& c = caps();
 
     c.iConnectionBusType = EConnectionBusUsb;
-	c.iDriveAtt = KDriveAttLocal | KDriveAttRemovable | KDriveAttExternal;
-	c.iMediaAtt = KMediaAttFormattable;
-	c.iFileSystemId = KDriveFileSysFAT;
+    c.iDriveAtt = KDriveAttLocal | KDriveAttRemovable | KDriveAttExternal;
+    c.iMediaAtt = KMediaAttFormattable;
+    c.iFileSystemId = KDriveFileSysFAT;
 
-	TCapsInfo capsInfo;
-	TInt r = iUsbHostMsLun.Caps(capsInfo);
+    TCapsInfo capsInfo;
+    TInt r = iUsbHostMsLun.Caps(capsInfo);
 
-	if (KErrNone == r)
-		{
+    if (KErrNone == r)
+        {
         c.iType = capsInfo.iMediaType;
 
         if (capsInfo.iMediaType == EMediaHardDisk)
             {
             c.iBlockSize = capsInfo.iBlockLength;
             TUint64 size = iMsDataMemMap.DataSize();
-    
+
             if (size == 0)
                 {
                 // No valid partitions so specify the size of the disk
                 size = static_cast<TUint64>(capsInfo.iNumberOfBlocks) * capsInfo.iBlockLength;
                 }
             c.iSize = size;
-    
+
             c.iEraseBlockSize = 0;
-    
+
             if (capsInfo.iWriteProtect)
                 {
                 c.iMediaAtt |= KMediaAttWriteProtected;
                 }
-                
+
             static const TInt K512ByteSectorSize = 0x200; // 512
             if(K512ByteSectorSize != capsInfo.iBlockLength)
                 {
                 // not formattable if sector size is not 512
                 c.iMediaAtt &= ~KMediaAttFormattable;
                 }
-            __HOSTPRINT4(_L("<<< HOST Caps Block[num=0x%x size=0x%x] Media[size=0x%lx WP=0x%x]"),
-                        capsInfo.iNumberOfBlocks, capsInfo.iBlockLength,
-                        caps().iSize, caps().iMediaAtt);
+            OstTraceExt2(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_710,
+                         "<<< HOST Caps Block[num=0x%x size=0x%x]",
+                         capsInfo.iNumberOfBlocks, capsInfo.iBlockLength);
+            OstTraceExt2(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_711,
+                         "Media size=0x%x %x", I64HIGH(caps().iSize), I64LOW(caps().iSize));
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_712,
+                      "WP=0x%x", caps().iMediaAtt);
             }
         else if (capsInfo.iMediaType == EMediaCdRom)
             {
             // not formattable
             c.iMediaAtt &= ~KMediaAttFormattable;
-            __HOSTPRINT(_L(">>> HOST Caps MediaType = EMediaCdRom"));
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_72,
+                      ">>> HOST Caps MediaType = EMediaCdRom");
             }
         else
             {
             // do nothing
             }
-		}
-	else if (KErrNotReady == r)
+        }
+    else if (KErrNotReady == r)
         {
-        __HOSTPRINT(_L("<<< HOST Caps Media Not Present"));
-		c.iType = EMediaNotPresent;		
-		r = KErrNone;
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_73,
+                  "<<< HOST Caps Media Not Present");
+        c.iType = EMediaNotPresent;
+        r = KErrNone;
         }
-	else if (KErrGeneral == r)
+    else if (KErrGeneral == r)
         {
-        __HOSTPRINT(_L("<<< HOST Caps Unable to communicate with media"));
-		c.iType = EMediaUnknown;		
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_74,
+                  "<<< HOST Caps Unable to communicate with media");
+        c.iType = EMediaUnknown;
         }
 
     else
         {
-        __HOSTPRINT(_L("<<< HOST Caps Unknown Error"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_75,
+                  "<<< HOST Caps Unknown Error");
         c.iType = EMediaUnknown;
-		r = KErrUnknown;
+        r = KErrUnknown;
         }
-	anInfo = caps.Left(Min(caps.Length(),anInfo.MaxLength()));
-	return r;
-	}
+    anInfo = caps.Left(Min(caps.Length(),anInfo.MaxLength()));
+    return r;
+    }
 
 
 /**
@@ -630,10 +627,10 @@
 @return system wide error code.
 */
 TInt CUsbHostMsProxyDrive::Erase(TInt64 aPos, TInt& aLength)
-	{
-	__MSFNSLOG
-    __HOSTPRINT3(_L("\n HOST Erase Pos=0x%lx LBA=0x%lx 0x%x"),
-                 aPos, aPos/KBlockSize, aLength);
+    {
+    OstTraceExt5(TRACE_SHOSTMASSSTORAGE_HOST, HOSTUSBMSPROXY_80,
+                 "HOST Erase Pos=0x%x %x LBA=0x%x %x 0x%x",
+                 I64HIGH(aPos), I64LOW(aPos), I64HIGH(aPos/KBlockSize), I64LOW(aPos/KBlockSize), aLength);
     TInt err = iMsDataMemMap.TranslateDataPos(aPos, aLength);
 
     if (err)
@@ -641,7 +638,7 @@
 
     err = iUsbHostMsLun.Erase(aPos, aLength);
     return err;
-	}
+    }
 
 
 /**
@@ -653,10 +650,9 @@
 @return system wide error code.
 */
 TInt CUsbHostMsProxyDrive::Format(TInt64 aPos, TInt aLength)
-	{
-	__MSFNSLOG
+    {
     return Erase(aPos, aLength);
-	}
+    }
 
 
 /**
@@ -667,9 +663,7 @@
 @return system wide error code.
 */
 TInt CUsbHostMsProxyDrive::Format(TFormatInfo& aInfo)
-	{
-	__MSFNSLOG
-
+    {
     const TInt KDefaultMaxBytesPerFormat = 0x100 * iMsDataMemMap.BlockLength();  // 128K
 
     if (aInfo.i512ByteSectorsFormatted < 0)
@@ -681,10 +675,10 @@
         aInfo.i512ByteSectorsFormatted = 0;
         aInfo.iMaxBytesPerFormat = KDefaultMaxBytesPerFormat;
 
-		TLocalDriveCapsV6Buf caps;
-		TInt r = Caps(caps);
-		if (r != KErrNone)
-			return r;
+        TLocalDriveCapsV6Buf caps;
+        TInt r = Caps(caps);
+        if (r != KErrNone)
+            return r;
 
         iMsDataMemMap.InitDataArea(caps().iSize);
         }
@@ -705,75 +699,67 @@
 
 
 TInt CUsbHostMsProxyDrive::NotifyChange(TDes8 &aChanged,TRequestStatus* aStatus)
-	{
-	__MSFNSLOG
-	iUsbHostMsLun.NotifyChange(aChanged, *aStatus);
+    {
+    iUsbHostMsLun.NotifyChange(aChanged, *aStatus);
 
-	if(*aStatus != KRequestPending)
-		return KErrUnknown;
+    if(*aStatus != KRequestPending)
+        return KErrUnknown;
 
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 void CUsbHostMsProxyDrive::NotifyChangeCancel()
-	{
-	__MSFNSLOG
-	iUsbHostMsLun.NotifyChangeCancel();
-	}
+    {
+    iUsbHostMsLun.NotifyChangeCancel();
+    }
 
 TInt CUsbHostMsProxyDrive::SetMountInfo(const TDesC8* /*aMountInfo*/,TInt /*aMountInfoThreadHandle=KCurrentThreadHandle*/)
     {
-	__MSFNSLOG
     return KErrNone;
     }
 
 TInt CUsbHostMsProxyDrive::ForceRemount(TUint aFlags)
     {
-	__MSFNSLOG
     iUsbHostMsLun.ForceRemount(aFlags);
     return KErrNone;
     }
 
 TInt CUsbHostMsProxyDrive::Unlock(TMediaPassword& /*aPassword*/, TBool /*aStorePassword*/)
     {
-	__MSFNSLOG
     return KErrNotSupported;
     }
 
 TInt CUsbHostMsProxyDrive::Lock(TMediaPassword& /*aOldPassword*/, TMediaPassword& /*aNewPassword*/, TBool /*aStorePassword*/)
     {
-	__MSFNSLOG
     return KErrNotSupported;
     }
 
 TInt CUsbHostMsProxyDrive::Clear(TMediaPassword& /*aPassword*/)
     {
-	__MSFNSLOG
     return KErrNotSupported;
     }
 
 TInt CUsbHostMsProxyDrive::ErasePassword()
     {
-	__MSFNSLOG
     return KErrNotSupported;
     }
 
 TInt CUsbHostMsProxyDrive::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput)
-	{
-	switch(aInterfaceId)
-		{
-		case ELocalBufferSupport:
-			return KErrNone;
-		case EFinalised:
-			{
-			TBool isFinalised = (TBool)aInput;
-			if(isFinalised)
-				{
-				iUsbHostMsLun.SuspendLun();
-				}
-			}
-			return KErrNone;
-		default:
-			return KErrNotSupported;
-		}
-	}
+    {
+    switch(aInterfaceId)
+        {
+        case ELocalBufferSupport:
+            return KErrNone;
+        case EFinalised:
+            {
+            TBool isFinalised = (TBool)aInput;
+            if(isFinalised)
+                {
+                iUsbHostMsLun.SuspendLun();
+                }
+            }
+            return KErrNone;
+        default:
+            return KErrNotSupported;
+        }
+    }
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/susbhomsproxy.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/susbhomsproxy.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -12,35 +12,30 @@
 //
 // Description:
 // f32/shostmassstorage/msproxy/susbhomsproxy.mmp
-// 
+//
 //
 
-TARGET			usbhostms.pxy
-TARGETTYPE		fsy
-
-USERINCLUDE	.
-USERINCLUDE ../client
+TARGET      usbhostms.pxy
+TARGETTYPE  fsy
 
-SOURCEPATH		.
-SOURCE			hostusbmsfactory.cpp
-SOURCE			hostusbmsproxy.cpp
-SOURCE			tmsmemmap.cpp
-SOURCE			debug.cpp
+USERINCLUDE .
+USERINCLUDE ../client
+USERINCLUDE ../server/shared
+USERINCLUDE traces
 
-// Function tracing
-//SOURCEPATH		../server/shared
-//SOURCE			msdebug.cpp
+SOURCEPATH  .
+SOURCE      hostusbmsfactory.cpp
+SOURCE      hostusbmsproxy.cpp
+SOURCE      tmsmemmap.cpp
+SOURCE      tmbr.cpp
+
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-LIBRARY			euser.lib efile.lib usbhostmsclient.lib
+LIBRARY     euser.lib efile.lib usbhostmsclient.lib
 
-UID		0x100039df 0x10000CEE
-VENDORID 0x70000001
-
-//MACRO _HOST_DEBUG_PRINT_
-//MACRO _PROXY_DEBUG_PRINT_
-//MACRO _MSFN_DEBUG_PRINT_
+UID         0x100039df 0x10000CEE
+VENDORID	0x70000001
 
 CAPABILITY TCB ProtServ DiskAdmin AllFiles PowerMgmt CommDD
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmbr.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,104 @@
+// 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:
+//
+//
+
+/** @file
+@internalTechnology
+*/
+
+#include <e32cmn.h>
+#include <e32des8.h>
+#include <partitions.h>
+
+#include "mscutils.h"
+#include "tmbr.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmbrTraces.h"
+#endif
+
+
+TInt TMbr::GetPartition(TDes8& aMbrData, TMBRPartitionEntry& aPartitionEntry)
+    {
+    TUint8* buffer = const_cast<TUint8*>(aMbrData.Ptr());
+
+    // check first sector for a Master Boot Record
+    if (LittleEndian::Get16(&buffer[KMBRSignatureOffset]) != KMBRSignature)
+        {
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_11,
+                  "MBR not present");
+        return KErrNotFound;
+        }
+
+    memcpy(&buffer[0],&buffer[KMBRFirstPartitionOffset],(sizeof(TMBRPartitionEntry)<<2));
+    TMBRPartitionEntry* pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
+
+    TInt firstValidPartitionCount = -1;
+    TInt defaultPartitionNumber = -1;
+    TInt partitionCount = 0;
+    for (TInt i = 0; i < KMBRMaxPrimaryPartitions; i++, pe++)
+        {
+        if (pe->IsValidDosPartition() || pe->IsValidFAT32Partition() || pe->IsValidExFATPartition())
+            {
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_12,
+                      "Partition %d is recognized", i);
+            partitionCount++;
+
+            if (firstValidPartitionCount < 0)
+                firstValidPartitionCount = i;
+
+            if (pe->iX86BootIndicator == KBootIndicatorBootable)
+                {
+                OstTrace1(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_13,
+                          "Partition %d is bootable", i);
+                defaultPartitionNumber = i;
+                break;
+                }
+            }
+        else
+            {
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_14,
+                      "Partition %d is invalid", i);
+            }
+        }
+
+    if (partitionCount > 0)
+        {
+        pe = reinterpret_cast<TMBRPartitionEntry*>(&buffer[0]);
+        TInt partitionIndex = firstValidPartitionCount;
+        if (defaultPartitionNumber > 0)
+            {
+            partitionIndex = defaultPartitionNumber;
+            }
+
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_15,
+                  "Using Partition %d", partitionIndex);
+
+        TMBRPartitionEntry& partitionEntry = pe[partitionIndex];
+        aPartitionEntry = partitionEntry;
+
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_16,
+                     "partitioncount = %d defaultpartition = %d",
+                     partitionCount, partitionIndex);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_MBR, TMBR_17,
+                     "iFirstSector = x%x iNumSectors = x%x",
+                     partitionEntry.iFirstSector,
+                     partitionEntry.iNumSectors);
+        }
+
+    return partitionCount;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmbr.h	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 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:
+*
+*/
+#ifndef TMBR_H
+#define TMBR_H
+
+/** @file
+@internalTechnology
+*/
+
+
+class TMbr
+    {
+public:
+    static TInt GetPartition(TDes8& aBootSector, TMBRPartitionEntry& aPartitionEntry);
+    };
+
+#endif
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -28,14 +28,16 @@
 #include <e32err.h>
 
 #include "tmsmemmap.h"
-#include "debug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tmsmemmapTraces.h"
+#endif
 
 
 TMsDataMemMap::TMsDataMemMap()
-	{
-	__MSFNSLOG
+    {
     Reset();
-	}
+    }
 
 
 /**
@@ -52,7 +54,6 @@
  */
 TInt TMsDataMemMap::TranslateDataPos(TInt64& aPos, TInt& aLength) const
     {
-	__MSFNSLOG
     // Map to the actual position on the media
     aPos += iDataOffset;
 
@@ -82,7 +83,6 @@
  */
 TInt TMsDataMemMap::CheckBlockInRange(TInt64& aPos, TInt aLength) const
     {
-	__MSFNSLOG
     // Map to the actual position on the media
     aPos += iDataOffset;
 
@@ -94,7 +94,8 @@
     TInt64 endPos = aPos + aLength;
     if (endPos > iSize)
         {
-        __PXYPRINT2(_L("EOF found 0x%lx x%x"), aPos, aLength);
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_PROXY, TMSMEMMAP_1,
+                     "EOF found Pos=0x%x %x Len=0x%x", I64HIGH(aPos), I64LOW(aPos), aLength);
         return KErrEof;
         }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl	Tue Nov 02 15:29:23 2010 +0000
@@ -34,23 +34,23 @@
 
 inline TUint64 TMsDataMemMap::DataSize() const
     {
-    return iSize - iDataOffset;
+    return iSize;
     }
 
 inline void TMsDataMemMap::InitDataArea(TUint32 aFirstDataSector, TUint32 aNumSectors, TUint32 aSectorSize)
-	{
-	iSectorSize = aSectorSize;
+    {
+    iSectorSize = aSectorSize;
 
-	iFormatSectorShift = 0;
+    iFormatSectorShift = 0;
 
     while(aSectorSize >>= 1)
         {
         ++iFormatSectorShift;
         }
 
-	iDataOffset = static_cast<TInt64>(aFirstDataSector) * iSectorSize;
-	iSize = static_cast<TInt64>(aNumSectors) * iSectorSize;
-	}
+    iDataOffset = static_cast<TInt64>(aFirstDataSector) * iSectorSize;
+    iSize = static_cast<TInt64>(aNumSectors) * iSectorSize;
+    }
 
 
 inline void TMsDataMemMap::InitDataArea(TUint64 aSize)
@@ -65,7 +65,7 @@
     }
 
 inline TInt TMsDataMemMap::FormatSectorShift() const
-	{
-	return iFormatSectorShift;
-	}
+    {
+    return iFormatSectorShift;
+    }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/traces/OstTraceDefinitions.h	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 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:
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevice.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevice.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -33,100 +33,95 @@
 #include "cusbhostmsdevice.h"
 #include "cusbmssuspendresume.h"
 
-#include "msdebug.h"
-#include "debug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbhostmsdeviceTraces.h"
+#endif
 
 
 CUsbHostMsDevice* CUsbHostMsDevice::NewL(THostMassStorageConfig& aConfig)
     {
-    __MSFNSLOG
-	CUsbHostMsDevice* r = new (ELeave) CUsbHostMsDevice(aConfig);
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
-	}
+    CUsbHostMsDevice* r = new (ELeave) CUsbHostMsDevice(aConfig);
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
+    }
 
 void CUsbHostMsDevice::ConstructL()
     {
-    __MSFNLOG
-	iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-	iTimerRunning = EFalse;
+    iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iTimerRunning = EFalse;
     }
 
 
 CUsbHostMsDevice::CUsbHostMsDevice(THostMassStorageConfig& aConfig)
-:	iConfig(aConfig),
-	iState(EReady)
+:   iConfig(aConfig),
+    iState(EReady)
     {
-    __MSFNLOG
-	}
+    }
 
 
 CUsbHostMsDevice::~CUsbHostMsDevice()
     {
-    __MSFNLOG
-	delete iTransport;
-	delete iDeviceSuspendResume;
-	if (iTimer && iTimerRunning)
-		{
-		iTimer->Cancel();
-		}
-	delete iTimer;
-	}
+    delete iTransport;
+    delete iDeviceSuspendResume;
+    if (iTimer && iTimerRunning)
+        {
+        iTimer->Cancel();
+        }
+    delete iTimer;
+    }
 
 
 MTransport* CUsbHostMsDevice::InitialiseTransportL(TTransportType aTransportId)
     {
-    __MSFNLOG
-	switch(aTransportId)
+    switch(aTransportId)
         {
-	case BulkOnlyTransport:
-		return CBulkOnlyTransport::NewL(iConfig.iInterfaceToken);
-	default:
-	//		Panic;
-		__HOSTPRINT(_L("Unsupported Transport class requested"));
-		User::Leave(KErrNotSupported);
-		return NULL;
+    case BulkOnlyTransport:
+        return CBulkOnlyTransport::NewL(iConfig.iInterfaceToken);
+    default:
+    //      Panic;
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICE_10,
+                  "Unsupported Transport class requested");
+        User::Leave(KErrNotSupported);
+        return NULL;
         }
     }
 
 void CUsbHostMsDevice::InitialiseL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	iTransport = InitialiseTransportL((TTransportType) iConfig.iTransportId);
-	TRAPD(r, iDeviceSuspendResume = CUsbMsIfaceSuspendResume::NewL(iTransport, this));
-	if(r != KErrNone)
-		{
-		delete iTransport;
-		User::Leave(r);
-		}
-	iTransport->GetMaxLun(&iMaxLun, aMessage);
-	}
+    {
+    iTransport = InitialiseTransportL((TTransportType) iConfig.iTransportId);
+    TRAPD(r, iDeviceSuspendResume = CUsbMsIfaceSuspendResume::NewL(iTransport, this));
+    if(r != KErrNone)
+        {
+        delete iTransport;
+        User::Leave(r);
+        }
+    iTransport->GetMaxLun(&iMaxLun, aMessage);
+    }
 
 
 void CUsbHostMsDevice::UnInitialiseL()
     {
-    __MSFNLOG
-	StopTimer();
+    StopTimer();
     iLuList.RemoveAllLuL();
     }
 
 
 TInt CUsbHostMsDevice::AddLunL(TLun aLun)
     {
-    __MSFNLOG
     TInt r = KErrNone;
-	StartTimer();
+    StartTimer();
     CUsbHostMsLogicalUnit* lu = CUsbHostMsLogicalUnit::NewL(aLun);
     CleanupStack::PushL(lu);
 
     TRAP(r, lu->InitialiseProtocolL(aLun, iConfig, *iTransport));
 
-	if (r == KErrNone)
-		{
-		TRAP(r, iLuList.AddLuL(lu));
-		}
+    if (r == KErrNone)
+        {
+        TRAP(r, iLuList.AddLuL(lu));
+        }
 
     if (r != KErrNone)
         {
@@ -142,24 +137,21 @@
 
 void CUsbHostMsDevice::RemoveLunL(TLun aLun)
     {
-    __MSFNLOG
-	if(iLuList.Count() <= 1)
-		StopTimer();
-	iLuList.RemoveLuL(aLun);
+    if(iLuList.Count() <= 1)
+        StopTimer();
+    iLuList.RemoveLuL(aLun);
     }
 
 
 void CUsbHostMsDevice::InitLunL(TLun aLun)
-	{
-    __MSFNLOG
-	CUsbHostMsLogicalUnit& lu = SetLunL(aLun);
+    {
+    CUsbHostMsLogicalUnit& lu = SetLunL(aLun);
     lu.InitL();
-	}
+    }
 
 
 void CUsbHostMsDevice::SuspendLunL(TLun aLun)
-	{
-    __MSFNLOG
+    {
     if (IsSuspended())
         {
         return;
@@ -169,42 +161,40 @@
 
     // check whether all the luns are suspended, if so then request usb
     // interface suspension to the transport layer
-	for (TInt i = 0; i < iLuList.Count(); i++)
-		{
-		CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
-	   	if (!lu.IsReadyToSuspend() && lu.IsConnected())
-	   		return;
-		}
+    for (TInt i = 0; i < iLuList.Count(); i++)
+        {
+        CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
+        if (!lu.IsReadyToSuspend() && lu.IsConnected())
+            return;
+        }
 
-	for (TInt i = 0; i < iLuList.Count(); i++)
-		{
-		CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
-		SetLunL(lu);
-		lu.SuspendL();
-		}
+    for (TInt i = 0; i < iLuList.Count(); i++)
+        {
+        CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
+        SetLunL(lu);
+        lu.SuspendL();
+        }
 
-	StopTimer();
-	iDeviceSuspendResume->Suspend();
-	iState = ESuspended;
-	}
+    StopTimer();
+    iDeviceSuspendResume->Suspend();
+    iState = ESuspended;
+    }
 
 
 void CUsbHostMsDevice::Resume(TRequestStatus& aStatus)
-	{
-    __MSFNLOG
-	if (iState == ESuspended)
-		{
-		StartTimer();
-		iDeviceSuspendResume->Resume(aStatus);
-		}
-	}
+    {
+    if (iState == ESuspended)
+        {
+        StartTimer();
+        iDeviceSuspendResume->Resume(aStatus);
+        }
+    }
 
 
 TLun CUsbHostMsDevice::GetAndSetLunL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	// Subssessions need a positive value to store in the handles. We represent Luns as LunId+1
-	// We represent LunId in MSC from 0 to MaxLun-1 as represented in BOT so subtract 1 from the Id
+    {
+    // Subssessions need a positive value to store in the handles. We represent Luns as LunId+1
+    // We represent LunId in MSC from 0 to MaxLun-1 as represented in BOT so subtract 1 from the Id
     // received from RMessage
 
     TInt lun = aMessage.Int3() - 1;
@@ -212,9 +202,9 @@
         {
         User::Leave(KErrArgument);
         }
-	SetLunL(static_cast<TLun>(lun));
-	return static_cast<TLun>(lun);
-	}
+    SetLunL(static_cast<TLun>(lun));
+    return static_cast<TLun>(lun);
+    }
 
 
 CUsbHostMsLogicalUnit& CUsbHostMsDevice::GetLuL(TInt aLunNum) const
@@ -224,64 +214,63 @@
 
 
 void CUsbHostMsDevice::SetLunL(CUsbHostMsLogicalUnit& aLu)
-	{
-    __MSFNLOG
+    {
     TLun lun = aLu.Lun();
-	if (lun <= iMaxLun)
+    if (lun <= iMaxLun)
         {
-        __HOSTPRINT1(_L("SetLun %d"), lun);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICE_20,
+                  "SetLun %d", lun);
         iTransport->SetLun(lun);
-		if (aLu.IsReadyToSuspend())
-			{
-			aLu.CancelReadyToSuspend();
-			}
-		}
-	}
+        if (aLu.IsReadyToSuspend())
+            {
+            aLu.CancelReadyToSuspend();
+            }
+        }
+    }
 
 
 CUsbHostMsLogicalUnit& CUsbHostMsDevice::SetLunL(TLun aLun)
-	{
-    __MSFNLOG
+    {
     CUsbHostMsLogicalUnit& lu = iLuList.GetLuL(aLun);
     SetLunL(lu);
     return lu;
-	}
+    }
 
 /**
 Starts timer to periodically check LUN. If the timer is not yet running then
 start it.
 */
 void CUsbHostMsDevice::StartTimer()
-	{
-    __MSFNLOG
-	if (!iTimerRunning)
-		{
-		// Period of the LUN Ready check
-		const TTimeIntervalMicroSeconds32 KInterval = iConfig.iStatusPollingInterval * 1000 * 1000;
-		TCallBack callback(TimerCallback, this);
-		__HOSTPRINT(_L("Starting timer"));
-		iTimer->Start(KInterval, KInterval, callback);
-		iTimerRunning = ETrue;
-		}
-	}
+    {
+    if (!iTimerRunning)
+        {
+        // Period of the LUN Ready check
+        const TTimeIntervalMicroSeconds32 KInterval = iConfig.iStatusPollingInterval * 1000 * 1000;
+        TCallBack callback(TimerCallback, this);
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICE_21,
+                  "Starting timer");
+        iTimer->Start(KInterval, KInterval, callback);
+        iTimerRunning = ETrue;
+        }
+    }
 
 
 /**
 Ensure that the Timer is stopped
 */
 void CUsbHostMsDevice::StopTimer()
-	{
-    __MSFNLOG
-	if (iTimer && iTimerRunning)
-		{
-		__HOSTPRINT(_L("Stopping timer"));
-		if (iTimer->IsActive())
-			{
-			iTimer->Cancel();
-			}
-		iTimerRunning = EFalse;
-		}
-	}
+    {
+    if (iTimer && iTimerRunning)
+        {
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICE_30,
+                  "Stopping timer");
+        if (iTimer->IsActive())
+            {
+            iTimer->Cancel();
+            }
+        iTimerRunning = EFalse;
+        }
+    }
 
 /**
 A static wrapper for the DoLunReadyCheckEvent member function for use as a timer
@@ -291,70 +280,65 @@
 @return not used in CPeriodic callback (see TCallback)
 */
 TInt CUsbHostMsDevice::TimerCallback(TAny* obj)
-	{
-    __MSFNSLOG
+    {
     CUsbHostMsDevice* device = static_cast<CUsbHostMsDevice*>(obj);
-	TRAPD(err, device->DoLunReadyCheckEventL());
-	return err;
-	}
+    TRAPD(err, device->DoLunReadyCheckEventL());
+    return err;
+    }
 
 void CUsbHostMsDevice::DoLunReadyCheckEventL()
-	{
-    __MSFNLOG
-	TInt err;
-	for (TInt i = 0; i < iLuList.Count(); i++)
-		{
-		CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
-		SetLunL(lu);
-		TRAP(err, lu.DoLunReadyCheckL());
-		}
-	}
+    {
+    TInt err;
+    for (TInt i = 0; i < iLuList.Count(); i++)
+        {
+        CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
+        SetLunL(lu);
+        TRAP(err, lu.DoLunReadyCheckL());
+        }
+    }
 
 void CUsbHostMsDevice::DoHandleRemoteWakeupL()
-	{
-    __MSFNLOG
-	DoResumeLogicalUnitsL();
-	DoLunReadyCheckEventL();	// For remote wakeup we do not wait for timer to expire
+    {
+    DoResumeLogicalUnitsL();
+    DoLunReadyCheckEventL();    // For remote wakeup we do not wait for timer to expire
 
     // check whether all the luns are suspended, if so then request usb
     // interface suspension to the transport layer
-	for (TInt i = 0; i < iLuList.Count(); i++)
-		{
-		CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
-		// Has any of the logical units have got its state changed?
-	   	if ( (lu.IsReadyToSuspend() && !lu.IsConnected()) ||
-				(!lu.IsReadyToSuspend() && lu.IsConnected()) )
-			{
-			StartTimer(); // Now start the timer
-	   		return;
-			}
-		}
+    for (TInt i = 0; i < iLuList.Count(); i++)
+        {
+        CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
+        // Has any of the logical units have got its state changed?
+        if ( (lu.IsReadyToSuspend() && !lu.IsConnected()) ||
+                (!lu.IsReadyToSuspend() && lu.IsConnected()) )
+            {
+            StartTimer(); // Now start the timer
+            return;
+            }
+        }
 
-	for (TInt i = 0; i < iLuList.Count(); i++)
-		{
-		CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
-		SetLunL(lu);
-		lu.SuspendL();
-		}
+    for (TInt i = 0; i < iLuList.Count(); i++)
+        {
+        CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
+        SetLunL(lu);
+        lu.SuspendL();
+        }
 
-	iDeviceSuspendResume->Suspend();
-	iState = ESuspended;
-	}
+    iDeviceSuspendResume->Suspend();
+    iState = ESuspended;
+    }
 
 void CUsbHostMsDevice::DoResumeLogicalUnitsL()
-	{
-    __MSFNLOG
-	for (TInt i = 0; i < iLuList.Count(); i++)
-		{
-		CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
-		SetLunL(lu);
-		lu.ResumeL();
-		}
-	}
+    {
+    for (TInt i = 0; i < iLuList.Count(); i++)
+        {
+        CUsbHostMsLogicalUnit& lu = iLuList.GetLu(i);
+        SetLunL(lu);
+        lu.ResumeL();
+        }
+    }
 
 void CUsbHostMsDevice::ResumeCompletedL()
-	{
-    __MSFNLOG
-	iState = EReady;
-	DoResumeLogicalUnitsL();
-	}
+    {
+    iState = EReady;
+    DoResumeLogicalUnitsL();
+    }
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmsdevicethread.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -27,10 +27,13 @@
 #include "msgservice.h"
 #include "cusbhostmslogicalunit.h"
 #include "cusbhostmsdevice.h"
-#include "msdebug.h"
 #include "cusbhostmssession.h"
 #include "cusbhostmsdevicethread.h"
-#include "debug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbhostmsdevicethreadTraces.h"
+#endif
 
 /**
 Constructor
@@ -38,7 +41,6 @@
 TDeviceHandler::TDeviceHandler(CUsbHostMsDevice& aDevice)
 :   iDevice(aDevice)
     {
-    __MSFNLOG
     }
 
 
@@ -51,14 +53,13 @@
  */
 void TDeviceHandler::HandleMessageL(const RMessage2& aMessage)
     {
-    __MSFNLOG
     TLun lun = iDevice.GetAndSetLunL(aMessage);
 
-	switch (aMessage.Function())
-		{
-	case EUsbHostMsSuspendLun:
+    switch (aMessage.Function())
+        {
+    case EUsbHostMsSuspendLun:
         iDevice.SuspendLunL(lun);
-		break;
+        break;
     case EUsbHostMsUnRegisterLun:
         iDevice.RemoveLunL(lun);
         break;
@@ -67,8 +68,8 @@
         CUsbHostMsLogicalUnit& lu = iDevice.GetLuL(lun);
         TLogicalUnitHandler luHandler(lu);
         luHandler.HandleMessageL(aMessage);
-		break;
-		}
+        break;
+        }
     }
 
 
@@ -80,7 +81,6 @@
 TLogicalUnitHandler::TLogicalUnitHandler(CUsbHostMsLogicalUnit& aLu)
 :   iLu(aLu)
     {
-    __MSFNLOG
     }
 
 
@@ -91,65 +91,62 @@
    @param aMessage
  */
 void TLogicalUnitHandler::HandleMessageL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	switch (aMessage.Function())
-		{
-	case EUsbHostMsNotifyChange:
+    {
+    switch (aMessage.Function())
+        {
+    case EUsbHostMsNotifyChange:
         iLu.NotifyChange(aMessage);
-		break;
-	case EUsbHostMsCancelChangeNotifier:
+        break;
+    case EUsbHostMsCancelChangeNotifier:
         iLu.CancelChangeNotifierL();
-		break;
-	case EUsbHostMsForceRemount:
+        break;
+    case EUsbHostMsForceRemount:
         iLu.ForceCompleteNotifyChangeL();
-		break;
-	case EUsbHostMsRead:
+        break;
+    case EUsbHostMsRead:
         iLu.ReadL(aMessage);
-		break;
-	case EUsbHostMsWrite:
+        break;
+    case EUsbHostMsWrite:
         iLu.WriteL(aMessage);
-		break;
-	case EUsbHostMsErase:
+        break;
+    case EUsbHostMsErase:
         iLu.EraseL(aMessage);
-		break;
-	case EUsbHostMsCapacity:
+        break;
+    case EUsbHostMsCapacity:
         iLu.CapsL(aMessage);
-		break;
-	default:
-		aMessage.Panic(KUsbHostMsSrvPncCat, EUsbMsPanicIllegalIPC);
-		break;
-		}
-	}
+        break;
+    default:
+        aMessage.Panic(KUsbHostMsSrvPncCat, EUsbMsPanicIllegalIPC);
+        break;
+        }
+    }
 
 
 void CUsbHostMsDeviceThread::DoStartServerL(TAny* aPtr)
     {
-    __MSFNSLOG
     CActiveScheduler* s = new(ELeave) CActiveScheduler;
     CActiveScheduler::Install(s);
 
-	CUsbHostMsDeviceThread* iThread = (CUsbHostMsDeviceThread*)aPtr;
-	CActiveScheduler::Add(iThread);
+    CUsbHostMsDeviceThread* iThread = (CUsbHostMsDeviceThread*)aPtr;
+    CActiveScheduler::Add(iThread);
 
     iThread->Start();
 
-	RThread::Rendezvous(KErrNone);
+    RThread::Rendezvous(KErrNone);
 
-	//
+    //
     // Ready to run
     CActiveScheduler::Start();
 
     //
     // Cleanup the scheduler
-	delete s;
+    delete s;
     }
 
 
 TInt CUsbHostMsDeviceThread::Entry(TAny* aPtr)
-	{
-    __MSFNSLOG
-	CTrapCleanup* cleanup = CTrapCleanup::New();
+    {
+    CTrapCleanup* cleanup = CTrapCleanup::New();
     if (!cleanup)
         {
         return KErrNoMemory;
@@ -158,31 +155,29 @@
     TRAPD(error, DoStartServerL(aPtr));
     delete cleanup;
     return error;
-	}
+    }
 
 
 void  CUsbHostMsDeviceThread::RunL()
-	{
-    __MSFNLOG
-
+    {
     // called on completion of MessageRequest() or Resume()
     User::LeaveIfError(iStatus.Int());
 
-	Lock();    
+    Lock();
     if (iUsbHostMsDevice)
         {
         if (iUsbHostMsDevice->IsSuspended())
             {
 
-            RMessage2 msg = iRMessage2[iDequeueIndex];      
+            RMessage2 msg = iRMessage2[iDequeueIndex];
             if (msg.Function() != EUsbHostMsSuspendLun)
                 {
-                // request resume 
+                // request resume
                 Unlock();
                 iUsbHostMsDevice->Resume(iStatus);
                 SetActive();
                 return;
-                }            
+                }
             }
         }
 
@@ -192,15 +187,15 @@
     iDequeueIndex++;
 
     if(iDequeueIndex >= KMaxNumMessage)
-     	iDequeueIndex = 0;
+        iDequeueIndex = 0;
     if(iQueueFull)
-     	iQueueFull = EFalse;
+        iQueueFull = EFalse;
 
     HandleMessage(msg);
 
     if ((iQueueIndex != iDequeueIndex) || iQueueFull)
-	   	{
-        // self completion        
+        {
+        // self completion
         TRequestStatus* status = &iStatus;
         User::RequestComplete(status, KErrNone);
         SetActive();
@@ -211,7 +206,7 @@
         SetActive();
         }
     Unlock();
-	}
+    }
 
 
 void CUsbHostMsDeviceThread::DoCancel()
@@ -223,63 +218,59 @@
 
 TInt CUsbHostMsDeviceThread::RunError(TInt aError)
 {
-    __HOSTPRINT1(_L(">> HOST RunError returning %d"), aError);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICETHREAD_10,
+              ">> HOST RunError returning %d", aError);
     return KErrNone;
 }
 
 
 TInt CUsbHostMsDeviceThread::QueueMsg(const RMessage2& aMsg)
-	{
-    __MSFNLOG
-
-	if (iQueueFull)
-		{
-		return KErrOverflow;
-		}
+    {
+    if (iQueueFull)
+        {
+        return KErrOverflow;
+        }
 
     Lock();
 
-	iRMessage2[iQueueIndex] = aMsg;
-	iQueueIndex++;
+    iRMessage2[iQueueIndex] = aMsg;
+    iQueueIndex++;
 
-	if (iQueueIndex >= KMaxNumMessage)
-		{
-		iQueueIndex = 0;
-		}
+    if (iQueueIndex >= KMaxNumMessage)
+        {
+        iQueueIndex = 0;
+        }
 
-	if (iQueueIndex == iDequeueIndex)
-		{
-		iQueueFull = ETrue;
-		}
-	Unlock();
-	return KErrNone;
-	}
+    if (iQueueIndex == iDequeueIndex)
+        {
+        iQueueFull = ETrue;
+        }
+    Unlock();
+    return KErrNone;
+    }
 
 
 CUsbHostMsDeviceThread::CUsbHostMsDeviceThread(CUsbHostMsSession& aUsbHostMsSession, TUint aToken)
-:	CActive(EPriorityStandard),
+:   CActive(EPriorityStandard),
     iUsbHostMsSession(aUsbHostMsSession),
     iQueueFull(EFalse)
-	{
-    __MSFNLOG
+    {
     TBuf<32> nameBuf;
     nameBuf.Format(_L("Host Ms ThreadMutex%8x"), aToken);
-	iMutex.CreateGlobal(nameBuf,EOwnerProcess);
-	}
+    iMutex.CreateGlobal(nameBuf,EOwnerProcess);
+    }
 
 CUsbHostMsDeviceThread::~CUsbHostMsDeviceThread()
-	{
-    __MSFNLOG
+    {
     Cancel();
-	iMutex.Close();
-	}
+    iMutex.Close();
+    }
 
 CUsbHostMsDeviceThread* CUsbHostMsDeviceThread::NewL(CUsbHostMsSession& aUsbHostMsSession, TUint aToken)
-	{
-    __MSFNSLOG
-	CUsbHostMsDeviceThread* r = new (ELeave) CUsbHostMsDeviceThread(aUsbHostMsSession, aToken);
-	return r;
-	}
+    {
+    CUsbHostMsDeviceThread* r = new (ELeave) CUsbHostMsDeviceThread(aUsbHostMsSession, aToken);
+    return r;
+    }
 
 
 void CUsbHostMsDeviceThread::Start()
@@ -291,59 +282,61 @@
 
 /**
  Handles the request (in the form of a message) received from the client
-@param	aMessage	The received message
+@param  aMessage    The received message
  */
 void CUsbHostMsDeviceThread::HandleMessage(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	TInt ret = KErrNotReady;
-    __HOSTPRINT2(_L(">> HOST DispatchMessageL Function=%d %d"), aMessage.Function(), aMessage.Int3());
-	switch (aMessage.Function())
-		{
-	case EUsbHostMsRegisterInterface:
-		TRAP(ret, RegisterInterfaceL(aMessage));
-		break;
+    {
+    TInt ret = KErrNotReady;
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICETHREAD_21,
+              ">> HOST DispatchMessageL Function=%d %d",
+              aMessage.Function(), aMessage.Int3());
+    switch (aMessage.Function())
+        {
+    case EUsbHostMsRegisterInterface:
+        TRAP(ret, RegisterInterfaceL(aMessage));
+        break;
     case EUsbHostMsInitialiseInterface:
-		TRAP(ret, InitialiseInterfaceL(aMessage));
+        TRAP(ret, InitialiseInterfaceL(aMessage));
         // CUsbInterfaceHandler::GetMaxLun() completes asynchronously
         if (ret)
             {
             // Error condition needs to be completed
             break;
             }
-		return;
-	case EUsbHostMsUnRegisterInterface:
-		// Check whether all luns have got uninitialised. 
+        return;
+    case EUsbHostMsUnRegisterInterface:
+        // Check whether all luns have got uninitialised.
         if (iUsbHostMsDevice)
             {
             for(TInt i = 0, j = iUsbHostMsDevice->GetMaxLun(); i <= j; i++)
                 TRAP_IGNORE(iUsbHostMsDevice->RemoveLunL(i));
             }
-		TRAP(ret, UnRegisterInterfaceL(aMessage));
-		break;
-	case EUsbHostMsRegisterLun:
-		TRAP(ret, RegisterLogicalUnitL(aMessage));
-		break;
-	case EUsbHostMsGetNumLun:
-		TRAP(ret, GetNumLunL(aMessage));
-		break;
-	case EUsbHostMsShutdown:
-		ret = Shutdown();
-		break;
+        TRAP(ret, UnRegisterInterfaceL(aMessage));
+        break;
+    case EUsbHostMsRegisterLun:
+        TRAP(ret, RegisterLogicalUnitL(aMessage));
+        break;
+    case EUsbHostMsGetNumLun:
+        TRAP(ret, GetNumLunL(aMessage));
+        break;
+    case EUsbHostMsShutdown:
+        ret = Shutdown();
+        break;
     default:
         // Try Device Handler and Logical Unit Handler
         __ASSERT_DEBUG(iUsbHostMsDevice, User::Invariant());
         TDeviceHandler deviceHandler(*iUsbHostMsDevice);
         TRAP(ret, deviceHandler.HandleMessageL(aMessage));
-		break;
-		}
-    __HOSTPRINT1(_L(">> HOST returning %d"), ret);
+        break;
+        }
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICETHREAD_22,
+              ">> HOST returning %d", ret);
 
     if (aMessage.Function() != EUsbHostMsNotifyChange)
         {
         aMessage.Complete(ret);
         }
-	}
+    }
 
 
 /**
@@ -353,85 +346,81 @@
 */
 TInt CUsbHostMsDeviceThread::Shutdown()
     {
-    __MSFNLOG
     CActiveScheduler::Stop();
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 void CUsbHostMsDeviceThread::GetNumLunL(const RMessage2& aMessage)
-	{
-	__MSFNLOG
+    {
     if (!iUsbHostMsDevice)
         {
         User::Leave(KErrNotReady);
         }
 
-	TUint32 maxLun = iUsbHostMsDevice->GetMaxLun() + 1;
-	TPtrC8 pLun((TUint8*)&maxLun,sizeof(TUint32));
-	aMessage.WriteL(0,pLun);
-	}
+    TUint32 maxLun = iUsbHostMsDevice->GetMaxLun() + 1;
+    TPtrC8 pLun((TUint8*)&maxLun,sizeof(TUint32));
+    aMessage.WriteL(0,pLun);
+    }
 
 
 void CUsbHostMsDeviceThread::RegisterInterfaceL(const RMessage2& aMessage)
-	{
-	__MSFNLOG
+    {
+    THostMassStorageConfig msDeviceConfig;
+    TPtr8 ptr((TUint8*)&msDeviceConfig,sizeof(THostMassStorageConfig));
+    aMessage.ReadL(0, ptr);
 
-	THostMassStorageConfig msDeviceConfig;
-	TPtr8 ptr((TUint8*)&msDeviceConfig,sizeof(THostMassStorageConfig));
-	aMessage.ReadL(0, ptr);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICETHREAD_30,
+              "RegisterInterfaceL Token=%d ", msDeviceConfig.iInterfaceToken);
 
-    __HOSTPRINT1(_L("RegisterInterfaceL Token=%d "), msDeviceConfig.iInterfaceToken);
-
-	iUsbHostMsDevice = CUsbHostMsDevice::NewL(msDeviceConfig);
-	}
+    iUsbHostMsDevice = CUsbHostMsDevice::NewL(msDeviceConfig);
+    }
 
 
 void CUsbHostMsDeviceThread::InitialiseInterfaceL(const RMessage2& aMessage)
-	{
-	__MSFNLOG
+    {
     if (!iUsbHostMsDevice)
         {
         User::Leave(KErrNotReady);
         }
 
-	TRAPD(err, iUsbHostMsDevice->InitialiseL(aMessage));
+    TRAPD(err, iUsbHostMsDevice->InitialiseL(aMessage));
     if (err != KErrNone)
         {
         delete iUsbHostMsDevice;
-		iUsbHostMsDevice = NULL;
+        iUsbHostMsDevice = NULL;
         User::Leave(err);
         }
-	}
+    }
 
 
 void CUsbHostMsDeviceThread::UnRegisterInterfaceL(const RMessage2& aMessage)
     {
-    __MSFNLOG
     if (!iUsbHostMsDevice)
         {
         User::Leave(KErrNotReady);
         }
 
-	TRAPD(err, iUsbHostMsDevice->UnInitialiseL());
-	delete iUsbHostMsDevice;
-	iUsbHostMsDevice = NULL;
+    TRAPD(err, iUsbHostMsDevice->UnInitialiseL());
+    delete iUsbHostMsDevice;
+    iUsbHostMsDevice = NULL;
     User::LeaveIfError(err);
     }
 
 
 void CUsbHostMsDeviceThread::RegisterLogicalUnitL(const RMessage2& aMessage)
-	{
+    {
     if (!iUsbHostMsDevice)
         {
         User::Leave(KErrNotReady);
         }
 
-	TUint32 iLunId = aMessage.Int0() + 1; // Subssessions need a positive value to store in the handles. We represent Luns as LunId+1
-	TPtrC8 pLun((TUint8*)&iLunId, sizeof(TUint32));
-	aMessage.WriteL(3, pLun);
-	iLunId -= 1;	// We represent LunId in MSC from 0 to MaxLun-1 as represented in BOT
-    __HOSTPRINT1(_L("RegisterLogicalUnitL LUN=%d "), iLunId);
-	iUsbHostMsDevice->AddLunL(iLunId);
-	iUsbHostMsDevice->InitLunL(iLunId);
-	}
+    TUint32 iLunId = aMessage.Int0() + 1; // Subssessions need a positive value to store in the handles. We represent Luns as LunId+1
+    TPtrC8 pLun((TUint8*)&iLunId, sizeof(TUint32));
+    aMessage.WriteL(3, pLun);
+    iLunId -= 1;    // We represent LunId in MSC from 0 to MaxLun-1 as represented in BOT
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSDEVICETHREAD_31,
+              "RegisterLogicalUnitL LUN=%d ", iLunId);
+    iUsbHostMsDevice->AddLunL(iLunId);
+    iUsbHostMsDevice->InitLunL(iLunId);
+    }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmslogicalunit.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbhostmslogicalunit.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -31,69 +31,65 @@
 
 #include "cusbhostmslogicalunit.h"
 #include "usbmshostpanic.h"
-#include "msdebug.h"
-#include "debug.h"
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbhostmslogicalunitTraces.h"
+#endif
 
 CUsbHostMsLogicalUnit* CUsbHostMsLogicalUnit::NewL(TLun aLun)
     {
-    __MSFNSLOG
-	CUsbHostMsLogicalUnit* r = new (ELeave) CUsbHostMsLogicalUnit(aLun);
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
-	}
+    CUsbHostMsLogicalUnit* r = new (ELeave) CUsbHostMsLogicalUnit(aLun);
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
+    }
 
 
 void CUsbHostMsLogicalUnit::ConstructL()
     {
-    __MSFNLOG
     const TInt KInitialDataBufSize = 0x200;
-	iDataBuf.CreateL(KInitialDataBufSize);
+    iDataBuf.CreateL(KInitialDataBufSize);
     }
 
 
 CUsbHostMsLogicalUnit::CUsbHostMsLogicalUnit(TLun aLun)
 :   iProtocol(NULL),
     iLun(aLun),
-	iSuspendRequest(EFalse)
+    iSuspendRequest(EFalse)
     {
-    __MSFNLOG
-	}
+    }
 
 CUsbHostMsLogicalUnit::~CUsbHostMsLogicalUnit()
     {
-    __MSFNLOG
     iDataBuf.Close();
-	delete iProtocol;
-	}
+    delete iProtocol;
+    }
 
 
 void CUsbHostMsLogicalUnit::InitL()
     {
-    __MSFNLOG
-	iProtocol->InitialiseUnitL();
+    iProtocol->InitialiseUnitL();
     }
 
 void CUsbHostMsLogicalUnit::UnInitL()
     {
-    __MSFNLOG
-	iProtocol->UninitialiseUnitL();
+    iProtocol->UninitialiseUnitL();
     }
 
 void CUsbHostMsLogicalUnit::ReadL(const RMessage2& aMessage)
     {
-    __MSFNLOG
-	TReadWrite p;
-	TPtr8 pReadWrite((TUint8*)&p,sizeof(TReadWrite));
-	aMessage.ReadL(0, pReadWrite);
-    __HOSTPRINT2(_L("pos = 0x%lx len = %08x"), p.iPos, p.iLen);
+    TReadWrite p;
+    TPtr8 pReadWrite((TUint8*)&p,sizeof(TReadWrite));
+    aMessage.ReadL(0, pReadWrite);
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSLOGICALUNIT_10,
+                 "pos = 0x%x %x len = %08x", I64HIGH(p.iPos), I64LOW(p.iPos), p.iLen);
 
     User::LeaveIfError(CheckPosition(p));
 
-	// check if buffer can hold requested data and resize if not
-	if (iDataBuf.MaxLength() < p.iLen)
+    // check if buffer can hold requested data and resize if not
+    if (iDataBuf.MaxLength() < p.iLen)
         iDataBuf.ReAllocL(p.iLen);
 
     iProtocol->ReadL(p.iPos, iDataBuf, p.iLen);
@@ -103,11 +99,11 @@
 
 void CUsbHostMsLogicalUnit::WriteL(const RMessage2& aMessage)
     {
-    __MSFNLOG
-	TReadWrite p;
-	TPtr8 pReadWrite((TUint8*)&p,sizeof(TReadWrite));
-	aMessage.ReadL(1, pReadWrite);
-    __HOSTPRINT2(_L("pos = 0x%lx len = %08x"), p.iPos, p.iLen);
+    TReadWrite p;
+    TPtr8 pReadWrite((TUint8*)&p,sizeof(TReadWrite));
+    aMessage.ReadL(1, pReadWrite);
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSLOGICALUNIT_11,
+                 "pos = 0x%x %x len = %08x", I64HIGH(p.iPos), I64LOW(p.iPos), p.iLen);
 
     User::LeaveIfError(CheckPosition(p));
 
@@ -115,18 +111,18 @@
     if (iDataBuf.MaxLength() < p.iLen)
         iDataBuf.ReAllocL(p.iLen);
 
-	aMessage.ReadL(0, iDataBuf);
-	iProtocol->WriteL(p.iPos, iDataBuf, p.iLen);
+    aMessage.ReadL(0, iDataBuf);
+    iProtocol->WriteL(p.iPos, iDataBuf, p.iLen);
     }
 
 
 void CUsbHostMsLogicalUnit::EraseL(const RMessage2& aMessage)
     {
-    __MSFNLOG
-	TReadWrite p;
-	TPtr8 pReadWrite((TUint8*)&p,sizeof(TReadWrite));
-	aMessage.ReadL(0, pReadWrite);
-    __HOSTPRINT2(_L("pos = 0x%lx len = %08x"), p.iPos, p.iLen);
+    TReadWrite p;
+    TPtr8 pReadWrite((TUint8*)&p,sizeof(TReadWrite));
+    aMessage.ReadL(0, pReadWrite);
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSLOGICALUNIT_12,
+                 "pos = 0x%x %x len = %08x", I64HIGH(p.iPos), I64LOW(p.iPos), p.iLen);
 
     User::LeaveIfError(CheckPosition(p));
 
@@ -135,99 +131,88 @@
         iDataBuf.ReAllocL(p.iLen);
 
     iDataBuf.FillZ(p.iLen);
-	iProtocol->WriteL(p.iPos, iDataBuf, p.iLen);
+    iProtocol->WriteL(p.iPos, iDataBuf, p.iLen);
     }
 
 
 void CUsbHostMsLogicalUnit::CapsL(const RMessage2& aMessage)
     {
-    __MSFNLOG
-
     TCapsInfo capsInfo;
     TPckg<TCapsInfo> pckg(capsInfo);
-	iProtocol->GetCapacityL(capsInfo);
+    iProtocol->GetCapacityL(capsInfo);
     iSize = static_cast<TInt64>(capsInfo.iNumberOfBlocks) * capsInfo.iBlockLength;
-	aMessage.WriteL(0, pckg);
+    aMessage.WriteL(0, pckg);
     }
 
 void CUsbHostMsLogicalUnit::NotifyChange(const RMessage2& aMessage)
     {
-    __MSFNLOG
-	iProtocol->NotifyChange(aMessage);
+    iProtocol->NotifyChange(aMessage);
     }
 
 
 void CUsbHostMsLogicalUnit::ForceCompleteNotifyChangeL()
     {
-    __MSFNLOG
-	iProtocol->ForceCompleteNotifyChangeL();
+    iProtocol->ForceCompleteNotifyChangeL();
     }
 
 void CUsbHostMsLogicalUnit::CancelChangeNotifierL()
     {
-    __MSFNLOG
-	iProtocol->CancelChangeNotifierL();
+    iProtocol->CancelChangeNotifierL();
     }
 
 TBool CUsbHostMsLogicalUnit::IsConnected()
-	{
-	return iProtocol->IsConnected() ? ETrue : EFalse;
-	}
+    {
+    return iProtocol->IsConnected() ? ETrue : EFalse;
+    }
 
 TBool CUsbHostMsLogicalUnit::IsReadyToSuspend()
     {
-    __MSFNLOG
-	return iSuspendRequest ? ETrue : EFalse;
-	}
+    return iSuspendRequest ? ETrue : EFalse;
+    }
 
 void CUsbHostMsLogicalUnit::ReadyToSuspend()
     {
-    __MSFNLOG
-	iSuspendRequest = ETrue;
+    iSuspendRequest = ETrue;
     }
 
 void CUsbHostMsLogicalUnit::CancelReadyToSuspend()
     {
-    __MSFNLOG
-	iSuspendRequest = EFalse;
+    iSuspendRequest = EFalse;
     }
 
 void CUsbHostMsLogicalUnit::SuspendL()
     {
-    __MSFNLOG
-	iProtocol->SuspendL();
+    iProtocol->SuspendL();
     }
 
 void CUsbHostMsLogicalUnit::ResumeL()
-	{
-    __MSFNLOG
-	// We do not cancel iSuspendRequest here
-	iProtocol->ResumeL();
-	}
+    {
+    // We do not cancel iSuspendRequest here
+    iProtocol->ResumeL();
+    }
 
 void CUsbHostMsLogicalUnit::DoLunReadyCheckL()
     {
-    __MSFNLOG
-	iProtocol->DoScsiReadyCheckEventL();
+    iProtocol->DoScsiReadyCheckEventL();
     }
 
 TInt CUsbHostMsLogicalUnit::InitialiseProtocolL(TLun aLun,
                                                 THostMassStorageConfig& aConfig,
                                                 MTransport& aTransport)
     {
-    __MSFNLOG
     __ASSERT_DEBUG(iProtocol == NULL, User::Panic(KUsbMsHostPanicCat, EProtocolNotFree));
-	switch(aConfig.iProtocolId)
+    switch(aConfig.iProtocolId)
         {
-	case ScsiProtocol:
-		iProtocol = CScsiProtocol::NewL(aLun, aTransport);
-		break;
-	default:
-		__HOSTPRINT(_L("Unsupported Transport class requested"));
-		iProtocol = NULL;
-		return KErrNotSupported;
+    case ScsiProtocol:
+        iProtocol = CScsiProtocol::NewL(aLun, aTransport);
+        break;
+    default:
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSLOGICALUNIT_13,
+                  "Unsupported Transport class requested");
+        iProtocol = NULL;
+        return KErrNotSupported;
         }
-	return KErrNone;
+    return KErrNone;
     }
 
 TInt CUsbHostMsLogicalUnit::CheckPosition(const TReadWrite& aReadWrite)
@@ -240,9 +225,9 @@
             return KErrArgument;
         }
 
-	// detect drive not present
-	if (iSize == 0)
-		return KErrNotReady;
+    // detect drive not present
+    if (iSize == 0)
+        return KErrNotReady;
 
     if (aReadWrite.iPos >= iSize)
         return KErrArgument;
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbmssuspendresume.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/cusbmssuspendresume.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -34,76 +34,81 @@
 #include "cbulkonlytransport.h"
 #include "cusbmssuspendresume.h"
 
-#include "msdebug.h"
-#include "debug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbmssuspendresumeTraces.h"
+#endif
 
 
 void CUsbMsIfaceSuspendResume::RunL()
     {
-    __MSFNLOG
-	iDevice->ResumeCompletedL();
-	if(iCancelSuspend)
-		{
-		User::RequestComplete(iDeviceStatus, iStatus.Int());
-		iDeviceStatus = NULL;
-		}
-	else
-		{
-		iDevice->DoHandleRemoteWakeupL();
-		}
+    iDevice->ResumeCompletedL();
+    if(iCancelSuspend)
+        {
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_SUSPEND, CUSBMSSUSPENDRESUME_10,
+                  "SUSPEND/RESUME completed.");
+        User::RequestComplete(iDeviceStatus, iStatus.Int());
+        iDeviceStatus = NULL;
+        }
+    else
+        {
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_SUSPEND, CUSBMSSUSPENDRESUME_11,
+                  "REMOTE WAKEUP");
+        iDevice->DoHandleRemoteWakeupL();
+        }
     }
 
 /**
 Cancellation of outstanding request
 */
 void CUsbMsIfaceSuspendResume::DoCancel()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 TInt CUsbMsIfaceSuspendResume::RunError(TInt aError)
-	{
-    __MSFNLOG
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_SUSPEND, CUSBMSSUSPENDRESUME_12,
+                  "Error = %d", aError);
     return KErrNone;
-	}
+    }
 
 
 void CUsbMsIfaceSuspendResume::Resume(TRequestStatus& aStatus)
-	{
-    __MSFNLOG
-	iCancelSuspend = ETrue;
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SUSPEND, CUSBMSSUSPENDRESUME_13,
+                  "RESUME");
+    iCancelSuspend = ETrue;
     aStatus = KRequestPending;
-	iDeviceStatus = &aStatus;
-	iTransport->Resume();
-	}
+    iDeviceStatus = &aStatus;
+    iTransport->Resume();
+    }
 
 void CUsbMsIfaceSuspendResume::Suspend()
-	{
-    __MSFNLOG
-	if(!IsActive())
-		SetActive();
-	iCancelSuspend = EFalse;
-	iTransport->Suspend(iStatus);
-	}
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SUSPEND, CUSBMSSUSPENDRESUME_14,
+                  "SUSPEND");
+    if(!IsActive())
+        SetActive();
+    iCancelSuspend = EFalse;
+    iTransport->Suspend(iStatus);
+    }
 
 CUsbMsIfaceSuspendResume* CUsbMsIfaceSuspendResume::NewL(MTransport *aTransport, CUsbHostMsDevice *aDevice)
-	{
-	return new (ELeave) CUsbMsIfaceSuspendResume(aTransport, aDevice);
-	}
+    {
+    return new (ELeave) CUsbMsIfaceSuspendResume(aTransport, aDevice);
+    }
 
 CUsbMsIfaceSuspendResume::CUsbMsIfaceSuspendResume(MTransport* aTransport, CUsbHostMsDevice* aDevice)
-:	CActive(EPriorityHigh),
+:   CActive(EPriorityHigh),
     iTransport(aTransport),
     iDevice(aDevice),
     iCancelSuspend(EFalse)
-	{
-    __MSFNLOG
-	CActiveScheduler::Add(this);
-	}
+    {
+    CActiveScheduler::Add(this);
+    }
 
 CUsbMsIfaceSuspendResume::~CUsbMsIfaceSuspendResume()
-	{
-    __MSFNLOG
-	Cancel();
-	}
+    {
+    Cancel();
+    }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/tlogicalunitlist.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/tlogicalunitlist.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -25,19 +25,20 @@
 #include "cusbhostmslogicalunit.h"
 #include "tlogicalunitlist.h"
 
-#include "msdebug.h"
-#include "debug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tlogicalunitlistTraces.h"
+#endif
 
 TLogicalUnitList::~TLogicalUnitList()
     {
-    __MSFNLOG
     iLu.ResetAndDestroy();
     }
 
 void TLogicalUnitList::AddLuL(CUsbHostMsLogicalUnit* aLu)
     {
-    __MSFNLOG
-    __HOSTPRINT1(_L("Adding LU 0x%x"), aLu);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, TLOGICALUNITLIST_10,
+              "Adding LU 0x%x", aLu);
     TInt r= FindLu(aLu->Lun());
 
     if (r < 0)
@@ -47,18 +48,17 @@
             User::Leave(r);
             }
         }
-    else	// If it is able to find the lun already
+    else    // If it is able to find the lun already
         {
         User::Leave(KErrAlreadyExists);
         }
 
-	User::LeaveIfError(iLu.Append(aLu));
+    User::LeaveIfError(iLu.Append(aLu));
     }
 
 
 void TLogicalUnitList::RemoveLuL(TLun aLun)
     {
-    __MSFNLOG
     TInt index = FindLu(aLun);
     User::LeaveIfError(index);
 
@@ -66,23 +66,22 @@
     TRAPD(err, lu->UnInitL());
     delete lu;
     iLu.Remove(index);
-	if(err != KErrNone)
-		User::Leave(err);
+    if(err != KErrNone)
+        User::Leave(err);
     }
 
 
 void TLogicalUnitList::RemoveAllLuL()
     {
-    __MSFNLOG
-	TInt ret = KErrNone;
+    TInt ret = KErrNone;
     for (TInt index = 0; index < iLu.Count(); index++)
         {
         CUsbHostMsLogicalUnit* lu = iLu[index];
         TRAPD(err, lu->UnInitL());
         delete lu;
         // set return flag for first error condition
-		if (ret == KErrNone && err != KErrNone)
-			ret = err;
+        if (ret == KErrNone && err != KErrNone)
+            ret = err;
         }
 
     iLu.Reset();
@@ -91,18 +90,17 @@
 
 TInt TLogicalUnitList::Count() const
     {
-    __MSFNSLOG
-	return iLu.Count();
-	}
+    return iLu.Count();
+    }
 
 TInt TLogicalUnitList::FindLu(TLun aLun) const
     {
-    __MSFNSLOG
-
     TInt index;
     for (index = 0; index < iLu.Count(); index++)
         {
-        __HOSTPRINT2(_L("search LUN=%d : interface id = %d"), aLun, iLu[index]->Lun());
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_HOST, TLOGICALUNITLIST_11,
+                     "search LUN=%d : interface id = %d",
+                     (TInt)aLun, (TInt)iLu[index]->Lun());
         if (iLu[index]->Lun() == aLun)
             {
             break;
@@ -119,7 +117,6 @@
 
 CUsbHostMsLogicalUnit& TLogicalUnitList::GetLuL(TLun aLun) const
     {
-    __MSFNSLOG
     TInt index = FindLu(aLun);
     User::LeaveIfError(index);
     return *iLu[index];
@@ -128,6 +125,5 @@
 
 CUsbHostMsLogicalUnit& TLogicalUnitList::GetLu(TInt aIndex) const
     {
-    __MSFNSLOG
     return *iLu[aIndex];
     }
--- a/userlibandfileserver/fileserver/shostmassstorage/server/hostmsserver.mmp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/hostmsserver.mmp	Tue Nov 02 15:29:23 2010 +0000
@@ -13,58 +13,57 @@
 // Description:
 // f32/group/hostmsserver.mmp
 // Host mass storage client/server mmp file
-// 
+//
 //
 
-TARGET			usbhostmssrv.exe
+TARGET                  usbhostmssrv.exe
 
-TARGETTYPE		exe
+TARGETTYPE              exe
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE	../shared
-USERINCLUDE	./src/include
-USERINCLUDE	./controller/include
-USERINCLUDE	./transport/include
-USERINCLUDE	./protocol/include
-USERINCLUDE	./shared
+USERINCLUDE     ../shared
+USERINCLUDE     ./src/include
+USERINCLUDE     ./controller/include
+USERINCLUDE     ./transport/include
+USERINCLUDE     ./protocol/include
+USERINCLUDE     ./shared
+USERINCLUDE     ./traces
 
-SOURCEPATH	./src
-SOURCE		cusbhostmssession.cpp
-SOURCE		cusbhostmsserver.cpp
-SOURCE		entry.cpp
-
-SOURCEPATH	./controller
-SOURCE		cusbhostmsdevice.cpp
-SOURCE      tlogicalunitlist.cpp
-SOURCE		cusbmssuspendresume.cpp
-SOURCE		cusbhostmsdevicethread.cpp
-SOURCE		cusbhostmslogicalunit.cpp
+SOURCEPATH      ./src
+SOURCE          cusbhostmssession.cpp
+SOURCE          cusbhostmsserver.cpp
+SOURCE          entry.cpp
 
-SOURCEPATH	./transport
-SOURCE		cbulkonlytransport.cpp
-SOURCE		cusbifacehandler.cpp
+SOURCEPATH      ./controller
+SOURCE          cusbhostmsdevice.cpp
+SOURCE      tlogicalunitlist.cpp
+SOURCE          cusbmssuspendresume.cpp
+SOURCE          cusbhostmsdevicethread.cpp
+SOURCE          cusbhostmslogicalunit.cpp
+
+SOURCEPATH      ./transport
+SOURCE          cbulkonlytransport.cpp
+SOURCE          cusbifacehandler.cpp
 
-SOURCEPATH	./protocol
-SOURCE		cmassstoragefsm.cpp
-SOURCE		cscsiprotocol.cpp
-SOURCE		tspcclientinterface.cpp
-SOURCE		tsbcclientinterface.cpp
-SOURCE		tscsiclientreq.cpp
-SOURCE		tscsiprimarycmds.cpp
-SOURCE		tscsiblockcmds.cpp
-SOURCE		tblocktransfer.cpp
+SOURCEPATH      ./protocol
+SOURCE          cmassstoragefsm.cpp
+SOURCE          cscsiprotocol.cpp
+SOURCE          tspcclientinterface.cpp
+SOURCE          tsbcclientinterface.cpp
+SOURCE          tscsiclientreq.cpp
+SOURCE          tscsiprimarycmds.cpp
+SOURCE          tscsiblockcmds.cpp
+SOURCE          tblocktransfer.cpp
 
-SOURCEPATH	./shared
-SOURCE		msdebug.cpp
 
-LIBRARY		efsrv.lib euser.lib hal.lib usbdescriptors.lib usbdi_utils.lib
+LIBRARY         efsrv.lib euser.lib hal.lib usbdescriptors.lib usbdi_utils.lib
 START WINS
-BASEADDRESS		0x61000000 
+BASEADDRESS             0x61000000
 END
 
 CAPABILITY AllFiles CommDD
 
-UID		0 0x10286A83 
+UID             0 0x10286A83
 
 // **** Enable for Host MS testing ****
 //MACRO _TESTREPORT_PRINT_
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cmassstoragefsm.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cmassstoragefsm.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -20,10 +20,12 @@
 
 #include <e32base.h>
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cmassstoragefsmTraces.h"
+#endif
+
 #include "usbmshostpanic.h"
-#include "debug.h"
-#include "msdebug.h"
-
 #include "msctypes.h"
 #include "mprotocol.h"
 #include "mblocktransferprotocol.h"
@@ -32,6 +34,7 @@
 #include "cmassstoragefsm.h"
 
 
+
 /**
 Constructor
 
@@ -40,7 +43,6 @@
 TMassStorage::TMassStorage(CScsiProtocol& aScsiProtocol)
 :   iScsiProtocol(aScsiProtocol)
     {
-	__MSFNLOG
     }
 
 
@@ -49,8 +51,7 @@
 */
 void CMassStorageFsm::ClearStatusCheck()
 {
-	__MSFNLOG
-	iStatusCheck = EFalse;
+    iStatusCheck = EFalse;
 }
 
 
@@ -59,8 +60,7 @@
 */
 void CMassStorageFsm::SetStatusCheck()
 {
-	__MSFNLOG
-	iStatusCheck = ETrue;
+    iStatusCheck = ETrue;
 }
 
 
@@ -71,8 +71,7 @@
 */
 TBool CMassStorageFsm::IsStatusCheck() const
 {
-	__MSFNSLOG
-	return iStatusCheck;
+    return iStatusCheck;
 }
 
 
@@ -83,7 +82,6 @@
 */
 TBool TMassStorage::IsSbcSet() const
     {
-	__MSFNSLOG
     return iScsiProtocol.MsIsSbcSet();
     }
 
@@ -94,7 +92,6 @@
 */
 TBool TMassStorage::IsRemovableMedia() const
     {
-	__MSFNSLOG
     return iScsiProtocol.MsIsRemovableMedia();
     }
 
@@ -105,7 +102,6 @@
 */
 const TSenseInfo& TMassStorage::MsSenseInfo() const
     {
-	__MSFNSLOG
     return iScsiProtocol.MsSenseInfo();
     }
 
@@ -113,7 +109,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::InquiryL()
     {
-	__MSFNLOG
     TEvent event = EEvCommandFailed;
 
     switch (iScsiProtocol.MsInquiryL())
@@ -125,11 +120,13 @@
         event = EEvCommandFailed;
         break;
     case KErrNotSupported:
-        __SCSIPRINT(_L("INQUIRY Command returned NOT SUPPORTED"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, CMASSSTORAGEFSM_10,
+                  "INQUIRY Command returned NOT SUPPORTED");
         User::Leave(KErrNotSupported);
         break;
     default:
-        __SCSIPRINT(_L("INQUIRY Command returned KErrUnknown"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, CMASSSTORAGEFSM_11,
+                  "INQUIRY Command returned KErrUnknown");
         User::Leave(KErrUnknown);
         break;
         }
@@ -140,18 +137,19 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::SenseL()
     {
-	__MSFNLOG
     TEvent event = EEvCommandPassed;
     switch (iScsiProtocol.MsRequestSenseL())
         {
     case KErrNone:
         break;
     case KErrCommandFailed:
-        __SCSIPRINT(_L("REQUEST SENSE Command Failed"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, CMASSSTORAGEFSM_12,
+                  "REQUEST SENSE Command Failed");
         User::Leave(KErrNotSupported);
         break;
     default:
-        __SCSIPRINT(_L("INQUIRY Command returned KErrUnknown"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, CMASSSTORAGEFSM_13,
+                  "INQUIRY Command returned KErrUnknown");
         User::Leave(KErrUnknown);
         break;
         }
@@ -162,7 +160,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::TestUnitReadyL()
     {
-	__MSFNLOG
     // KErrCommandFailed indictates that device is NOT READY
     TInt err = iScsiProtocol.MsTestUnitReadyL();
     return (err == KErrNone) ? EEvCommandPassed : EEvCommandFailed;
@@ -172,7 +169,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::StartStopUnitL(TBool aStart)
     {
-	__MSFNLOG
     TInt err = iScsiProtocol.MsStartStopUnitL(aStart);
     return (err == KErrNone) ? EEvCommandPassed : EEvCommandFailed;
     }
@@ -181,7 +177,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::PreventAllowMediumRemovalL(TBool aPrevent)
     {
-	__MSFNLOG
     // KErrCommandFailed indictates that device is NOT READY
     TInt err = iScsiProtocol.MsPreventAllowMediaRemovalL(aPrevent);
     return (err == KErrNone) ? EEvCommandPassed : EEvCommandFailed;
@@ -191,7 +186,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::ReadCapacityL()
     {
-	__MSFNLOG
     TInt err = iScsiProtocol.MsReadCapacityL();
     return ErrToEvent(err);
     }
@@ -200,7 +194,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::ModeSense10L()
     {
-	__MSFNLOG
     TInt err = iScsiProtocol.MsModeSense10L();
     return ErrToEvent(err);
     }
@@ -209,7 +202,6 @@
 /** SCSI Request */
 TMassStorage::TEvent TMassStorage::ModeSense6L()
     {
-	__MSFNLOG
     TInt err = iScsiProtocol.MsModeSense6L();
     return ErrToEvent(err);
     }
@@ -225,18 +217,16 @@
 */
 CMassStorageFsm* CMassStorageFsm::NewL(CScsiProtocol& aScsiProtocol)
 {
-	__MSFNSLOG
-	CMassStorageFsm* r = new (ELeave) CMassStorageFsm(aScsiProtocol);
+    CMassStorageFsm* r = new (ELeave) CMassStorageFsm(aScsiProtocol);
 
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
 }
 
 void CMassStorageFsm::ConstructL()
     {
-	__MSFNLOG
     TInt i = 0;
     // EInquiryState,
     iStateTable[i++] = new (ELeave) TInquiryState;
@@ -291,13 +281,10 @@
 :   TMassStorage(aScsiProtocol),
     iStartStopUnitRequired(EFalse)
     {
-	__MSFNLOG
     }
 
 CMassStorageFsm::~CMassStorageFsm()
     {
-	__MSFNLOG
-
     for (TInt i = 0; i < iStateTable.Count(); i++)
         {
         delete iStateTable[i];
@@ -307,8 +294,6 @@
 
 TMassStorage::TEvent CMassStorageFsm::EntryL()
     {
-	__MSFNLOG
-
     return iState->EntryL(*this);
     }
 
@@ -320,8 +305,8 @@
 */
 TInt CMassStorageFsm::ConnectLogicalUnitL()
     {
-	__MSFNLOG
-    __HOSTPRINT(_L("CMassStorageFsm::ConnectLogicalUnitL()"));        
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CMASSSTORAGEFSM_14,
+              "Connect Logical Unit");
     TInt err = KErrNone;
     for (;;)
          {
@@ -340,8 +325,8 @@
 */
 TInt CMassStorageFsm::DisconnectLogicalUnitL()
     {
-	__MSFNLOG
-    __HOSTPRINT(_L("CMassStorageFsm::DisconnectLogicalUnitL()"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CMASSSTORAGEFSM_15,
+              "Disconnect Logical Unit");
     TInt err = KErrNone;
     for (;;)
          {
@@ -360,24 +345,24 @@
 */
 TBool CMassStorageFsm::IsConnected() const
     {
-	__MSFNSLOG
     return iState->iStateId == TMassStorageState::EConnectedState ? ETrue : EFalse;
     }
 
 
 TInt CMassStorageFsm::ProcessStateL()
     {
-	__MSFNLOG
     TMassStorage::TEvent event = TMassStorage::EEvCommandFailed;
     TRAPD(err,  event = EntryL());
     if (err == KErrNotSupported)
         {
-        __HOSTPRINT(_L("FSM ProcessState returning with KErrNotSupported"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CMASSSTORAGEFSM_16,
+                  "FSM ProcessState returning with KErrNotSupported");
         return KErrNotSupported;
         }
     User::LeaveIfError(err);
 
-    __HOSTPRINT1(_L("FSM event=%d"), event);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CMASSSTORAGEFSM_17,
+              "FSM event=%d", event);
     switch (event)
         {
     case TMassStorage::EEvCommandPassed:
@@ -394,28 +379,26 @@
         break;
         }
 
-    __HOSTPRINT1(_L("FSM ProcessState completed=%d"), err);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CMASSSTORAGEFSM_18,
+              "FSM ProcessState completed=%d", err);
     return err;
     }
 
 
 TInt CMassStorageFsm::ScsiCommandPassed()
     {
-	__MSFNLOG
     return iState->ScsiCommandPassed(*this);
     }
 
 
 TInt CMassStorageFsm::ScsiCommandFailed()
     {
-	__MSFNLOG
     return iState->ScsiCommandFailed(*this);
     }
 
 
 TInt CMassStorageFsm::ScsiCommandError()
     {
-	__MSFNLOG
     return iState->ScsiCommandError(*this);
     }
 
@@ -428,16 +411,15 @@
 TMassStorageState::TMassStorageState(TStateId aStateId)
 :   iStateId(aStateId)
     {
-	__MSFNLOG
     }
 
 
-/** 
-   Default state does nothing. Used by states where the stalled event is not 
-   applicable 
-   
+/**
+   Default state does nothing. Used by states where the stalled event is not
+   applicable
+
    @param aFsm
-   
+
    @return TInt
  */
 TInt TMassStorageState::ScsiCommandError(CMassStorageFsm& /* aFsm */)
@@ -448,7 +430,6 @@
 
 TInt TMassStorageState::SenseError(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrNone;
     const TSenseInfo& senseInfo = aFsm.MsSenseInfo();
 
@@ -471,20 +452,17 @@
 TInquiryState::TInquiryState()
 :   TMassStorageState(EInquiryState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TInquiryState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.InquiryL();
     };
 
 
 TInt TInquiryState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(ENotReadyState);
     return KErrNone;
     };
@@ -492,7 +470,6 @@
 
 TInt TInquiryState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EInquirySenseState);
     return KErrNone;
     }
@@ -504,20 +481,17 @@
 TInquirySenseState::TInquirySenseState()
 :   TMassStorageState(EInquirySenseState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TInquirySenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     };
 
 
 TInt TInquirySenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     // SENSE ERROR
     aFsm.SetState(TMassStorageState::EInquiryState);
     return KErrCompletion;
@@ -526,7 +500,6 @@
 
 TInt TInquirySenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EInquiryState);
     return KErrCompletion;
     }
@@ -538,20 +511,17 @@
 TNotReadyState::TNotReadyState()
 :   TMassStorageState(ENotReadyState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TNotReadyState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.TestUnitReadyL();
     }
 
 
 TInt TNotReadyState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     if (aFsm.IsSbcSet())
         {
         if (aFsm.IsRemovableMedia())
@@ -561,17 +531,17 @@
         }
     else
         {
-        __HOSTPRINT(_L("SBC is not set !!"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CMASSSTORAGEFSM_19,
+                  "SBC is not set !!");
         aFsm.SetState(TMassStorageState::EReadCapacityState);
         }
-        
+
     return KErrNone;
     }
 
 
 TInt TNotReadyState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::ENotReadySenseState);
     return KErrNone;
     }
@@ -583,20 +553,17 @@
 TNotReadySenseState::TNotReadySenseState()
 :   TMassStorageState(ENotReadySenseState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TNotReadySenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     }
 
 
 TInt TNotReadySenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     const TSenseInfo& senseInfo = aFsm.MsSenseInfo();
     TInt ret = KErrNone;
 
@@ -618,7 +585,6 @@
 
 TInt TNotReadySenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return TMassStorageState::SenseError(aFsm);
     }
 
@@ -629,20 +595,17 @@
 TStartUnitState::TStartUnitState()
 :   TMassStorageState(EPreventRemovalState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TStartUnitState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.StartStopUnitL(ETrue);
     }
 
 
 TInt TStartUnitState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     if (aFsm.IsRemovableMedia())
         aFsm.SetState(TMassStorageState::EPreventRemovalState);
     else
@@ -653,7 +616,6 @@
 
 TInt TStartUnitState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EPreventRemovalSenseState);
     return KErrNone;
     }
@@ -664,20 +626,17 @@
 TStartUnitSenseState::TStartUnitSenseState()
 :   TMassStorageState(EPreventRemovalSenseState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TStartUnitSenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     }
 
 
 TInt TStartUnitSenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     if (aFsm.IsRemovableMedia())
         aFsm.SetState(TMassStorageState::EPreventRemovalState);
     else
@@ -689,7 +648,6 @@
 
 TInt TStartUnitSenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrCompletion;
     const TSenseInfo& senseInfo = aFsm.MsSenseInfo();
 
@@ -714,20 +672,17 @@
 TPreventMediumRemovalState::TPreventMediumRemovalState()
 :   TMassStorageState(EPreventRemovalState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TPreventMediumRemovalState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.PreventAllowMediumRemovalL(ETrue);
     }
 
 
 TInt TPreventMediumRemovalState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EReadCapacityState);
     return KErrNone;
     }
@@ -735,7 +690,6 @@
 
 TInt TPreventMediumRemovalState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EPreventRemovalSenseState);
     return KErrNone;
     }
@@ -746,20 +700,17 @@
 TPreventMediumRemovalSenseState::TPreventMediumRemovalSenseState()
 :   TMassStorageState(EPreventRemovalSenseState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TPreventMediumRemovalSenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     }
 
 
 TInt TPreventMediumRemovalSenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EReadCapacityState);
     return KErrNone;
     }
@@ -769,7 +720,6 @@
 
 TInt TPreventMediumRemovalSenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrCompletion;
     const TSenseInfo& senseInfo = aFsm.MsSenseInfo();
 
@@ -792,20 +742,17 @@
 TReadCapacity10State::TReadCapacity10State()
 :   TMassStorageState(EReadCapacityState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TReadCapacity10State::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.ReadCapacityL();
     };
 
 
 TInt TReadCapacity10State::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EModeSense10State);
     return KErrNone;
     };
@@ -813,7 +760,6 @@
 
 TInt TReadCapacity10State::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::ESenseState);
     return KErrCompletion;
     }
@@ -821,7 +767,6 @@
 
 TInt TReadCapacity10State::ScsiCommandError(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::ENotReadyState);
     return KErrCompletion;
     }
@@ -833,20 +778,17 @@
 TModeSense10State::TModeSense10State()
 :   TMassStorageState(EModeSense10State)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TModeSense10State::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.ModeSense10L();
     };
 
 
 TInt TModeSense10State::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EConnectedState);
     return KErrCompletion;
     };
@@ -854,7 +796,6 @@
 
 TInt TModeSense10State::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EModeSense10SenseState);
     return KErrNone;
     }
@@ -862,7 +803,6 @@
 
 TInt TModeSense10State::ScsiCommandError(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EModeSense6State);
     return KErrNone;
     }
@@ -873,20 +813,17 @@
 TModeSense10SenseState::TModeSense10SenseState()
 :   TMassStorageState(EModeSense10SenseState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TModeSense10SenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     };
 
 
 TInt TModeSense10SenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrCompletion;
     const TSenseInfo& senseInfo = aFsm.MsSenseInfo();
 
@@ -906,7 +843,6 @@
 
 TInt TModeSense10SenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EInquirySenseState);
     return KErrCompletion;
     }
@@ -917,20 +853,17 @@
 TModeSense6State::TModeSense6State()
 :   TMassStorageState(EModeSense6State)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TModeSense6State::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.ModeSense6L();
     };
 
 
 TInt TModeSense6State::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EConnectedState);
     return KErrCompletion;
     };
@@ -938,7 +871,6 @@
 
 TInt TModeSense6State::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EModeSense6SenseState);
     return KErrNone;
     }
@@ -946,7 +878,6 @@
 
 TInt TModeSense6State::ScsiCommandError(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     // If device responds with protocol error, ignore the error and assume the
     // device is not write protected
     aFsm.SetState(EConnectedState);
@@ -960,20 +891,17 @@
 TModeSense6SenseState::TModeSense6SenseState()
 :   TMassStorageState(EModeSense6SenseState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TModeSense6SenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     };
 
 
 TInt TModeSense6SenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrCompletion;
     const TSenseInfo& senseInfo = aFsm.MsSenseInfo();
 
@@ -992,7 +920,6 @@
 
 TInt TModeSense6SenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EInquirySenseState);
     return KErrCompletion;
     }
@@ -1005,29 +932,26 @@
 TConnectedState::TConnectedState()
 :   TMassStorageState(EConnectedState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TConnectedState::EntryL(CMassStorageFsm& /* aFsm */)
     {
-	__MSFNLOG
     return TMassStorage::EEvCommandPassed;
     };
 
 
 TInt TConnectedState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrNone;
 
     if (aFsm.IsRemovableMedia())
         {
-		if(aFsm.IsStatusCheck())
-			{
-			aFsm.SetState(TMassStorageState::EStatusCheckState);
-			}
-		else
+        if(aFsm.IsStatusCheck())
+            {
+            aFsm.SetState(TMassStorageState::EStatusCheckState);
+            }
+        else
             {
             aFsm.SetState(TMassStorageState::EAllowRemovalState);
             }
@@ -1038,8 +962,8 @@
         }
     else
         {
-		aFsm.SetState(TMassStorageState::ENotReadyState);
-		ret = KErrCompletion;
+        aFsm.SetState(TMassStorageState::ENotReadyState);
+        ret = KErrCompletion;
         }
     return ret;
     };
@@ -1047,7 +971,6 @@
 
 TInt TConnectedState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EInquiryState);
     return KErrCompletion;
     }
@@ -1059,20 +982,17 @@
 TStatusCheckState::TStatusCheckState()
 :   TMassStorageState(EStatusCheckState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TStatusCheckState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.TestUnitReadyL();
     };
 
 
 TInt TStatusCheckState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(EConnectedState);
     return KErrCompletion;
     };
@@ -1080,8 +1000,7 @@
 
 TInt TStatusCheckState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
-	aFsm.SetState(ESenseState);
+    aFsm.SetState(ESenseState);
     return KErrNone;
     }
 
@@ -1092,20 +1011,17 @@
 TAllowMediumRemovalState::TAllowMediumRemovalState()
 :   TMassStorageState(EAllowRemovalState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TAllowMediumRemovalState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.PreventAllowMediumRemovalL(EFalse);
     }
 
 
 TInt TAllowMediumRemovalState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     TInt ret = KErrNone;
     if (aFsm.StartStopUnitRequired())
         {
@@ -1122,7 +1038,6 @@
 
 TInt TAllowMediumRemovalState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EInquiryState);
     return KErrCompletion;
     }
@@ -1134,20 +1049,17 @@
 TStopUnitState::TStopUnitState()
 :   TMassStorageState(EStopUnitState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TStopUnitState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.StartStopUnitL(EFalse);
     }
 
 
 TInt TStopUnitState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(ENotReadyState);
     return KErrCompletion;
     };
@@ -1155,7 +1067,6 @@
 
 TInt TStopUnitState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(TMassStorageState::EInquiryState);
     return KErrCompletion;
     }
@@ -1167,20 +1078,17 @@
 TSenseState::TSenseState()
 :   TMassStorageState(EConnectedState)
     {
-	__MSFNLOG
     }
 
 
 TMassStorage::TEvent TSenseState::EntryL(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     return aFsm.SenseL();
     };
 
 
 TInt TSenseState::ScsiCommandPassed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     aFsm.SetState(ENotReadyState);
     return KErrCompletion;
     };
@@ -1188,7 +1096,6 @@
 
 TInt TSenseState::ScsiCommandFailed(CMassStorageFsm& aFsm)
     {
-	__MSFNLOG
     // This event should not happen
     aFsm.SetState(EInquiryState);
     return KErrCompletion;
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -20,8 +20,11 @@
 
 #include <e32base.h>
 
-#include "debug.h"
-#include "msdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cscsiprotocolTraces.h"
+#endif
+
 #include "msctypes.h"
 #include "shared.h"
 #include "msgservice.h"
@@ -53,19 +56,17 @@
 */
 CScsiProtocol* CScsiProtocol::NewL(TLun aLun, MTransport& aTransport)
     {
-	__MSFNSLOG
-	CScsiProtocol* r = new (ELeave) CScsiProtocol(aTransport);
+    CScsiProtocol* r = new (ELeave) CScsiProtocol(aTransport);
 
-	CleanupStack::PushL(r);
-	r->ConstructL(aLun);
-	CleanupStack::Pop();
-	return r;
+    CleanupStack::PushL(r);
+    r->ConstructL(aLun);
+    CleanupStack::Pop();
+    return r;
     }
 
 void CScsiProtocol::ConstructL(TLun aLun)
     {
-	__MSFNLOG
-	// iState = EEntry;
+    // iState = EEntry;
     iFsm = CMassStorageFsm::NewL(*this);
 
     const TInt blockLength = 0x200;
@@ -79,13 +80,11 @@
 :   iSpcInterface(aTransport),
     iSbcInterface(NULL)
     {
-	__MSFNLOG
     }
 
 
 CScsiProtocol::~CScsiProtocol()
     {
-	__MSFNLOG
     delete iFsm;
     iHeadbuf.Close();
     iTailbuf.Close();
@@ -95,11 +94,10 @@
 
 void CScsiProtocol::InitialiseUnitL()
     {
-	__MSFNLOG
     iState = EDisconnected;
 
-	// A device may take time to mount the media. If the device fails attempt to
-	// retry the connection for a number of seconds
+    // A device may take time to mount the media. If the device fails attempt to
+    // retry the connection for a number of seconds
     TInt retryCounter = 20;
     do
         {
@@ -117,43 +115,39 @@
         User::After(1000 * 200);    // 200 mS
         }
     while (retryCounter);
-	}
+    }
 
 
 void CScsiProtocol::UninitialiseUnitL()
     {
-	__MSFNLOG
     iFsm->DisconnectLogicalUnitL();
     }
 
 TBool CScsiProtocol::IsConnected()
     {
-	__MSFNLOG
-	return (iState == EConnected)? ETrue : EFalse;
+    return (iState == EConnected)? ETrue : EFalse;
     }
 
 void CScsiProtocol::ReadL(TPos aPos,
                           TDes8& aBuf,
                           TInt aLength)
     {
-	__MSFNLOG
 
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
     if(!IsConnected())
-		User::Leave(KErrNotReady);
+        User::Leave(KErrNotReady);
     iSbcInterface->iBlockTransfer.ReadL(*this, aPos, aLength, aBuf);
     }
 
 
 void CScsiProtocol::BlockReadL(TPos aPos, TDes8& aCopybuf, TInt aLen)
     {
-	__MSFNLOG
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
-	__ASSERT_DEBUG(aPos % iSbcInterface->iBlockTransfer.BlockLength() == 0,
+    __ASSERT_DEBUG(aPos % iSbcInterface->iBlockTransfer.BlockLength() == 0,
                    User::Panic(KUsbMsHostPanicCat, EBlockDevice));
 
     const TInt blockLen = iSbcInterface->iBlockTransfer.BlockLength();
@@ -166,18 +160,21 @@
         User::LeaveIfError(KErrOverflow);
         }
 
-	TInt err = iSbcInterface->Read10L(I64LOW(lba), aCopybuf, len);
+    TInt err = iSbcInterface->Read10L(I64LOW(lba), aCopybuf, len);
     if (err)
         {
-        __SCSIPRINT1(_L("READ(10) Err=%d"), err);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_10,
+                  "READ(10) Err=%d", err);
         User::LeaveIfError(DoCheckConditionL());
         }
 
     // handle residue
     while (len != aLen)
         {
-        __SCSIPRINT2(_L("SCSI Read Residue 0x%x bytes read (0x%x)"), len, aLen);
-        __SCSIPRINT2(_L("Pos=0x%lx Len=0x%x"), aPos, aLen);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_11,
+                  "SCSI Read Residue 0x%x bytes read (0x%x)", len, aLen);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_12,
+                  "Pos=0x%lx Len=0x%x", aPos, aLen);
 
         // read next block
 
@@ -187,8 +184,8 @@
         aLen -= bytesRead;
         len = aLen;
 
-        __SCSIPRINT3(_L("New Pos=0x%lx Len=0x%x (bytes read = %x)"),
-                     aPos, aLen, bytesRead);
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_13,
+                     "New Pos=0x%lx Len=0x%x (bytes read = %x)", aPos, aLen, bytesRead);
 
         aCopybuf.SetLength(bytesRead);
 
@@ -206,27 +203,25 @@
                            TDesC8& aBuf,
                            TInt aLength)
     {
-	__MSFNLOG
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
     if(!IsConnected())
-		User::Leave(KErrNotReady);
+        User::Leave(KErrNotReady);
     iSbcInterface->iBlockTransfer.WriteL(*this, aPosition, aLength, aBuf);
     }
 
 
 void CScsiProtocol::BlockWriteL(TPos aPos, TDesC8& aCopybuf, TUint aOffset, TInt aLen)
     {
-	__MSFNLOG
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
-	__ASSERT_DEBUG(aPos % iSbcInterface->iBlockTransfer.BlockLength() == 0,
+    __ASSERT_DEBUG(aPos % iSbcInterface->iBlockTransfer.BlockLength() == 0,
                    User::Panic(KUsbMsHostPanicCat, EBlockDevice));
     const TInt blockLen = iSbcInterface->iBlockTransfer.BlockLength();
     TInt len = aLen;
-	TInt err = iSbcInterface->Write10L(aPos/blockLen, aCopybuf, aOffset, len);
+    TInt err = iSbcInterface->Write10L(aPos/blockLen, aCopybuf, aOffset, len);
     if (err)
         {
         User::LeaveIfError(DoCheckConditionL());
@@ -235,8 +230,10 @@
     while (len != aLen)
         {
         // handle residue
-        __SCSIPRINT2(_L("SCSI Write Residue 0x%x bytes read (0x%x)"), len, aLen);
-        __SCSIPRINT2(_L("Pos=0x%lx Len=0x%x"), aPos, aLen);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_20,
+                     "SCSI Write Residue 0x%x bytes read (0x%x)", len, aLen);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_21,
+                     "Pos=0x%lx Len=0x%x", aPos, aLen);
 
         // write next block
 
@@ -245,7 +242,8 @@
         aPos += bytesWritten;
         aLen -= bytesWritten;
         len = aLen;
-        __SCSIPRINT2(_L("New Pos=0x%lx Len=0x%x"), aPos, aLen);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_22,
+                     "New Pos=0x%lx Len=0x%x", aPos, aLen);
 
         TPtrC8 buf = aCopybuf.Mid(bytesWritten);
 
@@ -261,7 +259,6 @@
 
 void CScsiProtocol::GetCapacityL(TCapsInfo& aCapsInfo)
     {
-	__MSFNLOG
     if (!IsConnected())
         {
         if (!DoScsiReadyCheckEventL())
@@ -279,8 +276,8 @@
 
     aCapsInfo.iMediaType = EMediaHardDisk;
 
-	TLba lastLba;
-	TUint32 blockLength;
+    TLba lastLba;
+    TUint32 blockLength;
 
     // Retry ReadCapacity10L if stalled
     TInt stallCounter = 4;
@@ -322,15 +319,16 @@
                 {
                 User::LeaveIfError(err);
                 }
-            }           
+            }
         }
 
     aCapsInfo.iNumberOfBlocks = lastLba + 1;
     aCapsInfo.iBlockLength = blockLength;
     aCapsInfo.iWriteProtect = iWriteProtect;
 
-	__SCSIPRINT3(_L("numBlock = x%x , blockLength = %x wp = %d"),
-                 lastLba + 1, blockLength, iWriteProtect);
+    OstTraceExt3(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_30,
+                 "numBlock=x%x blockLength=x%x wp=%d",
+                 (TUint32)(lastLba + 1), blockLength, (TInt32)iWriteProtect);
     }
 
 
@@ -343,7 +341,6 @@
 */
 TInt CScsiProtocol::MsInquiryL()
     {
-	__MSFNLOG
     ResetSbc();
 
    /**
@@ -367,27 +364,39 @@
         }
 
     // print reponse
-    __TESTREPORT1(_L("RMB = %d"), info.iRemovable);
-    __TESTREPORT2(_L("PERIPHERAL DEVICE TYPE = %d PQ = %d"),
-                 info.iPeripheralDeviceType,
-                 info.iPeripheralQualifier);
-    __TESTREPORT1(_L("VERSION = %d"), info.iVersion);
-    __TESTREPORT1(_L("RESPONSE DATA FORMAT = %d"), info.iResponseDataFormat);
-    __TESTREPORT3(_L("VENDOR ID %S PRODUCT ID %S REV %S"),
-                 &info.iIdentification.iVendorId,
-                 &info.iIdentification.iProductId,
-                 &info.iIdentification.iProductRev);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_40,
+              "RMB = %d", info.iRemovable);
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_41,
+              "PERIPHERAL DEVICE TYPE = %d PQ = %d",
+              info.iPeripheralDeviceType,
+              info.iPeripheralQualifier);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_42,
+              "VERSION = %d", info.iVersion);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_43,
+              "RESPONSE DATA FORMAT = %d",
+              info.iResponseDataFormat);
+
+    OstTraceData(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_440,
+              "VENDOR ID %s",
+              info.iIdentification.iVendorId.Ptr(), info.iIdentification.iVendorId.Size() * 2);
+    OstTraceData(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_441,
+              "PRODUCT ID %s",
+              info.iIdentification.iProductId.Ptr(), info.iIdentification.iProductId.Size()  * 2);
+    OstTraceData(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_442,
+              "REV %s",
+              info.iIdentification.iProductRev.Ptr(), info.iIdentification.iProductRev.Size() * 2);
 
     if (info.iPeripheralQualifier != 0 && info.iPeripheralQualifier != 1)
         {
-        __HOSTPRINT(_L("Peripheral Qualifier[Unknown device type]"))
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CSCSIPROTOCOL_45,
+                  "Peripheral Qualifier[Unknown device type]");
         err = KErrUnknown;
         }
     else if (info.iPeripheralDeviceType == 0)
         {
         // SCSI SBC Direct access device
         iRemovableMedia = info.iRemovable;
-    
+
         // SCSI Block device
         iSbcInterface = new (ELeave) TSbcClientInterface(iSpcInterface.Transport());
         iSbcInterface->InitBuffers(&iHeadbuf, &iTailbuf);
@@ -396,10 +405,11 @@
     else if (info.iPeripheralDeviceType == 5)
         {
         // SCSI MMC-2 CD-ROM device
-        __HOSTPRINT(_L("Peripheral Device Type[CD-ROM]"))
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CSCSIPROTOCOL_46,
+                  "Peripheral Device Type[CD-ROM]");
         iRemovableMedia = info.iRemovable;
 
-        // MMC-2 is not supported. A SCSI interface call will return 
+        // MMC-2 is not supported. A SCSI interface call will return
         // KErrNotSupported. If SCSI support is extended in future then
         // TSbcInterface class should be replaced with a proper interface class.
         iSbcInterface = NULL;
@@ -407,8 +417,9 @@
         }
     else
         {
-        __HOSTPRINT(_L("Peripheral Device Type[Unsupported device type]"))
-        err = KErrUnknown;    
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CSCSIPROTOCOL_47,
+                  "Peripheral Device Type[Unsupported device type]");
+        err = KErrUnknown;
         }
 
     return err;
@@ -424,7 +435,6 @@
 */
 TInt CScsiProtocol::MsTestUnitReadyL()
     {
-	__MSFNLOG
     /* TestUnitReady */
     return iSpcInterface.TestUnitReadyL();
     }
@@ -443,7 +453,6 @@
 */
 TInt CScsiProtocol::MsReadCapacityL()
     {
-	__MSFNLOG
     if (!iSbcInterface)
         {
         User::Leave(KErrNotSupported);
@@ -454,7 +463,8 @@
     TUint32 lastLba;
     TInt err = iSbcInterface->ReadCapacity10L(lastLba, blockSize);
 
-    __TESTREPORT2(_L("CAPACITY: Block Size=0x%x Last LBA=0x%x"), blockSize, lastLba);
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_DEVICEREPORT, CSCSIPROTOCOL_50,
+                 "CAPACITY: Block Size=0x%x Last LBA=0x%x", blockSize, lastLba);
     return err;
     }
 
@@ -468,7 +478,6 @@
 */
 TInt CScsiProtocol::MsModeSense10L()
     {
-	__MSFNLOG
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
@@ -492,7 +501,6 @@
 */
 TInt CScsiProtocol::MsModeSense6L()
     {
-	__MSFNLOG
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
@@ -516,7 +524,6 @@
 */
 TInt CScsiProtocol::MsStartStopUnitL(TBool aStart)
     {
-	__MSFNLOG
     if (!iSbcInterface)
         User::Leave(KErrNotSupported);
 
@@ -533,14 +540,12 @@
 */
 TInt CScsiProtocol::MsPreventAllowMediaRemovalL(TBool aPrevent)
     {
-	__MSFNLOG
     return iSpcInterface.PreventAllowMediumRemovalL(aPrevent);
     }
 
 
 TInt CScsiProtocol::DoCheckConditionL()
     {
-	__MSFNLOG
     User::LeaveIfError(MsRequestSenseL());
 
     TInt err;
@@ -550,15 +555,15 @@
         iSenseInfo.iAdditional == TSenseInfo::EAscLogicalUnitNotReady &&
         iSenseInfo.iQualifier == TSenseInfo::EAscqInitializingCommandRequired)
         {
-		if (iSbcInterface)
-			{
-	        // start unit
-			err = iSbcInterface->StartStopUnitL(ETrue);
-	        if (err)
-		        {
-			    User::LeaveIfError(MsRequestSenseL());
-				}			
-			}
+        if (iSbcInterface)
+            {
+            // start unit
+            err = iSbcInterface->StartStopUnitL(ETrue);
+            if (err)
+                {
+                User::LeaveIfError(MsRequestSenseL());
+                }
+            }
         }
 
     err = GetSystemWideSenseError(iSenseInfo);
@@ -582,7 +587,7 @@
         iMediaChangeNotifier.DoNotifyL();
         iState = nextState;
         }
-           
+
     return err;
     }
 
@@ -630,99 +635,97 @@
     extension will be notified setting the iChanged flag
 */
 TInt CScsiProtocol::GetSystemWideSenseError(const TSenseInfo& aSenseInfo)
-	{
-	__MSFNLOG
-	TInt ret = KErrNone;
-	TInt additionalError = KErrNone;
+    {
+    TInt ret = KErrNone;
+    TInt additionalError = KErrNone;
 
-	switch(aSenseInfo.iSenseCode)
-		{
-		case TSenseInfo::ENoSense:
-		case TSenseInfo::ERecoveredError:
-			ret = KErrNone;
-			break;
-		case TSenseInfo::ENotReady:
+    switch(aSenseInfo.iSenseCode)
+        {
+        case TSenseInfo::ENoSense:
+        case TSenseInfo::ERecoveredError:
+            ret = KErrNone;
+            break;
+        case TSenseInfo::ENotReady:
             ret = KErrNotReady;
-			additionalError = ProcessAsCodes(aSenseInfo);
+            additionalError = ProcessAsCodes(aSenseInfo);
             if (additionalError != KErrNone)
                 {
                 ret = additionalError;
                 }
-			break;
-		case TSenseInfo::EMediumError:
-			ret = KErrCorrupt;
-			additionalError = ProcessAsCodes(aSenseInfo);
+            break;
+        case TSenseInfo::EMediumError:
+            ret = KErrCorrupt;
+            additionalError = ProcessAsCodes(aSenseInfo);
             if (additionalError != KErrNone)
                 {
                 ret = additionalError;
                 }
-			break;
-		case TSenseInfo::EUnitAttention:
-			ret = KErrDisconnected;
-			break;
-		case TSenseInfo::EDataProtection:
-			ret = KErrAccessDenied;
-			break;
-		case TSenseInfo::EIllegalRequest:
-		case TSenseInfo::EHardwareError:
-		case TSenseInfo::EBlankCheck:
-		case TSenseInfo::EVendorSpecific:
-		case TSenseInfo::EMisCompare:
-			ret = KErrUnknown;
-			break;
-		case TSenseInfo::ECopyAborted:
-		case TSenseInfo::EAbortedCommand:
-			ret = KErrAbort;
-			break;
-		case TSenseInfo::EDataOverflow:
-			ret = KErrOverflow;
-			break;
-		default:
-			ret = KErrUnknown;
-			break;
-		}
+            break;
+        case TSenseInfo::EUnitAttention:
+            ret = KErrDisconnected;
+            break;
+        case TSenseInfo::EDataProtection:
+            ret = KErrAccessDenied;
+            break;
+        case TSenseInfo::EIllegalRequest:
+        case TSenseInfo::EHardwareError:
+        case TSenseInfo::EBlankCheck:
+        case TSenseInfo::EVendorSpecific:
+        case TSenseInfo::EMisCompare:
+            ret = KErrUnknown;
+            break;
+        case TSenseInfo::ECopyAborted:
+        case TSenseInfo::EAbortedCommand:
+            ret = KErrAbort;
+            break;
+        case TSenseInfo::EDataOverflow:
+            ret = KErrOverflow;
+            break;
+        default:
+            ret = KErrUnknown;
+            break;
+        }
 
-	return ret;
-	}
+    return ret;
+    }
 
 
 TInt CScsiProtocol::ProcessAsCodes(const TSenseInfo& aSenseInfo)
     {
-	__MSFNLOG
-	TInt ret = KErrNone;
+    TInt ret = KErrNone;
 
-	switch(aSenseInfo.iAdditional)
-		{
+    switch(aSenseInfo.iAdditional)
+        {
         case TSenseInfo::EAscLogicalUnitNotReady:
-		case TSenseInfo::EMediaNotPresent:
+        case TSenseInfo::EMediaNotPresent:
             ret = KErrNotReady;
-			break;
+            break;
+
+        case TSenseInfo::ELbaOutOfRange:
+            ret = KErrOverflow;
+            break;
 
-		case TSenseInfo::ELbaOutOfRange:
-			ret = KErrOverflow;
-			break;
-
-		case TSenseInfo::EWriteProtected:
-			ret = KErrAccessDenied;
-			break;
+        case TSenseInfo::EWriteProtected:
+            ret = KErrAccessDenied;
+            break;
 
-		case TSenseInfo::ENotReadyToReadyChange:
-			ret = KErrNone;
-			break;
+        case TSenseInfo::ENotReadyToReadyChange:
+            ret = KErrNone;
+            break;
 
-		case TSenseInfo::EAscLogicalUnitDoesNotRespondToSelection:
-		case TSenseInfo::EInvalidCmdCode:
-		case TSenseInfo::EInvalidFieldInCdb:
-		case TSenseInfo::ELuNotSupported:
+        case TSenseInfo::EAscLogicalUnitDoesNotRespondToSelection:
+        case TSenseInfo::EInvalidCmdCode:
+        case TSenseInfo::EInvalidFieldInCdb:
+        case TSenseInfo::ELuNotSupported:
         case TSenseInfo::EInsufficientRes:
             ret = KErrUnknown;
             break;
-		default:
-			ret = KErrNone;
-			break;
-		}
-	return ret;
-	}
+        default:
+            ret = KErrNone;
+            break;
+        }
+    return ret;
+    }
 
 
 /**
@@ -734,14 +737,12 @@
 */
 TInt CScsiProtocol::MsRequestSenseL()
     {
-	__MSFNLOG
     return iSpcInterface.RequestSenseL(iSenseInfo) ? KErrCommandFailed : KErrNone;
-	}
+    }
 
 
 void CScsiProtocol::CreateSbcInterfaceL(TUint32 aBlockLen, TUint32 aLastLba)
     {
-	__MSFNLOG
     // SCSI Block device
     ASSERT(iSbcInterface == NULL);
     iSbcInterface = new (ELeave) TSbcClientInterface(iSpcInterface.Transport());
@@ -752,7 +753,6 @@
 
 void CScsiProtocol::ResetSbc()
     {
-	__MSFNLOG
     if (iSbcInterface)
         {
         delete iSbcInterface;
@@ -762,92 +762,86 @@
 
 
 void CScsiProtocol::NotifyChange(const RMessage2& aMessage)
-	{
-    __MSFNLOG
+    {
     iMediaChangeNotifier.Register(aMessage);
-	}
+    }
 
 
 void CScsiProtocol::ForceCompleteNotifyChangeL()
-	{
-    __MSFNLOG
+    {
     iMediaChangeNotifier.DoNotifyL();
-	}
+    }
 
 
 void CScsiProtocol::CancelChangeNotifierL()
-	{
-    __MSFNLOG
+    {
     iMediaChangeNotifier.DoCancelL();
-	}
+    }
 
 
 void CScsiProtocol::SuspendL()
-	{
-    __MSFNLOG
+    {
     if (iFsm->StartStopUnitRequired())
         {
         iSbcInterface->StartStopUnitL(EFalse);
         }
-	}
+    }
 
 void CScsiProtocol::ResumeL()
-	{
-    __MSFNLOG
+    {
     if (iFsm->StartStopUnitRequired())
         {
         iSbcInterface->StartStopUnitL(ETrue);
         }
-	}
+    }
 
 
 TBool CScsiProtocol::DoScsiReadyCheckEventL()
-	{
-    __MSFNLOG
-	TInt err = KErrNone;
+    {
+    TInt err = KErrNone;
 
-	if(iRemovableMedia || iState != EConnected)
+    if(iRemovableMedia || iState != EConnected)
         {
-		iFsm->SetStatusCheck();
-		TRAP(err, iFsm->ConnectLogicalUnitL());
-		iFsm->ClearStatusCheck();
+        iFsm->SetStatusCheck();
+        TRAP(err, iFsm->ConnectLogicalUnitL());
+        iFsm->ClearStatusCheck();
 
-		User::LeaveIfError(err);
-		err = iFsm->IsConnected() ? KErrNone : KErrNotReady;
+        User::LeaveIfError(err);
+        err = iFsm->IsConnected() ? KErrNone : KErrNotReady;
         }
 
-	if (iState == EConnected)
+    if (iState == EConnected)
         {
-		if (err != KErrNone)
-			{
-			iState = EDisconnected;
-            __SCSIPRINT(_L("** Disconnected Notification **"));
+        if (err != KErrNone)
+            {
+            iState = EDisconnected;
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_60,
+                      "** Disconnected Notification **");
             iMediaChangeNotifier.DoNotifyL();
-			}
+            }
         }
-	else
+    else
         {
-		if (err == KErrNone)
-			{
-			iState = EConnected;
-            __SCSIPRINT(_L("** Connected Notification **"));
+        if (err == KErrNone)
+            {
+            iState = EConnected;
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, CSCSIPROTOCOL_61,
+                      "** Connected Notification **");
             iMediaChangeNotifier.DoNotifyL();
-			}
+            }
         }
     return err = KErrNone ? ETrue : EFalse;
-	}
+    }
 
 
 RMediaChangeNotifier::RMediaChangeNotifier()
 :   iRegistered(EFalse)
     {
-    __MSFNSLOG
     }
 
 
 RMediaChangeNotifier::~RMediaChangeNotifier()
     {
-    __MSFNSLOG
     if (iRegistered)
         iNotifier.Complete(KErrDisconnected);
     }
@@ -859,33 +853,29 @@
 */
 void RMediaChangeNotifier::Register(const RMessage2& aMessage)
     {
-    __MSFNLOG
-	iRegistered = ETrue;
-	iNotifier = aMessage;
+    iRegistered = ETrue;
+    iNotifier = aMessage;
     }
 
 
 void RMediaChangeNotifier::DoNotifyL()
     {
-	__MSFNLOG
-	CompleteNotifierL(KErrNone);
+    CompleteNotifierL(KErrNone);
     }
 
 void RMediaChangeNotifier::DoCancelL()
     {
-	__MSFNLOG
-	CompleteNotifierL(KErrCancel);
+    CompleteNotifierL(KErrCancel);
     }
 
 void RMediaChangeNotifier::CompleteNotifierL(TInt aReason)
-	{
-    __MSFNLOG
-	if (iRegistered)
+    {
+    if (iRegistered)
         {
-		TBool mediaChanged = ETrue;
-		TPtrC8 pStatus((TUint8*)&mediaChanged,sizeof(TBool));
-		iNotifier.WriteL(0,pStatus);
-		iNotifier.Complete(aReason);
-		iRegistered = EFalse;
+        TBool mediaChanged = ETrue;
+        TPtrC8 pStatus((TUint8*)&mediaChanged,sizeof(TBool));
+        iNotifier.WriteL(0,pStatus);
+        iNotifier.Complete(aReason);
+        iRegistered = EFalse;
         }
-	}
+    }
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/cmassstoragefsm.inl	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/cmassstoragefsm.inl	Tue Nov 02 15:29:23 2010 +0000
@@ -16,14 +16,13 @@
 /**
  @file
  @internalTechnology
- 
+
  Sets the StateId to be entered next time the FSM is called.
- 
+
  @param aStateId The State ID
 */
 inline void CMassStorageFsm::SetState(TMassStorageState::TStateId aStateId)
     {
-    __HOSTPRINT1(_L("CMassStorage::SetState[%d]"), aStateId);
     iState = iStateTable[aStateId];
     }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiblockcmds.inl	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiblockcmds.inl	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -12,15 +12,15 @@
 //
 // Description:
 // scsiblockcommands.inl
-// 
+//
 //
 
 /**
  @file
  @internalTechnology
- 
+
  Constructor for SCSI MODE SENSE (6) request.
- 
+
  @param aPageControl SCSI PAGE CONTROL field
  @param aPageCode SCSI PAGE CODE field
  @param aSubPageCode SCSI SUB PAGE CODE field
@@ -40,7 +40,6 @@
 
 inline TInt TScsiClientModeSense6Req::EncodeRequestL(TDes8& aBuffer) const
     {
-    __SCSIPRINT(_L("<-- SCSI MODE SENSE (6)"));
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     // PC
@@ -65,7 +64,6 @@
     iBlockTransferLength(0),
     iProtect(0)
     {
-    __MSFNSLOG
     }
 
 
@@ -74,7 +72,6 @@
     :
     TScsiClientRdWr10Req(ERead10)
     {
-    __MSFNSLOG
     }
 
 
@@ -83,7 +80,6 @@
 :   TScsiClientReq(EReadCapacity10),
     iLba(0)
     {
-    __MSFNSLOG
     }
 
 
@@ -96,7 +92,6 @@
 :   TScsiClientReq(EReadCapacity10),
     iLba(aLba)
     {
-    __MSFNSLOG
     }
 
 
@@ -105,7 +100,6 @@
     :
     TScsiClientRdWr10Req(EWrite10)
     {
-    __MSFNSLOG
     }
 
 
@@ -117,6 +111,5 @@
     iStart(EFalse),
     iLoej(EFalse)
     {
-    __MSFNSLOG
     }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiclientreq.inl	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiclientreq.inl	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -16,9 +16,9 @@
 /**
  @file
  @internalTechnology
- 
+
  Constructor initialised with the SCSI OPERATION CODE for this object.
- 
+
  @param aOperationCode The SCSI OPERATION CODE of the request
 */
 inline TScsiClientReq::TScsiClientReq(TOperationCode aOperationCode)
@@ -27,12 +27,10 @@
     iNaca(0),
     iLink(0)
     {
-    __MSFNSLOG
     }
 
 inline TUint8 TScsiClientReq::GetControlByte() const
     {
-    __MSFNSLOG
     TUint8 control = 0;
 
     if (iLink)
@@ -48,7 +46,6 @@
 
 inline TGroupCode TScsiClientReq::GetGroupCode() const
     {
-    __MSFNSLOG
     return iOperationCode >> 5;
     }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiprimarycmds.inl	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiprimarycmds.inl	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // scsiprimarycommands.inl
-// 
+//
 //
 
 /**
@@ -24,7 +24,6 @@
 inline TScsiClientTestUnitReadyReq::TScsiClientTestUnitReadyReq()
 :   TScsiClientReq(ETestUnitReady)
     {
-    __MSFNSLOG
     }
 
 
@@ -33,7 +32,6 @@
 :   TScsiClientReq(ERequestSense),
     iAllocationLength(KResponseLength)
     {
-    __MSFNSLOG
     }
 
 
@@ -44,15 +42,12 @@
 */
 inline void TScsiClientRequestSenseReq::SetAllocationLength(TAllocationLength aAllocationLength)
     {
-    __MSFNSLOG
     iAllocationLength = aAllocationLength;
     }
 
 
 inline TInt TScsiClientRequestSenseReq::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI REQUEST SENSE"));
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     aBuffer[4] = iAllocationLength;
@@ -67,7 +62,6 @@
     iEvpd(EFalse),
     iAllocationLength(KResponseLength)
     {
-    __MSFNSLOG
     }
 
 
@@ -78,7 +72,6 @@
 */
 inline void TScsiClientInquiryReq::SetAllocationLength(TAllocationLength aAllocationLength)
     {
-    __MSFNSLOG
     iAllocationLength = aAllocationLength;
     }
 
@@ -90,7 +83,6 @@
 */
 inline void TScsiClientInquiryReq::SetEvpd(TUint8 aPageCode)
     {
-    __MSFNSLOG
     iEvpd = ETrue;
     iPage = aPageCode;
     }
@@ -103,7 +95,6 @@
 */
 inline void TScsiClientInquiryReq::SetCmdDt(TUint8 aOperationCode)
     {
-    __MSFNSLOG
     iCmdDt = ETrue;
     iPage = aOperationCode;
     }
@@ -111,8 +102,6 @@
 
 inline TInt TScsiClientInquiryReq::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI INQUIRY"));
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     if (iEvpd)
@@ -151,7 +140,6 @@
 :   TScsiClientReq(EPreventMediaRemoval),
     iPrevent(aPrevent)
     {
-    __MSFNSLOG
     }
 
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tblocktransfer.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tblocktransfer.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -25,8 +25,11 @@
 
 #include "mblocktransferprotocol.h"
 #include "tblocktransfer.h"
-#include "debug.h"
-#include "msdebug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tblocktransferTraces.h"
+#endif
 
 
 /**
@@ -42,48 +45,51 @@
                            TInt aLength,
                            TDes8& aBuf)
     {
-    __MSFNLOG
-	__HOSTPRINT1(_L("blocklen = 0%lx"), iBlockLength);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_1,
+              "blocklen = 0%lx", iBlockLength);
 
-	TInt copylen = 0;
+    TInt copylen = 0;
     TInt headlen = 0;
 
-	aBuf.SetLength(0);
+    aBuf.SetLength(0);
     TPos headOffset = GetHeadBlockOffset(aPosition);
-	/**** READ10 HEAD ****/
-	if (headOffset)
+    /**** READ10 HEAD ****/
+    if (headOffset)
         {
-		TPos headpos = aPosition - headOffset;
+        TPos headpos = aPosition - headOffset;
         iHeadbuf->Zero();
-		headlen = ((headOffset + aLength - 1) / iBlockLength) == 0 ? aLength : (iBlockLength - headOffset);
+        headlen = ((headOffset + aLength - 1) / iBlockLength) == 0 ? aLength : (iBlockLength - headOffset);
 
-		__HOSTPRINT2(_L("\tRead head pos = 0%lx length = 0%lx"),
-                     headpos, iBlockLength);
-		aProtocol.BlockReadL(headpos, *iHeadbuf, iBlockLength);
-		aBuf.Append(iHeadbuf->Ptr() + headOffset, headlen);		
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_10,
+                     "Read head pos = 0%x %x length = 0%lx",
+                    I64HIGH(headpos), I64LOW(headpos), iBlockLength);
+        aProtocol.BlockReadL(headpos, *iHeadbuf, iBlockLength);
+        aBuf.Append(iHeadbuf->Ptr() + headOffset, headlen);
         }
 
-	/**** READ10 BODY ****/
+    /**** READ10 BODY ****/
     TInt blocksInMain = (aLength - headlen)/iBlockLength;
-	if (blocksInMain)
+    if (blocksInMain)
         {
-		copylen = blocksInMain * iBlockLength;
-		__HOSTPRINT2(_L("\tRead main pos = 0%lx length = 0x%x"),
-                     aPosition+headlen, copylen);
-		aProtocol.BlockReadL(aPosition+headlen, (TDes8 &)aBuf, copylen);
+        copylen = blocksInMain * iBlockLength;
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_11,
+                     "Read main pos = 0%x %x length = 0x%x",
+                     I64HIGH(aPosition+headlen), I64LOW(aPosition+headlen), copylen);
+        aProtocol.BlockReadL(aPosition+headlen, (TDes8 &)aBuf, copylen);
         }
 
-	copylen += headlen;
+    copylen += headlen;
 
-	/**** READ10 TAIL ****/
+    /**** READ10 TAIL ****/
     TInt tailLen = aLength - copylen;
-	if ((tailLen) != 0)
+    if ((tailLen) != 0)
         {
-		__HOSTPRINT2(_L("\tRead tail pos = 0%lx length = 0%lx"),
-                     aPosition+copylen, iBlockLength);
-        iTailbuf->Zero();    
-		aProtocol.BlockReadL(aPosition+copylen, *iTailbuf, iBlockLength);
-		aBuf.Append(iTailbuf->Ptr(), tailLen);
+        OstTraceExt4(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_12,
+                     "Read tail pos = 0%x %x length = 0%x %x",
+                     I64HIGH(aPosition+copylen), I64LOW(aPosition+copylen), I64HIGH(iBlockLength), I64LOW(iBlockLength));
+        iTailbuf->Zero();
+        aProtocol.BlockReadL(aPosition+copylen, *iTailbuf, iBlockLength);
+        aBuf.Append(iTailbuf->Ptr(), tailLen);
         }
     }
 
@@ -101,71 +107,75 @@
                             TInt aLength,
                             TDesC8& aBuf)
     {
-    __MSFNLOG
-	TInt copylen = 0;
+    TInt copylen = 0;
     TInt headlen = 0;
 
     TPos headOffset = GetHeadBlockOffset(aPosition);
-	/**** WRITE10 HEAD ****/
-	if (headOffset)
+    /**** WRITE10 HEAD ****/
+    if (headOffset)
         {
-		TPos headpos = aPosition - headOffset;
+        TPos headpos = aPosition - headOffset;
 
         iHeadbuf->Zero();
 
         RBuf8& buf = *iTailbuf;
         buf.Zero();
 
-		headlen = ((headOffset + aLength - 1) / iBlockLength) == 0 ? aLength : (iBlockLength - headOffset);
+        headlen = ((headOffset + aLength - 1) / iBlockLength) == 0 ? aLength : (iBlockLength - headOffset);
 
-		__HOSTPRINT2(_L("\tWrite-Read head pos = 0%lx length = 0%lx"),
-                     headpos, iBlockLength);
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_20,
+                     "Write-Read head pos = 0%x %x length = 0%lx",
+                     I64HIGH(headpos), I64LOW(headpos), iBlockLength);
 
-		aProtocol.BlockReadL(headpos, *iHeadbuf, iBlockLength);
-		/* get head */
-		__HOSTPRINT2(_L("\tcopying read data pos = 0%lx offset = 0%lx"),
-                     headpos, headOffset);
-		buf.Append(iHeadbuf->Ptr(), headOffset);
+        aProtocol.BlockReadL(headpos, *iHeadbuf, iBlockLength);
+        /* get head */
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_21,
+                     "tcopying read data pos = 0%x %x offset = 0%lx",
+                     I64HIGH(headpos), I64LOW(headpos), headOffset);
+        buf.Append(iHeadbuf->Ptr(), headOffset);
 
-		/* get body */
-		buf.Append(aBuf.Ptr(), headlen);
+        /* get body */
+        buf.Append(aBuf.Ptr(), headlen);
 
-		/* Is it a short write and tail exist? */
+        /* Is it a short write and tail exist? */
         TInt headEndOffset = headOffset + headlen;
-		if (headEndOffset != iBlockLength)
+        if (headEndOffset != iBlockLength)
             {
             TInt len = iBlockLength - headEndOffset;
 
-			__HOSTPRINT2(_L("\t(short write) copying read data pos = 0%lx length = %08x"),
-                         (headpos + headEndOffset), len);
-			buf.Append(iHeadbuf->Ptr() + headEndOffset, len);
+            OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_22,
+                         "(short write) copying read data pos = 0%x %x length = %08x",
+                         I64HIGH(headpos + headEndOffset), I64LOW(headpos + headEndOffset), len);
+            buf.Append(iHeadbuf->Ptr() + headEndOffset, len);
             }
 
-		__HOSTPRINT2(_L("\tWrite head pos = 0%lx length = %08x"),
-                     headpos, headlen);
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_23,
+                     "Write head pos = 0%x %x length = %08x",
+                     I64HIGH(headpos), I64LOW(headpos), headlen);
 
-		aProtocol.BlockWriteL(headpos, (TDes8 &)buf, 0, iBlockLength);
+        aProtocol.BlockWriteL(headpos, (TDes8 &)buf, 0, iBlockLength);
         }
 
-	/**** WRITE10 BODY ****/
+    /**** WRITE10 BODY ****/
     TPos blocksInMain = (aLength - headlen)/iBlockLength;
-	if (blocksInMain)
+    if (blocksInMain)
         {
-		copylen = blocksInMain * iBlockLength;
+        copylen = blocksInMain * iBlockLength;
 
         const TUint64 pos = aPosition + headlen;
-		__HOSTPRINT2(_L("\tWrite main pos = 0%lx length = %08x"),
-                     pos, copylen);
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_24,
+                     "Write main pos = 0%x %x length = %08x",
+                     I64HIGH(pos), I64LOW(pos), copylen);
 
-		/* form the body */
-		aProtocol.BlockWriteL(pos, (TDes8 &)aBuf, headlen, copylen);
+        /* form the body */
+        aProtocol.BlockWriteL(pos, (TDes8 &)aBuf, headlen, copylen);
         }
 
-	copylen += headlen;
+    copylen += headlen;
 
-	/**** WRITE10 TAIL ****/
+    /**** WRITE10 TAIL ****/
     TInt tailLen = aLength - copylen;;
-	if (tailLen != 0)
+    if (tailLen != 0)
         {
         RBuf8& buf = *iHeadbuf;
         buf.Zero();
@@ -174,23 +184,23 @@
 
         const TUint64 pos = aPosition + copylen;
 
-		__HOSTPRINT2(_L("\tWrite-Read tail pos = 0%lx length = %08x"),
-                     pos, iBlockLength);
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_HOST, TBLOCKTRANSFER_25,
+                  "Write-Read tail pos = 0%x %x length = %08x",
+                  I64HIGH(pos), I64LOW(pos), iBlockLength);
 
-		aProtocol.BlockReadL(pos, *iTailbuf, iBlockLength);
-		/* get head */
-		buf.Append(aBuf.Ptr() + copylen, tailLen);
-		/* get tail */
-		buf.Append(iTailbuf->Ptr() + tailLen, iBlockLength - tailLen);
+        aProtocol.BlockReadL(pos, *iTailbuf, iBlockLength);
+        /* get head */
+        buf.Append(aBuf.Ptr() + copylen, tailLen);
+        /* get tail */
+        buf.Append(iTailbuf->Ptr() + tailLen, iBlockLength - tailLen);
 
-		aProtocol.BlockWriteL(pos, (TDes8 &)buf, 0, iBlockLength);
+        aProtocol.BlockWriteL(pos, (TDes8 &)buf, 0, iBlockLength);
         }
     }
 
 
 void TBlockTransfer::SetCapacityL(TUint32 aBlockLength, TLba aLastLba)
     {
-    __MSFNLOG
     iBlockLength = static_cast<TInt64>(aBlockLength);
     iLastLba = aLastLba;
 
@@ -201,19 +211,17 @@
         {
         iHeadbuf->ReAllocL(aBlockLength);
         iTailbuf->ReAllocL(aBlockLength);
-        }    
+        }
     }
 
 
 TPos TBlockTransfer::GetHeadBlockOffset(TPos aPos)
     {
-    __MSFNLOG
-	return (aPos % iBlockLength);
+    return (aPos % iBlockLength);
     }
 
 TLba TBlockTransfer::GetHeadBlockLbaL(TPos aPos)
     {
-    __MSFNLOG
     TLba lba = I64LOW(aPos / iBlockLength);
     if (lba > iLastLba)
         User::Leave(KErrArgument);
@@ -222,13 +230,11 @@
 
 TPos TBlockTransfer::GetTailBlockOffset(TPos aPos, TInt aLen)
     {
-    __MSFNLOG
     return ((aPos + aLen) % iBlockLength);
     }
 
 TLba TBlockTransfer::GetTailBlockLbaL(TPos aPos, TInt aLen)
     {
-    __MSFNLOG
     TLba lba = I64LOW((aPos + aLen) / iBlockLength);
     if (lba > iLastLba)
         User::Leave(KErrArgument);
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tsbcclientinterface.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tsbcclientinterface.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -20,8 +20,11 @@
 
 #include <e32base.h>
 
-#include "msdebug.h"
-#include "debug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tsbcclientinterfaceTraces.h"
+#endif
+
 #include "msctypes.h"
 
 #include "mtransport.h"
@@ -34,6 +37,7 @@
 #include "tscsiblockcmds.h"
 #include "tsbcclientinterface.h"
 
+
 /**
 Constructor.
 
@@ -42,13 +46,11 @@
 TSbcClientInterface::TSbcClientInterface(MTransport& aTransport)
 :   iTransport(aTransport)
     {
-    __MSFNLOG
     }
 
 
 TSbcClientInterface::~TSbcClientInterface()
     {
-    __MSFNLOG
     }
 
 
@@ -65,22 +67,21 @@
 */
 TInt TSbcClientInterface::ModeSense6L(TUint aPageCode, TBool& aWriteProtected)
     {
-    __MSFNLOG
     TScsiClientModeSense6Req modeSense6Req(TScsiClientModeSense6Req::ECurrentValues,
                                            aPageCode);
     TScsiClientModeSense6Resp modeSense6Resp;
     TInt err = iTransport.SendControlCmdL(&modeSense6Req, &modeSense6Resp);
     if (!err)
         {
-        __SCSIPRINT1(_L("SCSI MODE SENSE (6) INFO WrProtect=%d"),
-                     modeSense6Resp.iWriteProtected);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_SCSI, TSBCCLIENTINTERFACE_10,
+                  "SCSI MODE SENSE (6) INFO WrProtect=%d", modeSense6Resp.iWriteProtected);
         aWriteProtected = modeSense6Resp.iWriteProtected;
         }
     else
         {
         aWriteProtected = EFalse;
         }
-	return err;
+    return err;
     }
 
 
@@ -97,7 +98,6 @@
 */
 TInt TSbcClientInterface::ModeSense10L(TUint aPageCode, TBool& aWriteProtected)
     {
-    __MSFNLOG
     TScsiClientModeSense10Req modeSense10Req(TScsiClientModeSense10Req::ECurrentValues,
                                              aPageCode);
     TScsiClientModeSense10Resp modeSense10Resp;
@@ -105,15 +105,15 @@
 
     if (!err)
         {
-        __SCSIPRINT1(_L("SCSI MODE SENSE (10) INFO WrProtect=%d"),
-                     modeSense10Resp.iWriteProtected);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_SCSI, TSBCCLIENTINTERFACE_11,
+                  "SCSI MODE SENSE (10) INFO WrProtect=%d", modeSense10Resp.iWriteProtected);
         aWriteProtected = modeSense10Resp.iWriteProtected;
         }
     else
         {
         aWriteProtected = EFalse;
         }
-	return err;
+    return err;
     }
 
 
@@ -134,14 +134,13 @@
     iSubPageCode(aSubPageCode),
     iAllocationLength(KResponseLength)
     {
-    __MSFNLOG
     }
 
 
 TInt TScsiClientModeSense10Req::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI MODE SENSE (10)"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSBCCLIENTINTERFACE_12,
+              "<-- SCSI MODE SENSE (10)");
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     // PC
@@ -171,8 +170,7 @@
 */
 TInt TSbcClientInterface::Read10L(TLba aLba, TDes8& aBuffer, TInt& aLen)
     {
-    __MSFNLOG
-	__ASSERT_DEBUG(iBlockTransfer.BlockLength(), User::Panic(KUsbMsHostPanicCat, EBlockLengthNotSet));
+    __ASSERT_DEBUG(iBlockTransfer.BlockLength(), User::Panic(KUsbMsHostPanicCat, EBlockLengthNotSet));
     __ASSERT_DEBUG(aLen % iBlockTransfer.BlockLength() == 0, User::Panic(KUsbMsHostPanicCat, EBlockDevice));
 
     TScsiClientRead10Req read10Req;
@@ -186,7 +184,7 @@
         }
     read10Req.iBlockTransferLength = static_cast<TUint16>(blockTransferLength);
     TInt err = iTransport.SendDataRxCmdL(&read10Req, aBuffer, aLen);
-	return err;
+    return err;
     }
 
 /**
@@ -203,7 +201,6 @@
 */
 TInt TSbcClientInterface::ReadCapacity10L(TLba& aLba, TUint32& aBlockSize)
     {
-    __MSFNLOG
     TScsiClientReadCapacity10Req capacity10Req;
     TScsiClientReadCapacity10Resp capacity10Resp;
 
@@ -213,12 +210,12 @@
         aLba = capacity10Resp.iLba;
         aBlockSize = capacity10Resp.iBlockSize;
 
-        __SCSIPRINT2(_L("Capacity LBA=0x%08x SIZE=0x%08x"),
-                     aLba, aBlockSize);
+        OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, TSBCCLIENTINTERFACE__,
+                     "Capacity LBA=0x%08x SIZE=0x%08x", aLba, aBlockSize);
 
         iBlockTransfer.SetCapacityL(aBlockSize, aLba);
         }
-	return err;
+    return err;
     }
 
 
@@ -233,7 +230,6 @@
 */
 TInt TSbcClientInterface::StartStopUnitL(TBool aStart)
     {
-    __MSFNLOG
     TScsiClientStartStopUnitReq startStopUnitReq;
 
     startStopUnitReq.iImmed = ETrue;
@@ -242,7 +238,7 @@
 
     TInt err = iTransport.SendControlCmdL(&startStopUnitReq);
 
-	return err;
+    return err;
     }
 
 
@@ -264,15 +260,14 @@
 */
 TInt TSbcClientInterface::Write10L(TLba aLba, TDesC8& aBuffer, TUint aPos, TInt& aLen)
     {
-    __MSFNLOG
-	__ASSERT_DEBUG(iBlockTransfer.BlockLength(), User::Panic(KUsbMsHostPanicCat, EBlockLengthNotSet));
+    __ASSERT_DEBUG(iBlockTransfer.BlockLength(), User::Panic(KUsbMsHostPanicCat, EBlockLengthNotSet));
     __ASSERT_DEBUG(aLen % iBlockTransfer.BlockLength() == 0, User::Panic(KUsbMsHostPanicCat, EBlockDevice));
 
     // check that buffer size is large enough
-	if (aBuffer.Length() < (aPos + aLen))
-		{
+    if (aBuffer.Length() < (aPos + aLen))
+        {
         User::Leave(KErrArgument);
-		}
+        }
 
     TScsiClientWrite10Req write10Req;
     write10Req.iLogicalBlockAddress = aLba;
@@ -285,6 +280,6 @@
     write10Req.iBlockTransferLength = static_cast<TUint16>(blockTransferLength);
 
     TInt err = iTransport.SendDataTxCmdL(&write10Req, aBuffer, aPos, aLen);
-	return err;
+    return err;
     }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiblockcmds.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiblockcmds.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -19,8 +19,12 @@
 */
 
 #include <e32base.h>
-#include "debug.h"
-#include "msdebug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tscsiblockcmdsTraces.h"
+#endif
+
 #include "msctypes.h"
 #include "mscutils.h"
 
@@ -30,12 +34,13 @@
 #include "tscsiblockcmds.h"
 
 
-// ****	MODE SENSE (6) ****
+// **** MODE SENSE (6) ****
 void TScsiClientModeSense6Resp::DecodeL(const TDesC8& aPtr)
-	{
-    __MSFNSLOG
-    __SCSIPRINT(_L("--> SCSI MODE SENSE (6)"));
-    __SCSIPRINT1(_L("len=%d"), aPtr.Length());
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_10,
+              "--> SCSI MODE SENSE (6)");
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_11,
+              "len=%d", aPtr.Length());
     // Mode Parameter List
     // SPC-3 7.4.2
     // - Mode Parameter Header
@@ -61,77 +66,13 @@
         {
         User::Leave(KErrGeneral);
         }
-   
+
     TInt mediumType = aPtr[1];
     TUint8 deviceSpecificParameter = aPtr[2];
     // TInt blockDescriptorLength = aPtr[3];
 
-    __SCSIPRINT2(_L("Medium Type=%d DSP=0x%x"), mediumType, deviceSpecificParameter);
-    // [1] Medium Type
-    // 0x00 for SBC
-    if (mediumType == 0)
-        {
-        // [2] Device specific parameter
-        // SBC-3 6.3.1
-        // get the WP bit from the Device Specific parameters
-        iWriteProtected = (deviceSpecificParameter & 0x80) ? ETrue : EFalse;
-        }
-    else
-        {
-        // unsupported medium type
-        iWriteProtected = EFalse;
-        }
-
-    // [3] Block Descriptor Length
-    // 0x00 for no descriptors
-
-    // No Block Descriptors
-
-    // No Mode Pages
-
-	}
-
-
-// ****	MODE SENSE (10) ****
-void TScsiClientModeSense10Resp::DecodeL(const TDesC8& aPtr)
-	{
-    __MSFNSLOG
-    __SCSIPRINT(_L("--> SCSI MODE SENSE (10)"));
-    __SCSIPRINT1(_L("len=%d"), aPtr.Length());
-    // Mode Parameter List
-    // SPC-3 7.4.2
-    // - Mode Parameter Header
-    // - Block Descriptor(s)
-    // - Mode Page(s)
-
-    // Mode Parameter Header
-    // SPC-3 7.4.3
-    // [0] Mode Data Length
-    // [1] Mode Data Length
-    // [2] Medium Type
-    // [3] Device-Specific Paramater
-    // [4] Reserved
-    // [5] Reserved
-    // [6] Block Descriptor Length
-    // [7] Block Descriptor Length
-
-    // validate length
-    if (aPtr.Length() < KResponseLength)
-        {
-        User::Leave(KErrGeneral);
-        }
-    
-    TInt modeDataLength = BigEndian::Get16(&aPtr[0]);
-    if (aPtr.Length() - 2 > modeDataLength)
-        {
-        User::Leave(KErrGeneral);
-        }
-
-    TInt mediumType = aPtr[2];
-    TUint8 deviceSpecificParameter = aPtr[3];
-    // TInt blockDescriptorLength = BigEndian::Get32(&aPtr[6]);;
-
-    __SCSIPRINT2(_L("Medium Type=%d DSP=0x%x"), mediumType, deviceSpecificParameter);
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_20,
+                 "Medium Type=%d DSP=0x%x", mediumType, deviceSpecificParameter);
     // [1] Medium Type
     // 0x00 for SBC
     if (mediumType == 0)
@@ -154,15 +95,82 @@
 
     // No Mode Pages
 
-	}
+    }
+
+
+// **** MODE SENSE (10) ****
+void TScsiClientModeSense10Resp::DecodeL(const TDesC8& aPtr)
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_30,
+              "--> SCSI MODE SENSE (10)");
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_31,
+              "len=%d", aPtr.Length());
+    // Mode Parameter List
+    // SPC-3 7.4.2
+    // - Mode Parameter Header
+    // - Block Descriptor(s)
+    // - Mode Page(s)
+
+    // Mode Parameter Header
+    // SPC-3 7.4.3
+    // [0] Mode Data Length
+    // [1] Mode Data Length
+    // [2] Medium Type
+    // [3] Device-Specific Paramater
+    // [4] Reserved
+    // [5] Reserved
+    // [6] Block Descriptor Length
+    // [7] Block Descriptor Length
+
+    // validate length
+    if (aPtr.Length() < KResponseLength)
+        {
+        User::Leave(KErrGeneral);
+        }
+
+    TInt modeDataLength = BigEndian::Get16(&aPtr[0]);
+    if (aPtr.Length() - 2 > modeDataLength)
+        {
+        User::Leave(KErrGeneral);
+        }
+
+    TInt mediumType = aPtr[2];
+    TUint8 deviceSpecificParameter = aPtr[3];
+    // TInt blockDescriptorLength = BigEndian::Get32(&aPtr[6]);;
+
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_40,
+                 "Medium Type=%d DSP=0x%x", mediumType, deviceSpecificParameter);
+    // [1] Medium Type
+    // 0x00 for SBC
+    if (mediumType == 0)
+        {
+        // [2] Device specific parameter
+        // SBC-3 6.3.1
+        // get the WP bit from the Device Specific parameters
+        iWriteProtected = (deviceSpecificParameter & 0x80) ? ETrue : EFalse;
+        }
+    else
+        {
+        // unsupported medium type
+        iWriteProtected = EFalse;
+        }
+
+    // [3] Block Descriptor Length
+    // 0x00 for no descriptors
+
+    // No Block Descriptors
+
+    // No Mode Pages
+
+    }
 
 
 
-// ****	READ CAPACITY (10) ***
+// **** READ CAPACITY (10) ***
 TInt TScsiClientReadCapacity10Req::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- READ CAPACITY 10"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_50,
+              "<-- READ CAPACITY 10");
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     if (iLba)
@@ -177,25 +185,25 @@
 
 
 void TScsiClientReadCapacity10Resp::DecodeL(const TDesC8& aPtr)
-	{
-    __MSFNSLOG
-    __SCSIPRINT(_L("--> SCSI READ CAPACITY (10)"));
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_60,
+              "--> SCSI READ CAPACITY (10)");
     iLba = BigEndian::Get32(&aPtr[0]);
     iBlockSize = BigEndian::Get32(&aPtr[4]);
-	}
+    }
 
 
-// ****	RdWr10 ****
+// **** RdWr10 ****
 TInt TScsiClientRdWr10Req::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     // PROTECT
     if (iProtect)
         aBuffer[1] = iProtect << 5;
 
-    __SCSIPRINT2(_L("LBA=%08x LEN=%08x"), iLogicalBlockAddress, iBlockTransferLength);
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_70,
+                 "LBA=%08x LEN=%08x", iLogicalBlockAddress, iBlockTransferLength);
     // LOGICAL BLOCK ADDRESS
     BigEndian::Put32(&aBuffer[2], iLogicalBlockAddress);
     // TRANSFER LENGTH
@@ -203,21 +211,21 @@
     return length;
     }
 
-// ****	READ (10) ****
+// **** READ (10) ****
 TInt TScsiClientRead10Req::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI READ (10)"));
-	TInt length = TScsiClientRdWr10Req::EncodeRequestL(aBuffer);
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_80,
+              "<-- SCSI READ (10)");
+    TInt length = TScsiClientRdWr10Req::EncodeRequestL(aBuffer);
     return length;
     }
 
 
-// ****	START STOP UNIT ****
+// **** START STOP UNIT ****
 TInt TScsiClientStartStopUnitReq::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("--> SCSI START STOP UNIT"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_90,
+              "--> SCSI START STOP UNIT");
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
 
     // byte 1 mask
@@ -237,11 +245,11 @@
     }
 
 
-// ****	WRITE (10) ****
+// **** WRITE (10) ****
 TInt TScsiClientWrite10Req::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI WRITE 10"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIBLOCKCMDS_91,
+              "<-- SCSI WRITE 10");
 
     TInt length = TScsiClientRdWr10Req::EncodeRequestL(aBuffer);
     return length;
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiclientreq.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiclientreq.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -20,15 +20,12 @@
 
 #include <e32base.h>
 
-#include "debug.h"
-#include "msdebug.h"
 #include "mprotocol.h"
 #include "tscsiclientreq.h"
 
 
 TInt TScsiClientReq::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
     TInt length = 0;
     switch (GetGroupCode())
         {
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiprimarycmds.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tscsiprimarycmds.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -12,7 +12,7 @@
 //
 // Description:
 // scsiprimarycmds.cpp
-// 
+//
 //
 
 /**
@@ -22,10 +22,13 @@
 
 #include <e32base.h>
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tscsiprimarycmdsTraces.h"
+#endif
+
+
 #include "msctypes.h"
-#include "debug.h"
-#include "msdebug.h"
-
 #include "mtransport.h"
 #include "mprotocol.h"
 
@@ -36,8 +39,8 @@
 // **** TEST UNIT READY ****
 TInt TScsiClientTestUnitReadyReq::EncodeRequestL(TDes8& aBuffer) const
     {
-	__MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI TEST UNIT READY"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIPRIMARYCMDS_10,
+              "<-- SCSI TEST UNIT READY");
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
     return length;
     }
@@ -46,7 +49,6 @@
 // **** REQUEST SENSE ****
 void TScsiClientRequestSenseResp::DecodeSenseInfo(const TDesC8& aPtr)
     {
-	__MSFNSLOG
     iResponseCode = static_cast<TResponseCode>(aPtr[0]);
     iSenseInfo.iSenseCode = aPtr[02];
     iSenseInfo.iAdditional = aPtr[12];
@@ -55,9 +57,9 @@
 
 
 void TScsiClientRequestSenseResp::DecodeL(const TDesC8& aPtr)
-	{
-	__MSFNSLOG
-    __SCSIPRINT(_L("--> SCSI REQUEST SENSE"));
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIPRIMARYCMDS_11,
+              "--> SCSI REQUEST SENSE");
     if (aPtr.Length() < KResponseLength)
         {
         // Handle short data.
@@ -77,13 +79,12 @@
         {
         DecodeSenseInfo(aPtr);
         }
-	}
+    }
 
 
 // **** INQUIRY ****
 void TScsiClientInquiryResp::DecodeInquiry(const TDesC8& aPtr)
     {
-	__MSFNSLOG
     iPeripheralInfo.iRemovable = (aPtr[1] & 0x80) ? ETrue : EFalse;
 
     iPeripheralInfo.iPeripheralQualifier = aPtr[0] >> 5;
@@ -103,9 +104,9 @@
 
 
 void TScsiClientInquiryResp::DecodeL(const TDesC8& aPtr)
-	{
-    __MSFNSLOG
-    __SCSIPRINT(_L("--> SCSI INQUIRY"));
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIPRIMARYCMDS_12,
+              "--> SCSI INQUIRY");
     if (aPtr.Length() < KResponseLength)
         {
         // Handle short data.
@@ -125,16 +126,16 @@
         {
         DecodeInquiry(aPtr);
         }
-	}
+    }
 
 
-// ****	PREVENT MEDIA REMOVAL ****
+// **** PREVENT MEDIA REMOVAL ****
 TInt TScsiClientPreventMediaRemovalReq::EncodeRequestL(TDes8& aBuffer) const
     {
-    __MSFNSLOG
-    __SCSIPRINT(_L("<-- SCSI PREVENT MEDIA REMOVAL"));
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_SCSI, TSCSIPRIMARYCMDS_13,
+              "<-- SCSI PREVENT MEDIA REMOVAL");
     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
-	if (iPrevent)
+    if (iPrevent)
         aBuffer[4] |= 0x01;
     return length;
     }
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tspcclientinterface.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/tspcclientinterface.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -19,8 +19,11 @@
 */
 
 #include <e32base.h>
-#include "debug.h"
-#include "msdebug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "tspcclientinterfaceTraces.h"
+#endif
 
 #include "msctypes.h"
 #include "mtransport.h"
@@ -40,7 +43,6 @@
 TSpcClientInterface::TSpcClientInterface(MTransport& aTransport)
 :   iTransport(aTransport)
     {
-	__MSFNLOG
     }
 
 /**
@@ -48,7 +50,6 @@
 */
 TSpcClientInterface::~TSpcClientInterface()
     {
-	__MSFNLOG
     }
 
 /**
@@ -63,13 +64,12 @@
 */
 TInt TSpcClientInterface::InquiryL(TPeripheralInfo& aInfo)
     {
-	__MSFNLOG
     TScsiClientInquiryReq inquiryReq;
 
     TScsiClientInquiryResp inquiryResp(aInfo);
 
     TInt err = iTransport.SendControlCmdL(&inquiryReq, &inquiryResp);
-	return err;
+    return err;
     }
 
 
@@ -85,17 +85,19 @@
 */
 TInt TSpcClientInterface::RequestSenseL(TSenseInfo& aSenseInfo)
     {
-	__MSFNLOG
     TScsiClientRequestSenseReq requestSenseReq;
     TScsiClientRequestSenseResp requestSenseResp;
 
     TInt err = iTransport.SendControlCmdL(&requestSenseReq, &requestSenseResp);
     aSenseInfo = requestSenseResp.iSenseInfo;
 
-    __SCSIPRINT4(_L("SCSI SENSE INFO Response%08x Code=%08x, Qual=%08x Add=%08x"),
-                 requestSenseResp.iResponseCode,
-                 aSenseInfo.iSenseCode, aSenseInfo.iQualifier, aSenseInfo.iAdditional);
-	return err;
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, TSPCCLIENTINTERFACE_10,
+                 "SCSI SENSE INFO Response %x Code=%x",
+                 (TUint32)requestSenseResp.iResponseCode, (TUint32)aSenseInfo.iSenseCode);
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_SCSI, TSPCCLIENTINTERFACE_11,
+                 "                Qual=%08x Add=%08x",
+                 (TUint32)aSenseInfo.iQualifier, (TUint32)aSenseInfo.iAdditional);
+    return err;
     }
 
 
@@ -109,11 +111,10 @@
 */
 TInt TSpcClientInterface::TestUnitReadyL()
     {
-	__MSFNLOG
     TScsiClientTestUnitReadyReq testUnitReadyReq;
 
     TInt err = iTransport.SendControlCmdL(&testUnitReadyReq);
-	return err;
+    return err;
     }
 
 
@@ -129,10 +130,9 @@
 */
 TInt TSpcClientInterface::PreventAllowMediumRemovalL(TBool aPrevent)
     {
-	__MSFNLOG
     TScsiClientPreventMediaRemovalReq preventAllowMediaRemovalReq(aPrevent);
     TInt err = iTransport.SendControlCmdL(&preventAllowMediaRemovalReq);
-	return err;
+    return err;
     }
 
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/shared/debug.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-// Copyright (c) 2008-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:
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#ifndef DEBUG_H
-#define DEBUG_H
-
-//#define _SCSI_DEBUG_PRINT_
-//#define _BOT_DEBUG_PRINT_
-//#define _HOST_DEBUG_PRINT_
-//#define _TESTREPORT_PRINT_
-
-#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#include <e32debug.h>
-#endif
-
-#if defined(_SCSI_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-/** Trace - format string  */
-#define __SCSIPRINT(t) {RDebug::Print(t);}
-/** Trace - format string with 1 param */
-#define __SCSIPRINT1(t,a) {RDebug::Print(t,a);}
-/** Trace - format string with 2 params */
-#define __SCSIPRINT2(t,a,b) {RDebug::Print(t,a,b);}
-/** Trace - format string with 3 params */
-#define __SCSIPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-/** Trace - format string with 4 params */
-#define __SCSIPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-/** Trace - format string with 5 params */
-#define __SCSIPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-#else
-/** NULL definition */
-#define __SCSIPRINT(t)
-/** NULL definition */
-#define __SCSIPRINT1(t,a)
-/** NULL definition */
-#define __SCSIPRINT2(t,a,b)
-/** NULL definition */
-#define __SCSIPRINT3(t,a,b,c)
-/** NULL definition */
-#define __SCSIPRINT4(t,a,b,c,d)
-/** NULL definition */
-#define __SCSIPRINT5(t,a,b,c,d,e)
-#endif
-
-
-#if defined(_BOT_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-/** Trace - format string */
-#define __BOTPRINT(t) {RDebug::Print(t);}
-/** Trace - format string with 1 param */
-#define __BOTPRINT1(t,a) {RDebug::Print(t,a);}
-/** Trace - format string with 2 params */
-#define __BOTPRINT2(t,a,b) {RDebug::Print(t,a,b);}
-/** Trace - format string with 3 params */
-#define __BOTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-/** Trace - format string with 4 params */
-#define __BOTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-/** Trace - format string with 5 params */
-#define __BOTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-#else
-/** NULL definition */
-#define __BOTPRINT(t)
-/** NULL definition */
-#define __BOTPRINT1(t,a)
-/** NULL definition */
-#define __BOTPRINT2(t,a,b)
-/** NULL definition */
-#define __BOTPRINT3(t,a,b,c)
-/** NULL definition */
-#define __BOTPRINT4(t,a,b,c,d)
-/** NULL definition */
-#define __BOTPRINT5(t,a,b,c,d,e)
-#endif
-
-
-#if defined(_HOST_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-/** Trace - format string */
-#define __HOSTPRINT(t) {RDebug::Print(t);}
-/** Trace - format string with 1 param */
-#define __HOSTPRINT1(t,a) {RDebug::Print(t,a);}
-/** Trace - format string with 2 params */
-#define __HOSTPRINT2(t,a,b) {RDebug::Print(t,a,b);}
-/** Trace - format string with 3 params */
-#define __HOSTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-/** Trace - format string with 4 params */
-#define __HOSTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-/** Trace - format string with 5 params */
-#define __HOSTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-#else
-/** NULL definition */
-#define __HOSTPRINT(t)
-/** NULL definition */
-#define __HOSTPRINT1(t,a)
-/** NULL definition */
-#define __HOSTPRINT2(t,a,b)
-/** NULL definition */
-#define __HOSTPRINT3(t,a,b,c)
-/** NULL definition */
-#define __HOSTPRINT4(t,a,b,c,d)
-/** NULL definition */
-#define __HOSTPRINT5(t,a,b,c,d,e)
-#endif
-
-
-#if defined(_TESTREPORT_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-/** Trace - format string */
-#define __TESTREPORT(t) {RDebug::Print(t);}
-/** Trace - format string with 1 param */
-#define __TESTREPORT1(t,a) {RDebug::Print(t,a);}
-/** Trace - format string with 2 params */
-#define __TESTREPORT2(t,a,b) {RDebug::Print(t,a,b);}
-/** Trace - format string with 3 params */
-#define __TESTREPORT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
-/** Trace - format string with 4 params */
-#define __TESTREPORT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
-/** Trace - format string with 5 params */
-#define __TESTREPORT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
-#else
-/** NULL definition */
-#define __TESTREPORT(t)
-/** NULL definition */
-#define __TESTREPORT1(t,a)
-/** NULL definition */
-#define __TESTREPORT2(t,a,b)
-/** NULL definition */
-#define __TESTREPORT3(t,a,b,c)
-/** NULL definition */
-#define __TESTREPORT4(t,a,b,c,d)
-/** NULL definition */
-#define __TESTREPORT5(t,a,b,c,d,e)
-#endif
-
-#endif // DEBUG_H
--- a/userlibandfileserver/fileserver/shostmassstorage/server/shared/msdebug.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-// Copyright (c) 2008-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:
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#include "msdebug.h"
-
-#ifdef MSFN_TRACE_ENABLED
-
-_LIT8(KFnMsgSIn, ">>\t%S\r\n");
-_LIT8(KFnMsgSOut,"<<\t%S\r\n");
-_LIT8(KFnMsgIn, ">>[0x%08x]\t%S\r\n");
-_LIT8(KFnMsgOut,"<<[0x%08x]\t%S\r\n");
-
-TMsLogStaticFn::TMsLogStaticFn(const TDesC8& aFunctionName)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KFnMsgSIn, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogStaticFn::~TMsLogStaticFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KFnMsgSOut, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogFn::TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer)
-:   iThisPointer(aThisPointer)
-    {
-    iFunctionName.Set(aFunctionName);
-    buf.AppendFormat(KFnMsgIn, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-
-TMsLogFn::~TMsLogFn()
-    {
-    buf.Zero();
-    buf.AppendFormat(KFnMsgOut, iThisPointer, &iFunctionName);
-    RDebug::RawPrint(buf);
-    };
-
-#endif
--- a/userlibandfileserver/fileserver/shostmassstorage/server/shared/msdebug.h	Wed Oct 20 13:58:28 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 2008-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:
-// msdebug.cpp
-// 
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#ifndef MSDEBUG_H
-#define MSDEBUG_H
-
-// #define _MSFN_DEBUG_PRINT_
-
-#if defined(_MSFN_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
-#define MSFN_TRACE_ENABLED
-#endif
-
-#ifdef MSFN_TRACE_ENABLED
-#include <e32debug.h>
-
-
-/**
-Logging function to be used with static functions. Prints the function string on
-function entry and exit.
-*/
-class TMsLogStaticFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-
-    TMsLogStaticFn(const TDesC8& aFunctionName);
-
-	~TMsLogStaticFn();
-
-protected:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-    };
-
-
-/**
-Logging function which prints the function string on function entry and exit.
-*/
-class TMsLogFn
-    {
-public:
-    static const TInt KLogBufferSize = 0xFF;
-	TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer);
-
-	~TMsLogFn();
-
-private:
-    TBuf8<KLogBufferSize> buf;
-	TPtrC8 iFunctionName;
-	void* iThisPointer;
-    };
-
-
-
-#define __MSFNLOG TMsLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this);
-#define __MSFNSLOG TMsLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__));
-#else
-#define __MSFNSLOG
-#define __MSFNLOG
-#endif
-
-#endif // MSDEBUG_H
-
-
--- a/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmsserver.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmsserver.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -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"
@@ -12,7 +12,7 @@
 //
 // Description:
 // cusbhostmsderver.cpp
-// 
+//
 //
 
 /**
@@ -27,30 +27,32 @@
 #include "usbmshostpanic.h"
 #include "cusbhostmssession.h"
 #include "cusbhostmsserver.h"
-#include "msdebug.h"
-#include "debug.h"
 #include "securitypolicy.h"
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbhostmsserverTraces.h"
+#endif
+
+
 /**
 Constructs a USB mass storage Server
 */
 CUsbHostMsServer* CUsbHostMsServer::NewLC()
-	{
-    __MSFNSLOG
-	CUsbHostMsServer* r = new (ELeave) CUsbHostMsServer();
-	CleanupStack::PushL(r);
-	r->StartL(KUsbHostMsServerName);
-	return r;
-	}
+    {
+    CUsbHostMsServer* r = new (ELeave) CUsbHostMsServer();
+    CleanupStack::PushL(r);
+    r->StartL(KUsbHostMsServerName);
+    return r;
+    }
 
 /**
 Destructor
 */
 CUsbHostMsServer::~CUsbHostMsServer()
-	{
-    __MSFNLOG
+    {
     // Intentionally left blank
-	}
+    }
 
 
 /**
@@ -58,9 +60,8 @@
 */
 CUsbHostMsServer::CUsbHostMsServer()
 :   CPolicyServer(EPriorityHigh,KUsbMsServerPolicy, EGlobalSharableSessions)
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 
 /**
@@ -72,20 +73,19 @@
 @return CSession2* A pointer to a session object to be used for the client
 */
 CSession2* CUsbHostMsServer::NewSessionL(const TVersion &aVersion, const RMessage2& /*aMessage*/) const
-	{
-    __MSFNSLOG
-	TVersion v(KUsbHostMsSrvMajorVersionNumber,
+    {
+    TVersion v(KUsbHostMsSrvMajorVersionNumber,
                KUsbHostMsSrvMinorVersionNumber,
                KUsbHostMsSrvBuildVersionNumber);
-	if (!User::QueryVersionSupported(v, aVersion))
-		User::Leave(KErrNotSupported);
+    if (!User::QueryVersionSupported(v, aVersion))
+        User::Leave(KErrNotSupported);
 
-	CUsbHostMsServer* ncThis = const_cast<CUsbHostMsServer*>(this);
+    CUsbHostMsServer* ncThis = const_cast<CUsbHostMsServer*>(this);
 
-	CUsbHostMsSession* sess = CUsbHostMsSession::NewL(*ncThis);
+    CUsbHostMsSession* sess = CUsbHostMsSession::NewL(*ncThis);
 
-	return sess;
-	}
+    return sess;
+    }
 
 
 /**
@@ -94,13 +94,13 @@
 @param aError The error that has occurred
 */
 void CUsbHostMsServer::Error(TInt aError)
-	{
-    __MSFNLOG
-	__HOSTPRINT1(_L("CUsbHostMsServer::Error [aError=%d]\n"), aError);
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSERVER_10,
+              "CUsbHostMsServer::Error [aError=%d]\n", aError);
 
-	Message().Complete(aError);
-	ReStart();
-	}
+    Message().Complete(aError);
+    ReStart();
+    }
 
 /**
 Increment the open session count (iSessionCount) by one.
@@ -108,15 +108,13 @@
 @post The number of open sessions is incremented by one
 */
 void CUsbHostMsServer::IncrementSessionCount()
-	{
-    __MSFNLOG
-	__HOSTPRINT1(_L("CUsbHostMsServer::IncrementSessionCount %d\n"), iSessionCount);
-	__ASSERT_DEBUG(iSessionCount >= 0, User::Panic(KUsbMsHostPanicCat, EUsbMsPanicIllegalIPC));
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSERVER_11,
+              "CUsbHostMsServer::IncrementSessionCount %d", iSessionCount);
+    __ASSERT_DEBUG(iSessionCount >= 0, User::Panic(KUsbMsHostPanicCat, EUsbMsPanicIllegalIPC));
 
-	++iSessionCount;
-
-	__HOSTPRINT(_L("CUsbHostMsServer::IncrementSessionCount\n"));
-	}
+    ++iSessionCount;
+    }
 
 /**
 Decrement the open session count (iSessionCount) by one.
@@ -124,12 +122,12 @@
 @post The number of open sessions is decremented by one
 */
 void CUsbHostMsServer::DecrementSessionCount()
-	{
-    __MSFNLOG
-	__HOSTPRINT1(_L("CUsbHostMsServer::DecrementSessionCount %d\n"), iSessionCount);
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSERVER_12,
+              "CUsbHostMsServer::DecrementSessionCount %d", iSessionCount);
 
-	__ASSERT_DEBUG(iSessionCount > 0, User::Panic(KUsbMsHostPanicCat, EUsbMsPanicIllegalIPC));
+    __ASSERT_DEBUG(iSessionCount > 0, User::Panic(KUsbMsHostPanicCat, EUsbMsPanicIllegalIPC));
 
-	--iSessionCount;
-	}
+    --iSessionCount;
+    }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/src/cusbhostmssession.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -20,6 +20,11 @@
 
 #include <e32base.h>
 
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbhostmssessionTraces.h"
+#endif
+
 #include "msctypes.h"
 #include "shared.h"
 #include "msgservice.h"
@@ -29,91 +34,86 @@
 #include "usbmshostpanic.h"
 #include "cusbhostmsdevicethread.h"
 #include "cusbhostmssession.h"
-#include "msdebug.h"
-#include "debug.h"
+
 
 /** Construct a Symbian OS session object.
 
-	param	aServer		Service the session will be a member of
-	param	aMessage	The message from the client.
-	return	A new CUsbHostMsSession object
+    param   aServer     Service the session will be a member of
+    param   aMessage    The message from the client.
+    return  A new CUsbHostMsSession object
  */
 CUsbHostMsSession* CUsbHostMsSession::NewL(CUsbHostMsServer& aServer)
-	{
-    __MSFNSLOG
-	CUsbHostMsSession* r = new (ELeave) CUsbHostMsSession(aServer);
-	CleanupStack::PushL(r);
-	r->ConstructL();
-	CleanupStack::Pop();
-	return r;
-	}
+    {
+    CUsbHostMsSession* r = new (ELeave) CUsbHostMsSession(aServer);
+    CleanupStack::PushL(r);
+    r->ConstructL();
+    CleanupStack::Pop();
+    return r;
+    }
 
 /**
  Constructor.
 
-	param	aServer	Service the session will be a member of
+    param   aServer Service the session will be a member of
  */
 CUsbHostMsSession::CUsbHostMsSession(CUsbHostMsServer& aServer)
-	: iUsbHostMsServer(aServer)
-	{
-    __MSFNLOG
-	}
+    : iUsbHostMsServer(aServer)
+    {
+    }
 
 
 /**
  2nd Phase Construction.
  */
 void CUsbHostMsSession::ConstructL()
-	{
-    __MSFNLOG
-	iUsbHostMsServer.IncrementSessionCount();
-    __HOSTPRINT1(_L("\tiSessionCount: %d\n"), iUsbHostMsServer.SessionCount());
-	}
+    {
+    iUsbHostMsServer.IncrementSessionCount();
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSESSION_10,
+              "iSessionCount: %d", iUsbHostMsServer.SessionCount());
+    }
 
 
 /**
  Destructor.
  */
 CUsbHostMsSession::~CUsbHostMsSession()
-	{
-    __MSFNLOG
-
-	iUsbHostMsServer.DecrementSessionCount();
-	iThread.Close();
-    __HOSTPRINT1(_L("\tClosed a session -> iSessionCount: %d\n"), iUsbHostMsServer.SessionCount());
-	}
+    {
+    iUsbHostMsServer.DecrementSessionCount();
+    iThread.Close();
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSESSION_11,
+              "Closed a session -> iSessionCount: %d",
+              iUsbHostMsServer.SessionCount());
+    }
 
 /**
  Called when a message is received from the client.
 
-	param	aMessage	Message received from the client
+    param   aMessage    Message received from the client
  */
 void CUsbHostMsSession::ServiceL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	DispatchMessageL(aMessage);
-	}
+    {
+    DispatchMessageL(aMessage);
+    }
 
 
 /**
  Handles the request (in the form of a message) received from the client
 
-	param	aMessage	The received message
+    param   aMessage    The received message
  */
 void CUsbHostMsSession::DispatchMessageL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	TInt r = KErrNone;
-	switch (aMessage.Function())
-		{
-	case EUsbHostMsRegisterInterface:
-		TRAP(r, CreateDeviceThreadL(aMessage));
-		if(r != KErrNone)
-			{
-			aMessage.Complete(r);
-			return;
-			}
-		break;
+    {
+    TInt r = KErrNone;
+    switch (aMessage.Function())
+        {
+    case EUsbHostMsRegisterInterface:
+        TRAP(r, CreateDeviceThreadL(aMessage));
+        if(r != KErrNone)
+            {
+            aMessage.Complete(r);
+            return;
+            }
+        break;
     case EUsbHostMsUnRegisterInterface:
         if(iCleanupInProgress)
             {
@@ -124,88 +124,88 @@
             {
             iCleanupInProgress = ETrue;
             }
-		break;
-	/* If it is a cleanup then we need to delete the iDeviceThread */
-	case EUsbHostMsFinalCleanup:	
-		delete iDeviceThread;
-		iDeviceThread = NULL;
-		iThread.Kill(KErrNone);
-		aMessage.Complete(KErrNone);
-		return;
-	default:
-		break;
-		}
+        break;
+    /* If it is a cleanup then we need to delete the iDeviceThread */
+    case EUsbHostMsFinalCleanup:
+        delete iDeviceThread;
+        iDeviceThread = NULL;
+        iThread.Kill(KErrNone);
+        aMessage.Complete(KErrNone);
+        return;
+    default:
+        break;
+        }
 
-	if (iDeviceThread == NULL) 
-		{
-		aMessage.Complete(KErrBadHandle);
-		return;
-		}
+    if (iDeviceThread == NULL)
+        {
+        aMessage.Complete(KErrBadHandle);
+        return;
+        }
 
-    if (iCleanupInProgress && aMessage.Function() != EUsbHostMsUnRegisterInterface) 
+    if (iCleanupInProgress && aMessage.Function() != EUsbHostMsUnRegisterInterface)
         {
         aMessage.Complete(KErrBadHandle);
         return;
         }
 
-	r = iDeviceThread->QueueMsg(aMessage);
-	if (r != KErrNone)
-		{
-		aMessage.Complete(r);
-		return;
-		}
+    r = iDeviceThread->QueueMsg(aMessage);
+    if (r != KErrNone)
+        {
+        aMessage.Complete(r);
+        return;
+        }
 
-	if (iClientStatus && *iClientStatus == KRequestPending)
-		{
-		__HOSTPRINT(_L("Signaling device thread to handle message"));
-		iThread.RequestComplete(iClientStatus, KErrNone);
-		}
-	}
+    if (iClientStatus && *iClientStatus == KRequestPending)
+        {
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSESSION_20,
+                  "Signaling device thread to handle message");
+        iThread.RequestComplete(iClientStatus, KErrNone);
+        }
+    }
 
 
 void CUsbHostMsSession::CreateDeviceThreadL(const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	THostMassStorageConfig msDeviceConfig;
-	TPtr8 ptr((TUint8*)&msDeviceConfig,sizeof(THostMassStorageConfig));
+    {
+    THostMassStorageConfig msDeviceConfig;
+    TPtr8 ptr((TUint8*)&msDeviceConfig,sizeof(THostMassStorageConfig));
 
-	aMessage.ReadL(0, ptr);
-	__HOSTPRINT1(_L("EUsbHostMsRegisterInterface Token=%d "), msDeviceConfig.iInterfaceToken);
+    aMessage.ReadL(0, ptr);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_HOST, CUSBHOSTMSSESSION_21,
+              "EUsbHostMsRegisterInterface Token=%d ", msDeviceConfig.iInterfaceToken);
 
     TBuf<32> nameBuf;
-	nameBuf.Format(_L("Host Ms Thread%8x"), msDeviceConfig.iInterfaceToken);
-	iDeviceThread = CUsbHostMsDeviceThread::NewL(*this, msDeviceConfig.iInterfaceToken);
+    nameBuf.Format(_L("Host Ms Thread%8x"), msDeviceConfig.iInterfaceToken);
+    iDeviceThread = CUsbHostMsDeviceThread::NewL(*this, msDeviceConfig.iInterfaceToken);
 
-	RHeap* h = (RHeap*)&User::Allocator();
-	TInt maxsize = h->MaxLength();	// loader heap max size = file server heap max size
-	const TUint KHeapMinSize = 2048;
+    RHeap* h = (RHeap*)&User::Allocator();
+    TInt maxsize = h->MaxLength();  // loader heap max size = file server heap max size
+    const TUint KHeapMinSize = 2048;
 
-	TInt r = iThread.Create(nameBuf, CUsbHostMsDeviceThread::Entry, KDefaultStackSize, KHeapMinSize, maxsize, iDeviceThread);
-	if(r != KErrNone)
-		{
-		delete iDeviceThread;
+    TInt r = iThread.Create(nameBuf, CUsbHostMsDeviceThread::Entry, KDefaultStackSize, KHeapMinSize, maxsize, iDeviceThread);
+    if(r != KErrNone)
+        {
+        delete iDeviceThread;
         iDeviceThread = NULL;
-		User::Leave(r);
-		}
-	iThread.SetPriority(EPriorityAbsoluteForeground);
-	TRequestStatus status;
-	iThread.Rendezvous(status);
-	iThread.Resume();
-	User::WaitForRequest(status);
-	if(status != KErrNone)
-		{
-		delete iDeviceThread;
+        User::Leave(r);
+        }
+    iThread.SetPriority(EPriorityAbsoluteForeground);
+    TRequestStatus status;
+    iThread.Rendezvous(status);
+    iThread.Resume();
+    User::WaitForRequest(status);
+    if(status != KErrNone)
+        {
+        delete iDeviceThread;
         iDeviceThread = NULL;
-		iThread.Kill(KErrNone);
-		User::Leave(status.Int());
-		}
-	}
+        iThread.Kill(KErrNone);
+        User::Leave(status.Int());
+        }
+    }
 
 
 
 void CUsbHostMsSession::MessageRequest(TRequestStatus& aStatus)
     {
-    __MSFNLOG
     iClientStatus = &aStatus;
     *iClientStatus = KRequestPending;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/traces/OstTraceDefinitions.h	Tue Nov 02 15:29:23 2010 +0000
@@ -0,0 +1,21 @@
+// Copyright (c) 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:
+
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- a/userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -34,24 +34,26 @@
 #include "mprotocol.h"
 #include "cusbifacehandler.h"
 #include "cbulkonlytransport.h"
-#include "debug.h"
-#include "msdebug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cbulkonlytransportTraces.h"
+#endif
+
 
 CBulkOnlyTransport::CBulkOnlyTransport()
-:	iBulkOutCbwTd(KCbwPacketSize),
-	iBulkDataTd(KResponsePacketSize),
-	iBulkInCswTd(KCswPacketSize)
-	{
-    __MSFNLOG
-	}
+:   iBulkOutCbwTd(KCbwPacketSize),
+    iBulkDataTd(KResponsePacketSize),
+    iBulkInCswTd(KCswPacketSize)
+    {
+    }
 
 CBulkOnlyTransport::~CBulkOnlyTransport()
-	{
-    __MSFNLOG
-	delete iUsbInterfaceHandler;
-	UnInitialiseTransport();
-	iInterface.Close();
-	}
+    {
+    delete iUsbInterfaceHandler;
+    UnInitialiseTransport();
+    iInterface.Close();
+    }
 
 /**
 Create CBulkOnlyTransport object.
@@ -61,170 +63,164 @@
 @return CBulkOnlyTransport* Pointer to the created object
 */
 CBulkOnlyTransport* CBulkOnlyTransport::NewL(TUint aInterfaceId)
-	{
-    __MSFNSLOG
-	CBulkOnlyTransport* transport = new (ELeave) CBulkOnlyTransport();
-	CleanupStack::PushL(transport);
+    {
+    CBulkOnlyTransport* transport = new (ELeave) CBulkOnlyTransport();
+    CleanupStack::PushL(transport);
     transport->ConstructL(aInterfaceId);
     CleanupStack::Pop(transport);
-	return transport;
-	}
+    return transport;
+    }
 
 
 void CBulkOnlyTransport::ConstructL(TUint aInterfaceId)
     {
-    __MSFNSLOG
-	User::LeaveIfError(iInterface.Open(aInterfaceId));
-	iUsbInterfaceHandler = CUsbInterfaceHandler::NewL(iInterface, iBulkPipeIn);
-	InitialiseTransport();
+    User::LeaveIfError(iInterface.Open(aInterfaceId));
+    iUsbInterfaceHandler = CUsbInterfaceHandler::NewL(iInterface, iBulkPipeIn);
+    InitialiseTransport();
     }
 
 
 void CBulkOnlyTransport::Resume()
-	{
-    __MSFNSLOG
-	__BOTPRINT(_L("BOT RESUME"));
- 
-	iInterface.CancelPermitSuspend();
-	}
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_10, "BOT RESUME");
+    iInterface.CancelPermitSuspend();
+    }
 
 void CBulkOnlyTransport::Suspend(TRequestStatus& aStatus)
-	{
-    __MSFNSLOG
-	__BOTPRINT(_L("BOT SUSPEND"));
-//	iInterface.PermitRemoteWakeup(ETrue);
-	iInterface.PermitSuspendAndWaitForResume(aStatus);
-	}
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_11, "BOT SUSPEND");
+//  iInterface.PermitRemoteWakeup(ETrue);
+    iInterface.PermitSuspendAndWaitForResume(aStatus);
+    }
 
 TInt CBulkOnlyTransport::InitialiseTransport()
-	{
-    __MSFNLOG
-	TInt BulkOutEpAddr;
-	TInt BulkInEpAddr;
-	const TUint8 KEpDirectionIn = 0x80;
-	const TUint8 KEpDirectionOut = 0x00;
-	const TUint8 KTransferTypeBulk = 0x02;
+    {
+    TInt BulkOutEpAddr;
+    TInt BulkInEpAddr;
+    const TUint8 KEpDirectionIn = 0x80;
+    const TUint8 KEpDirectionOut = 0x00;
+    const TUint8 KTransferTypeBulk = 0x02;
 
-	GetEndpointAddress(iInterface,0,KTransferTypeBulk,KEpDirectionOut,BulkOutEpAddr);
-	GetEndpointAddress(iInterface,0,KTransferTypeBulk,KEpDirectionIn,BulkInEpAddr);
-	iInterface.OpenPipeForEndpoint(iBulkPipeOut, BulkOutEpAddr, EFalse);
-	iInterface.OpenPipeForEndpoint(iBulkPipeIn, BulkInEpAddr, EFalse);
+    GetEndpointAddress(iInterface,0,KTransferTypeBulk,KEpDirectionOut,BulkOutEpAddr);
+    GetEndpointAddress(iInterface,0,KTransferTypeBulk,KEpDirectionIn,BulkInEpAddr);
+    iInterface.OpenPipeForEndpoint(iBulkPipeOut, BulkOutEpAddr, EFalse);
+    iInterface.OpenPipeForEndpoint(iBulkPipeIn, BulkInEpAddr, EFalse);
 
-	if (iInterface.RegisterTransferDescriptor(iBulkOutCbwTd) != KErrNone ||
-			iInterface.RegisterTransferDescriptor(iBulkDataTd) != KErrNone ||
-					iInterface.RegisterTransferDescriptor(iBulkInCswTd) != KErrNone)
+    if (iInterface.RegisterTransferDescriptor(iBulkOutCbwTd) != KErrNone ||
+            iInterface.RegisterTransferDescriptor(iBulkDataTd) != KErrNone ||
+                    iInterface.RegisterTransferDescriptor(iBulkInCswTd) != KErrNone)
         {
-		return KErrGeneral;
+        return KErrGeneral;
         }
 
-	if (iInterface.InitialiseTransferDescriptors() != KErrNone)
+    if (iInterface.InitialiseTransferDescriptors() != KErrNone)
         {
-		return KErrGeneral;
+        return KErrGeneral;
         }
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 
 void CBulkOnlyTransport::UnInitialiseTransport()
-	{
-    __MSFNLOG
-	iBulkPipeOut.Close();
-	iBulkPipeIn.Close();
-	}
+    {
+    iBulkPipeOut.Close();
+    iBulkPipeIn.Close();
+    }
+
 
 TInt CBulkOnlyTransport::GetEndpointAddress(RUsbInterface& aUsbInterface,
                                             TInt aInterfaceSetting,
                                             TUint8 aTransferType,
                                             TUint8 aDirection,
                                             TInt& aEndpointAddress)
-	{
-    __MSFNLOG
-	TUsbInterfaceDescriptor alternateInterfaceDescriptor;
+    {
+    TUsbInterfaceDescriptor alternateInterfaceDescriptor;
 
-	if (aUsbInterface.GetAlternateInterfaceDescriptor(aInterfaceSetting, alternateInterfaceDescriptor))
-		{
-		__BOTPRINT1(_L("GetEndpointAddress : <Error> Unable to get alternate interface (%x) descriptor"),aInterfaceSetting);
-		return KErrGeneral;
-		}
+    if (aUsbInterface.GetAlternateInterfaceDescriptor(aInterfaceSetting, alternateInterfaceDescriptor))
+        {
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_20,
+                  "GetEndpointAddress : <Error> Unable to get alternate interface (%x) descriptor", aInterfaceSetting);
+        return KErrGeneral;
+        }
 
-	TUsbGenericDescriptor* descriptor = alternateInterfaceDescriptor.iFirstChild;
+    TUsbGenericDescriptor* descriptor = alternateInterfaceDescriptor.iFirstChild;
 
-	while (descriptor)
-		{
-		TUsbEndpointDescriptor* endpoint = TUsbEndpointDescriptor::Cast(descriptor);
-		if (endpoint)
-			{
-			if ((endpoint->Attributes() & aTransferType) == aTransferType)
-				{
-				// Found the endpoint address
-				if ( (endpoint->EndpointAddress() & 0x80) == aDirection)
-					{
-					aEndpointAddress = endpoint->EndpointAddress();
-					__BOTPRINT(_L("GetEndpointAddress : Endpoint address found"));
-					return KErrNone;
-					}
-				}
-			}
-		descriptor = descriptor->iNextPeer;
-		}
+    while (descriptor)
+        {
+        TUsbEndpointDescriptor* endpoint = TUsbEndpointDescriptor::Cast(descriptor);
+        if (endpoint)
+            {
+            if ((endpoint->Attributes() & aTransferType) == aTransferType)
+                {
+                // Found the endpoint address
+                if ( (endpoint->EndpointAddress() & 0x80) == aDirection)
+                    {
+                    aEndpointAddress = endpoint->EndpointAddress();
+                    OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_21,
+                              "GetEndpointAddress : Endpoint address found");
+                    return KErrNone;
+                    }
+                }
+            }
+        descriptor = descriptor->iNextPeer;
+        }
 
-	// Unable to find the endpoint address
-	__BOTPRINT(_L("GetEndpointAddress : Unable to find endpoint address matching the specified attributes"));
-	return KErrNotFound;
-	}
+    // Unable to find the endpoint address
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_22,
+              "GetEndpointAddress : Unable to find endpoint address matching the specified attributes");
+    return KErrNotFound;
+    }
 
 void CBulkOnlyTransport::GetMaxLun(TLun* aMaxLun, const RMessage2& aMessage)
-	{
-    __MSFNLOG
-	iUsbInterfaceHandler->GetMaxLun(aMaxLun, aMessage);
-	}
+    {
+    iUsbInterfaceHandler->GetMaxLun(aMaxLun, aMessage);
+    }
 
 TInt CBulkOnlyTransport::Reset()
-	{
-    __MSFNLOG
-	RUsbInterface::TUsbTransferRequestDetails reqDetails;
-	_LIT8(KNullDesC8,"");
+    {
+    RUsbInterface::TUsbTransferRequestDetails reqDetails;
+    _LIT8(KNullDesC8,"");
 
-	reqDetails.iRequestType = 0x21;
-	reqDetails.iRequest = 0xFF;
-	reqDetails.iValue = 0x0000;
-	reqDetails.iIndex = 0x0000;
-	reqDetails.iFlags = 0x04;		// Short transfer OK
+    reqDetails.iRequestType = 0x21;
+    reqDetails.iRequest = 0xFF;
+    reqDetails.iValue = 0x0000;
+    reqDetails.iIndex = 0x0000;
+    reqDetails.iFlags = 0x04;       // Short transfer OK
 
-	iInterface.Ep0Transfer(reqDetails, KNullDesC8, (TDes8 &) KNullDesC8, iStatus);
-	User::WaitForRequest(iStatus);
-    __BOTPRINT1(_L("BOT RESET[%d]"), iStatus.Int());
+    iInterface.Ep0Transfer(reqDetails, KNullDesC8, (TDes8 &) KNullDesC8, iStatus);
+    User::WaitForRequest(iStatus);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_30,
+              "BOT RESET[%d]", iStatus.Int());
 
-	if (iStatus.Int() != KErrNone)
+    if (iStatus.Int() != KErrNone)
         {
-		return KErrGeneral;
+        return KErrGeneral;
         }
 
-	return KErrNone;
-	}
+    return KErrNone;
+    }
 
 void CBulkOnlyTransport::DoResetRecovery()
-	{
-    __MSFNLOG
-
-    __BOTPRINT(_L("BOT RESET RECOVERY"));
+    {
+    OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_31,
+              "BOT RESET RECOVERY");
 #ifdef MASSSTORAGE_PUBLISHER
     TMsPublisher publisher(TMsPublisher::KBotResetProperty);
 #endif
-	Reset();
-	iBulkPipeIn.ClearRemoteStall();
-	iBulkPipeOut.ClearRemoteStall();
-	}
+    Reset();
+    iBulkPipeIn.ClearRemoteStall();
+    iBulkPipeOut.ClearRemoteStall();
+    }
 
 
 void CBulkOnlyTransport::SendCbwL(const MClientCommandServiceReq* aReq,
                                   TBotCbw::TCbwDirection aDirection,
                                   TUint32 aTransferLength)
-	{
-    __MSFNLOG
-    __BOTPRINT1(_L("Cbw Tag=0x%x"), iCbwTag);
+    {
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_40,
+              "Cbw Tag=0x%x", iCbwTag);
 
-	iCbw.SetTag(iCbwTag++);
+    iCbw.SetTag(iCbwTag++);
     iCbw.SetDataTransferLength(aTransferLength);
     iCbw.SetDataTransferDirection(aDirection);
     iCbw.SetLun(iLun);
@@ -236,110 +232,115 @@
     iBulkPipeOut.Transfer(iBulkOutCbwTd, iStatus);
     User::WaitForRequest(iStatus);
 
-	TInt r = iStatus.Int();
+    TInt r = iStatus.Int();
     if (r != KErrNone)
         {
-		if (r == KErrUsbStalled)
+        if (r == KErrUsbStalled)
             {
-            __BOTPRINT(_L("Cbw: BulkOut stalled"));
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_41,
+                      "Cbw: BulkOut stalled");
             DoResetRecovery();
             }
-		__BOTPRINT1(_L("Usb transfer error %d"),r);
-		User::Leave(KErrGeneral);
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_42,
+                  "Usb transfer error %d", r);
+        User::Leave(KErrGeneral);
         }
-	}
+    }
 
 
 void CBulkOnlyTransport::ReceiveCswL()
-	{
-    __MSFNLOG
-	iBulkInCswTd.SaveData(KCswPacketSize);
-	iBulkPipeIn.Transfer(iBulkInCswTd, iStatus);
-	User::WaitForRequest(iStatus);
+    {
+    iBulkInCswTd.SaveData(KCswPacketSize);
+    iBulkPipeIn.Transfer(iBulkInCswTd, iStatus);
+    User::WaitForRequest(iStatus);
 
-	TInt r = iStatus.Int();
-	if (r != KErrNone)
+    TInt r = iStatus.Int();
+    if (r != KErrNone)
         {
-		if (r == KErrUsbStalled)
-			{
-            __BOTPRINT(_L("Csw: Clearing BulkIn stall"));
-			iBulkPipeIn.ClearRemoteStall();
-			iBulkInCswTd.SaveData(KCswPacketSize);
-			iBulkPipeIn.Transfer(iBulkInCswTd, iStatus);
-			User::WaitForRequest(iStatus);
+        if (r == KErrUsbStalled)
+            {
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_50,
+                      "Csw: Clearing BulkIn stall");
+            iBulkPipeIn.ClearRemoteStall();
+            iBulkInCswTd.SaveData(KCswPacketSize);
+            iBulkPipeIn.Transfer(iBulkInCswTd, iStatus);
+            User::WaitForRequest(iStatus);
 #ifdef MASSSTORAGE_PUBLISHER
             TMsPublisher publisher(TMsPublisher::KStallProperty);
 #endif
-			r = iStatus.Int();
-			if (r == KErrUsbStalled)
+            r = iStatus.Int();
+            if (r == KErrUsbStalled)
                 {
-				__BOTPRINT(_L("Csw: BulkIn stalled"));
-				DoResetRecovery();
+                OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_51,
+                          "Csw: BulkIn stalled");
+                DoResetRecovery();
                 }
-			}
-		// Handle other usb error and retry failures
-		if (r != KErrNone)
-			{
-			__BOTPRINT1(_L("Usb transfer error %d"), r);
-			User::Leave(KErrGeneral);
-			}
+            }
+        // Handle other usb error and retry failures
+        if (r != KErrNone)
+            {
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_52,
+                      "Usb transfer error %d", r);
+            User::Leave(KErrGeneral);
+            }
         }
 
-	TPtrC8 data = iBulkInCswTd.Buffer();
-	r = iCsw.Decode(data);
+    TPtrC8 data = iBulkInCswTd.Buffer();
+    r = iCsw.Decode(data);
     if (r != KErrNone)
         {
-        __BOTPRINT(_L("Csw: Invalid"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_53,
+                  "Csw: Invalid");
         DoResetRecovery();
         User::Leave(KErrGeneral);
         }
-	}
+    }
 
 
 TInt CBulkOnlyTransport::SendControlCmdL(const MClientCommandServiceReq* aCommand)
-	{
-    __MSFNLOG
+    {
     SendCbwL(aCommand, TBotCbw::EDataOut, 0);
     ReceiveCswL();
     return ProcessZeroTransferL();
-	}
+    }
 
 
 TInt CBulkOnlyTransport::SendControlCmdL(const MClientCommandServiceReq* aCommand,
                                          MClientCommandServiceResp* aResp)
-	{
-    __MSFNLOG
-
-	SendCbwL(aCommand, TBotCbw::EDataIn, aResp->DataLength());
+    {
+    SendCbwL(aCommand, TBotCbw::EDataIn, aResp->DataLength());
 
-	if (aResp->DataLength() > KResponsePacketSize)
+    if (aResp->DataLength() > KResponsePacketSize)
         {
-		__BOTPRINT(_L("Control command response length not supported"));
-		User::Leave(KErrGeneral);
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_60,
+                  "Control command response length not supported");
+        User::Leave(KErrGeneral);
         }
 
-	iBulkDataTd.SaveData(KResponsePacketSize);
-	iBulkPipeIn.Transfer(iBulkDataTd, iStatus);
-	User::WaitForRequest(iStatus);
-	TInt r = iStatus.Int();
-	if (r != KErrNone)
+    iBulkDataTd.SaveData(KResponsePacketSize);
+    iBulkPipeIn.Transfer(iBulkDataTd, iStatus);
+    User::WaitForRequest(iStatus);
+    TInt r = iStatus.Int();
+    if (r != KErrNone)
         {
-		if (r != KErrUsbStalled)
-			{
-			__BOTPRINT1(_L("Usb transfer error %d"),r);
-			User::Leave(KErrGeneral);
-			}
-		__BOTPRINT(_L("SendControlCmdL ClearRemoteStall"));
-		iBulkPipeIn.ClearRemoteStall();
+        if (r != KErrUsbStalled)
+            {
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_61,
+                      "Usb transfer error %d",r);
+            User::Leave(KErrGeneral);
+            }
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_62,
+                  "SendControlCmdL ClearRemoteStall");
+        iBulkPipeIn.ClearRemoteStall();
         ReceiveCswL();
-        return KErrCommandStalled;        
+        return KErrCommandStalled;
         }
-	TPtrC8 data = iBulkDataTd.Buffer();
+    TPtrC8 data = iBulkDataTd.Buffer();
 
-	ReceiveCswL();
+    ReceiveCswL();
 
     TUint32 dataReceived = 0;
-	r = ProcessInTransferL(dataReceived);
+    r = ProcessInTransferL(dataReceived);
     if (!r)
         {
         TRAP(r, aResp->DecodeL(data));
@@ -356,169 +357,174 @@
             // 1 Transcend JetFlashV30 VendorID=JetFlash ProductID=TS#GJFV30
             // (# is device size in G)
 
-            __BOTPRINT1(_L("Warning: No data received"), dataReceived);
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_63,
+                      "Warning: No data received");
             }
         }
-	return r;
-	}
+    return r;
+    }
 
 
 TInt CBulkOnlyTransport::SendDataRxCmdL(const MClientCommandServiceReq* aCommand,
                                         TDes8& aCopyBuf,
                                         TInt& aLen)
-	{
-    __MSFNLOG
-
-	TInt r = KErrNone;
-	SendCbwL(aCommand, TBotCbw::EDataIn, aLen);
+    {
+    TInt r = KErrNone;
+    SendCbwL(aCommand, TBotCbw::EDataIn, aLen);
 
     // store initial length as data is appended to the buffer
     TInt startPos = aCopyBuf.Length();
 
-	TInt len = aLen;
+    TInt len = aLen;
 
-	while (len)
+    while (len)
         {
-		if(len > KResponsePacketSize)
-			iBulkDataTd.SaveData(KResponsePacketSize);
-		else
-			iBulkDataTd.SaveData(len);
-		iBulkPipeIn.Transfer(iBulkDataTd, iStatus);
-		User::WaitForRequest(iStatus);
+        if(len > KResponsePacketSize)
+            iBulkDataTd.SaveData(KResponsePacketSize);
+        else
+            iBulkDataTd.SaveData(len);
+        iBulkPipeIn.Transfer(iBulkDataTd, iStatus);
+        User::WaitForRequest(iStatus);
 
-		r = iStatus.Int();
-		if (r != KErrNone)
-			{
-			if (r == KErrUsbStalled)
-				{
-				__BOTPRINT(_L("SendDataRxCmdL ClearRemoteStall"));
-				iBulkPipeIn.ClearRemoteStall();
+        r = iStatus.Int();
+        if (r != KErrNone)
+            {
+            if (r == KErrUsbStalled)
+                {
+                OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_70,
+                          "SendDataRxCmdL ClearRemoteStall");
+                iBulkPipeIn.ClearRemoteStall();
 #ifdef MASSSTORAGE_PUBLISHER
                 TMsPublisher publisher(TMsPublisher::KStallProperty);
 #endif
-				break;
-				}
-			DoResetRecovery();
-			__BOTPRINT1(_L("Usb transfer error %d"),r);
-			User::Leave(KErrGeneral);
-			}
+                break;
+                }
+            DoResetRecovery();
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_71,
+                      "Usb transfer error %d", r);
+            User::Leave(KErrGeneral);
+            }
 
-		TPtrC8 data = iBulkDataTd.Buffer();
-		aCopyBuf.Append(data.Ptr(), data.Length());
-		if(len > KResponsePacketSize)
-			len -= KResponsePacketSize;
-		else
-			len = 0;
+        TPtrC8 data = iBulkDataTd.Buffer();
+        aCopyBuf.Append(data.Ptr(), data.Length());
+        if(len > KResponsePacketSize)
+            len -= KResponsePacketSize;
+        else
+            len = 0;
         }
 
-	ReceiveCswL();
-	TUint32 lenReceived = 0;
+    ReceiveCswL();
+    TUint32 lenReceived = 0;
 
-	r = ProcessInTransferL(lenReceived);
+    r = ProcessInTransferL(lenReceived);
     aLen = lenReceived;
     aCopyBuf.SetLength(startPos + lenReceived);
 
-	return r;
-	}
+    return r;
+    }
 
 TInt CBulkOnlyTransport::SendDataTxCmdL(const MClientCommandServiceReq* aCommand,
                                         TDesC8& aData,
                                         TUint aPos,
                                         TInt& aLen)
-	{
-    __MSFNLOG
-   	TInt r = KErrNone;
+    {
+    TInt r = KErrNone;
+
+    SendCbwL(aCommand, TBotCbw::EDataOut, aLen);
 
-   	SendCbwL(aCommand, TBotCbw::EDataOut, aLen);
-
-   	TInt len = aLen;
-   	TInt length = 0;
-   	iBulkDataTd.SetZlpStatus(RUsbTransferDescriptor::ESuppressZlp);
-   	while (len)
+    TInt len = aLen;
+    TInt length = 0;
+    iBulkDataTd.SetZlpStatus(RUsbTransferDescriptor::ESuppressZlp);
+    while (len)
         {
-   		TPtr8 senddata = iBulkDataTd.WritableBuffer();
-		senddata.Append(aData.Ptr() + length + aPos, len > KResponsePacketSize? KResponsePacketSize : len);
+        TPtr8 senddata = iBulkDataTd.WritableBuffer();
+        senddata.Append(aData.Ptr() + length + aPos, len > KResponsePacketSize? KResponsePacketSize : len);
 
-   		iBulkDataTd.SaveData(senddata.Length());
-   		iBulkPipeOut.Transfer(iBulkDataTd, iStatus);
-   		User::WaitForRequest(iStatus);
+        iBulkDataTd.SaveData(senddata.Length());
+        iBulkPipeOut.Transfer(iBulkDataTd, iStatus);
+        User::WaitForRequest(iStatus);
 
-		if (iStatus.Int() != KErrNone)
-   			{
-   			if (iStatus.Int() == KErrUsbStalled)
-   				{
-				__BOTPRINT(_L("SendDataTxCmdL ClearRemoteStall"));
-   				iBulkPipeOut.ClearRemoteStall();
+        if (iStatus.Int() != KErrNone)
+            {
+            if (iStatus.Int() == KErrUsbStalled)
+                {
+                OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_80,
+                          "SendDataTxCmdL ClearRemoteStall");
+                iBulkPipeOut.ClearRemoteStall();
 #ifdef MASSSTORAGE_PUBLISHER
                 TMsPublisher publisher(TMsPublisher::KStallProperty);
 #endif
-   				break;
-   				}
-   			DoResetRecovery();
-			__BOTPRINT1(_L("Usb transfer error %d"), r);
-   			User::Leave(KErrGeneral);
-   			}
+                break;
+                }
+            DoResetRecovery();
+            OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_81,
+                      "Usb transfer error %d", r);
+            User::Leave(KErrGeneral);
+            }
 
-		if(len > KResponsePacketSize)
-			{
-   			len -= KResponsePacketSize;
-   			length += KResponsePacketSize;
-			}
-		else
-			{
-   			length += len;
-   			len = 0;
-			}
+        if(len > KResponsePacketSize)
+            {
+            len -= KResponsePacketSize;
+            length += KResponsePacketSize;
+            }
+        else
+            {
+            length += len;
+            len = 0;
+            }
         }
 
-   	ReceiveCswL();
+    ReceiveCswL();
 
-   	TUint32 lenSent = 0;
-   	r = ProcessOutTransferL(lenSent);
-   	aLen = lenSent;
+    TUint32 lenSent = 0;
+    r = ProcessOutTransferL(lenSent);
+    aLen = lenSent;
 
-   	return r;
-	}
+    return r;
+    }
 
 
 TInt CBulkOnlyTransport::ProcessZeroTransferL()
     {
-    __MSFNLOG
     // process 13 cases
 
-	__ASSERT_DEBUG(iCbw.iDirection == TBotCbw::EDataOut, User::Invariant());
-	__ASSERT_DEBUG(iCbw.iDataTransferLength == 0, User::Invariant());
+    __ASSERT_DEBUG(iCbw.iDirection == TBotCbw::EDataOut, User::Invariant());
+    __ASSERT_DEBUG(iCbw.iDataTransferLength == 0, User::Invariant());
 
     // Hn - Host expects no data transfers
     if (!iCsw.IsValidCsw(iCbw.iTag))
         {
-        __BOTPRINT(_L("BOT CSW Invalid"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_90,
+                  "BOT CSW Invalid");
         DoResetRecovery();
-		User::Leave(KErrGeneral);
+        User::Leave(KErrGeneral);
         }
     if (!iCsw.IsMeaningfulCsw(iCbw.iDataTransferLength))
         {
-        __BOTPRINT(_L("BOT CSW not meaningful"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_91,
+                  "BOT CSW not meaningful");
         DoResetRecovery();
-		User::Leave(KErrGeneral);
+        User::Leave(KErrGeneral);
         }
 
     if (iCsw.iStatus == TBotCsw::EPhaseError)
         {
         // Case (2) or (3)
-        __BOTPRINT(_L("BOT Phase Error"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_92,
+                  "BOT Phase Error");
         // Reset Recovery
         DoResetRecovery();
-		User::Leave(KErrGeneral);
+        User::Leave(KErrGeneral);
         }
 
     if (iCsw.iDataResidue != 0)
         {
         // should not happen
-        __BOTPRINT(_L("BOT Residue is invalid!"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_93,
+                  "BOT Residue is invalid!");
         // Reset Recovery
         DoResetRecovery();
-		User::Leave(KErrGeneral);
+        User::Leave(KErrGeneral);
         }
 
     // all ok if here
@@ -528,22 +534,23 @@
 
 TInt CBulkOnlyTransport::ProcessInTransferL(TUint32& aDataReceived)
     {
-    __MSFNLOG
     aDataReceived = 0;
     // process 13 cases
 
-	__ASSERT_DEBUG(iCbw.iDirection == TBotCbw::EDataIn, User::Invariant());
+    __ASSERT_DEBUG(iCbw.iDirection == TBotCbw::EDataIn, User::Invariant());
 
     // Hi - Host expects to receive data from the device
     if (!iCsw.IsValidCsw(iCbw.iTag))
         {
-        __BOTPRINT(_L("BOT CSW Invalid"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_100,
+                  "BOT CSW Invalid");
         DoResetRecovery();
         User::Leave(KErrGeneral);
         }
     if (!iCsw.IsMeaningfulCsw(iCbw.iDataTransferLength))
         {
-        __BOTPRINT(_L("BOT CSW not meaningful"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_101,
+                  "BOT CSW not meaningful");
         DoResetRecovery();
         User::Leave(KErrGeneral);
         }
@@ -551,11 +558,12 @@
 
     if (iCsw.iStatus == TBotCsw::EPhaseError)
         {
-        __BOTPRINT(_L("BOT Phase Error"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_102,
+                  "BOT Phase Error");
         // Case (7) or (8)
         // Reset Recovery
         DoResetRecovery();
-		User::Leave(KErrGeneral);
+        User::Leave(KErrGeneral);
         }
 
     // all ok if here
@@ -567,33 +575,35 @@
 
 TInt CBulkOnlyTransport::ProcessOutTransferL(TUint32& aDataReceived)
     {
-    __MSFNLOG
     aDataReceived = 0;
     // process 13 cases
 
-	__ASSERT_DEBUG(iCbw.iDirection == TBotCbw::EDataOut, User::Invariant());
+    __ASSERT_DEBUG(iCbw.iDirection == TBotCbw::EDataOut, User::Invariant());
 
     // Ho - Host expects to send data to the device
     if (!iCsw.IsValidCsw(iCbw.iTag))
         {
-        __BOTPRINT(_L("BOT CSW Invalid"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_110,
+                  "BOT CSW Invalid");
         DoResetRecovery();
         User::Leave(KErrGeneral);
         }
     if (!iCsw.IsMeaningfulCsw(iCbw.iDataTransferLength))
         {
-        __BOTPRINT(_L("BOT CSW not meaningful"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_111,
+                  "BOT CSW not meaningful");
         DoResetRecovery();
         User::Leave(KErrGeneral);
         }
 
     if (iCsw.iStatus == TBotCsw::EPhaseError)
         {
-        __BOTPRINT(_L("BOT Phase Error"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_112,
+                  "BOT Phase Error");
         // Case (10) or (13)
         // Reset Recovery
         DoResetRecovery();
-		User::Leave(KErrGeneral);
+        User::Leave(KErrGeneral);
         }
 
     // all ok if here
@@ -605,9 +615,9 @@
 
 void CBulkOnlyTransport::SetLun(TLun aLun)
     {
-    __MSFNLOG
     iLun = aLun;
-    __BOTPRINT1(_L("CBulkOnlyTransport::SetLun(%d)"), aLun)
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_120,
+              "CBulkOnlyTransport::SetLun(%d)", aLun);
     }
 
 
@@ -620,23 +630,23 @@
 */
 void TBotCbw::EncodeL(TPtr8 &aBuffer, const MClientCommandServiceReq* aCommand) const
     {
-    __MSFNSLOG
-	aBuffer.SetLength(KCbwLength);
+    aBuffer.SetLength(KCbwLength);
 
-	TPtr8 commandBlock = aBuffer.MidTPtr(TBotCbw::KCbwCbOffset);
+    TPtr8 commandBlock = aBuffer.MidTPtr(TBotCbw::KCbwCbOffset);
 
-	aBuffer.FillZ();
+    aBuffer.FillZ();
 
     TInt cbLength = aCommand->EncodeRequestL(commandBlock);
 
-	TUint8* ptr = (TUint8 *) aBuffer.Ptr();
+    TUint8* ptr = (TUint8 *) aBuffer.Ptr();
     LittleEndian::Put32(&ptr[KCbwSignatureOffset], 0x43425355);
     LittleEndian::Put32(&ptr[KCbwTagOffset], iTag);
     LittleEndian::Put32(&ptr[KCbwDataTransferLengthOffset], iDataTransferLength);
     aBuffer[KCbwFlagOffset] = (iDirection == EDataOut) ? 0x00 : 0x80;
     aBuffer[KCbwLunOffset] = iLun;
     aBuffer[KCbwCbLengthOffset] = cbLength;
-	__BOTPRINT1(_L("BOT TBotCbw::Encode Lun=%d"), iLun);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_121,
+              "BOT TBotCbw::Encode Lun=%d", iLun);
     }
 
 
@@ -647,10 +657,10 @@
 */
 TInt TBotCsw::Decode(const TDesC8& aPtr)
     {
-    __MSFNLOG
     if (aPtr.Length() != KCswLength)
         {
-		__BOTPRINT1(_L("Invalid CSW length %d"), aPtr.Length());
+        OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_130,
+                  "Invalid CSW length %d", aPtr.Length());
         return KErrGeneral;
         }
 
@@ -660,7 +670,8 @@
 
     TInt status = aPtr[KCswStatusOffset];
     iStatus = static_cast<TCswStatus>(status);
-    __BOTPRINT1(_L("BOT CSW Status = %d"), iStatus);
+    OstTrace1(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_131,
+              "BOT CSW Status = %d", iStatus);
     return KErrNone;
     }
 
@@ -675,7 +686,6 @@
 */
 TBool TBotCsw::IsValidCsw(TUint32 aTag) const
     {
-    __MSFNSLOG
     if (iSignature != 0x53425355)
         {
         return EFalse;
@@ -698,7 +708,6 @@
 */
 TBool TBotCsw::IsMeaningfulCsw(TUint32 aTransferLength) const
     {
-    __MSFNSLOG
     if (iStatus != EPhaseError)
         {
         if (iDataResidue > aTransferLength)
@@ -712,13 +721,14 @@
 #ifdef MASSSTORAGE_PUBLISHER
 TMsPublisher::TMsPublisher(TPropertyKeys aKey)
     {
-	RProperty prop;
+    RProperty prop;
 
     const TUid KUidHostMassStorageCategory = {KMyUid};
 
-	TInt ret = prop.Attach(KUidHostMassStorageCategory, aKey);
-    __BOTPRINT2(_L("Property Key[%d] attach ret=%d"), aKey, ret);
-	if (ret == KErrNone)
+    TInt ret = prop.Attach(KUidHostMassStorageCategory, aKey);
+    OstTraceExt2(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_140,
+                 "Property Key[%d] attach ret=%d", aKey, ret);
+    if (ret == KErrNone)
         {
         TInt flag;
         ret = prop.Get(KUidHostMassStorageCategory, aKey, flag);
@@ -727,8 +737,10 @@
             flag++;
             ret = prop.Set(KUidHostMassStorageCategory, aKey, flag);
             }
-	    __BOTPRINT3(_L("Property Set[%d] ret=%d Counter=%d"), aKey, ret, flag);
-		prop.Close();
+        OstTraceExt3(TRACE_SHOSTMASSSTORAGE_BOT, CBULKONLYTRANSPORT_141,
+                     "Property Set[%d] ret=%d Counter=%d",
+                     aKey, ret, flag);
+        prop.Close();
         }
     }
 
--- a/userlibandfileserver/fileserver/shostmassstorage/server/transport/cusbifacehandler.cpp	Wed Oct 20 13:58:28 2010 +0100
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/transport/cusbifacehandler.cpp	Tue Nov 02 15:29:23 2010 +0000
@@ -30,98 +30,99 @@
 #include "mprotocol.h"
 #include "cusbifacehandler.h"
 #include "cbulkonlytransport.h"
-#include "debug.h"
-#include "msdebug.h"
+
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cusbifacehandlerTraces.h"
+#endif
 
 CUsbInterfaceHandler* CUsbInterfaceHandler::NewL(RUsbInterface &aInterface, RUsbPipe& aBulkPipeIn)
-	{
-	return new (ELeave) CUsbInterfaceHandler(aInterface, aBulkPipeIn);
-	}
+    {
+    return new (ELeave) CUsbInterfaceHandler(aInterface, aBulkPipeIn);
+    }
 
 CUsbInterfaceHandler::CUsbInterfaceHandler(RUsbInterface &aInterface, RUsbPipe& aBulkPipeIn)
-:	CActive(EPriorityStandard),
-	iInterface(aInterface),
+:   CActive(EPriorityStandard),
+    iInterface(aInterface),
     iBulkPipeIn(aBulkPipeIn)
-	{
-    __MSFNLOG
-	CActiveScheduler::Add(this);
-	}
+    {
+    CActiveScheduler::Add(this);
+    }
 
 CUsbInterfaceHandler::~CUsbInterfaceHandler()
-	{
-    __MSFNLOG
-	if (iState != ENone)
-		{
-		iState = ENone;
-		iBotGetMaxLun.Complete(KErrCancel);
-		Cancel();
-		}
-	}
+    {
+    if (iState != ENone)
+        {
+        iState = ENone;
+        iBotGetMaxLun.Complete(KErrCancel);
+        Cancel();
+        }
+    }
 
 /**
 Cancellation of outstanding request
 */
 void CUsbInterfaceHandler::DoCancel()
-	{
-    __MSFNLOG
-	}
+    {
+    }
 
 /**
 Completion of USB transport request.
 */
 void CUsbInterfaceHandler::RunL()
     {
-    __MSFNLOG
-	TInt error = iStatus.Int();
+    TInt error = iStatus.Int();
 
-	if (error == KErrUsbStalled && iState == EGetMaxLun)
+    if (error == KErrUsbStalled && iState == EGetMaxLun)
         {
         // Devices that do not support multiple LUNs may STALL this command
-		__BOTPRINT(_L("...KErrUsbStalled"));		
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CUSBIFACEHANLDER_10,
+                  "...KErrUsbStalled");
         iBulkPipeIn.ClearRemoteStall();
-        error = KErrNone;     
+        error = KErrNone;
         }
 
-	else if (error == KErrNone)
+    else if (error == KErrNone)
         {
-		__BOTPRINT(_L("...KErrNone"));
-		if (iState == EGetMaxLun)
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CUSBIFACEHANLDER_11,
+                  "...KErrNone");
+        if (iState == EGetMaxLun)
             {
-			__BOTPRINT(_L("...sending GetMaxLun response"));
-			*ipGetMaxLun = iBuffer[0];
+            OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CUSBIFACEHANLDER_12,
+                      "...sending GetMaxLun response");
+            *ipGetMaxLun = iBuffer[0];
             }
         }
     else
         {
-        __BOTPRINT(_L("...completeing with KErrGeneral"));
+        OstTrace0(TRACE_SHOSTMASSSTORAGE_BOT, CUSBIFACEHANLDER_13,
+                  "...completeing with KErrGeneral");
         error = KErrGeneral;
         }
 
     iState = ENone;
-	iBotGetMaxLun.Complete(error);
+    iBotGetMaxLun.Complete(error);
     }
 
 
 void CUsbInterfaceHandler::GetMaxLun(TLun* aMaxLun, const RMessage2& aMessage)
-	{
-    __MSFNLOG
-
-	/* Send the Get max lun command in the ep0 */
-	RUsbInterface::TUsbTransferRequestDetails reqDetails;
-	_LIT8(KNullDesC8,"");
-	iBotGetMaxLun = aMessage;
-	iState = EGetMaxLun;
-	ipGetMaxLun = aMaxLun;
+    {
+    /* Send the Get max lun command in the ep0 */
+    RUsbInterface::TUsbTransferRequestDetails reqDetails;
+    _LIT8(KNullDesC8,"");
+    iBotGetMaxLun = aMessage;
+    iState = EGetMaxLun;
+    ipGetMaxLun = aMaxLun;
     *ipGetMaxLun = 0;       // default response is MaxLUN=0
 
-	reqDetails.iRequestType = 0xA1;
-	reqDetails.iRequest = 0xFE;
-	reqDetails.iValue = 0x0000;
-	reqDetails.iIndex = 0x0000;
-	reqDetails.iFlags = 0x04;		// Short transfer OK
+    reqDetails.iRequestType = 0xA1;
+    reqDetails.iRequest = 0xFE;
+    reqDetails.iValue = 0x0000;
+    reqDetails.iIndex = 0x0000;
+    reqDetails.iFlags = 0x04;       // Short transfer OK
 
-	iBuffer.SetLength(1);
-	iInterface.Ep0Transfer(reqDetails, KNullDesC8, iBuffer, iStatus);
-	SetActive();
-	}
+    iBuffer.SetLength(1);
+    iInterface.Ep0Transfer(reqDetails, KNullDesC8, iBuffer, iStatus);
+    SetActive();
+    }