// ----------------------------------------------------------------------------- // RVoIPAudioSession::OpenRingTonePlayer // ----------------------------------------------------------------------------- // EXPORT_C TInt RVoIPAudioSession::OpenRingTonePlayer(const RFile& aFileHandle) { TIpcArgs args; aFileHandle.TransferToServer(args, 0, 1); //0=Fs, 1==file handle TInt err = SendClientRequest(EVoIPOpenRingTonePlayerFromRFile, args); return err; }
// ----------------------------------------------------------------------------- // RSWInstLauncher::Install // Launches the software install procedure. // (other items were commented in a header). // ----------------------------------------------------------------------------- // EXPORT_C TInt RSWInstLauncher::Install( RFile& aFile ) { __ASSERT_ALWAYS( iConnected, PanicClient( ESWInstPanicBadHandle ) ); TIpcArgs args; aFile.TransferToServer( args, KFileHandleIpcSlot, KFileSrvSessionIpcSlot ); return SendReceive( ERequestInstallHandle, args ); }
// ----------------------------------------------------------------------------- // RSWInstLauncher::Install // Launches the software install procedure. // (other items were commented in a header). // ----------------------------------------------------------------------------- // EXPORT_C void RSWInstLauncher::Install( TRequestStatus& aReqStatus, RFile& aFile ) { __ASSERT_ALWAYS( iConnected, PanicClient( ESWInstPanicBadHandle ) ); TIpcArgs args; aFile.TransferToServer( args, KFileHandleIpcSlot, KFileSrvSessionIpcSlot ); SendReceive( ERequestInstallHandle, args, aReqStatus ); }
EXPORT_C TInt RFTokenClient::GenerateToken(const RFile& aOpenFile, const TSecurityPolicy& aSecurityPolicy,TDes8& aToken) const { TPtrC8 ptr = aSecurityPolicy.Package(); TIpcArgs ipcArgs(&ptr, &aToken, 0, 0); TInt ret = aOpenFile.TransferToServer(ipcArgs, 2, 3); if (ret == KErrNone) { ret = SendReceive(EGenerateTokenBasedOnOpenHandle, ipcArgs); } return ret; }
// ----------------------------------------------------------------------------- // RSWInstLauncher::SilentInstall // Launches the silent software install procedure. // (other items were commented in a header). // ----------------------------------------------------------------------------- // EXPORT_C TInt RSWInstLauncher::SilentInstall( RFile& aFile, const TDesC8& aParams, const TDesC8& aOptions ) { __ASSERT_ALWAYS( iConnected, PanicClient( ESWInstPanicBadHandle ) ); TIpcArgs args; aFile.TransferToServer( args, KFileHandleIpcSlot, KFileSrvSessionIpcSlot ); args.Set( KParamsIpcSlot, &aParams ); args.Set( KOptionsIpcSlot, &aOptions ); return SendReceive( ERequestSilentInstallParamsHandle, args ); }
// // Registers the runtime security policy with security manager. This method // packs the message parameters required for registering the policy. // // The various parameters required for SetPolicy operation are : // // Operation Code : ESetPolicy // IPC Argument[0] : Policy Identifier (as inOut parameter) // IPC Argument[1] : SecurityPolicy FileHandle // IPC Argument[2] : SecurityPolicy FileSession object // IPC Argument[3] : none // TInt RSecMgrSession::SetPolicy(const RFile& aSecPolicy) { TPckgBuf<TInt> pckgPId; TIpcArgs args(&pckgPId); TInt ret = aSecPolicy.TransferToServer (args, EMsgArgOne, EMsgArgTwo); if ( KErrNone==ret) { ret = SendReceive (ESetPolicy, args); if ( KErrNone==ret) return pckgPId (); // Extract the policyID returned from the server. } return ret; }
EXPORT_C TInt RRtaContent::Open(RFile& aFile) { TIpcArgs ipcArgs; aFile.TransferToServer(ipcArgs, 0, 1); TInt err = RRtaClient::Connect(); if(err == KErrNone) { if(IsDrmCapabilityEnforced()) { err = SendReceive(ECreateContentMessageHandler, TIpcArgs()); } else { err = SendReceive(ENoEnforceCreateContentMessageHandler, TIpcArgs()); } } if(err == KErrNone) { ShareAuto(); if(IsDrmCapabilityEnforced()) { err = SendReceive(EOpenFileHandle, ipcArgs); } else { err = SendReceive(ENoEnforceOpenFileHandle, ipcArgs); } } if(err != KErrNone) { // either connect and open file or don't connect Close(); } return err; }
// // Updates an already registered security policy. Runtimes should call this function // to update their policy. // // The various parameters required for UpdatePolicy operation are : // // Operation Code : EUpdatePolicy // IPC Argument[0] : Policy Identifier // IPC Argument[1] : SecurityPolicy FileHandle // IPC Argument[2] : SecurityPolicy FileSession object // IPC Argument[3] : none // TPolicyID RSecMgrSession::UpdatePolicy(TPolicyID aPolicyID, const RFile& aSecPolicy) { if ( aPolicyID<=KErrNone) { return ErrInvalidPolicyID; } TPckgBuf<TInt> pckgPID(aPolicyID); TIpcArgs args(&pckgPID); TInt ret = aSecPolicy.TransferToServer (args, EMsgArgOne, EMsgArgTwo); if ( KErrNone==ret) { ret = SendReceive (EUpdatePolicy, args); if ( KErrNone==ret) ret = pckgPID (); } return ret; }
// // Opens client-side sub-session for a registered script. The script session is modelled as a // client side sub-session with a peer server side sub-session. // TInt RSecMgrSubSession::Open(const RSessionBase& aSession, CScript& aScriptInfo, TPolicyID aPolicyID, const TDesC& aHashValue) { TIpcArgs args(aScriptInfo.ScriptID (), aPolicyID); TInt errCode(KErrNone); errCode = iFs.Connect(); if(errCode == KErrNone) { if ( KAnonymousScript==aScriptInfo.ScriptID ()) errCode = CreateSubSession (aSession, EGetTrustedUnRegScriptSession, args); else errCode = CreateSubSession (aSession, EGetScriptSession, args); if ( errCode==KErrNone) { // Retrieve the RFs and RFile handles from the server TPckgBuf<TInt> fh; // sub-session (RFile) handle TIpcArgs args(&fh); RFile file; CleanupClosePushL(file); if ( KErrNone==errCode) { iFs.ShareProtected (); TFileName tempDirPath; TFileName tempPath; iFs.PrivatePath (tempDirPath); BaflUtils::EnsurePathExistsL (iFs, tempDirPath); errCode = file.Temp (iFs, tempDirPath, tempPath, EFileWrite); if ( KErrNone==errCode) { file.TransferToServer (args, EMsgArgOne, EMsgArgTwo); errCode = SendReceive (EGetScriptFile, args); if ( KErrNone==errCode) { RFileReadStream rfs(file); CleanupClosePushL(rfs); aScriptInfo.InternalizeL (rfs); TBufC<KMaxPath> hashValue(aScriptInfo.Hash()); if(0 != hashValue.Compare(KNullDesC)) { if(!aScriptInfo.HashMatch(aHashValue)) { //hash check failed errCode = KErrNotFound; } } CleanupStack::PopAndDestroy(&rfs); } } iFs.Delete (tempPath); } CleanupStack::PopAndDestroy(&file); } } return errCode; }