userlibandfileserver/fileserver/sfile/sf_dat.cpp
changeset 6 0173bcd7697c
parent 0 a41df078684a
child 19 4a8fed1c0ef6
equal deleted inserted replaced
4:56f325a607ea 6:0173bcd7697c
   547 
   547 
   548 	// No section found...
   548 	// No section found...
   549 	return(EFalse);
   549 	return(EFalse);
   550 	}
   550 	}
   551 
   551 
       
   552 /**
       
   553     Obtain drive information. This function is called by the default implementation of CFileSystem::DriveInfo().
       
   554     @param  anInfo       out: drive information
       
   555     @param  aDriveNumber drive number
       
   556 */
       
   557 EXPORT_C void GetDriveInfo(TDriveInfo& anInfo, TInt aDriveNumber)
       
   558     {
       
   559 	if(!IsValidLocalDriveMapping(aDriveNumber))
       
   560 		return;
       
   561 
       
   562     TLocalDriveCapsBuf localDriveCaps;
       
   563 
       
   564 	TInt r = KErrNone;
       
   565 
       
   566 	// is the drive local?
       
   567 	if (!IsProxyDrive(aDriveNumber))
       
   568 		{
       
   569 		// if not valid local drive, use default values in localDriveCaps
       
   570 		// if valid local drive and not locked, use TBusLocalDrive::Caps() values
       
   571 		// if valid drive and locked, hard-code attributes
       
   572 		r = GetLocalDrive(aDriveNumber).Caps(localDriveCaps);
       
   573 		}
       
   574 	else
       
   575 		{
       
   576 		CExtProxyDrive* pD = GetProxyDrive(aDriveNumber);
       
   577         __ASSERT_ALWAYS(pD != NULL,User::Panic(_L("GetDriveInfo - pProxyDrive == NULL"), -999));
       
   578 		r = pD->Caps(localDriveCaps);
       
   579 		}
       
   580 
       
   581     TLocalDriveCaps& caps = localDriveCaps();
       
   582 	if (r != KErrLocked)
       
   583 		{
       
   584 		anInfo.iMediaAtt=caps.iMediaAtt;
       
   585 		}
       
   586 	else
       
   587 		{
       
   588 		anInfo.iMediaAtt = KMediaAttLocked | KMediaAttLockable | KMediaAttHasPassword;
       
   589 		}
       
   590 
       
   591 	anInfo.iType=caps.iType;
       
   592 	anInfo.iDriveAtt=caps.iDriveAtt;
       
   593     anInfo.iConnectionBusType=caps.iConnectionBusType;
       
   594     }
       
   595 
       
   596 
       
   597 
       
   598