First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Definitions for this file system extension
22 #ifndef WIN_DRIVE_EXTENSION_H
23 #define WIN_DRIVE_EXTENSION_H
25 #include "win_media.h"
27 //-----------------------------------------------------------------------------
30 This class represents the File System extension (.fxt module) that intercepts media driver operations and
31 deals with them on windows filesystem level.
33 class CWinDrvProxyDrive : public CBaseExtProxyDrive
36 static CWinDrvProxyDrive* NewL(CProxyDrive* aProxyDrive, CMountCB* aMount);
39 CWinDrvProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount);
40 virtual ~CWinDrvProxyDrive();
42 //-- overrides from the base class
44 virtual TInt Initialise();
45 virtual TInt Dismounted();
47 virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags);
48 virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset);
49 virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
51 virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags);
52 virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset);
53 virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
55 virtual TInt Caps(TDes8& anInfo);
57 virtual TInt Format(TFormatInfo& anInfo);
58 virtual TInt Format(TInt64 aPos,TInt aLength);
60 /* -------- virtual base class API --------------
61 virtual TInt Enlarge(TInt aLength);
62 virtual TInt ReduceSize(TInt aPos, TInt aLength);
64 # virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags);
65 # virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset);
66 # virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
68 # virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags);
69 # virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset);
70 # virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
72 # virtual TInt Caps(TDes8& anInfo);
73 #virtual TInt Format(TFormatInfo& anInfo);
74 #virtual TInt Format(TInt64 aPos,TInt aLength);
75 virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle);
76 virtual TInt ForceRemount(TUint aFlags=0);
77 virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword);
78 virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword);
79 virtual TInt Clear(TMediaPassword &aPassword);
80 virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2);
81 virtual TInt ErasePassword();
82 virtual TInt GetLastErrorInfo(TDes8& aErrorInfo);
83 virtual TInt DeleteNotify(TInt64 aPos, TInt aLength);
86 virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);
90 CMountCB* iMount; ///< pointer to the owning mount
91 CProxyDrive* iProxyDrive; ///< pointer to the chain of the proxies to the native media driver
92 CMediaBase* ipMedia; ///< pointer to the base "media" object that implements this extension't IO operations
94 RBuf8 iScratchBuf; ///< scratch buffer for non-local read/write operations
97 //-----------------------------------------------------------------------------
100 This Proxy drive factory class
102 class CWinDrvProxyDriveFactory : public CProxyDriveFactory
105 CWinDrvProxyDriveFactory();
106 virtual TInt Install();
107 virtual CProxyDrive* NewProxyDriveL(CProxyDrive* aProxy,CMountCB* aMount);
111 #endif //WIN_DRIVE_EXTENSION_H