equal
deleted
inserted
replaced
224 |
224 |
225 EXPORT_C TInt CLocDrvMountCB::CreateDrive(TInt aDriveNumber) |
225 EXPORT_C TInt CLocDrvMountCB::CreateDrive(TInt aDriveNumber) |
226 /** Create drive |
226 /** Create drive |
227 Ascertain if the drive is mapped to a local drive or a proxy drive, and create the drive |
227 Ascertain if the drive is mapped to a local drive or a proxy drive, and create the drive |
228 as appropriate |
228 as appropriate |
229 @param aDriveNumer drive number |
229 @param aDriveNumber drive number |
230 @return KErrNone on success |
230 @return KErrNone on success |
231 KErrArgument is the drive is not mapped to a proxy or a local drive or if the number |
231 KErrArgument if the drive is not mapped to a proxy or a local drive or if the number |
232 is invalid |
232 is invalid |
233 */ |
233 */ |
234 { |
234 { |
235 // dunno why we are using TInts instead of TUints here |
235 // dunno why we are using TInts instead of TUints here |
236 __PRINT(_L("CLocDrvMountCB::CreateLocalDrive()")); |
236 __PRINT(_L("CLocDrvMountCB::CreateDrive()")); |
237 |
237 |
238 if (aDriveNumber<0 || aDriveNumber>=KMaxDrives) return KErrArgument; |
238 if (aDriveNumber<0 || aDriveNumber>=KMaxDrives) return KErrArgument; |
239 TInt r = KErrNone; |
239 TInt r = KErrNone; |
240 TInt aDriveLocal = LocalDrives::DriveNumberToLocalDriveNumber(aDriveNumber); |
240 TInt aDriveLocal = LocalDrives::DriveNumberToLocalDriveNumber(aDriveNumber); |
241 if (aDriveLocal == KDriveInvalid) return KErrArgument; |
241 if (aDriveLocal == KDriveInvalid) return KErrArgument; |
244 return CreateLocalDrive(LocalDrives::GetLocalDrive(aDriveNumber)); // drive is really local |
244 return CreateLocalDrive(LocalDrives::GetLocalDrive(aDriveNumber)); // drive is really local |
245 } |
245 } |
246 else |
246 else |
247 { |
247 { |
248 CExtProxyDrive* pProxyDrive = LocalDrives::GetProxyDrive(aDriveNumber); |
248 CExtProxyDrive* pProxyDrive = LocalDrives::GetProxyDrive(aDriveNumber); |
249 __ASSERT_ALWAYS(pProxyDrive != NULL,User::Panic(_L("CreateDrive - pProxyDrive == NULL"), -999)); |
249 __ASSERT_ALWAYS(pProxyDrive != NULL,User::Panic(_L("CreateDrive() - pProxyDrive == NULL"), -999)); |
250 |
250 |
251 iProxyDrive = CreateProxyDriveL(pProxyDrive, this); |
251 TRAP(r, iProxyDrive = CreateProxyDriveL(pProxyDrive,this)); |
252 __ASSERT_ALWAYS(iProxyDrive != NULL,User::Panic(_L("CreateDrive - CreateProxyDrive returned NULL"), -999)); |
252 __ASSERT_ALWAYS(r == KErrNone,User::Panic(_L("CreateDrive() - CreateProxyDriveL error"), -999)); |
253 |
253 |
254 r = InitLocalDrive(); |
254 r = InitLocalDrive(); |
255 } |
255 } |
256 |
256 |
257 return r; |
257 return r; |