void CMessageKeyProcessor::ProcessKeyPress(TChar aChar) { TInt error = KErrNone; aChar.UpperCase(); switch(aChar) { case 'Q': case EKeyEscape: { TInt err = KErrNone; for(TInt j=0; j<KMaxDrives; j++) { err = RestoreMount(j); if (err) { // Mount is busy/locked and can not be restored. break; } } if (err == KErrNone) { CActiveScheduler::Stop(); return; } } break; #if defined(_DEBUG) case 'T': iTraceEnable = !iTraceEnable; if (iTraceEnable) // 0x44008401 User::SetDebugMask(KHARDWARE|KDLL|KSCRATCH|KPOWER|KMEMTRACE); else User::SetDebugMask(0); break; #endif case 'D': if(++selectedDriveIndex >= PropertyHandlers::allDrivesStatus.Length()/2) { selectedDriveIndex = 0; } ShowDriveSelection(); break; case 'M': if(PropertyHandlers::allDrivesStatus.Length()) { MountMsFs(PropertyHandlers::allDrivesStatus[selectedDriveIndex*2]); } break; case 'U': if(PropertyHandlers::allDrivesStatus.Length()) { RestoreMount(PropertyHandlers::allDrivesStatus[selectedDriveIndex*2]); } break; case 'L': { // lock unprotected drive TMediaPassword password; MakePassword(password); _LIT(KEmpty, ""); TMediaPassword nul; nul.Copy(KEmpty); error = fs.LockDrive(PropertyHandlers::allDrivesStatus[selectedDriveIndex*2], nul, password, ETrue); console->SetPos(0,9); LogPrint(_L("LockDrive %S (%d)"), (error?&KError:&KOk), error); break; } case 'I': { // lock password protected drive TMediaPassword password; MakePassword(password); error = fs.LockDrive(PropertyHandlers::allDrivesStatus[selectedDriveIndex*2], password, password, ETrue); console->SetPos(0,9); LogPrint(_L("LockDrive %S (%d)"), (error?&KError:&KOk), error); break; } case 'N': { TMediaPassword password; MakePassword(password); error = fs.UnlockDrive(PropertyHandlers::allDrivesStatus[selectedDriveIndex*2], password, ETrue); Clear(9); LogPrint(_L("UnlockDrive %S (%d)"), (error?&KError:&KOk), error); } break; case 'C': { TMediaPassword password; MakePassword(password); error = fs.ClearPassword(PropertyHandlers::allDrivesStatus[selectedDriveIndex*2], password); Clear(9); LogPrint(_L("ClearPassword %S (%d)"), (error?&KError:&KOk), error); } break; default: break; } RequestCharacter(); }