filesystemuis/memscaneng/serversrc/mseng.cpp
branchRCL_3
changeset 39 65326cf895ed
equal deleted inserted replaced
38:491b3ed49290 39:65326cf895ed
       
     1 /*
       
     2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *     The actual "engine". 
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 
       
    24 // SYSTEM INCLUDES
       
    25 #include    <mseng.rsg>
       
    26 #include    <bautils.h>
       
    27 #include    <driveinfo.h>
       
    28 
       
    29 // USER INCLUDES
       
    30 #include    "mseng.h"
       
    31 #include    "mseng.hrh"
       
    32 #include    "msengscanner.h"
       
    33 
       
    34 // ========================= MEMBER FUNCTIONS ================================
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // CMseng::CMseng()
       
    38 //
       
    39 // C++ default constructor. Can NOT contain any code, that might leave.
       
    40 // ---------------------------------------------------------------------------
       
    41 
       
    42 
       
    43     
       
    44 CMseng::CMseng( MMsengUIHandler& aUIHandler ) :
       
    45     iUIHandler(aUIHandler),
       
    46     iFreeMemory(0)
       
    47     {
       
    48     }    
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // CMseng::NewL()
       
    52 //
       
    53 // Two-phased constructor.
       
    54 // ---------------------------------------------------------------------------
       
    55 
       
    56 EXPORT_C CMseng* CMseng::NewL(MMsengUIHandler& aUIHandler)
       
    57     {
       
    58     CMseng* self = new (ELeave) CMseng(aUIHandler);
       
    59        
       
    60     CleanupStack::PushL( self );
       
    61     self->ConstructL();
       
    62     CleanupStack::Pop( self );
       
    63 
       
    64     return self;
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CMseng::ConstructL()
       
    69 //
       
    70 // Symbian OS default constructor can leave.
       
    71 // ---------------------------------------------------------------------------
       
    72 
       
    73 void CMseng::ConstructL()
       
    74     {
       
    75     #ifdef __SHOW_RDEBUG_PRINT_
       
    76     RDebug::Print(_L("** CMseng::ConstructL()... starting **"));
       
    77     #endif // __SHOW_RDEBUG_PRINT_
       
    78 
       
    79     // Connect to File Server
       
    80     User::LeaveIfError(iFsSession.Connect());
       
    81 
       
    82     // Open the resource file
       
    83     TParse* fp = new(ELeave) TParse(); 
       
    84     fp->Set(KMsengRscFilePath, &KDC_RESOURCE_FILES_DIR, NULL); 
       
    85     TFileName fileName( fp->FullName() );
       
    86     delete fp;
       
    87 
       
    88 
       
    89     BaflUtils::NearestLanguageFile( iFsSession, fileName );
       
    90     //
       
    91     TEntry entry;
       
    92     User::LeaveIfError( iFsSession.Entry( fileName, entry ) );
       
    93     // if file does not exist, leaves with KErrNotFound
       
    94 
       
    95     iResFile = CResourceFile::NewL( iFsSession, fileName, 0, entry.FileSize() );
       
    96     
       
    97     iResFile->ConfirmSignatureL();
       
    98     
       
    99 
       
   100     /////////////////////////////////////////////////////////
       
   101     //create data structures and initialize them from resource file
       
   102 
       
   103     TInt index = -1; // index used in for-loops
       
   104     TInt subindex = -1; // index used in for-loops inside another for-loop
       
   105     TInt length = -1; // length of resource array being read
       
   106     TInt sublength = -1; // length of sub-array inside array resource
       
   107 
       
   108     RResourceReader theReader;
       
   109     theReader.OpenLC( iResFile, DATAGROUPNAMEARRAY );
       
   110     
       
   111 
       
   112     //the first WORD contains the number of elements in the resource
       
   113     iNumberOfDataGroups = theReader.ReadInt16L();
       
   114     
       
   115     CleanupStack::PopAndDestroy( &theReader );
       
   116     
       
   117     
       
   118 
       
   119     /////////////////////////////////////////////////////////
       
   120     // Read the resource containing the data needed to create
       
   121     // mapping between data groups and UIDs
       
   122     //
       
   123     theReader.OpenLC( iResFile, DATAGROUPUIDARRAY );  
       
   124    
       
   125     //the first WORD contains the number of elements in the resource
       
   126     length = theReader.ReadInt16L();
       
   127 
       
   128    
       
   129     // Create array with such granularity that reallocation is unnecessary
       
   130     // initialize array to contain null pointers 
       
   131     iDataGroupUidArray = new (ELeave) CArrayPtrFlat<CIntArray>(iNumberOfDataGroups);
       
   132     for(index=0; index<iNumberOfDataGroups; index++)
       
   133         {
       
   134         iDataGroupUidArray->AppendL(NULL);
       
   135         }
       
   136     TInt groupindex; // value from enum TDataGroups
       
   137     // Read the array resource
       
   138     for(index=0; index<length; index++)
       
   139         {
       
   140         // Read one enum TDataGroups value
       
   141         groupindex = theReader.ReadInt8L();
       
   142         
       
   143         // Read the sub-array. First WORD contains array length.
       
   144         sublength = theReader.ReadInt16L();
       
   145         
       
   146         // Create new CUidArray with appropriate granularity
       
   147         // and insert it into the main array
       
   148         CIntArray* subarray = new (ELeave) CIntArray(iNumberOfDataGroups);
       
   149         CleanupStack::PushL(subarray);
       
   150         if( groupindex < iDataGroupUidArray->Count() )
       
   151             {
       
   152             iDataGroupUidArray->At(groupindex) = subarray;
       
   153             }
       
   154         
       
   155         // Read the subarray resource
       
   156         for(subindex=0; subindex<sublength; subindex++)
       
   157             {
       
   158             // uidtype matches one value fron enum TUidTypes
       
   159             TInt uidtype = theReader.ReadInt8L(); 
       
   160             if( groupindex < iDataGroupUidArray->Count() )
       
   161                 {
       
   162                 iDataGroupUidArray->At(groupindex)->InsertL(subindex,uidtype);
       
   163                 }
       
   164             }
       
   165         CleanupStack::Pop( subarray );
       
   166         }
       
   167     CleanupStack::PopAndDestroy( &theReader );
       
   168 
       
   169     /////////////////////////////////////////////////////////
       
   170     // Read the resource containing the data needed to create
       
   171     // mapping between data groups and extensions 
       
   172     //
       
   173     theReader.OpenLC( iResFile, DATAGROUPEXTARRAY );
       
   174 
       
   175     //the first WORD contains the number of elements in the resource
       
   176     length = theReader.ReadInt16L();
       
   177     // Create array with such granularity that reallocation is unnecessary
       
   178     // Initialize it to contain null pointers, since some cells can leave empty
       
   179     iDataGroupExtArray = new (ELeave) CArrayPtrFlat<CIntArray>(iNumberOfDataGroups);
       
   180     for(index=0; index<iNumberOfDataGroups; index++)
       
   181         {
       
   182         iDataGroupExtArray->AppendL(NULL);
       
   183         }
       
   184     // Read the array resource
       
   185     for(index=0; index<length; index++)
       
   186         {
       
   187         // Read one enum TDataGroups value
       
   188         groupindex = theReader.ReadInt8L();
       
   189         // Read the sub-array. First WORD contains array length.
       
   190         sublength = theReader.ReadInt16L();
       
   191         // Create new CIntArray with appropriate granularity
       
   192         // and insert it into the main array
       
   193         CIntArray* subarray = new (ELeave) CIntArray(sublength);
       
   194         CleanupStack::PushL(subarray);
       
   195         if( groupindex < iDataGroupExtArray->Count() )
       
   196             {
       
   197             iDataGroupExtArray->At(groupindex) = subarray;
       
   198             }
       
   199         
       
   200         // Read the subarray resource
       
   201         for(subindex=0; subindex<sublength; subindex++)
       
   202             {
       
   203             // exttype matches one value fron enum TUidTypes
       
   204             TInt exttype = theReader.ReadInt8L();
       
   205             if( groupindex < iDataGroupExtArray->Count() )
       
   206                 {
       
   207                 iDataGroupExtArray->At(groupindex)->InsertL(subindex,exttype);
       
   208                 }
       
   209             }
       
   210         CleanupStack::Pop( subarray );
       
   211         }
       
   212 
       
   213     CleanupStack::PopAndDestroy( &theReader );
       
   214     
       
   215     //instantiate scanner
       
   216     iScanner = new (ELeave) CMsengScanner(iUIHandler, *iResFile);
       
   217     }
       
   218     
       
   219 
       
   220 // ---------------------------------------------------------------------------
       
   221 // CMseng::~CMseng()
       
   222 // 
       
   223 // Destructor.
       
   224 // ---------------------------------------------------------------------------
       
   225 
       
   226 EXPORT_C CMseng::~CMseng()
       
   227     {
       
   228 #ifdef __SHOW_RDEBUG_PRINT_
       
   229     RDebug::Print(_L("** CMseng::~CMseng(). Finished. **"));
       
   230 #endif // __SHOW_RDEBUG_PRINT_
       
   231 
       
   232     delete iScanner;
       
   233     
       
   234     // Pointer arrays: elements must be deleted before deleting array
       
   235     if(iDataGroupUidArray)
       
   236         {
       
   237         iDataGroupUidArray->ResetAndDestroy();
       
   238         }
       
   239     delete iDataGroupUidArray;
       
   240     
       
   241     
       
   242     if(iDataGroupExtArray)
       
   243         {
       
   244         iDataGroupExtArray->ResetAndDestroy();
       
   245         }
       
   246     delete iDataGroupExtArray;
       
   247   
       
   248         
       
   249     delete iResFile;
       
   250     
       
   251     iFsSession.Close();       
       
   252     }
       
   253 
       
   254 
       
   255 
       
   256 // ---------------------------------------------------------------------------
       
   257 // CMseng::DataGroupsL()
       
   258 //
       
   259 // Get a descriptor array containing the names of the data groups.
       
   260 // ---------------------------------------------------------------------------
       
   261 
       
   262 EXPORT_C CDesCArray* CMseng::DataGroupsL() const
       
   263     {
       
   264 #ifdef __SHOW_RDEBUG_PRINT_
       
   265     RDebug::Print(_L("CMseng::GetDataGroupsL() called."));
       
   266 #endif // __SHOW_RDEBUG_PRINT_
       
   267 
       
   268 
       
   269     // Create the array for the data group names with appropriate granularity
       
   270     CDesCArray* dataGroupNameArray = new (ELeave) CDesCArrayFlat(iNumberOfDataGroups);
       
   271     CleanupStack::PushL(dataGroupNameArray);
       
   272 
       
   273     // Read the resource containing data group names 
       
   274     // and put them to resultArray
       
   275     
       
   276     RResourceReader theReader;
       
   277     theReader.OpenLC( iResFile, DATAGROUPNAMEARRAY );
       
   278     
       
   279     
       
   280     // The first WORD contains the number of elements in the resource
       
   281     // (actually this is already in iNumberOfDataGroups)
       
   282 
       
   283     TInt length = theReader.ReadInt16L();
       
   284     __ASSERT_DEBUG(iNumberOfDataGroups == length, User::Panic(_L("CMseng::DataGroupsL"), KErrGeneral));
       
   285     
       
   286     // Read the data group names from resource file and insert to array
       
   287     TInt groupindex; // value from enum TDataGroups
       
   288     for(TInt index=0; index<length; index++)
       
   289         {
       
   290         groupindex = theReader.ReadInt8L();
       
   291         TPtrC name = theReader.ReadTPtrCL();
       
   292         // Copy the name to the right place in the array
       
   293         dataGroupNameArray->InsertL(groupindex, name);
       
   294         }
       
   295     CleanupStack::PopAndDestroy( &theReader );
       
   296 
       
   297     // Return the array of data groups
       
   298     CleanupStack::Pop( dataGroupNameArray );
       
   299 
       
   300 #ifdef __SHOW_RDEBUG_PRINT_
       
   301 // print the data group array
       
   302     RDebug::Print(_L("Printing the Data Groups:"));
       
   303     for(TInt k = 0; k < dataGroupNameArray->Count(); k++)
       
   304         {
       
   305         HBufC* groupName = dataGroupNameArray->MdcaPoint(k).AllocL();
       
   306         RDebug::Print( _L("    %d: %S"), k, groupName);
       
   307         delete groupName;
       
   308         }
       
   309 #endif // __SHOW_RDEBUG_PRINT_
       
   310 
       
   311     return dataGroupNameArray;
       
   312     
       
   313     }
       
   314 
       
   315 // ---------------------------------------------------------------------------
       
   316 // CMseng::ScanResultL()
       
   317 //
       
   318 // Returns an array of scan results
       
   319 // ---------------------------------------------------------------------------
       
   320 
       
   321 EXPORT_C CArrayFix<TInt64>* CMseng::ScanResultL() const
       
   322     {
       
   323 #ifdef __SHOW_RDEBUG_PRINT_
       
   324     RDebug::Print(_L("CMseng::ScanResultL() called. Starting to calculate result..."));
       
   325 #endif // __SHOW_RDEBUG_PRINT_
       
   326 
       
   327     // Create the result array (with such granularity that reallocations do not happen)
       
   328     CArrayFix<TInt64>* resultArray = new (ELeave) CArrayFixFlat<TInt64>(iNumberOfDataGroups);
       
   329     CleanupStack::PushL(resultArray);
       
   330 
       
   331     // Get result arrays from scanner 
       
   332     const CArrayFix<TInt64>* extResultArray = iScanner->ExtResults();
       
   333     const CArrayFix<TInt64>* uidResultArray = iScanner->UidResults();
       
   334     const CArrayFix<TInt64>* groupResultArray = iScanner->GroupResults();
       
   335 
       
   336     // Initialize the result array from the array of initial result
       
   337     for (TInt i = 0; i < iNumberOfDataGroups; i++)
       
   338         {
       
   339         if( i < groupResultArray->Count() )
       
   340             {
       
   341             resultArray->AppendL(groupResultArray->At(i));
       
   342             }
       
   343         }
       
   344 
       
   345     //Calculate the results and put them to the array
       
   346     
       
   347     // Find results for each data group
       
   348     for(TInt groupindex = 0; groupindex < iNumberOfDataGroups; groupindex++)
       
   349         {
       
   350         // For one data group, the UIDs belonging to this group are listed in 
       
   351         // iDataGroupExtArray. For each of these UIDs, add the result to the total result.
       
   352 
       
   353         // If the examined data group does not have associated UIDs, 
       
   354         // iDataGroupUidArray->At(groupindex) is a NULL pointer.
       
   355         if(iDataGroupUidArray->At(groupindex))
       
   356             {
       
   357             TInt count = iDataGroupUidArray->At(groupindex)->Count();
       
   358             for(TInt uidindex = 0; uidindex < count; uidindex++)
       
   359                 {
       
   360                 resultArray->At(groupindex) += 
       
   361                     uidResultArray->At( iDataGroupUidArray->At(groupindex)->At(uidindex) );
       
   362                 }
       
   363             }
       
   364 
       
   365         // The extension results are collected in a similar manner
       
   366 
       
   367         // If the examined data group does not have associated UIDs, 
       
   368         // iDataGroupUidArray->At(groupindex) is a NULL pointer
       
   369         if(iDataGroupExtArray->At(groupindex))
       
   370             {
       
   371             TInt count = iDataGroupExtArray->At(groupindex)->Count();
       
   372             for(TInt extindex = 0; extindex < count; extindex++)
       
   373                 {
       
   374                 resultArray->At(groupindex) += 
       
   375                     extResultArray->At( iDataGroupExtArray->At(groupindex)->At(extindex) );
       
   376                 }
       
   377             }
       
   378         }
       
   379     // Calculate "Free memory" and "All device data"
       
   380     TInt64 totalMemory;
       
   381     TInt64 freeMemory;
       
   382     DiskInfoL(totalMemory, freeMemory, iScanner->CurrentDrive());
       
   383 #ifdef __SHOW_RDEBUG_PRINT_
       
   384     RDebug::Print(_L("CMseng::ScanresultL(): iFreeMemory %d, freeMemory %d"), (TUint32)iFreeMemory, (TUint32)freeMemory);
       
   385 #endif
       
   386     // For some reason there is sometimes 16 kB difference in free memory when scanning started
       
   387     // vs. scanning ended (16 kB more at the end of scanning) and latter one is incorrect.
       
   388     // That is why free memory detected in the beginning of scanning taken into account. 
       
   389     if(iFreeMemory)
       
   390         {
       
   391         freeMemory = iFreeMemory;
       
   392         }
       
   393     else
       
   394         {
       
   395         iFreeMemory = freeMemory;
       
   396         }
       
   397     
       
   398     // "Free memory" is the memory currently available
       
   399     resultArray->At(EGroupFreeMemory) = freeMemory;
       
   400     // "All Device Data" is all memory used
       
   401     resultArray->At(EGroupAllDeviceData) = (totalMemory - freeMemory);
       
   402     
       
   403     // Calculate how much files not falling to any predefined category consume
       
   404     TInt64 others( 0 );
       
   405     for( TInt i = EGroupCalendar; i < iNumberOfDataGroups; i++ )
       
   406         {
       
   407         others += resultArray->At( i );
       
   408         }
       
   409     
       
   410     // This should never happen, but just in case check that negative count is not established.
       
   411     if( resultArray->At(EGroupAllDeviceData) - others < 0 )
       
   412         {
       
   413         resultArray->At( EGroupOthers ) = 0;
       
   414         }
       
   415     else
       
   416         {
       
   417         resultArray->At( EGroupOthers ) = resultArray->At(EGroupAllDeviceData) - others;
       
   418         }
       
   419 
       
   420 // write the result array to log file
       
   421 #ifdef __SHOW_RDEBUG_PRINT_
       
   422     RDebug::Print(_L("CMseng::ScanresultL(): current result array -"));
       
   423     // note that the log macros cannot handle TInt64
       
   424     for(TInt k = 0; k < resultArray->Count(); k++)
       
   425         {
       
   426         const TInt KMaxChars = 32;
       
   427         TBuf<KMaxChars> num;
       
   428         num.Num(resultArray->At(k));
       
   429         RDebug::Print(num);
       
   430         }
       
   431 #endif // __SHOW_RDEBUG_PRINT_
       
   432 
       
   433     CleanupStack::Pop( resultArray );
       
   434     return resultArray;
       
   435     }
       
   436 
       
   437 // ---------------------------------------------------------------------------
       
   438 // CMseng::ScanInProgress()
       
   439 //
       
   440 // Return ETrue if there is scanning going on, otherwise EFalse.
       
   441 // ---------------------------------------------------------------------------
       
   442 //
       
   443 EXPORT_C TBool CMseng::ScanInProgress() const
       
   444     {
       
   445     if(iScanner) 
       
   446         {
       
   447         return iScanner->HaveActiveScanners();
       
   448         }
       
   449     else
       
   450         {
       
   451         return EFalse;
       
   452         }
       
   453     }
       
   454 
       
   455 // ---------------------------------------------------------------------------
       
   456 // CMseng::DiskInfoL
       
   457 //
       
   458 // Retrieves information about disk usage.
       
   459 // ---------------------------------------------------------------------------
       
   460 //
       
   461 EXPORT_C void CMseng::DiskInfoL(TInt64& aTotal, TInt64& aFree, const TDriveNumber aVolume) const
       
   462     {
       
   463 
       
   464     TVolumeInfo vinfo;
       
   465     User::LeaveIfError(iFsSession.Volume(vinfo, aVolume));
       
   466     aTotal = TInt64(vinfo.iSize);
       
   467     aFree = TInt64(vinfo.iFree);
       
   468 
       
   469 	}
       
   470 
       
   471 // ---------------------------------------------------------------------------
       
   472 // CMseng::MemInfoL
       
   473 //
       
   474 // Retrieves information about RAM usage.
       
   475 // ---------------------------------------------------------------------------
       
   476 //
       
   477 EXPORT_C void CMseng::MemInfoL(TInt64& aTotal, TInt64& aFree)
       
   478     {
       
   479     TMemoryInfoV1Buf membuf;
       
   480     User::LeaveIfError(UserHal::MemoryInfo(membuf));
       
   481     TMemoryInfoV1 minfo = membuf();
       
   482     aTotal = minfo.iTotalRamInBytes;
       
   483     aFree = minfo.iFreeRamInBytes;
       
   484     }
       
   485 
       
   486 // ---------------------------------------------------------------------------
       
   487 // CMseng::ScanL()
       
   488 //
       
   489 // First scan the specific data files.
       
   490 // Then scan directories that are scanned for the 
       
   491 // size of all files. Then call scanner's ScanL.
       
   492 // ---------------------------------------------------------------------------
       
   493 //
       
   494 EXPORT_C void CMseng::ScanL(TDriveNumber aDrive)
       
   495     {
       
   496     __ASSERT_ALWAYS( (CMseng::IsInternalDrive(iFsSession, aDrive)
       
   497         || CMseng::IsRemovableDrive(iFsSession, aDrive)), User::Leave(KErrNotSupported) );
       
   498 
       
   499     // Scanning started.
       
   500     iUIHandler.StartL();
       
   501     
       
   502     // Start scanning memory, check that not already doing it
       
   503     TInt err = iScanner->ScanL(aDrive, iNumberOfDataGroups, iFsSession);
       
   504     if(err != KErrNone) // can be only KErrNone or KErrInUse
       
   505         {
       
   506         iUIHandler.ErrorL(KErrInUse);
       
   507         }        
       
   508     }
       
   509 
       
   510 // ---------------------------------------------------------------------------
       
   511 // CMseng::Cancel()
       
   512 // 
       
   513 // ---------------------------------------------------------------------------
       
   514 //
       
   515 EXPORT_C void CMseng::Cancel()
       
   516     {
       
   517 #ifdef __SHOW_RDEBUG_PRINT_
       
   518     RDebug::Print(_L("CMseng::Cancel() called. canceling scanning..."));
       
   519 #endif // __SHOW_RDEBUG_PRINT_
       
   520     
       
   521     iScanner->Cancel();
       
   522     }
       
   523 
       
   524 // -----------------------------------------------------------------------------
       
   525 // CMseng::IsInternalDrive
       
   526 // -----------------------------------------------------------------------------
       
   527 //
       
   528 TBool CMseng::IsInternalDrive( RFs& aFs, TInt aDrv )
       
   529     {
       
   530     TDriveInfo drvInfo;
       
   531     if ( aFs.Drive( drvInfo, aDrv ) == KErrNone )
       
   532         {
       
   533          if ( !( drvInfo.iDriveAtt & KDriveAttInternal ) &&
       
   534               drvInfo.iDriveAtt & ( KDriveAttRemovable | KDriveAttRemote ) )
       
   535             {
       
   536             return EFalse;
       
   537             }
       
   538         }
       
   539     else
       
   540         {
       
   541         return EFalse;
       
   542         }
       
   543     return ETrue;
       
   544     }
       
   545 
       
   546 // -----------------------------------------------------------------------------
       
   547 // CMseng::IsRemovableDrive
       
   548 // -----------------------------------------------------------------------------
       
   549 //
       
   550 TBool CMseng::IsRemovableDrive( RFs& aFs, TInt aDrv )
       
   551     {
       
   552     TDriveInfo drvInfo;
       
   553     if ( aFs.Drive( drvInfo, aDrv ) == KErrNone )
       
   554         {
       
   555          if ( !( drvInfo.iDriveAtt & KDriveAttRemovable ) )
       
   556             {
       
   557             return EFalse;
       
   558             }
       
   559         }
       
   560     else
       
   561         {
       
   562         return EFalse;
       
   563         }
       
   564     return ETrue;
       
   565     }
       
   566 
       
   567 // -----------------------------------------------------------------------------
       
   568 // CMseng::IsMassStorageDrive
       
   569 // -----------------------------------------------------------------------------
       
   570 //
       
   571 TBool CMseng::IsMassStorageDrive( RFs& aFs, TInt aDrv )
       
   572     {
       
   573     
       
   574     TUint drvStatus( 0 );
       
   575     TInt err( DriveInfo::GetDriveStatus( aFs, aDrv, drvStatus ) );
       
   576     if ( err != KErrNone )
       
   577         {
       
   578         return EFalse;
       
   579         }
       
   580     
       
   581     if ( ( drvStatus & DriveInfo::EDriveInternal ) &&
       
   582         ( drvStatus & DriveInfo::EDriveExternallyMountable ) )
       
   583         {
       
   584         return ETrue;
       
   585         }
       
   586     return EFalse;
       
   587     }
       
   588 
       
   589 //  End of File