terminalsecurity/SCP/SCPServer/src/SCPSession.cpp
branchRCL_3
changeset 24 13d7c31c74e0
parent 12 9e9792ae22e3
child 25 b183ec05bd8c
equal deleted inserted replaced
23:4af31167ea77 24:13d7c31c74e0
  1551     implArray.ResetAndDestroy();
  1551     implArray.ResetAndDestroy();
  1552     CleanupStack :: PopAndDestroy(&implArray);
  1552     CleanupStack :: PopAndDestroy(&implArray);
  1553     Dprint(_L("[CSCPSession]-> NotifyAllStakeHoldersL() <<<"));
  1553     Dprint(_L("[CSCPSession]-> NotifyAllStakeHoldersL() <<<"));
  1554     return KErrNone;
  1554     return KErrNone;
  1555 }
  1555 }
       
  1556 
  1556 TInt CSCPSession :: HandleCleanupL(const RMessage2& aMessage) {
  1557 TInt CSCPSession :: HandleCleanupL(const RMessage2& aMessage) {
       
  1558     Dprint((_L("[CSCPSession]-> HandleCleanupL() >>>")));
       
  1559 	
       
  1560     if( (aMessage.SecureId().iId != KSCPServerSIDTerminalControl) && 
       
  1561         (aMessage.SecureId().iId != KSCPEvntHndlrUid)) {
       
  1562 		
       
  1563         Dprint((_L("[CSCPSession]-> ERROR: caller app id=%ld. Permission denied..."), aMessage.SecureId().iId));
       
  1564         User :: Leave(KErrPermissionDenied);
       
  1565     }
       
  1566 	
  1557     // Copy the client data into a local buffer
  1567     // Copy the client data into a local buffer
  1558     TInt32 lCount = aMessage.GetDesLength(1);
  1568     TInt32 lCount = aMessage.GetDesLength(1);
  1559     
       
  1560 /*    // If the caller is not SCPEventHandler the deny access
       
  1561     if(aMessage.SecureId() != KSCPEvntHndlrUid) {
       
  1562         return KErrPermissionDenied;
       
  1563     }*/
       
  1564     
  1569     
  1565     // Atleast one application id has to be present in the received message (atleast 8 bytes)
  1570     // Atleast one application id has to be present in the received message (atleast 8 bytes)
  1566     if(lCount < sizeof(TInt32)) {
  1571     if(lCount < sizeof(TInt32)) {
  1567         return KErrArgument;
  1572         return KErrArgument;
  1568     }
  1573     }
  1569     
  1574     
       
  1575     TInt lStatus = KErrNone;
  1570     RArray<const TParamChange> lChangeArray;
  1576     RArray<const TParamChange> lChangeArray;
  1571     CleanupClosePushL(lChangeArray);
  1577     CleanupClosePushL(lChangeArray);
  1572     
  1578     
  1573     RPointerArray<HBufC8> lParamValArray;
  1579     RPointerArray<HBufC8> lParamValArray;
  1574     CleanupClosePushL(lParamValArray);
  1580     CleanupClosePushL(lParamValArray);
  1575     
  1581     
  1576     HBufC8* lBuffer = HBufC8 :: NewLC(lCount);
  1582     HBufC8* lBuffer = HBufC8 :: NewLC(lCount);
  1577     TPtr8 bufPtr = lBuffer->Des();
  1583     TPtr8 bufPtr = lBuffer->Des();
  1578     aMessage.ReadL(1, bufPtr);
  1584     aMessage.ReadL(1, bufPtr);    
  1579     
       
  1580     TInt lStatus = KErrNone;
       
  1581     
  1585     
  1582     TRAPD(lErr, lStatus = iServer.PerformCleanupL(lBuffer, lChangeArray, lParamValArray));
  1586     TRAPD(lErr, lStatus = iServer.PerformCleanupL(lBuffer, lChangeArray, lParamValArray));
  1583     
  1587     
  1584     if(lErr != KErrNone) {
  1588     if(lErr != KErrNone) {
  1585         Dprint(_L("[CSCPSession]-> ERROR: SCPServer was unable to complete the operation lErr=%d"), lErr);
  1589         Dprint(_L("[CSCPSession]-> ERROR: SCPServer was unable to complete the operation lErr=%d"), lErr);
  1599         }
  1603         }
  1600     }
  1604     }
  1601     
  1605     
  1602     lParamValArray.ResetAndDestroy();
  1606     lParamValArray.ResetAndDestroy();
  1603     CleanupStack :: PopAndDestroy(3); // lParamIDArray lParamValArray lBuffer    
  1607     CleanupStack :: PopAndDestroy(3); // lParamIDArray lParamValArray lBuffer    
       
  1608     Dprint((_L("[CSCPSession]-> HandleCleanupL() <<<")));
  1604     return lStatus;
  1609     return lStatus;
  1605 }
  1610 }
       
  1611 
  1606 TInt CSCPSession :: HandleSetALPeriodL( const RMessage2& aMessage ) {
  1612 TInt CSCPSession :: HandleSetALPeriodL( const RMessage2& aMessage ) {
  1607     Dprint((_L("[CSCPSession]-> HandleSetParamMessageL() >>>")));
  1613     Dprint((_L("[CSCPSession]-> HandleSetParamMessageL() >>>")));
  1608     TBool oldALState = EFalse;
  1614     TBool oldALState = EFalse;
  1609     TBool lNotifyChange = ETrue;
  1615     TBool lNotifyChange = ETrue;
  1610     #ifndef __WINS__ // No need to check for lock setting changes in emulator
  1616     #ifndef __WINS__ // No need to check for lock setting changes in emulator