os/boardsupport/emulator/emulatorbsp/win_drive/win_drive_ext.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Definitions for this file system extension
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef WIN_DRIVE_EXTENSION_H
sl@0
    23
#define WIN_DRIVE_EXTENSION_H
sl@0
    24
sl@0
    25
#include "win_media.h"
sl@0
    26
sl@0
    27
//-----------------------------------------------------------------------------
sl@0
    28
sl@0
    29
/**
sl@0
    30
    This class represents the File System extension (.fxt module) that intercepts media driver operations and
sl@0
    31
    deals with them on windows filesystem level.
sl@0
    32
*/
sl@0
    33
class CWinDrvProxyDrive : public CBaseExtProxyDrive
sl@0
    34
{
sl@0
    35
public:
sl@0
    36
    static CWinDrvProxyDrive* NewL(CProxyDrive* aProxyDrive, CMountCB* aMount);
sl@0
    37
sl@0
    38
protected:
sl@0
    39
    CWinDrvProxyDrive(CProxyDrive* aProxyDrive, CMountCB* aMount);
sl@0
    40
    virtual ~CWinDrvProxyDrive();
sl@0
    41
sl@0
    42
	//-- overrides from the base class
sl@0
    43
    
sl@0
    44
    virtual TInt Initialise();
sl@0
    45
	virtual TInt Dismounted();
sl@0
    46
sl@0
    47
	virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags);
sl@0
    48
	virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset);
sl@0
    49
	virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
sl@0
    50
	
sl@0
    51
	virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags);
sl@0
    52
	virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset);
sl@0
    53
	virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
sl@0
    54
sl@0
    55
    virtual TInt Caps(TDes8& anInfo);
sl@0
    56
sl@0
    57
    virtual TInt Format(TFormatInfo& anInfo);
sl@0
    58
    virtual TInt Format(TInt64 aPos,TInt aLength);
sl@0
    59
sl@0
    60
    /* -------- virtual base class API --------------
sl@0
    61
    virtual TInt Enlarge(TInt aLength);
sl@0
    62
	virtual TInt ReduceSize(TInt aPos, TInt aLength);
sl@0
    63
	
sl@0
    64
    # virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt aOffset,TInt aFlags);
sl@0
    65
	# virtual TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aThreadHandle,TInt anOffset);
sl@0
    66
	# virtual TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg);
sl@0
    67
sl@0
    68
	# virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt aOffset,TInt aFlags);
sl@0
    69
	# virtual TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aThreadHandle,TInt anOffset);
sl@0
    70
	# virtual TInt Write(TInt64 aPos,const TDesC8& aSrc);
sl@0
    71
	
sl@0
    72
    # virtual TInt Caps(TDes8& anInfo);
sl@0
    73
	#virtual TInt Format(TFormatInfo& anInfo);
sl@0
    74
	#virtual TInt Format(TInt64 aPos,TInt aLength);
sl@0
    75
	virtual TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMountInfoThreadHandle=KCurrentThreadHandle);
sl@0
    76
	virtual TInt ForceRemount(TUint aFlags=0);
sl@0
    77
	virtual TInt Unlock(TMediaPassword &aPassword, TBool aStorePassword);
sl@0
    78
	virtual TInt Lock(TMediaPassword &aOldPassword, TMediaPassword &aNewPassword, TBool aStorePassword);
sl@0
    79
	virtual TInt Clear(TMediaPassword &aPassword);
sl@0
    80
	virtual TInt ControlIO(const RMessagePtr2& aMessage,TInt aCommand,TAny* aParam1,TAny* aParam2);
sl@0
    81
	virtual TInt ErasePassword();
sl@0
    82
	virtual TInt GetLastErrorInfo(TDes8& aErrorInfo);
sl@0
    83
    virtual TInt DeleteNotify(TInt64 aPos, TInt aLength);
sl@0
    84
    */
sl@0
    85
protected:
sl@0
    86
	virtual TInt GetInterface(TInt aInterfaceId,TAny*& aInterface,TAny* aInput);	
sl@0
    87
sl@0
    88
sl@0
    89
protected:
sl@0
    90
    CMountCB*    iMount;        ///< pointer to the owning mount
sl@0
    91
    CProxyDrive* iProxyDrive;   ///< pointer to the chain of the proxies to the native media driver
sl@0
    92
    CMediaBase*  ipMedia;       ///< pointer to the base "media" object that implements this extension't IO operations
sl@0
    93
sl@0
    94
    RBuf8        iScratchBuf;   ///< scratch buffer for non-local read/write operations
sl@0
    95
};
sl@0
    96
sl@0
    97
//-----------------------------------------------------------------------------
sl@0
    98
sl@0
    99
/**
sl@0
   100
    This Proxy drive factory class
sl@0
   101
*/
sl@0
   102
class CWinDrvProxyDriveFactory : public CProxyDriveFactory
sl@0
   103
{
sl@0
   104
 public:
sl@0
   105
    CWinDrvProxyDriveFactory();
sl@0
   106
    virtual TInt Install();         
sl@0
   107
    virtual CProxyDrive* NewProxyDriveL(CProxyDrive* aProxy,CMountCB* aMount);
sl@0
   108
};
sl@0
   109
sl@0
   110
sl@0
   111
#endif //WIN_DRIVE_EXTENSION_H
sl@0
   112
sl@0
   113
sl@0
   114
sl@0
   115
sl@0
   116
sl@0
   117
sl@0
   118
sl@0
   119
sl@0
   120
sl@0
   121
sl@0
   122
sl@0
   123
sl@0
   124
sl@0
   125
sl@0
   126
sl@0
   127
sl@0
   128
sl@0
   129
sl@0
   130
sl@0
   131
sl@0
   132
sl@0
   133
sl@0
   134
sl@0
   135
sl@0
   136
sl@0
   137
sl@0
   138
sl@0
   139
sl@0
   140
sl@0
   141
sl@0
   142
sl@0
   143
sl@0
   144
sl@0
   145
sl@0
   146
sl@0
   147