1466 return(KErrNotFound); |
1466 return(KErrNotFound); |
1467 return(aRequest->Drive()->MountExtension(pE,EFalse)); |
1467 return(aRequest->Drive()->MountExtension(pE,EFalse)); |
1468 } |
1468 } |
1469 |
1469 |
1470 TInt TFsMountExtension::Initialise(CFsRequest* aRequest) |
1470 TInt TFsMountExtension::Initialise(CFsRequest* aRequest) |
1471 // |
1471 { |
1472 // |
1472 TInt r; |
1473 // |
1473 |
1474 { |
1474 //-- check extension name length. It should not exceed KMaxFSNameLength (32 characters) |
1475 TInt r=ValidateDrive(aRequest->Message().Int1(),aRequest); |
1475 r = aRequest->GetDesLength(KMsgPtr0); |
|
1476 if(r <=0 || r >KMaxFSNameLength) |
|
1477 return KErrArgument; |
|
1478 |
|
1479 r = ValidateDrive(aRequest->Message().Int1(),aRequest); |
1476 if(r!=KErrNone) |
1480 if(r!=KErrNone) |
1477 return(r); |
1481 return r; |
|
1482 |
1478 if(aRequest->Drive()->IsSubsted()) |
1483 if(aRequest->Drive()->IsSubsted()) |
1479 return(KErrNotSupported); |
1484 return KErrNotSupported; |
1480 return(r); |
1485 |
|
1486 return r; |
1481 } |
1487 } |
1482 |
1488 |
1483 |
1489 |
1484 TInt TFsDismountExtension::DoRequestL(CFsRequest* aRequest) |
1490 TInt TFsDismountExtension::DoRequestL(CFsRequest* aRequest) |
1485 // |
1491 // |
1486 // Dismount extension |
1492 // Dismount extension |
1487 // |
1493 // |
1488 { |
1494 { |
1489 TFullName name; |
1495 TFSName name; |
1490 aRequest->ReadL(KMsgPtr0,name); |
1496 aRequest->ReadL(KMsgPtr0,name); |
1491 CProxyDriveFactory* pE=GetExtension(name); |
1497 CProxyDriveFactory* pE=GetExtension(name); |
1492 if (pE==NULL) |
1498 if (pE==NULL) |
1493 return(KErrNotFound); |
1499 return(KErrNotFound); |
1494 return(aRequest->Drive()->DismountExtension(pE,EFalse)); |
1500 return(aRequest->Drive()->DismountExtension(pE,EFalse)); |
1495 } |
1501 } |
1496 |
1502 |
1497 |
1503 |
1498 TInt TFsDismountExtension::Initialise(CFsRequest* aRequest) |
1504 TInt TFsDismountExtension::Initialise(CFsRequest* aRequest) |
1499 // |
1505 { |
1500 // |
1506 TInt r; |
1501 // |
1507 |
1502 { |
1508 //-- check extension name length. It should not exceed KMaxFSNameLength (32 characters) |
|
1509 r = aRequest->GetDesLength(KMsgPtr0); |
|
1510 if(r <=0 || r >KMaxFSNameLength) |
|
1511 return KErrArgument; |
|
1512 |
1503 if (!KCapFsDismountExtension.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Dismount File Extension"))) |
1513 if (!KCapFsDismountExtension.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Dismount File Extension"))) |
1504 return KErrPermissionDenied; |
1514 return KErrPermissionDenied; |
1505 TInt r=ValidateDrive(aRequest->Message().Int1(),aRequest); |
1515 |
|
1516 r = ValidateDrive(aRequest->Message().Int1(),aRequest); |
1506 if(r!=KErrNone) |
1517 if(r!=KErrNone) |
1507 return(r); |
1518 return r; |
|
1519 |
1508 if(aRequest->Drive()->IsSubsted()) |
1520 if(aRequest->Drive()->IsSubsted()) |
1509 return(KErrNotSupported); |
1521 return(KErrNotSupported); |
1510 return(r); |
1522 |
|
1523 return r; |
1511 } |
1524 } |
1512 |
1525 |
1513 TInt TFsRemoveExtension::DoRequestL(CFsRequest* aRequest) |
1526 TInt TFsRemoveExtension::DoRequestL(CFsRequest* aRequest) |
1514 // |
1527 // |
1515 // Remove an extension |
1528 // Remove an extension |