userlibandfileserver/fileserver/sfile/sf_ext.cpp
changeset 201 43365a9b78a3
parent 152 657f875b013e
child 254 1560c419b176
equal deleted inserted replaced
200:73ea206103e6 201:43365a9b78a3
    50 
    50 
    51 Frees resources before destruction of the object.
    51 Frees resources before destruction of the object.
    52 */
    52 */
    53 CProxyDrive::~CProxyDrive()
    53 CProxyDrive::~CProxyDrive()
    54 	{
    54 	{
    55 	
    55 	delete iBody;
    56 	}
    56 	}
    57 
    57 
    58 
    58 
    59 /**
    59 /**
    60 An interface with which control commands can be passed to 
    60 An interface with which control commands can be passed to 
   173 	{
   173 	{
   174 	return(KErrNotSupported);
   174 	return(KErrNotSupported);
   175 	}	
   175 	}	
   176 
   176 
   177 
   177 
       
   178 TInt CProxyDrive::SetAndOpenLibrary(RLibrary aLibrary)
       
   179 	{
       
   180 	TInt r = KErrNone;
       
   181 	if (iBody)
       
   182 		{
       
   183 		iBody->iLibrary = aLibrary;
       
   184 		r = iBody->iLibrary.Duplicate(RThread(), EOwnerProcess);
       
   185 		}
       
   186 	return r;
       
   187 	}
       
   188 
       
   189 /**
       
   190 Gets a copy of the Proxy Drive library (previously opened by OpenLibrary()) prior to deleting the proxy drive itself.
       
   191 After deleting the proxy drive, RLibrary::Close() should be called on the returned RLibrary object.
       
   192 */
       
   193 RLibrary CProxyDrive::GetLibrary()
       
   194 	{
       
   195 	RLibrary lib;
       
   196 	if (iBody)
       
   197 		{
       
   198 		lib = iBody->iLibrary;
       
   199 		iBody->iLibrary.SetHandle(NULL);
       
   200 		}
       
   201 	return lib;
       
   202 	}
       
   203 
   178 /**
   204 /**
   179 Constructor.
   205 Constructor.
   180 */
   206 */
   181 EXPORT_C CLocDrvMountCB::CLocDrvMountCB() {}
   207 EXPORT_C CLocDrvMountCB::CLocDrvMountCB() {}
   182 
   208 
   187 Frees assigned Proxy drive before destruction of the object.
   213 Frees assigned Proxy drive before destruction of the object.
   188 */
   214 */
   189 EXPORT_C CLocDrvMountCB::~CLocDrvMountCB()
   215 EXPORT_C CLocDrvMountCB::~CLocDrvMountCB()
   190 	{
   216 	{
   191 	__PRINT1(_L("CLocDrvMountCB::~CLocDrvMountCB() 0x%x"),this);
   217 	__PRINT1(_L("CLocDrvMountCB::~CLocDrvMountCB() 0x%x"),this);
   192 	if(iProxyDrive && !LocalDrives::IsProxyDrive(Drive().DriveNumber()) && LocalDrives::IsValidDriveMapping(Drive().DriveNumber()))
   218 	if(iProxyDrive && !LocalDrives::IsProxyDrive(Drive().DriveNumber()))
   193 		delete(iProxyDrive);
   219 		{
       
   220 		RLibrary lib = iProxyDrive->GetLibrary();
       
   221 		delete iProxyDrive;
       
   222 		lib.Close();
       
   223 		}
   194 	}
   224 	}
   195 
   225 
   196 
   226 
   197 /**
   227 /**
   198 Creates and initialises the local drive.
   228 Creates and initialises the local drive.
   280 */
   310 */
   281 EXPORT_C void CLocDrvMountCB::DismountedLocalDrive()
   311 EXPORT_C void CLocDrvMountCB::DismountedLocalDrive()
   282 	{
   312 	{
   283 	__ASSERT_ALWAYS(iProxyDrive!=NULL,Fault(ELocDrvDismountedLocalDrive));
   313 	__ASSERT_ALWAYS(iProxyDrive!=NULL,Fault(ELocDrvDismountedLocalDrive));
   284 	iProxyDrive->Dismounted();
   314 	iProxyDrive->Dismounted();
   285 	iProxyDrive->SetMount(NULL);
       
   286 	}
   315 	}
   287 
   316 
   288 
   317 
   289 /**
   318 /**
   290 static constructor.
   319 static constructor.