author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 1997-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 the License "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 |
// f32test\fsstress\t_remfsy.cpp |
sl@0 | 15 |
// |
sl@0 | 16 |
// |
sl@0 | 17 |
|
sl@0 | 18 |
#if defined(_UNICODE) |
sl@0 | 19 |
#if !defined(UNICODE) |
sl@0 | 20 |
#define UNICODE |
sl@0 | 21 |
#endif |
sl@0 | 22 |
#endif |
sl@0 | 23 |
|
sl@0 | 24 |
/* |
sl@0 | 25 |
#define WIN32_LEAN_AND_MEAN |
sl@0 | 26 |
#pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union |
sl@0 | 27 |
#include <windows.h> |
sl@0 | 28 |
#pragma warning( default : 4201 ) // nonstandard extension used : nameless struct/union |
sl@0 | 29 |
#include <stdlib.h> |
sl@0 | 30 |
*/ |
sl@0 | 31 |
#include <f32file.h> |
sl@0 | 32 |
#include <f32fsys.h> |
sl@0 | 33 |
#include <f32ver.h> |
sl@0 | 34 |
#include <e32twin.h> |
sl@0 | 35 |
#include <e32uid.h> |
sl@0 | 36 |
|
sl@0 | 37 |
#include "t_remfsy.h" |
sl@0 | 38 |
|
sl@0 | 39 |
const TInt KMajorVersionNumber=1; |
sl@0 | 40 |
const TInt KMinorVersionNumber=0; |
sl@0 | 41 |
// |
sl@0 | 42 |
//const TInt KKiloBytes=0x400; |
sl@0 | 43 |
//const TBuf<4> KUidName=_L(":UID"); |
sl@0 | 44 |
//const TInt KUidNameLength=4; |
sl@0 | 45 |
// |
sl@0 | 46 |
//LOCAL_D TBuf8<0x1000> buf; |
sl@0 | 47 |
//LOCAL_D RConsole theConsole; |
sl@0 | 48 |
|
sl@0 | 49 |
|
sl@0 | 50 |
////////////////////////////////////////////////////////////////////////// |
sl@0 | 51 |
// CRemote // |
sl@0 | 52 |
////////////////////////////////////////////////////////////////////////// |
sl@0 | 53 |
|
sl@0 | 54 |
|
sl@0 | 55 |
CRemote::CRemote() |
sl@0 | 56 |
// |
sl@0 | 57 |
// Constructor |
sl@0 | 58 |
// |
sl@0 | 59 |
{ |
sl@0 | 60 |
__DECLARE_NAME(_S("CRemote")); |
sl@0 | 61 |
} |
sl@0 | 62 |
|
sl@0 | 63 |
|
sl@0 | 64 |
|
sl@0 | 65 |
TInt CRemote::Install() |
sl@0 | 66 |
// |
sl@0 | 67 |
// Install the file system. |
sl@0 | 68 |
// |
sl@0 | 69 |
{ |
sl@0 | 70 |
|
sl@0 | 71 |
// SetErrorMode(SEM_FAILCRITICALERRORS); |
sl@0 | 72 |
RDebug::Print(_L("BASH in CRemote::Install")); |
sl@0 | 73 |
iVersion=TVersion(KMajorVersionNumber,KMinorVersionNumber,KF32BuildVersionNumber); |
sl@0 | 74 |
TPtrC name=_L("T_REMFSY"); |
sl@0 | 75 |
return(SetName(&name)); |
sl@0 | 76 |
} |
sl@0 | 77 |
|
sl@0 | 78 |
|
sl@0 | 79 |
//???JCS: Removed all aSession parameters to get the code to compile |
sl@0 | 80 |
|
sl@0 | 81 |
|
sl@0 | 82 |
|
sl@0 | 83 |
CMountCB* CRemote::NewMountL(/*CSessionFs* aSession*/) const |
sl@0 | 84 |
// |
sl@0 | 85 |
// Create a new mount control block. |
sl@0 | 86 |
// |
sl@0 | 87 |
{ |
sl@0 | 88 |
|
sl@0 | 89 |
return(new(ELeave) CRemoteMountCB); |
sl@0 | 90 |
} |
sl@0 | 91 |
|
sl@0 | 92 |
CFileCB* CRemote::NewFileL(/*CSessionFs* aSession*/) const |
sl@0 | 93 |
// |
sl@0 | 94 |
// Create a new file. |
sl@0 | 95 |
// |
sl@0 | 96 |
{ |
sl@0 | 97 |
|
sl@0 | 98 |
return(new(ELeave) CRemoteFileCB); |
sl@0 | 99 |
} |
sl@0 | 100 |
|
sl@0 | 101 |
CDirCB* CRemote::NewDirL(/*CSessionFs* aSession*/) const |
sl@0 | 102 |
// |
sl@0 | 103 |
// Create a new directory lister. |
sl@0 | 104 |
// |
sl@0 | 105 |
{ |
sl@0 | 106 |
|
sl@0 | 107 |
return(new(ELeave) CRemoteDirCB(/*aSession*/)); |
sl@0 | 108 |
} |
sl@0 | 109 |
|
sl@0 | 110 |
CFormatCB* CRemote::NewFormatL(/*CSessionFs* aSession*/) const |
sl@0 | 111 |
// |
sl@0 | 112 |
// Create a new media formatter. |
sl@0 | 113 |
// |
sl@0 | 114 |
{ |
sl@0 | 115 |
|
sl@0 | 116 |
return(new(ELeave) CRemoteFormatCB(/*aSession*/)); |
sl@0 | 117 |
} |
sl@0 | 118 |
|
sl@0 | 119 |
TInt CRemote::DefaultPath(TDes& aPath) const |
sl@0 | 120 |
// |
sl@0 | 121 |
// Return the initial default path. |
sl@0 | 122 |
// |
sl@0 | 123 |
{ |
sl@0 | 124 |
|
sl@0 | 125 |
aPath=_L("Q:\\"); |
sl@0 | 126 |
return(KErrNone); |
sl@0 | 127 |
} |
sl@0 | 128 |
|
sl@0 | 129 |
|
sl@0 | 130 |
CFileSystem* CRemote::NewL() |
sl@0 | 131 |
// |
sl@0 | 132 |
// JCS |
sl@0 | 133 |
// |
sl@0 | 134 |
{ |
sl@0 | 135 |
CFileSystem* remoteFsy=new(ELeave) CRemote(); |
sl@0 | 136 |
return remoteFsy; |
sl@0 | 137 |
} |
sl@0 | 138 |
|
sl@0 | 139 |
|
sl@0 | 140 |
void CRemote::DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const |
sl@0 | 141 |
// |
sl@0 | 142 |
// Return the drive info, iDriveAtt already set |
sl@0 | 143 |
// |
sl@0 | 144 |
{ |
sl@0 | 145 |
|
sl@0 | 146 |
TFileName d; |
sl@0 | 147 |
d.Format(_L("%c:\\"),aDriveNumber+'A'); |
sl@0 | 148 |
if (MapDriveInfo(anInfo,aDriveNumber)) |
sl@0 | 149 |
{ |
sl@0 | 150 |
if (MapDriveAttributes(anInfo.iDriveAtt,aDriveNumber)) |
sl@0 | 151 |
{ |
sl@0 | 152 |
return; |
sl@0 | 153 |
} |
sl@0 | 154 |
} |
sl@0 | 155 |
|
sl@0 | 156 |
// UINT r=GetDriveType((_STRC)d.PtrZ()); |
sl@0 | 157 |
TMediaType t; |
sl@0 | 158 |
anInfo.iMediaAtt=0; |
sl@0 | 159 |
/* |
sl@0 | 160 |
switch (r) |
sl@0 | 161 |
{ |
sl@0 | 162 |
case DRIVE_REMOVABLE: |
sl@0 | 163 |
anInfo.iMediaAtt|=KMediaAttDualDensity; |
sl@0 | 164 |
t=EMediaFloppy; |
sl@0 | 165 |
break; |
sl@0 | 166 |
case DRIVE_NO_ROOT_DIR: t=EMediaNotPresent; break; |
sl@0 | 167 |
case DRIVE_FIXED: t=EMediaHardDisk; break; |
sl@0 | 168 |
case DRIVE_REMOTE: t=EMediaRemote; break; |
sl@0 | 169 |
case DRIVE_CDROM: t=EMediaCdRom; break; |
sl@0 | 170 |
case DRIVE_RAMDISK: t=EMediaRam; break; |
sl@0 | 171 |
case DRIVE_UNKNOWN: |
sl@0 | 172 |
default: |
sl@0 | 173 |
t=EMediaUnknown; |
sl@0 | 174 |
} |
sl@0 | 175 |
*/ |
sl@0 | 176 |
t=EMediaRemote; |
sl@0 | 177 |
anInfo.iType=t; |
sl@0 | 178 |
} |
sl@0 | 179 |
|
sl@0 | 180 |
|
sl@0 | 181 |
extern "C" { |
sl@0 | 182 |
|
sl@0 | 183 |
EXPORT_C CFileSystem* CreateFileSystem() |
sl@0 | 184 |
// |
sl@0 | 185 |
// Create a new file system |
sl@0 | 186 |
// |
sl@0 | 187 |
{ |
sl@0 | 188 |
return(CRemote::NewL()); |
sl@0 | 189 |
// return(new CRemote); |
sl@0 | 190 |
} |
sl@0 | 191 |
} |
sl@0 | 192 |
|
sl@0 | 193 |