sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // f32\sfile\sf_ext.cpp sl@0: // sl@0: // sl@0: sl@0: sl@0: #include "sf_std.h" sl@0: sl@0: typedef CProxyDriveFactory*(*TExtensionNew)(); sl@0: typedef CExtProxyDriveFactory*(*TProxyDriveNew)(); sl@0: sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: Initialises drive extension count to zero. sl@0: */ sl@0: TDriveExtInfo::TDriveExtInfo(){iCount=0;} sl@0: sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: Note that the class is intended only as an abstract base for other classes. sl@0: sl@0: @panic FSERV 51 if the supplied CMountCB pointer is NULL. sl@0: */ sl@0: CProxyDrive::CProxyDrive(CMountCB* aMount) sl@0: :iMount(aMount) sl@0: { sl@0: // __ASSERT_DEBUG(iMount!=NULL,Fault(EProxyDriveConstruction)); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Destructor. sl@0: sl@0: Frees resources before destruction of the object. sl@0: */ sl@0: CProxyDrive::~CProxyDrive() sl@0: { sl@0: sl@0: } sl@0: sl@0: sl@0: /** sl@0: An interface with which control commands can be passed to sl@0: the appropriate driver layer. sl@0: sl@0: This base implementation performs no operations. sl@0: sl@0: @param aMessage Message to be sent. sl@0: @param aCommand Command type. sl@0: @param aParam1 1st parameter of control message. sl@0: @param aParam2 2nd parameter of control message. sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt CProxyDrive::ControlIO(const RMessagePtr2& /*aMessage*/,TInt /*aCommand*/,TAny* /*aParam1*/,TAny* /*aParam2*/) sl@0: // sl@0: // General purpose function for use by specific file systems and extensions sl@0: // sl@0: { sl@0: return(KErrNone); sl@0: } sl@0: sl@0: /** sl@0: General purpose read function for use by specific file systems and extensions. sl@0: sl@0: This base implementation performs no operations. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aTrg to read the data from. sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt CProxyDrive::Read(TInt64 /*aPos*/,TInt /*aLength*/,const TAny* /*aTrg*/,TInt /*aThreadHandle*/,TInt /*aOffset*/, TInt /*aFlags*/) sl@0: { sl@0: return(KErrNone); sl@0: } sl@0: sl@0: /** sl@0: General purpose write function for use by specific file systems and extensions. sl@0: sl@0: This base implementation performs no operations. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aLength The length of the write. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aSrc to write the data to. sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt CProxyDrive::Write(TInt64 /*aPos*/,TInt /*aLength*/,const TAny* /*aSrc*/,TInt /*aThreadHandle*/,TInt /*aOffset*/, TInt /*aFlags*/) sl@0: { sl@0: return(KErrNone); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Issue a notification that a physical delete has occurred. sl@0: For example a cluster or partition has been freed. sl@0: sl@0: This base implementation performs no operations. sl@0: sl@0: @param aPos The position of the data which is being deleted. sl@0: @param aLength The length of the data which is being deleted. sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt CProxyDrive::DeleteNotify(TInt64 /*aPos*/, TInt /*aLength*/) sl@0: { sl@0: return(KErrNone); sl@0: } sl@0: sl@0: /** sl@0: An interface with which information can be retrieved about disk errors. sl@0: sl@0: This base implementation performs no operations. sl@0: sl@0: @param aErrorInfo Reference to a descriptor containing disk error information. sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt CProxyDrive::GetLastErrorInfo(TDes8& /*aErrorInfo*/) sl@0: { sl@0: return(KErrNotSupported); sl@0: } sl@0: sl@0: EXPORT_C TInt CProxyDrive::GetLocalDrive(TBusLocalDrive*& aLocDrv) sl@0: { sl@0: return (GetInterface(EGetLocalDrive, (TAny*&)aLocDrv, (TAny*)this)); // this GetInterface does the dirty work for you... sl@0: } sl@0: sl@0: EXPORT_C TInt CProxyDrive::Finalise(TBool aIsFinalised) sl@0: { sl@0: TAny* dummyInterface; sl@0: return (GetInterface(EFinalised, dummyInterface, (TAny*)aIsFinalised)); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Called to get a Proxy drive interface. sl@0: sl@0: @param aInterfaceId Interface identifier of the interface to be retrieved. sl@0: @param aInterface Address of variable that retrieves the specified interface. sl@0: @param aInput Data required for the instantiation of the interface. sl@0: sl@0: This base implementation performs no operations. sl@0: sl@0: @return KErrNotSupported sl@0: */ sl@0: EXPORT_C TInt CProxyDrive::GetInterface(TInt /*aInterfaceId*/,TAny*& /*aInterface*/,TAny* /*aInput*/) sl@0: { sl@0: return(KErrNotSupported); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Constructor. sl@0: */ sl@0: EXPORT_C CLocDrvMountCB::CLocDrvMountCB() {} sl@0: sl@0: sl@0: /** sl@0: Destructor. sl@0: sl@0: Frees assigned Proxy drive before destruction of the object. sl@0: */ sl@0: EXPORT_C CLocDrvMountCB::~CLocDrvMountCB() sl@0: { sl@0: __PRINT1(_L("CLocDrvMountCB::~CLocDrvMountCB() 0x%x"),this); sl@0: if(iProxyDrive && !LocalDrives::IsProxyDrive(Drive().DriveNumber()) && LocalDrives::IsValidDriveMapping(Drive().DriveNumber())) sl@0: delete(iProxyDrive); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Creates and initialises the local drive. sl@0: sl@0: @param aLocDrv The local drive to be created sl@0: sl@0: @return System wide error code. sl@0: */ sl@0: EXPORT_C TInt CLocDrvMountCB::CreateLocalDrive(TBusLocalDrive& aLocDrv) sl@0: { sl@0: __PRINT(_L("CLocDrvMountCB::CreateLocalDrive()")); sl@0: if(iProxyDrive!=NULL) sl@0: return(KErrNone); sl@0: TInt r; sl@0: CProxyDrive* pConcrete=CLocalProxyDrive::New(this,aLocDrv); sl@0: if(pConcrete==NULL) sl@0: { sl@0: r=KErrNoMemory; sl@0: } sl@0: else sl@0: { sl@0: // if failure then pConcrete will be deleted by CreateProxyDriveL() sl@0: TRAP(r,iProxyDrive=CreateProxyDriveL(pConcrete,this)); sl@0: } sl@0: if(r==KErrNone) sl@0: r=InitLocalDrive(); sl@0: __PRINT1(_L("CreateLocalDrive r=%d"),r); sl@0: return(r); sl@0: } sl@0: sl@0: EXPORT_C TInt CLocDrvMountCB::CreateDrive(TInt aDriveNumber) sl@0: /** Create drive sl@0: Ascertain if the drive is mapped to a local drive or a proxy drive, and create the drive sl@0: as appropriate sl@0: @param aDriveNumer drive number sl@0: @return KErrNone on success sl@0: KErrArgument is the drive is not mapped to a proxy or a local drive or if the number sl@0: is invalid sl@0: */ sl@0: { sl@0: // dunno why we are using TInts instead of TUints here sl@0: __PRINT(_L("CLocDrvMountCB::CreateLocalDrive()")); sl@0: sl@0: if (aDriveNumber<0 || aDriveNumber>=KMaxDrives) return KErrArgument; sl@0: TInt r = KErrNone; sl@0: TInt aDriveLocal = LocalDrives::DriveNumberToLocalDriveNumber(aDriveNumber); sl@0: if (aDriveLocal == KDriveInvalid) return KErrArgument; sl@0: if (aDriveLocal < KMaxLocalDrives) sl@0: { sl@0: return CreateLocalDrive(LocalDrives::GetLocalDrive(aDriveNumber)); // drive is really local sl@0: } sl@0: else sl@0: { sl@0: CExtProxyDrive* pProxyDrive = LocalDrives::GetProxyDrive(aDriveNumber); sl@0: __ASSERT_ALWAYS(pProxyDrive != NULL,User::Panic(_L("CreateDrive - pProxyDrive == NULL"), -999)); sl@0: sl@0: iProxyDrive = CreateProxyDriveL(pProxyDrive, this); sl@0: __ASSERT_ALWAYS(iProxyDrive != NULL,User::Panic(_L("CreateDrive - CreateProxyDrive returned NULL"), -999)); sl@0: sl@0: r = InitLocalDrive(); sl@0: } sl@0: sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Initialise the local drive sl@0: sl@0: @panic FSERV 52 if initialise when no local drive exists. sl@0: sl@0: @return system wide error code sl@0: */ sl@0: EXPORT_C TInt CLocDrvMountCB::InitLocalDrive() sl@0: { sl@0: __ASSERT_ALWAYS(iProxyDrive!=NULL,Fault(ELocDrvInitLocalDrive)); sl@0: iProxyDrive->SetMount(this); sl@0: return(iProxyDrive->Initialise()); sl@0: } sl@0: sl@0: /** sl@0: Dismount the local drive sl@0: sl@0: @panic FSERV 53 if dismount when no local drive exists. sl@0: */ sl@0: EXPORT_C void CLocDrvMountCB::DismountedLocalDrive() sl@0: { sl@0: __ASSERT_ALWAYS(iProxyDrive!=NULL,Fault(ELocDrvDismountedLocalDrive)); sl@0: iProxyDrive->Dismounted(); sl@0: iProxyDrive->SetMount(NULL); sl@0: } sl@0: sl@0: sl@0: /** sl@0: static constructor. sl@0: sl@0: Instatiates a CLocalProxyDrive objects with the given arguments. sl@0: sl@0: @param aMount The mount control block sl@0: @param aLocDrv The local drive. sl@0: sl@0: @return pointer to instantiated CLocalProxyDrive object. sl@0: */ sl@0: CLocalProxyDrive* CLocalProxyDrive::New(CMountCB* aMount,TBusLocalDrive& aLocDrv) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveNew, EF32TraceUidProxyDrive, sl@0: aMount, aMount->DriveNumber()); sl@0: sl@0: CLocalProxyDrive* proxyDrive = new CLocalProxyDrive(aMount,aLocDrv); sl@0: sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveNewRet, EF32TraceUidProxyDrive, proxyDrive); sl@0: return proxyDrive; sl@0: } sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: @param aMount The mount control block. sl@0: @param aLocDrv The local drive. sl@0: */ sl@0: CLocalProxyDrive::CLocalProxyDrive(CMountCB* aMount,TBusLocalDrive& aLocDrv) sl@0: :CProxyDrive(aMount),iLocDrv(aLocDrv) sl@0: { sl@0: __PRINT(_L("CLocalProxyDrive::CLocalProxyDrive()")); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Initialise the connected drive. sl@0: sl@0: This implementation performs no operations. sl@0: sl@0: @return KErrNone. sl@0: */ sl@0: TInt CLocalProxyDrive::Initialise() sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveInitialise, EF32TraceUidProxyDrive, this); sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveInitialiseRet, EF32TraceUidProxyDrive, KErrNone); sl@0: sl@0: return(KErrNone); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Ensures any cached data is flushed before unmounting drive. sl@0: sl@0: This implementation performs no operations. sl@0: sl@0: @return KErrNone. sl@0: */ sl@0: TInt CLocalProxyDrive::Dismounted() sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDismounted, EF32TraceUidProxyDrive, this); sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDismountedRet, EF32TraceUidProxyDrive, KErrNone); sl@0: sl@0: return(KErrNone); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Increase the size of the connected drive by the specified length (in bytes). sl@0: sl@0: @param aLength The length/size (in bytes) by which the drive is to be increased. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Enlarge(TInt aLength) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveEnlarge, EF32TraceUidProxyDrive, this, aLength); sl@0: sl@0: TInt r = iLocDrv.Enlarge(aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveEnlargeRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Reduce the size of the connected drive by removing the specified length sl@0: (in bytes) starting at the specified position. sl@0: Refer to relevant media driver documentation for implementation/restriction sl@0: notes. sl@0: sl@0: @param aPos The start position of area to be removed. sl@0: @param aLength The length of the data which is being removed. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::ReduceSize(TInt aPos, TInt aLength) sl@0: { sl@0: TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveReduceSize, EF32TraceUidProxyDrive, this, aPos, aLength); sl@0: sl@0: TInt r = iLocDrv.ReduceSize(aPos,aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveReduceSizeRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Read from the connected drive, and pass flags to driver. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aTrg to read the data from. sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset, TInt aFlags) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead1, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, aOffset, aFlags); sl@0: sl@0: TInt r = iLocDrv.Read(aPos,aLength,aTrg,aThreadHandle,aOffset,aFlags); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead1Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: Read from the connected drive. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aTrg to read the data from. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead2, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, anOffset); sl@0: sl@0: TInt r = iLocDrv.Read(aPos,aLength,aTrg,aThreadHandle,anOffset); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead2Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: Read from the connected drive. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Read(TInt64 aPos,TInt aLength,TDes8& aTrg) sl@0: { sl@0: TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead3, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, &aTrg); sl@0: sl@0: TInt r = iLocDrv.Read(aPos,aLength,aTrg); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveRead3Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Write to the connected drive and pass flags to driver. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aLength The length of the write. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aSrc to write the data to. sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite1, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, aOffset, aFlags); sl@0: sl@0: TInt r = iLocDrv.Write(aPos,aLength,aSrc,aThreadHandle,aOffset,aFlags); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite1Ret, EF32TraceUidProxyDrive, r); sl@0: sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Write to the connected drive. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aLength The length of the write. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aSrc to write the data to. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite2, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, anOffset); sl@0: sl@0: TInt r = iLocDrv.Write(aPos,aLength,aSrc,aThreadHandle,anOffset); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite2Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Write to the connected drive. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Write(TInt64 aPos,const TDesC8& aSrc) sl@0: { sl@0: TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite3, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aSrc.Length(), &aSrc); sl@0: sl@0: TInt r = iLocDrv.Write(aPos,aSrc); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveWrite3Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Get the connected drive's capabilities information. sl@0: sl@0: @param anInfo A descriptor of the connected drives capabilities. sl@0: sl@0: @return system wide error code sl@0: */ sl@0: TInt CLocalProxyDrive::Caps(TDes8& anInfo) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveCaps, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iLocDrv.Caps(anInfo); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveCapsRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Format the connected drive. sl@0: sl@0: @param anInfo Device specific format information. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Format(TFormatInfo& anInfo) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat1, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iLocDrv.Format(anInfo); sl@0: sl@0: TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat1Ret, EF32TraceUidProxyDrive, sl@0: r, anInfo.iFormatIsCurrent, anInfo.i512ByteSectorsFormatted, anInfo.iMaxBytesPerFormat); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Format the connected drive. sl@0: sl@0: @param aPos The position of the data which is being formatted. sl@0: @param aLength The length of the data which is being formatted. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Format(TInt64 aPos,TInt aLength) sl@0: { sl@0: TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat2, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength); sl@0: sl@0: TInt r = iLocDrv.Format(aPos,aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveFormat2Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Set the mount information on the local drive. sl@0: sl@0: @param aMountInfo Information passed down to the media driver. The meaning of this information depends on the media driver. sl@0: @param aMountInfoThreadHandle Message thread handle number. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle) sl@0: { sl@0: TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveSetMountInfo, EF32TraceUidProxyDrive, this, aMountInfo, aMountInfoThreadHandle); sl@0: sl@0: TInt r = iLocDrv.SetMountInfo(aMountInfo,aMountInfoThreadHandle); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveSetMountInfoRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Forces a remount on the local drive sl@0: sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::ForceRemount(TUint aFlags) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveForceRemount, EF32TraceUidProxyDrive, this, aFlags); sl@0: sl@0: TInt r = iLocDrv.ForceRemount(aFlags); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveForceRemountRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: An interface with which control commands can be passed to sl@0: the appropriate driver layer. sl@0: sl@0: @param aMessage Message to be sent. sl@0: @param aCommand Command type. sl@0: @param aParam1 1st parameter of control message. sl@0: @param aParam2 2nd parameter of control message. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::ControlIO(const RMessagePtr2& /*aMessage*/,TInt aCommand,TAny* aParam1,TAny* aParam2) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveControlIO, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iLocDrv.ControlIO(aCommand,aParam1,aParam2); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveControlIORet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Unlocks a password-enabled device. sl@0: sl@0: @param aPassword A descriptor containing the existing password. sl@0: @param aStorePassword If ETrue, the password is added to the password store. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Unlock(TMediaPassword &aPassword, TBool aStorePassword) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveUnlock, EF32TraceUidProxyDrive, this, aStorePassword); sl@0: sl@0: TInt r = iLocDrv.Unlock(aPassword,aStorePassword); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveUnlockRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Locks a password-enabled device with the new password. sl@0: sl@0: @param aOldPassword A descriptor containing the existing password. sl@0: @param aNewPassword A descriptor containing the new password. sl@0: @param aStorePassword If ETrue, the password is added to the password store. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveLock, EF32TraceUidProxyDrive, this, aStorePassword); sl@0: sl@0: TInt r = iLocDrv.SetPassword(aOldPassword,aNewPassword,aStorePassword); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveLockRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Clears a password from a device - controller sets password to null. sl@0: sl@0: @param aPassword A descriptor containing the password. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::Clear(TMediaPassword &aPassword) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveClear, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iLocDrv.Clear(aPassword); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveClearRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: Forcibly unlock a password-enabled drive. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::ErasePassword() sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveErasePassword, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iLocDrv.ErasePassword(); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveErasePasswordRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: Notify the media driver that an area of the partition has been deleted. sl@0: Used by some media drivers (e.g. NAND flash) for garbage collection. sl@0: sl@0: @param aPos The position of the data which is being deleted. sl@0: @param aLength The length of the data which is being deleted. sl@0: sl@0: @return System wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::DeleteNotify(TInt64 aPos, TInt aLength) sl@0: { sl@0: TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDeleteNotify, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength); sl@0: sl@0: TInt r = iLocDrv.DeleteNotify(aPos, aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveDeleteNotifyRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Retrieve disk error information. sl@0: sl@0: @param aErrorInfo Reference to a descriptor containing disk error information. sl@0: sl@0: @return System wide error code. sl@0: */ sl@0: TInt CLocalProxyDrive::GetLastErrorInfo(TDes8 &aErrorInfo) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetLastErrorInfo, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iLocDrv.GetLastErrorInfo(aErrorInfo); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetLastErrorInfoRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: TInt CLocalProxyDrive::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput) sl@0: { sl@0: TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetInterface, EF32TraceUidProxyDrive, sl@0: this, aInterfaceId, aInput); sl@0: sl@0: TInt r; sl@0: switch(aInterfaceId) sl@0: { sl@0: case EGetLocalDrive: sl@0: __ASSERT_ALWAYS((CProxyDrive*)aInput==this,Fault(ELocDrvInvalidLocalDrive)); sl@0: (TBusLocalDrive*&)aInterface=&iLocDrv; sl@0: r = KErrNone; sl@0: break; sl@0: sl@0: case ELocalBufferSupport: sl@0: aInterface = NULL; sl@0: r = KErrNone; sl@0: break; sl@0: sl@0: default: sl@0: r= CProxyDrive::GetInterface(aInterfaceId,aInterface,aInput); sl@0: } sl@0: sl@0: TRACERET2(UTF::EBorder, UTraceModuleProxyDrive::ECLocalProxyDriveGetInterfaceRet, EF32TraceUidProxyDrive, r, aInterface); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: @panic FSERV 54 if the supplied CMountCB pointer is NULL. sl@0: */ sl@0: EXPORT_C CBaseExtProxyDrive::CBaseExtProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount) sl@0: :CProxyDrive(aMount),iProxy(aProxyDrive) sl@0: { sl@0: __ASSERT_DEBUG(iProxy!=NULL,Fault(EBaseExtConstruction)); sl@0: } sl@0: sl@0: /** sl@0: Destructor. sl@0: sl@0: Frees resources before destruction of the object. sl@0: */ sl@0: EXPORT_C CBaseExtProxyDrive::~CBaseExtProxyDrive() sl@0: { sl@0: delete(iProxy); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Initialise the proxy drive. sl@0: sl@0: This implementation performs no operations. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Initialise() sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveInitialise, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->Initialise(); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveInitialiseRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Calls Dismounted() on the proxy drive. sl@0: sl@0: @return KErrNone. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Dismounted() sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDismounted, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->Dismounted(); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDismountedRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: Increase the size of the proxy drive by the specified length (in bytes). sl@0: sl@0: @param aLength The length (in bytes) of which the drive is to be increased by. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Enlarge(TInt aLength) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveEnlarge, EF32TraceUidProxyDrive, this, aLength); sl@0: sl@0: TInt r = iProxy->Enlarge(aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveEnlargeRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Reduce the size of the proxy drive by removing the specified length sl@0: (in bytes) starting at the specified position. sl@0: Refer to relevant media driver documentation for implementation/restriction sl@0: notes. sl@0: sl@0: @param aPos The start position of area to be removed. sl@0: @param aLength The length/size (in bytes) by which the drive is to be reduced. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::ReduceSize(TInt aPos, TInt aLength) sl@0: { sl@0: TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveReduceSize, EF32TraceUidProxyDrive, this, aPos, aLength); sl@0: sl@0: TInt r = iProxy->ReduceSize(aPos,aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveReduceSizeRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Read from the proxy drive, and pass flags to driver. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aTrg to read the data from. sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead1, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, aOffset, aFlags); sl@0: sl@0: TInt r = iProxy->Read(aPos,aLength,aTrg,aThreadHandle,aOffset,aFlags); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead1Ret, EF32TraceUidProxyDrive, r); sl@0: sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Read from the proxy drive. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aTrg to read the data from. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead2, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aTrg, threadId, anOffset); sl@0: sl@0: TInt r = iProxy->Read(aPos,aLength,aTrg,aThreadHandle,anOffset); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead2Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Read from the proxy drive. sl@0: sl@0: @param aPos The address from where the read begins. sl@0: @param aLength The length of the read. sl@0: @param aTrg A descriptor of the memory buffer from which to read. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Read(TInt64 aPos,TInt aLength,TDes8& aTrg) sl@0: { sl@0: TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead3, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, &aTrg); sl@0: sl@0: TInt r = iProxy->Read(aPos,aLength,aTrg); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveRead3Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Write to the proxy drive and pass flags to driver. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aLength The length of the write. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aSrc to write the data to. sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE8(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite1, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, aOffset, aFlags); sl@0: sl@0: TInt r = iProxy->Write(aPos,aLength,aSrc,aThreadHandle,aOffset,aFlags); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite1Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Write to the proxy drive. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aLength The length of the write. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: @param aThreadHandle The handle-number representing the drive thread. sl@0: @param aOffset Offset into aSrc to write the data to. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset) sl@0: { sl@0: TRACETHREADIDH(aThreadHandle); sl@0: TRACE7(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite2, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength, aSrc, threadId, anOffset); sl@0: sl@0: TInt r = iProxy->Write(aPos,aLength,aSrc,aThreadHandle,anOffset); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite2Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Write to the proxy drive. sl@0: sl@0: @param aPos The address from where the write begins. sl@0: @param aSrc A descriptor of the memory buffer from which to write. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Write(TInt64 aPos,const TDesC8& aSrc) sl@0: { sl@0: TRACE5(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite3, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aSrc.Length(), &aSrc); sl@0: sl@0: TInt r = iProxy->Write(aPos,aSrc); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveWrite3Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Get the proxy drive's capabilities information. sl@0: sl@0: @param anInfo A descriptor of the connected drives capabilities. sl@0: sl@0: @return system wide error code sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Caps(TDes8& anInfo) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveCaps, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->Caps(anInfo); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveCapsRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Format the connected drive. sl@0: sl@0: @param anInfo Device specific format information. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Format(TFormatInfo& anInfo) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat1, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->Format(anInfo); sl@0: sl@0: TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat1Ret, EF32TraceUidProxyDrive, sl@0: r, anInfo.iFormatIsCurrent, anInfo.i512ByteSectorsFormatted, anInfo.iMaxBytesPerFormat); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Format the proxy drive. sl@0: sl@0: @param aPos The position of the data which is being formatted. sl@0: @param aLength The length of the data which is being formatted. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Format(TInt64 aPos,TInt aLength) sl@0: { sl@0: TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat2, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength); sl@0: sl@0: TInt r = iProxy->Format(aPos,aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveFormat2Ret, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Set the mount information on the proxy drive. sl@0: sl@0: @param aMountInfo Information passed down to the media driver. The meaning of this information depends on the media driver. sl@0: @param aMountInfoThreadHandle Message thread handle number. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle) sl@0: { sl@0: TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveSetMountInfo, EF32TraceUidProxyDrive, this, aMountInfo, aMountInfoThreadHandle); sl@0: sl@0: TInt r = iProxy->SetMountInfo(aMountInfo,aMountInfoThreadHandle); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveSetMountInfoRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Forces a remount on the proxy drive sl@0: sl@0: @param aFlags Flags to be passed into the driver. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::ForceRemount(TUint aFlags) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveForceRemount, EF32TraceUidProxyDrive, this, aFlags); sl@0: sl@0: TInt r = iProxy->ForceRemount(aFlags); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveForceRemountRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Unlocks a password-enabled proxy drive. sl@0: sl@0: @param aPassword A descriptor containing the existing password. sl@0: @param aStorePassword If ETrue, the password is added to the password store. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Unlock(TMediaPassword &aPassword, TBool aStorePassword) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveUnlock, EF32TraceUidProxyDrive, this, aStorePassword); sl@0: sl@0: TInt r = iProxy->Unlock(aPassword,aStorePassword); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveUnlockRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Locks a password-enabled proxy drive with the new password. sl@0: sl@0: @param aOldPassword A descriptor containing the existing password. sl@0: @param aNewPassword A descriptor containing the new password. sl@0: @param aStorePassword If ETrue, the password is added to the password store. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword) sl@0: { sl@0: TRACE2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveLock, EF32TraceUidProxyDrive, this, aStorePassword); sl@0: sl@0: TInt r = iProxy->Lock(aOldPassword,aNewPassword,aStorePassword); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveLockRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Clears a password from a proxy drive - controller sets password to null. sl@0: sl@0: @param aPassword A descriptor containing the password. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::Clear(TMediaPassword &aPassword) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveClear, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->Clear(aPassword); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveClearRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: Forcibly unlock a password-enabled proxy drive. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::ErasePassword() sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveErasePassword, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->ErasePassword(); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveErasePasswordRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: /** sl@0: An interface with which control commands can be passed to sl@0: the appropriate driver layer. sl@0: sl@0: @param aMessage Message to be sent. sl@0: @param aCommand Command type. sl@0: @param aParam1 1st parameter of control message. sl@0: @param aParam2 2nd parameter of control message. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveControlIO, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->ControlIO(aMessage,aCommand,aParam1,aParam2); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveControlIORet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Initialise the provided interface extension. sl@0: sl@0: @param aInterfaceId Interface identifier of the interface to be retrieved. sl@0: @param aInterface Address of variable that retrieves the specified interface. sl@0: @param aInput Data required for the instantiation of the interface. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput) sl@0: { sl@0: TRACE3(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetInterface, EF32TraceUidProxyDrive, sl@0: this, aInterfaceId, aInput); sl@0: sl@0: TInt r; sl@0: if (aInterfaceId==EGetLocalDrive) sl@0: { sl@0: r = iProxy->GetLocalDrive((TBusLocalDrive*&)aInterface); // iProxy is of type CLocalProxyDrive, so OK to reenter sl@0: } sl@0: else sl@0: r = CProxyDrive::GetInterface(aInterfaceId,aInterface,aInput); sl@0: sl@0: TRACERET2(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetInterfaceRet, EF32TraceUidProxyDrive, r, aInterface); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Retrieve proxy drive disk error information. sl@0: sl@0: @param aErrorInfo Reference to a descriptor containing disk error information. sl@0: sl@0: @return System wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::GetLastErrorInfo(TDes8 &aErrorInfo) sl@0: { sl@0: TRACE1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetLastErrorInfo, EF32TraceUidProxyDrive, this); sl@0: sl@0: TInt r = iProxy->GetLastErrorInfo(aErrorInfo); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveGetLastErrorInfoRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Issue a notification that a physical delete has occurred. sl@0: For example a cluster or partition has been freed. sl@0: sl@0: @param aPos The position of the data which is being deleted. sl@0: @param aLength The length of the data which is being deleted. sl@0: sl@0: @return System wide error code. sl@0: */ sl@0: EXPORT_C TInt CBaseExtProxyDrive::DeleteNotify(TInt64 aPos, TInt aLength) sl@0: { sl@0: TRACE4(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDeleteNotify, EF32TraceUidProxyDrive, sl@0: this, I64LOW(aPos), I64HIGH(aPos), aLength); sl@0: sl@0: TInt r = iProxy->DeleteNotify(aPos, aLength); sl@0: sl@0: TRACERET1(UTF::EBorder, UTraceModuleProxyDrive::ECBaseExtProxyDriveDeleteNotifyRet, EF32TraceUidProxyDrive, r); sl@0: return r; sl@0: } sl@0: sl@0: sl@0: /** sl@0: Constructor. sl@0: */ sl@0: EXPORT_C CProxyDriveFactory::CProxyDriveFactory() sl@0: {} sl@0: sl@0: sl@0: /** sl@0: Remove the Proxy driver factory. sl@0: sl@0: This implementation performs no operations. sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt CProxyDriveFactory::Remove() sl@0: { sl@0: return(KErrNone); sl@0: } sl@0: sl@0: GLDEF_C CExtProxyDriveFactory* GetProxyDriveFactory(const TDesC& aName) sl@0: // sl@0: // Lookup an extension by name. sl@0: // sl@0: { sl@0: sl@0: TInt h=0; sl@0: TInt r=ProxyDrives->FindByName(h,aName); sl@0: if (r!=KErrNone) sl@0: return(NULL); sl@0: return((CExtProxyDriveFactory*)ProxyDrives->At(h)); sl@0: } sl@0: sl@0: sl@0: // construct a extension proxy drive device sl@0: EXPORT_C CExtProxyDriveFactory::CExtProxyDriveFactory() sl@0: { sl@0: } sl@0: sl@0: sl@0: EXPORT_C TInt CExtProxyDriveFactory::Remove() sl@0: { sl@0: return KErrNone; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CExtProxyDriveFactory::AsyncEnumerate() sl@0: { sl@0: } sl@0: sl@0: sl@0: /** sl@0: Create a proxy drive using the local proxy drive passed in sl@0: and any extensions that have been added to the drive. sl@0: sl@0: @param aConcreteDrive local proxy drive sl@0: @param aMount local proxy drive mount control block sl@0: sl@0: @return pointer to instantiated CProxyDrive object. sl@0: */ sl@0: EXPORT_C CProxyDrive* CreateProxyDriveL(CProxyDrive* aConcreteDrive,CMountCB* aMount) sl@0: { sl@0: __PRINT(_L("CreateProxyDriveL()")); sl@0: __ASSERT_DEBUG(aMount!=NULL,Fault(ECreateProxyDriveL)); sl@0: TDrive& drive=TheDrives[aMount->Drive().DriveNumber()]; sl@0: if(drive.ExtInfo().iCount==0) sl@0: return(aConcreteDrive); sl@0: sl@0: TBool extSupported = drive.FSys().IsExtensionSupported(); sl@0: TRACE1(UTF::EBorder, UTraceModuleFileSys::ECFileSystemIsExtensionSupported, EF32TraceUidProxyDrive, extSupported); sl@0: if(!extSupported) sl@0: { sl@0: delete(aConcreteDrive); sl@0: User::Leave(KErrAccessDenied); sl@0: } sl@0: CProxyDrive* pOrig=aConcreteDrive; sl@0: CProxyDrive* pFinal=NULL; sl@0: __ASSERT_DEBUG(drive.ExtInfo().iCount<=KMaxExtensionCount,Fault(EExtensionInfoCount2)); sl@0: for(TInt i=0;iName()); sl@0: __PRINT1(_L("extension is primary = %d"),drive.ExtInfo().iInfo[i].iIsPrimary); sl@0: TRAPD(r,pFinal=drive.ExtInfo().iInfo[i].iFactory->NewProxyDriveL(pOrig,aMount)); sl@0: if(r!=KErrNone) sl@0: { sl@0: delete(pOrig); sl@0: User::Leave(r); sl@0: } sl@0: pOrig=pFinal; sl@0: } sl@0: return(pOrig); sl@0: } sl@0: sl@0: /** sl@0: Lookup a proxy drive extension by name. sl@0: sl@0: @param aName name of extension to be found sl@0: sl@0: @return system wide error code sl@0: */ sl@0: CProxyDriveFactory* GetExtension(const TDesC& aName) sl@0: { sl@0: sl@0: TInt h=0; sl@0: TInt r=Extensions->FindByName(h,aName); sl@0: if (r!=KErrNone) sl@0: return(NULL); sl@0: return((CProxyDriveFactory*)Extensions->At(h)); sl@0: } sl@0: sl@0: sl@0: // construct a extension proxy drive sl@0: EXPORT_C CExtProxyDrive::CExtProxyDrive(CMountCB* aMount,CExtProxyDriveFactory* aDevice) sl@0: : CProxyDrive(aMount), sl@0: iFactory(aDevice) sl@0: { sl@0: } sl@0: sl@0: // delete a extension proxy drive sl@0: EXPORT_C CExtProxyDrive::~CExtProxyDrive() sl@0: { sl@0: if(iMediaChangeNotifier) sl@0: { sl@0: delete iMediaChangeNotifier; sl@0: } sl@0: } sl@0: sl@0: sl@0: EXPORT_C TInt CExtProxyDrive::NotifyChange(TDes8 &/*aChanged*/, TRequestStatus* /*aStatus*/) sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: EXPORT_C void CExtProxyDrive::NotifyChangeCancel() sl@0: { sl@0: } sl@0: sl@0: EXPORT_C TInt CExtProxyDrive::SetInfo(const RMessage2& /*aMsg*/, TAny* /*aMessageParam2*/, TAny* /*aMessageParam3*/) sl@0: { sl@0: return KErrNone; sl@0: } sl@0: sl@0: /** sl@0: Initialise the provided interface extension. sl@0: sl@0: @param aInterfaceId Interface identifier of the interface to be retrieved. sl@0: @param aInterface Address of variable that retrieves the specified interface. sl@0: @param aInput Data required for the instantiation of the interface. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: EXPORT_C TInt CExtProxyDrive::GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput) sl@0: { sl@0: return(CProxyDrive::GetInterface(aInterfaceId,aInterface,aInput)); sl@0: } sl@0: sl@0: TInt CExtProxyDrive::SetupMediaChange() sl@0: { sl@0: if(iMediaChangeNotifier) sl@0: { sl@0: TRAPD(err, iMediaChangeNotifier->RequestL()); sl@0: return err; sl@0: } sl@0: sl@0: TRAPD(err, iMediaChangeNotifier = CExtNotifyMediaChange::NewL(this)); sl@0: sl@0: return(err == KErrNotSupported ? KErrNone : err); sl@0: } sl@0: sl@0: TInt TFsAddExtension::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Add an extension sl@0: // sl@0: { sl@0: __PRINT(_L("TFsAddExtension::DoRequestL(CFsRequest* aRequest)")); sl@0: sl@0: RLibrary lib; sl@0: // Get library handle sl@0: lib.SetHandle(aRequest->Message().Int0()); sl@0: if (lib.Type()[1]!=TUid::Uid(KFileSystemUidValue)) sl@0: return KErrNotSupported; sl@0: sl@0: TExtensionNew e=(TExtensionNew)lib.Lookup(1); sl@0: if (!e) sl@0: return KErrCorrupt; sl@0: CProxyDriveFactory* pP=(*e)(); sl@0: if(!pP) sl@0: return KErrNoMemory; sl@0: TInt r=pP->Install(); sl@0: __PRINT1TEMP(_L("InstallExtension %S"),pP->Name()); sl@0: if (r==KErrNone) sl@0: { sl@0: __PRINT(_L("TRAP(r,Extensions->AddL(pP,ETrue))")); sl@0: TRAP(r,Extensions->AddL(pP,ETrue)) sl@0: __PRINT1TEMP(_L("r == %d"), r); sl@0: if(r!=KErrNone) sl@0: pP->Remove(); sl@0: } sl@0: __PRINT1TEMP(_L("r == %d"), r); sl@0: if (r==KErrNone) sl@0: pP->SetLibrary(lib); sl@0: else sl@0: pP->Close(); sl@0: return(r); sl@0: } sl@0: sl@0: sl@0: TInt TFsAddExtension::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: TSecurityPolicy policy(RProcess().SecureId(), ECapabilityTCB); sl@0: if (!policy.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Add File System Extension"))) sl@0: return KErrPermissionDenied; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt TFsAddProxyDrive::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Load a proxy drive sl@0: // sl@0: { sl@0: __PRINT(_L("TFsAddProxyDrive::DoRequestL(CFsRequest* aRequest)")); sl@0: sl@0: RLibrary lib; sl@0: // Get library handle sl@0: lib.SetHandle(aRequest->Message().Int0()); sl@0: if (lib.Type()[1]!=TUid::Uid(KFileSystemUidValue)) sl@0: return KErrNotSupported; sl@0: sl@0: TProxyDriveNew e=(TProxyDriveNew)lib.Lookup(1); sl@0: if (!e) sl@0: return KErrCorrupt; sl@0: CExtProxyDriveFactory* pP=(*e)(); sl@0: if(!pP) sl@0: return KErrNoMemory; sl@0: TInt r=pP->Install(); sl@0: __PRINT1TEMP(_L("Install Proxy Drive %S"),pP->Name()); sl@0: if (r==KErrNone) sl@0: { sl@0: __PRINT(_L("TRAP(r,ProxyDrives->AddL(pP,ETrue))")); sl@0: TRAP(r,ProxyDrives->AddL(pP,ETrue)) sl@0: __PRINT1TEMP(_L("r == %d"), r); sl@0: if(r!=KErrNone) sl@0: pP->Remove(); sl@0: } sl@0: __PRINT1TEMP(_L("r == %d"), r); sl@0: if (r==KErrNone) sl@0: pP->SetLibrary(lib); sl@0: else sl@0: pP->Close(); sl@0: return(r); sl@0: } sl@0: sl@0: sl@0: TInt TFsAddProxyDrive::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: TSecurityPolicy policy(RProcess().SecureId(), ECapabilityTCB); sl@0: if (!policy.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Add File System Proxy Drive"))) sl@0: return KErrPermissionDenied; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt TFsMountExtension::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Mount an extension sl@0: // sl@0: { sl@0: TFullName name; sl@0: aRequest->ReadL(KMsgPtr0,name); sl@0: CProxyDriveFactory* pE=GetExtension(name); sl@0: if (pE==NULL) sl@0: return(KErrNotFound); sl@0: return(aRequest->Drive()->MountExtension(pE,EFalse)); sl@0: } sl@0: sl@0: TInt TFsMountExtension::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: TInt r=ValidateDrive(aRequest->Message().Int1(),aRequest); sl@0: if(r!=KErrNone) sl@0: return(r); sl@0: if(aRequest->Drive()->IsSubsted()) sl@0: return(KErrNotSupported); sl@0: return(r); sl@0: } sl@0: sl@0: sl@0: TInt TFsDismountExtension::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Dismount extension sl@0: // sl@0: { sl@0: TFullName name; sl@0: aRequest->ReadL(KMsgPtr0,name); sl@0: CProxyDriveFactory* pE=GetExtension(name); sl@0: if (pE==NULL) sl@0: return(KErrNotFound); sl@0: return(aRequest->Drive()->DismountExtension(pE,EFalse)); sl@0: } sl@0: sl@0: sl@0: TInt TFsDismountExtension::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: if (!KCapFsDismountExtension.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Dismount File Extension"))) sl@0: return KErrPermissionDenied; sl@0: TInt r=ValidateDrive(aRequest->Message().Int1(),aRequest); sl@0: if(r!=KErrNone) sl@0: return(r); sl@0: if(aRequest->Drive()->IsSubsted()) sl@0: return(KErrNotSupported); sl@0: return(r); sl@0: } sl@0: sl@0: TInt TFsRemoveExtension::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Remove an extension sl@0: // sl@0: { sl@0: TFullName name; sl@0: aRequest->ReadL(KMsgPtr0,name); sl@0: CProxyDriveFactory* pE=GetExtension(name); sl@0: if (pE==NULL) sl@0: return(KErrNotFound); sl@0: TInt r=pE->Remove(); sl@0: if (r!=KErrNone) sl@0: return(r); sl@0: RLibrary lib=pE->Library(); sl@0: pE->Close(); sl@0: lib.Close(); sl@0: return(KErrNone); sl@0: } sl@0: sl@0: sl@0: TInt TFsRemoveExtension::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: if (!KCapFsRemoveExtension.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Remove File Extension"))) sl@0: return KErrPermissionDenied; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt TFsRemoveProxyDrive::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Remove a proxy drive sl@0: // sl@0: { sl@0: TFullName name; sl@0: aRequest->ReadL(KMsgPtr0,name); sl@0: sl@0: CExtProxyDriveFactory* pD=GetProxyDriveFactory(name); sl@0: // are there any mounted drives using this extension? sl@0: if (LocalDrives::IsProxyDriveInUse(pD)) return KErrInUse; sl@0: if (pD==NULL) sl@0: return(KErrNotFound); sl@0: TInt r=pD->Remove(); sl@0: if (r!=KErrNone) sl@0: return(r); sl@0: RLibrary lib=pD->Library(); sl@0: pD->Close(); sl@0: lib.Close(); sl@0: sl@0: return(KErrNone); sl@0: } sl@0: sl@0: sl@0: TInt TFsRemoveProxyDrive::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: if (!KCapFsRemoveProxyDrive.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Remove Proxy Drive"))) sl@0: return KErrPermissionDenied; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt TFsExtensionName::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Return the name of an extension for a given drive and extension chain position sl@0: // sl@0: { sl@0: TFullName name; sl@0: TInt r=aRequest->Drive()->ExtensionName(name,aRequest->Message().Int2()); sl@0: if(r==KErrNone) sl@0: aRequest->WriteL(KMsgPtr0,name); sl@0: return(r); sl@0: } sl@0: sl@0: TInt TFsExtensionName::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: TInt r=ValidateDrive(aRequest->Message().Int1(),aRequest); sl@0: if(r!=KErrNone) sl@0: return(r); sl@0: if(aRequest->Drive()->IsSubsted()) sl@0: return(KErrNotSupported); sl@0: return(r); sl@0: } sl@0: sl@0: TInt TFsDismountProxyDrive::DoRequestL(CFsRequest* aRequest) sl@0: // sl@0: // Dismount a proxy extension sl@0: // sl@0: { sl@0: sl@0: __PRINT(_L("TFsDismountProxyDrive::DoRequestL")); sl@0: sl@0: return aRequest->Drive()->DismountProxyDrive(); sl@0: } sl@0: sl@0: sl@0: TInt TFsDismountProxyDrive::Initialise(CFsRequest* aRequest) sl@0: // sl@0: // sl@0: // sl@0: { sl@0: if (!KCapFsDismountProxyDrive.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Dismount Proxy Drive"))) sl@0: return KErrPermissionDenied; sl@0: sl@0: TInt r=ValidateDrive(aRequest->Message().Int0(),aRequest); sl@0: if(r!=KErrNone) sl@0: return(r); sl@0: sl@0: return KErrNone; sl@0: } sl@0: