memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp
changeset 26 41ebde60981f
parent 17 4f2773374eff
child 31 e7a04a6385be
equal deleted inserted replaced
25:31fc1277642e 26:41ebde60981f
   163     }
   163     }
   164 
   164 
   165 
   165 
   166 void CMemSpyViewKernelObjects::SetListBoxModelL()
   166 void CMemSpyViewKernelObjects::SetListBoxModelL()
   167     {
   167     {
   168     _LIT( KLineFormatSpec, "\t%S" );
   168     //_LIT( KLineFormatSpec, "\t%S" );
   169     _LIT( KTab, "\t" );
   169     _LIT( KTab, "\t" );
   170        
   170        
   171     iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );
   171     iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );
   172 
   172 
   173     iModel = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() ); //array for formated items
   173     iModel = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() ); //array for formated items
   176     	{
   176     	{
   177 		HBufC* tempName = HBufC::NewL( iKernelObjectItems[i]->Name().Length() + 16 );
   177 		HBufC* tempName = HBufC::NewL( iKernelObjectItems[i]->Name().Length() + 16 );
   178     	CleanupStack::PushL( tempName );
   178     	CleanupStack::PushL( tempName );
   179     	TPtr tempNamePtr( tempName->Des() );
   179     	TPtr tempNamePtr( tempName->Des() );
   180     	tempNamePtr.Copy( KTab );
   180     	tempNamePtr.Copy( KTab );
   181     	tempNamePtr.Append( iKernelObjectItems[i]->Name() );
   181     	
       
   182     	TBuf<KMaxName> temp;
       
   183     	temp.Copy(iKernelObjectItems[i]->Name());    	
       
   184     	tempNamePtr.Append( temp	 );
   182     	iModel->AppendL( tempNamePtr );
   185     	iModel->AppendL( tempNamePtr );
   183     	
   186     	
   184     	CleanupStack::PopAndDestroy( tempName ); 
   187     	CleanupStack::PopAndDestroy( tempName ); 
   185     	}
   188     	}
   186     
   189     
   246     return handled;
   249     return handled;
   247     }
   250     }
   248 
   251 
   249 
   252 
   250 TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
   253 TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
   251     {
   254     {	
   252 	// TODO: to remove support of tabs
       
   253     TKeyResponse resp = EKeyWasNotConsumed;
   255     TKeyResponse resp = EKeyWasNotConsumed;
   254     if  ( iTabs && ( aKeyEvent.iScanCode == EStdKeyRightArrow || aKeyEvent.iScanCode == EStdKeyLeftArrow ) )
   256     resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
   255         {
   257     //}
   256         resp = iTabs->OfferKeyEventL( aKeyEvent, aType );
       
   257         }
       
   258     else
       
   259         {
       
   260         resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
       
   261         }
       
   262     return resp;
   258     return resp;
   263     }
   259     }
   264 
   260 
   265 
       
   266 void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
   261 void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
   267     {
   262     {
   268 	/* TODO: tabs removed
       
   269     iObjectType = (TMemSpyDriverContainerType)iTabs->ActiveTabId();
       
   270     RefreshL();
       
   271     */
       
   272     }
   263     }
   273 
   264 
   274 
   265 
   275 void CMemSpyViewKernelObjects::OnCmdTerminateL()
   266 void CMemSpyViewKernelObjects::OnCmdTerminateL()
   276     {
   267     {
   277     switch ( iObjectType )
   268     switch ( iObjectType )
   278         {
   269         {
   279         case EMemSpyDriverContainerTypeThread:
   270         case EMemSpyDriverContainerTypeThread:
   280             {
   271             {
       
   272             TBool err = EFalse;
   281             TBool doTerminate = ETrue;
   273             TBool doTerminate = ETrue;
   282             
   274             
   283             //CMemSpyEngineObjectContainer& container = iEngine.Container();
   275             //CMemSpyEngineObjectContainer& container = iEngine.Container();
   284             //TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   276             //TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   285             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
   277             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
   286             
   278                         
   287             TBool err;
       
   288             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
   279             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
   289             
   280             
   290             // Try to find the thread in question...
   281             // Try to find the thread in question...
   291             //CMemSpyProcess* process = NULL;
   282             //CMemSpyProcess* process = NULL;
   292             //CMemSpyThread* thread = NULL; 
   283             //CMemSpyThread* thread = NULL; 
   297 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   288 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   298 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   289 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   299 				
   290 				
   300 				if ( doTerminate )
   291 				if ( doTerminate )
   301 					{
   292 					{
   302 					iMemSpySession.TerminateThread( id );
   293 					iMemSpySession.EndThread( id, ETerminate );
       
   294 					RefreshL();
   303 					}
   295 					}
   304             	}            
   296             	}            
   305             
   297             
   306             /*
   298             /*
   307             if ( thread )
   299             if ( thread )
   317                 if  ( doTerminate )
   309                 if  ( doTerminate )
   318                     {
   310                     {
   319                     thread->TerminateL();
   311                     thread->TerminateL();
   320                     }                
   312                     }                
   321                 }
   313                 }
   322             */
   314             */            
   323             RefreshL();
       
   324             break;
   315             break;
   325             }        
   316             }        
   326         case EMemSpyDriverContainerTypeProcess:
   317         case EMemSpyDriverContainerTypeProcess:
   327             {
   318             {
       
   319             TBool err = EFalse;
   328             TBool doTerminate = ETrue;
   320             TBool doTerminate = ETrue;
       
   321             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
       
   322             iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
       
   323             
       
   324             if( err )
       
   325             	{
       
   326 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
       
   327                 doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   328                 
       
   329                 if( doTerminate )
       
   330                 	{
       
   331                     iMemSpySession.EndProcess( id, ETerminate );     
       
   332                     RefreshL();
       
   333                     }
       
   334             	}
       
   335             
   329             // Obtain the process that corresponds to the selected item
   336             // Obtain the process that corresponds to the selected item
   330             //CMemSpyEngineObjectContainer& container = iEngine.Container();
   337             /*
   331             //TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   338             CMemSpyEngineObjectContainer& container = iEngine.Container();
   332             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
   339             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );                                                
   333             
       
   334             CMemSpyProcess& process = container.ProcessByIdL( id );
   340             CMemSpyProcess& process = container.ProcessByIdL( id );
   335             process.Open();
   341             process.Open();			
   336 
   342             						
   337             if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
   343             if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
   338                 {
   344                 {
   339                 CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   345                 CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   340                 doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   346                 doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   341                 }
   347                 }
   342             //
   348             //
   343             if  ( doTerminate )
   349             if  ( doTerminate )
   344                 {
   350                 {
   345                 process.TerminateL();
   351                 process.TerminateL();
   346                 RefreshL();
   352                 RefreshL();
   347                 }
   353                 }*/
       
   354             
   348             break;
   355             break;
   349             }
   356             }
   350         default:
   357         default:
   351             {
   358             {
   352             // Programming error
   359             // Programming error
   355         }
   362         }
   356     }
   363     }
   357 
   364 
   358 
   365 
   359 void CMemSpyViewKernelObjects::OnCmdSwitchToL()
   366 void CMemSpyViewKernelObjects::OnCmdSwitchToL()
   360     {/*
   367     {	
       
   368 	TBool brought = EFalse;
       
   369 	/*
   361     TInt wgCount;
   370     TInt wgCount;
   362     RWsSession wsSession;
   371     RWsSession wsSession;
   363     User::LeaveIfError( wsSession.Connect() );
   372     User::LeaveIfError( wsSession.Connect() );
   364     CleanupClosePushL( wsSession );
   373     CleanupClosePushL( wsSession );
   365     User::LeaveIfError( wgCount = wsSession.NumWindowGroups() );
   374     User::LeaveIfError( wgCount = wsSession.NumWindowGroups() );
   368     User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) );
   377     User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) );
   369     TApaTask task( wsSession );
   378     TApaTask task( wsSession );
   370     TBool brought( EFalse );
   379     TBool brought( EFalse );
   371     TInt wgId( KErrNotFound );
   380     TInt wgId( KErrNotFound );
   372     TThreadId threadId;
   381     TThreadId threadId;
       
   382     */
   373     switch ( iObjectType )
   383     switch ( iObjectType )
   374         {
   384         {    	    	    	
   375         case EMemSpyDriverContainerTypeThread:
   385         case EMemSpyDriverContainerTypeThread:
   376             {
   386             {
   377             TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   387             TThreadId currentThreadId( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
       
   388             TInt error = iMemSpySession.SwitchToThread( currentThreadId, brought );
       
   389             /*
       
   390             TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );            
   378             
   391             
   379             // loop trough all window groups and see if a thread id matches
   392             // loop trough all window groups and see if a thread id matches
   380             while( !brought && wgCount-- )
   393             while( !brought && wgCount-- )
   381                 {
   394                 {
   382                 wgId = wgArray[wgCount].iId;
   395                 wgId = wgArray[wgCount].iId;
   390                         task.BringToForeground();
   403                         task.BringToForeground();
   391                         brought = ETrue;                        
   404                         brought = ETrue;                        
   392                         }
   405                         }
   393                     CleanupStack::PopAndDestroy( wgName );
   406                     CleanupStack::PopAndDestroy( wgName );
   394                     }
   407                     }
   395                 }                
   408                 }
       
   409                 */                
   396             break;
   410             break;
   397             }
   411             }
   398         case EMemSpyDriverContainerTypeProcess:
   412         case EMemSpyDriverContainerTypeProcess:
   399             {
   413             {                        
   400             CMemSpyEngineObjectContainer& container = iEngine.Container();
   414             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
   401             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   415             TInt error = iMemSpySession.SwitchToProcess( id, brought  );
   402             CMemSpyProcess& process = container.ProcessByIdL( id );
   416             /*
       
   417             //CMemSpyEngineObjectContainer& container = iEngine.Container();
       
   418             //TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
       
   419             //CMemSpyProcess& process = container.ProcessByIdL( id );
       
   420             
       
   421             TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
       
   422             
   403             
   423             
   404             // loop trough threads in a process
   424             // loop trough threads in a process
   405             for ( TInt i = 0; i < process.MdcaCount(); i++ )
   425             for ( TInt i = 0; i < process.MdcaCount(); i++ )
   406                 {
   426                 {
   407                 TInt wgCountLocal = wgCount;
   427                 TInt wgCountLocal = wgCount;
   422                             }
   442                             }
   423                         CleanupStack::PopAndDestroy( wgName );
   443                         CleanupStack::PopAndDestroy( wgName );
   424                         }
   444                         }
   425                     }
   445                     }
   426                 }
   446                 }
   427 
   447 			*/
   428             break;
   448             break;
   429             }
   449             }
   430         default:
   450         default:
   431             {
   451             {
   432             // Programming error
   452             // Programming error
   436     if ( !brought )
   456     if ( !brought )
   437         {
   457         {
   438         // Error handling in HandleCommandL
   458         // Error handling in HandleCommandL
   439         User::Leave( KErrGeneral );
   459         User::Leave( KErrGeneral );
   440         }
   460         }
   441     CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession*/
   461     CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession    
   442     }
   462     }
   443 
   463 
   444 
   464 
   445 void CMemSpyViewKernelObjects::OnCmdEndL()
   465 void CMemSpyViewKernelObjects::OnCmdEndL()
   446     {/*
   466     {
   447     switch ( iObjectType )
   467     switch ( iObjectType )
   448         {
   468         {
   449         case EMemSpyDriverContainerTypeThread:
   469         case EMemSpyDriverContainerTypeThread:
   450             {
   470             {
       
   471             TBool err = EFalse;
   451             TBool doTerminate = ETrue;
   472             TBool doTerminate = ETrue;
   452             
   473             
       
   474             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
       
   475             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
       
   476             
       
   477             if( err )
       
   478             	{
       
   479 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   480 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   481                         				
       
   482 				if ( doTerminate )
       
   483 					{
       
   484 					iMemSpySession.EndThread( id, EKill );
       
   485 					RefreshL();
       
   486 					}
       
   487             	}            
       
   488 
       
   489             
       
   490             /*
   453             CMemSpyEngineObjectContainer& container = iEngine.Container();
   491             CMemSpyEngineObjectContainer& container = iEngine.Container();
   454             TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   492             TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   455             
   493             
   456             // Try to find the thread in question...
   494             // Try to find the thread in question...
   457             CMemSpyProcess* process = NULL;
   495             CMemSpyProcess* process = NULL;
   471                 if  ( doTerminate )
   509                 if  ( doTerminate )
   472                     {
   510                     {
   473                     thread->KillL();
   511                     thread->KillL();
   474                     }                
   512                     }                
   475                 }
   513                 }
       
   514             
   476             RefreshL();
   515             RefreshL();
       
   516             */
   477             break;
   517             break;
   478             }
   518             }
   479         case EMemSpyDriverContainerTypeProcess:
   519         case EMemSpyDriverContainerTypeProcess:
   480             {
   520             {
       
   521             TBool err = EFalse;
       
   522             TBool doTerminate = ETrue;
       
   523             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
       
   524             iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
       
   525             
       
   526             if( err )
       
   527             	{
       
   528 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
       
   529 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   530 				
       
   531 				if( doTerminate )
       
   532 					{
       
   533 					iMemSpySession.EndProcess( id, EKill);     
       
   534 					RefreshL();
       
   535 					}
       
   536             	}
       
   537             
       
   538             /*
   481             TBool doTerminate = ETrue;
   539             TBool doTerminate = ETrue;
   482             // Obtain the process that corresponds to the selected item
   540             // Obtain the process that corresponds to the selected item
   483             CMemSpyEngineObjectContainer& container = iEngine.Container();
   541             CMemSpyEngineObjectContainer& container = iEngine.Container();
   484             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   542             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   485             CMemSpyProcess& process = container.ProcessByIdL( id );
   543             CMemSpyProcess& process = container.ProcessByIdL( id );
   493             if  ( doTerminate )
   551             if  ( doTerminate )
   494                 {
   552                 {
   495                 process.KillL();
   553                 process.KillL();
   496                 RefreshL();
   554                 RefreshL();
   497                 }
   555                 }
   498 
   556 			*/
   499             break;
   557             break;
   500             }
   558             }
   501         default:
   559         default:
   502             {
   560             {
   503             // Programming error
   561             // Programming error
   504             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
   562             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
   505             }
   563             }
   506         }    */
   564         }    
   507     }
   565     }
   508 
   566 
   509 
   567 
   510 void CMemSpyViewKernelObjects::OnCmdPanicL()
   568 void CMemSpyViewKernelObjects::OnCmdPanicL()
   511     {/*
   569     {
   512     switch ( iObjectType )
   570     switch ( iObjectType )
   513         {
   571         {
   514         case EMemSpyDriverContainerTypeThread:
   572         case EMemSpyDriverContainerTypeThread:
   515             {
   573             {
       
   574             TBool err = EFalse;
   516             TBool doTerminate = ETrue;
   575             TBool doTerminate = ETrue;
   517             
   576             
   518             CMemSpyEngineObjectContainer& container = iEngine.Container();
   577             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
   519             TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   578             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
   520             
   579             
   521             // Try to find the thread in question...
   580             if( err )
   522             CMemSpyProcess* process = NULL;
   581             	{
   523             CMemSpyThread* thread = NULL; 
   582 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   524             User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
   583 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   525 
   584                         				
   526             if ( thread )
   585 				if ( doTerminate )
   527                 {
   586 					{
   528                 thread->Open();
   587 					iMemSpySession.EndThread( id, EPanic );
   529                 //
   588 					RefreshL();
   530                 if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
   589 					}
   531                     {
   590             	}
   532                     CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   591             
   533                     doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   534                     }
       
   535                 //
       
   536                 if  ( doTerminate )
       
   537                     {
       
   538                     thread->PanicL();
       
   539                     }                
       
   540                 }
       
   541             RefreshL();
       
   542             break;
   592             break;
   543             }
   593             }
   544         case EMemSpyDriverContainerTypeProcess:
   594         case EMemSpyDriverContainerTypeProcess:
   545             {
   595             {
       
   596             TBool err = EFalse;
   546             TBool doTerminate = ETrue;
   597             TBool doTerminate = ETrue;
   547             // Obtain the process that corresponds to the selected item
   598             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
   548             CMemSpyEngineObjectContainer& container = iEngine.Container();
   599             iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
   549             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
   600             
   550             CMemSpyProcess& process = container.ProcessByIdL( id );
   601             if( err )
   551             process.Open();
   602             	{
   552 
   603 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
   553             if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
   604 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   554                 {
   605                            
   555                 CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
   606 				if( doTerminate )
   556                 doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
   607 					{
   557                 }
   608 					iMemSpySession.EndProcess( id, EPanic );     
   558             if  ( doTerminate )
   609 					RefreshL();
   559                 {
   610 					}
   560                 process.PanicL();
   611             	}
   561                 RefreshL();
   612         
   562                 }
       
   563             break;
   613             break;
   564             }
   614             }
   565         default:
   615         default:
   566             {
   616             {
   567             // Programming error
   617             // Programming error
   568             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
   618             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
   569             }
   619             }
   570         }*/
   620         }
   571     }
   621     }
   572 
   622 
   573 
   623 
   574 void CMemSpyViewKernelObjects::CreateTabsL()
   624 void CMemSpyViewKernelObjects::CreateTabsL()
   575     {
   625     {
       
   626 	TMemSpyDriverContainerType type = iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Type();
       
   627 	const TPtrC pType( TypeAsString( type ) );
       
   628 	
   576 	CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
   629 	CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
   577 	TUid uid;
   630 	TUid uid;
   578 	uid.iUid = EEikStatusPaneUidNavi;
   631 	uid.iUid = EEikStatusPaneUidNavi;
   579 	iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );	
   632 	iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );	
   580 	iNavDecorator=iNaviPane->CreateMessageLabelL(_L("Kernel Object Type")); //TODO: To print there kernel object type
   633 	iNavDecorator=iNaviPane->CreateMessageLabelL( pType );
   581 	iNaviPane->PushL(*iNavDecorator); 
   634 	iNaviPane->PushL(*iNavDecorator); 		
   582 	/*
   635     }
   583     CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
   636 
   584     TUid uid;
   637 TPtrC CMemSpyViewKernelObjects::TypeAsString( TMemSpyDriverContainerType aType )
   585     uid.iUid = EEikStatusPaneUidNavi;
   638 	{
   586     iNavDecorator = ((CAknNavigationControlContainer*)(statusPane->ControlL(uid)))->Top();
   639 	 _LIT( KTypeUnknown, "Unknown Type" );
   587 
   640 	 _LIT( KTypeThread, "Thread" );
   588     if ( !iNavDecorator )
   641 	 _LIT( KTypeProcess, "Process" );
   589         {
   642 	 _LIT( KTypeChunk, "Chunk" );
   590         iNavContainer = (CAknNavigationControlContainer*)statusPane->ControlL(uid);
   643 	 _LIT( KTypeLibrary, "Library" );
   591         iNavDecorator = iNavContainer->CreateTabGroupL();
   644 	 _LIT( KTypeSemaphore, "Semaphore" );
   592 
   645 	 _LIT( KTypeMutex, "Mutex" );
   593         iTabs = ( CAknTabGroup* )iNavDecorator->DecoratedControl();
   646 	 _LIT( KTypeTimer, "Timer" );
   594         iTabs->SetTabFixedWidthL( KTabWidthWithThreeLongTabs );
   647 	 _LIT( KTypeServer, "Server" );
   595     
   648 	 _LIT( KTypeSession, "Session" );
   596         for ( TInt i = 0; i < iModel->Count(); i++ )
   649 	 _LIT( KTypeLogicalDevice, "Logical Device" );
   597             {
   650 	 _LIT( KTypePhysicalDevice, "Physical Device" );
   598             const CMemSpyEngineGenericKernelObjectList& item = iModel->At( i );
   651 	 _LIT( KTypeLogicalChannel, "Logical Channel" );
   599             iTabs->AddTabL( item.Type(), item.TypeAsString( item.Type() ) );
   652 	 _LIT( KTypeChangeNotifier, "Change Notifier" );
   600             }
   653 	 _LIT( KTypeUndertaker, "Undertaker" );
   601         iTabs->SetActiveTabById( iObjectType );
   654 	 _LIT( KTypeMsgQueue, "Msg. Queue" );
   602         iTabs->SetObserver( this );
   655 	 _LIT( KTypePropertyRef, "Property Ref." );
   603         iNavContainer->PushL( *iNavDecorator );
   656 	 _LIT( KTypeCondVar, "Conditional Var." );
   604        }
   657 	 //
   605        */
   658 	 TPtrC pType( KTypeUnknown );
   606     }
   659 	 //
   607 
   660 	 switch( aType )
       
   661 		{
       
   662 	    case EMemSpyDriverContainerTypeThread:
       
   663 	    	pType.Set( KTypeThread );
       
   664 	    	break;
       
   665 	    case EMemSpyDriverContainerTypeProcess:
       
   666 	        pType.Set( KTypeProcess );
       
   667 	        break;
       
   668 	    case EMemSpyDriverContainerTypeChunk:
       
   669 	        pType.Set( KTypeChunk );
       
   670 	        break;
       
   671 	    case EMemSpyDriverContainerTypeLibrary:
       
   672 	        pType.Set( KTypeLibrary );
       
   673 	        break;
       
   674 	    case EMemSpyDriverContainerTypeSemaphore:
       
   675 	        pType.Set( KTypeSemaphore );
       
   676 	        break;
       
   677 	    case EMemSpyDriverContainerTypeMutex:
       
   678 	        pType.Set( KTypeMutex );
       
   679 	        break;
       
   680 	    case EMemSpyDriverContainerTypeTimer:
       
   681 	        pType.Set( KTypeTimer );
       
   682 	        break;
       
   683 	    case EMemSpyDriverContainerTypeServer:
       
   684 	        pType.Set( KTypeServer );
       
   685 	        break;
       
   686 	    case EMemSpyDriverContainerTypeSession:
       
   687 	        pType.Set( KTypeSession );
       
   688 	        break;
       
   689 	    case EMemSpyDriverContainerTypeLogicalDevice:
       
   690 	        pType.Set( KTypeLogicalDevice );
       
   691 	        break;
       
   692 	    case EMemSpyDriverContainerTypePhysicalDevice:
       
   693 	        pType.Set( KTypePhysicalDevice );
       
   694 	        break;
       
   695 	    case EMemSpyDriverContainerTypeLogicalChannel:
       
   696 	        pType.Set( KTypeLogicalChannel );
       
   697 	        break;
       
   698 	    case EMemSpyDriverContainerTypeChangeNotifier:
       
   699 	        pType.Set( KTypeChangeNotifier );
       
   700 	        break;
       
   701 	    case EMemSpyDriverContainerTypeUndertaker:
       
   702 	        pType.Set( KTypeUndertaker );
       
   703 	        break;
       
   704 	    case EMemSpyDriverContainerTypeMsgQueue:
       
   705 	        pType.Set( KTypeMsgQueue );
       
   706 	        break;
       
   707 	    case EMemSpyDriverContainerTypePropertyRef:
       
   708 	        pType.Set( KTypePropertyRef );
       
   709 	        break;
       
   710 	    case EMemSpyDriverContainerTypeCondVar:
       
   711 	        pType.Set( KTypeCondVar );
       
   712 	        break;
       
   713 	        
       
   714 	    default:
       
   715 	        break;
       
   716 		}
       
   717 	    //
       
   718 	return pType;
       
   719 	}
   608 
   720 
   609 void CMemSpyViewKernelObjects::DetailsL()
   721 void CMemSpyViewKernelObjects::DetailsL()
   610     {
   722     {
   611     HBufC* messageBuf = HBufC::NewLC( 40960 );
   723     HBufC* messageBuf = HBufC::NewLC( 40960 );
   612     TPtr messagePtr = messageBuf->Des();
   724     TPtr messagePtr = messageBuf->Des();