memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp
branchRCL_3
changeset 22 fad26422216a
parent 21 b3cee849fa46
child 23 f8280f3bfeb7
equal deleted inserted replaced
21:b3cee849fa46 22:fad26422216a
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "MemSpyViewKernelObjects.h"
       
    19 
       
    20 // System includes
       
    21 #include <eikspane.h>
       
    22 #include <aknnavide.h> 
       
    23 #include <akntabgrp.h>
       
    24 #include <eikclbd.h>
       
    25 #include <AknQueryDialog.h>
       
    26 #include <aknnotewrappers.h>
       
    27 #include <apgwgnam.h>
       
    28 #include <aknmessagequerydialog.h>
       
    29 
       
    30 // Engine includes
       
    31 #include <memspy/engine/memspyengine.h>
       
    32 #include <memspy/engine/memspyengineobjectprocess.h>
       
    33 #include <memspy/engine/memspyengineobjectthread.h>
       
    34 #include <memspy/engine/memspyengineobjectcontainer.h>
       
    35 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
       
    36 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
       
    37 #include <memspy/engine/memspyenginehelperkernelcontainers.h>
       
    38 #include <memspy/engine/memspyenginehelperserver.h>
       
    39 #include <memspy/engine/memspyenginehelpercondvar.h>
       
    40 
       
    41 #include <memspysession.h>
       
    42 
       
    43 // User includes
       
    44 #include "MemSpyUiUtils.h"
       
    45 #include "MemSpyViewKernel.h"
       
    46 #include "MemSpyContainerObserver.h"
       
    47 #include "MemSpyViewKernelContainers.h"
       
    48 
       
    49 const TInt KMaxInfoLength = 128;
       
    50 
       
    51 /*
       
    52 CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
       
    53 :   CMemSpyViewBase( aEngine, aObserver ),
       
    54     iObjectType( aObjectType ),
       
    55     iCurrItemIndex( KErrNotFound )
       
    56     {
       
    57     }
       
    58 */
       
    59 CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
       
    60 :   CMemSpyViewBase( aSession, aObserver ),
       
    61     iObjectType( aObjectType ),
       
    62     iCurrItemIndex( KErrNotFound )
       
    63     {
       
    64     }
       
    65 
       
    66 
       
    67 CMemSpyViewKernelObjects::~CMemSpyViewKernelObjects()
       
    68     {
       
    69     if ( iNavContainer && iNavDecorator )
       
    70         {
       
    71         iNavContainer->Pop( iNavDecorator );
       
    72         delete iNavDecorator;
       
    73         }
       
    74     delete iModel;
       
    75     delete iItems;
       
    76     delete iObjectList;
       
    77     }
       
    78 
       
    79 
       
    80 void CMemSpyViewKernelObjects::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
       
    81     {
       
    82     _LIT( KTitle, "Kernel Objects" );
       
    83     SetTitleL( KTitle );
       
    84     iItems = new(ELeave) CDesCArrayFlat(5);
       
    85     //
       
    86     CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
       
    87     CreateTabsL();
       
    88     }
       
    89 
       
    90 
       
    91 CEikListBox* CMemSpyViewKernelObjects::ConstructListBoxL()
       
    92     {
       
    93     delete iListBox;
       
    94     iListBox = NULL;
       
    95     CAknSingleStyleListBox* listbox = new (ELeave) CAknSingleStyleListBox();
       
    96     iListBox = listbox;
       
    97     listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
       
    98     listbox->SetContainerWindowL( *this );
       
    99     listbox->CreateScrollBarFrameL( ETrue );
       
   100     SetListBoxModelL();
       
   101     listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
       
   102     listbox->SetListBoxObserver( this );
       
   103     listbox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
       
   104     listbox->SetObserver( this );
       
   105     return listbox;
       
   106     }
       
   107 
       
   108 
       
   109 void CMemSpyViewKernelObjects::RefreshL()
       
   110     {
       
   111     SetListBoxModelL();
       
   112     CMemSpyViewBase::RefreshL();
       
   113     }
       
   114 
       
   115 
       
   116 TMemSpyViewType CMemSpyViewKernelObjects::ViewType() const
       
   117     {
       
   118     return EMemSpyViewTypeKernelObjects;
       
   119     }
       
   120 
       
   121 
       
   122 CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareParentViewL()
       
   123     {	
       
   124 	if ( iNaviPane && iNavDecorator )
       
   125 	   {
       
   126 		iNaviPane->Pop( iNavDecorator );
       
   127 		delete iNavDecorator;
       
   128 		iNavDecorator = NULL;
       
   129 	   }	
       
   130     //CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iEngine, iObserver );
       
   131     CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iMemSpySession, iObserver );
       
   132     CleanupStack::PushL( parent );
       
   133     parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
       
   134     CleanupStack::Pop( parent );
       
   135     return parent;
       
   136     }
       
   137 
       
   138 
       
   139 CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareChildViewL()
       
   140     {
       
   141     CMemSpyViewBase* child = NULL;
       
   142     if ( iListBox && 
       
   143          iListBox->Model()->NumberOfItems() && 
       
   144          iListBox->CurrentItemIndex() > KErrNotFound )
       
   145         {
       
   146         DetailsL();
       
   147         }
       
   148     return child;
       
   149     }
       
   150 
       
   151 
       
   152 void CMemSpyViewKernelObjects::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
       
   153     {
       
   154     if  ( aResourceId == R_MEMSPY_MENUPANE )
       
   155        {
       
   156        if ( iObjectType > EMemSpyDriverContainerTypeProcess )
       
   157            {
       
   158            // Display Terminate, Switch to, End and Panic
       
   159            // commands only for Threads and processes
       
   160            aMenuPane->SetItemDimmed( EMemSpyCmdKernelObjects, ETrue );
       
   161            }
       
   162         }
       
   163     }
       
   164 
       
   165 
       
   166 void CMemSpyViewKernelObjects::SetListBoxModelL()
       
   167     {
       
   168     //_LIT( KLineFormatSpec, "\t%S" );
       
   169     _LIT( KTab, "\t" );
       
   170        
       
   171     iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );
       
   172 
       
   173     iModel = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() ); //array for formated items
       
   174         
       
   175     for ( TInt i = 0; i < iKernelObjectItems.Count(); i++ )
       
   176     	{
       
   177 		HBufC* tempName = HBufC::NewL( iKernelObjectItems[i]->Name().Length() + 16 );
       
   178     	CleanupStack::PushL( tempName );
       
   179     	TPtr tempNamePtr( tempName->Des() );
       
   180     	tempNamePtr.Copy( KTab );
       
   181     	
       
   182     	TBuf<KMaxName> temp;
       
   183     	temp.Copy(iKernelObjectItems[i]->Name());    	
       
   184     	tempNamePtr.Append( temp	 );
       
   185     	iModel->AppendL( tempNamePtr );
       
   186     	
       
   187     	CleanupStack::PopAndDestroy( tempName ); 
       
   188     	}
       
   189     
       
   190     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
       
   191     listbox->Model()->SetItemTextArray( iModel );
       
   192     listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );       
       
   193     }
       
   194 
       
   195 
       
   196 TBool CMemSpyViewKernelObjects::HandleCommandL( TInt aCommand )
       
   197     {
       
   198     TBool handled = ETrue;
       
   199     //
       
   200     switch ( aCommand )
       
   201         {
       
   202         case EMemSpyCmdKernelObjectTerminate:
       
   203             {
       
   204             TRAPD( err, OnCmdTerminateL() );
       
   205             if ( err )
       
   206                 {
       
   207                 CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
       
   208                 note->ExecuteLD( _L("Cannot terminate task") );
       
   209                 }
       
   210             break;
       
   211             }
       
   212         case EMemSpyCmdKernelObjectSwitchTo:
       
   213             {
       
   214             TRAPD( err, OnCmdSwitchToL() );
       
   215             if ( err )
       
   216                 {
       
   217                 CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
       
   218                 note->ExecuteLD( _L("Cannot bring to foreground") );
       
   219                 }
       
   220             break;
       
   221             }
       
   222         case EMemSpyCmdKernelObjectEnd:
       
   223             {
       
   224             TRAPD( err, OnCmdEndL() );
       
   225             if ( err )
       
   226                 {
       
   227                 CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
       
   228                 note->ExecuteLD( _L("Cannot end task") );
       
   229                 }
       
   230             break;
       
   231             }
       
   232         case EMemSpyCmdKernelObjectPanic:
       
   233             {
       
   234             TRAPD( err, OnCmdPanicL() );
       
   235             if ( err )
       
   236                 {
       
   237                 CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
       
   238                 note->ExecuteLD( _L("Cannot panic task") );
       
   239                 }
       
   240             break;
       
   241             }
       
   242         default:
       
   243             {
       
   244             handled = CMemSpyViewBase::HandleCommandL( aCommand );
       
   245             break;        
       
   246             }
       
   247         }
       
   248     //
       
   249     return handled;
       
   250     }
       
   251 
       
   252 
       
   253 TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
       
   254     {	
       
   255     TKeyResponse resp = EKeyWasNotConsumed;
       
   256     resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
       
   257     //}
       
   258     return resp;
       
   259     }
       
   260 
       
   261 void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
       
   262     {
       
   263     }
       
   264 
       
   265 
       
   266 void CMemSpyViewKernelObjects::OnCmdTerminateL()
       
   267     {
       
   268     switch ( iObjectType )
       
   269         {
       
   270         case EMemSpyDriverContainerTypeThread:
       
   271             {
       
   272             TBool err = EFalse;
       
   273             TBool doTerminate = ETrue;
       
   274             
       
   275             //CMemSpyEngineObjectContainer& container = iEngine.Container();
       
   276             //TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
       
   277             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
       
   278                         
       
   279             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
       
   280             
       
   281             // Try to find the thread in question...
       
   282             //CMemSpyProcess* process = NULL;
       
   283             //CMemSpyThread* thread = NULL; 
       
   284             //User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) ); //
       
   285                         
       
   286             if( err )
       
   287             	{
       
   288 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   289 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   290 				
       
   291 				if ( doTerminate )
       
   292 					{
       
   293 					iMemSpySession.EndThread( id, ETerminate );
       
   294 					RefreshL();
       
   295 					}
       
   296             	}            
       
   297             
       
   298             /*
       
   299             if ( thread )
       
   300                 {
       
   301                 thread->Open();
       
   302                 //
       
   303                 if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
       
   304                     {
       
   305                     CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   306                     doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   307                     }
       
   308                 //
       
   309                 if  ( doTerminate )
       
   310                     {
       
   311                     thread->TerminateL();
       
   312                     }                
       
   313                 }
       
   314             */            
       
   315             break;
       
   316             }        
       
   317         case EMemSpyDriverContainerTypeProcess:
       
   318             {
       
   319             TBool err = EFalse;
       
   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             
       
   336             // Obtain the process that corresponds to the selected item
       
   337             /*
       
   338             CMemSpyEngineObjectContainer& container = iEngine.Container();
       
   339             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );                                                
       
   340             CMemSpyProcess& process = container.ProcessByIdL( id );
       
   341             process.Open();			
       
   342             						
       
   343             if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
       
   344                 {
       
   345                 CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   346                 doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   347                 }
       
   348             //
       
   349             if  ( doTerminate )
       
   350                 {
       
   351                 process.TerminateL();
       
   352                 RefreshL();
       
   353                 }*/
       
   354             
       
   355             break;
       
   356             }
       
   357         default:
       
   358             {
       
   359             // Programming error
       
   360             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
       
   361             }
       
   362         }
       
   363     }
       
   364 
       
   365 
       
   366 void CMemSpyViewKernelObjects::OnCmdSwitchToL()
       
   367     {	
       
   368 	TBool brought = EFalse;
       
   369 	/*
       
   370     TInt wgCount;
       
   371     RWsSession wsSession;
       
   372     User::LeaveIfError( wsSession.Connect() );
       
   373     CleanupClosePushL( wsSession );
       
   374     User::LeaveIfError( wgCount = wsSession.NumWindowGroups() );
       
   375     RArray<RWsSession::TWindowGroupChainInfo> wgArray;
       
   376     CleanupClosePushL( wgArray );
       
   377     User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) );
       
   378     TApaTask task( wsSession );
       
   379     TBool brought( EFalse );
       
   380     TInt wgId( KErrNotFound );
       
   381     TThreadId threadId;
       
   382     */
       
   383     switch ( iObjectType )
       
   384         {    	    	    	
       
   385         case EMemSpyDriverContainerTypeThread:
       
   386             {
       
   387             TThreadId currentThreadId( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
       
   388             TInt error = iMemSpySession.SwitchToThread( currentThreadId, brought );
       
   389             /*
       
   390             TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );            
       
   391             
       
   392             // loop trough all window groups and see if a thread id matches
       
   393             while( !brought && wgCount-- )
       
   394                 {
       
   395                 wgId = wgArray[wgCount].iId;
       
   396                 User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
       
   397                 if ( threadId == currentThreadId )
       
   398                     {
       
   399                     CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
       
   400                     task.SetWgId( wgId );
       
   401                     if ( !wgName->Hidden() && task.Exists() )
       
   402                         {
       
   403                         task.BringToForeground();
       
   404                         brought = ETrue;                        
       
   405                         }
       
   406                     CleanupStack::PopAndDestroy( wgName );
       
   407                     }
       
   408                 }
       
   409                 */                
       
   410             break;
       
   411             }
       
   412         case EMemSpyDriverContainerTypeProcess:
       
   413             {                        
       
   414             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
       
   415             TInt error = iMemSpySession.SwitchToProcess( id, brought  );
       
   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             
       
   423             
       
   424             // loop trough threads in a process
       
   425             for ( TInt i = 0; i < process.MdcaCount(); i++ )
       
   426                 {
       
   427                 TInt wgCountLocal = wgCount;
       
   428                 
       
   429                 // loop trough all window groups and see if a thread id matches
       
   430                 while( !brought && wgCountLocal-- )
       
   431                     {
       
   432                     wgId = wgArray[wgCountLocal].iId;
       
   433                     User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
       
   434                     if ( threadId == process.At( i ).Id() )
       
   435                         {
       
   436                         CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
       
   437                         task.SetWgId( wgId );
       
   438                         if ( !wgName->Hidden() && task.Exists() )
       
   439                             {
       
   440                             task.BringToForeground();
       
   441                             brought = ETrue;                        
       
   442                             }
       
   443                         CleanupStack::PopAndDestroy( wgName );
       
   444                         }
       
   445                     }
       
   446                 }
       
   447 			*/
       
   448             break;
       
   449             }
       
   450         default:
       
   451             {
       
   452             // Programming error
       
   453             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
       
   454             }
       
   455         }
       
   456     if ( !brought )
       
   457         {
       
   458         // Error handling in HandleCommandL
       
   459         User::Leave( KErrGeneral );
       
   460         }
       
   461     CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession    
       
   462     }
       
   463 
       
   464 
       
   465 void CMemSpyViewKernelObjects::OnCmdEndL()
       
   466     {
       
   467     switch ( iObjectType )
       
   468         {
       
   469         case EMemSpyDriverContainerTypeThread:
       
   470             {
       
   471             TBool err = EFalse;
       
   472             TBool doTerminate = ETrue;
       
   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             /*
       
   491             CMemSpyEngineObjectContainer& container = iEngine.Container();
       
   492             TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
       
   493             
       
   494             // Try to find the thread in question...
       
   495             CMemSpyProcess* process = NULL;
       
   496             CMemSpyThread* thread = NULL; 
       
   497             User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
       
   498 
       
   499             if ( thread )
       
   500                 {
       
   501                 thread->Open();
       
   502                 //
       
   503                 if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
       
   504                     {
       
   505                     CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   506                     doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   507                     }
       
   508                 //
       
   509                 if  ( doTerminate )
       
   510                     {
       
   511                     thread->KillL();
       
   512                     }                
       
   513                 }
       
   514             
       
   515             RefreshL();
       
   516             */
       
   517             break;
       
   518             }
       
   519         case EMemSpyDriverContainerTypeProcess:
       
   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             /*
       
   539             TBool doTerminate = ETrue;
       
   540             // Obtain the process that corresponds to the selected item
       
   541             CMemSpyEngineObjectContainer& container = iEngine.Container();
       
   542             TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
       
   543             CMemSpyProcess& process = container.ProcessByIdL( id );
       
   544             process.Open();
       
   545 
       
   546             if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
       
   547                 {
       
   548                 CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   549                 doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   550                 }
       
   551             if  ( doTerminate )
       
   552                 {
       
   553                 process.KillL();
       
   554                 RefreshL();
       
   555                 }
       
   556 			*/
       
   557             break;
       
   558             }
       
   559         default:
       
   560             {
       
   561             // Programming error
       
   562             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
       
   563             }
       
   564         }    
       
   565     }
       
   566 
       
   567 
       
   568 void CMemSpyViewKernelObjects::OnCmdPanicL()
       
   569     {
       
   570     switch ( iObjectType )
       
   571         {
       
   572         case EMemSpyDriverContainerTypeThread:
       
   573             {
       
   574             TBool err = EFalse;
       
   575             TBool doTerminate = ETrue;
       
   576             
       
   577             TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
       
   578             iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
       
   579             
       
   580             if( err )
       
   581             	{
       
   582 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
       
   583 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   584                         				
       
   585 				if ( doTerminate )
       
   586 					{
       
   587 					iMemSpySession.EndThread( id, EPanic );
       
   588 					RefreshL();
       
   589 					}
       
   590             	}
       
   591             
       
   592             break;
       
   593             }
       
   594         case EMemSpyDriverContainerTypeProcess:
       
   595             {
       
   596             TBool err = EFalse;
       
   597             TBool doTerminate = ETrue;
       
   598             TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
       
   599             iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
       
   600             
       
   601             if( err )
       
   602             	{
       
   603 				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
       
   604 				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
       
   605                            
       
   606 				if( doTerminate )
       
   607 					{
       
   608 					iMemSpySession.EndProcess( id, EPanic );     
       
   609 					RefreshL();
       
   610 					}
       
   611             	}
       
   612         
       
   613             break;
       
   614             }
       
   615         default:
       
   616             {
       
   617             // Programming error
       
   618             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
       
   619             }
       
   620         }
       
   621     }
       
   622 
       
   623 
       
   624 void CMemSpyViewKernelObjects::CreateTabsL()
       
   625     {
       
   626 	TMemSpyDriverContainerType type = iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Type();
       
   627 	const TPtrC pType( MemSpyUiUtils::TypeAsString( type ) );
       
   628 	
       
   629 	CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
       
   630 	TUid uid;
       
   631 	uid.iUid = EEikStatusPaneUidNavi;
       
   632 	iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );	
       
   633 	iNavDecorator=iNaviPane->CreateMessageLabelL( pType );
       
   634 	iNaviPane->PushL(*iNavDecorator); 		
       
   635     }
       
   636 
       
   637 
       
   638 void CMemSpyViewKernelObjects::DetailsL()
       
   639     {
       
   640     HBufC* messageBuf = HBufC::NewLC( 40960 );
       
   641     TPtr messagePtr = messageBuf->Des();
       
   642 
       
   643     //const TMemSpyDriverHandleInfoGeneric& selectedObject = iObjectList->At( iListBox->CurrentItemIndex() );
       
   644     //iKernelObjectItems[iListBox->CurrentItemIndex];
       
   645 
       
   646     // General attributes:
       
   647     TFullName name;
       
   648     name.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameDetail() );
       
   649     AppendFormatString( messagePtr, _L("Name: %S\n"), &name );
       
   650     name.Zero();
       
   651     name.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
       
   652     AppendFormatString( messagePtr, _L("FullName: %S\n"), &name );
       
   653     name.Zero();
       
   654     AppendFormatString( messagePtr, _L("AccessCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AccessCount() );
       
   655     AppendFormatString( messagePtr, _L("UniqueID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UniqueID() );
       
   656     AppendFormatString( messagePtr, _L("Protection: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Protection() );
       
   657     AppendFormatString( messagePtr, _L("OwnrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfKernelOwner() );
       
   658     AppendFormatString( messagePtr, _L("KernelAddr: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Handle() );
       
   659     
       
   660     // Object type specific attributes:
       
   661     switch ( iKernelObjectItems[iListBox->CurrentItemIndex()]->Type() )
       
   662         {
       
   663         case EMemSpyDriverContainerTypeUnknown:
       
   664             {
       
   665             break;
       
   666             }
       
   667         case EMemSpyDriverContainerTypeThread:
       
   668             {
       
   669             AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
       
   670             AppendFormatString( messagePtr, _L("ThreadID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
       
   671             AppendFormatString( messagePtr, _L("Priority: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Priority() );
       
   672             TFullName procName;
       
   673             procName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
       
   674             AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
       
   675             procName.Zero();
       
   676             break;
       
   677             }
       
   678         case EMemSpyDriverContainerTypeProcess:
       
   679             {
       
   680             AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
       
   681             AppendFormatString( messagePtr, _L("CreatorId: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->CreatorId() );
       
   682             AppendFormatString( messagePtr, _L("Attributes: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Attributes() );
       
   683             AppendFormatString( messagePtr, _L("StckChnk: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfDataBssStackChunk() );
       
   684             AppendFormatString( messagePtr, _L("ProcessID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
       
   685             AppendFormatString( messagePtr, _L("Priority: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Priority() );
       
   686             AppendFormatString( messagePtr, _L("SecurityZone: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SecurityZone() );
       
   687             /* TODO: to solve process details
       
   688             CMemSpyEngineObjectContainer& container = iEngine.Container();
       
   689             TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex().iId );
       
   690             TRAP_IGNORE(
       
   691                 CMemSpyProcess& process = container.ProcessByIdL( id );
       
   692                 AppendFormatString( messagePtr, _L("\nSID: 0x%08X\n"), process.SID() );
       
   693                 AppendFormatString( messagePtr, _L("VID: 0x%08X\n"), process.VID() );
       
   694                 AppendFormatString( messagePtr, _L("UID1: 0x%08X\n"), process.UIDs()[0].iUid  );
       
   695                 AppendFormatString( messagePtr, _L("UID2: 0x%08X\n"), process.UIDs()[1].iUid  );
       
   696                 AppendFormatString( messagePtr, _L("UID3: 0x%08X\n"), process.UIDs()[2].iUid );
       
   697                 AppendFormatString( messagePtr, _L("Caps: 0x%08X%08X"), process.Capabilities().iCaps[0], process.Capabilities().iCaps[1]);
       
   698                 );
       
   699             */
       
   700             break;
       
   701             }
       
   702         case EMemSpyDriverContainerTypeChunk:
       
   703             {
       
   704             AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
       
   705             AppendFormatString( messagePtr, _L("Size: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Size() );
       
   706             AppendFormatString( messagePtr, _L("MaxSize: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MaxSize() );
       
   707             AppendFormatString( messagePtr, _L("Bottom: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Bottom() );
       
   708             AppendFormatString( messagePtr, _L("Top: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Top() );
       
   709             AppendFormatString( messagePtr, _L("Attr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Attributes() );
       
   710             AppendFormatString( messagePtr, _L("Start: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->StartPos() );
       
   711             AppendFormatString( messagePtr, _L("CntrlID: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ControllingOwner() );
       
   712             AppendFormatString( messagePtr, _L("Restrictions: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Restrictions() );
       
   713             AppendFormatString( messagePtr, _L("MapAttr: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MapAttr() );
       
   714             AppendFormatString( messagePtr, _L("Type: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ChunkType() );
       
   715             TFullName procName;
       
   716             procName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
       
   717             AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
       
   718             procName.Zero();
       
   719             // OwnerAddr iAddressOfKernelOwner already listed
       
   720             // ProcAddr iAddressOfOwningProcess already listed
       
   721             break;
       
   722             }
       
   723         case EMemSpyDriverContainerTypeLibrary:
       
   724             {
       
   725             AppendFormatString( messagePtr, _L("\nMapCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MapCount() );
       
   726             AppendFormatString( messagePtr, _L("State: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->State() );
       
   727             AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfCodeSeg() );
       
   728             break;
       
   729             }
       
   730         case EMemSpyDriverContainerTypeSemaphore:
       
   731             {
       
   732             AppendFormatString( messagePtr, _L("\nCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Count() );
       
   733             AppendFormatString( messagePtr, _L("Resetting: %u"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
       
   734             break;
       
   735             }
       
   736         case EMemSpyDriverContainerTypeMutex:
       
   737             {
       
   738             AppendFormatString( messagePtr, _L("\nHoldCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Count() );
       
   739             AppendFormatString( messagePtr, _L("WaitCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->WaitCount() );
       
   740             AppendFormatString( messagePtr, _L("Resetting: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
       
   741             AppendFormatString( messagePtr, _L("Order: %u"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Order() );
       
   742             break;
       
   743             }
       
   744         case EMemSpyDriverContainerTypeTimer:
       
   745             {
       
   746             AppendFormatString( messagePtr, _L("\nState: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TimerState() );
       
   747             AppendFormatString( messagePtr, _L("Type: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TimerType() );
       
   748             break;
       
   749             }
       
   750         case EMemSpyDriverContainerTypeServer:
       
   751             {
       
   752             // Owner == ThrdAddr
       
   753             AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
       
   754             TFullName thrName;
       
   755             thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
       
   756             AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
       
   757             thrName.Zero();
       
   758             AppendFormatString( messagePtr, _L("Type: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SessionType() );
       
   759             TBuf8<55>buf;
       
   760             RArray<TMemSpyDriverServerSessionInfo> sessions;
       
   761             CleanupClosePushL( sessions );
       
   762             /* TODO: to solve server sessions
       
   763             iEngine.HelperServer().GetServerSessionsL( iKernelObjectItems[iListBox->CurrentItemIndex(), sessions );
       
   764             const TInt count = sessions.Count();
       
   765             for ( TInt i = 0; i < count; i++ )
       
   766                 {
       
   767                 const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
       
   768                 AppendFormatString( messagePtr, _L("SessAddr: 0x%08X\n"), session.iAddress );
       
   769                 TFullName sessName;
       
   770                 sessName.Copy( session.iName );
       
   771                 AppendFormatString( messagePtr, _L("Sess: %S\n"), &sessName );
       
   772                 }
       
   773             CleanupStack::PopAndDestroy( &sessions );
       
   774             */
       
   775             break;
       
   776             }
       
   777         case EMemSpyDriverContainerTypeSession:
       
   778             {
       
   779             // Server == SvrAddr
       
   780             AppendFormatString( messagePtr, _L("\nServer: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfServer() );
       
   781             TFullName srvName;
       
   782             srvName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
       
   783             AppendFormatString( messagePtr, _L("Srv: %S\n"), &srvName );
       
   784             srvName.Zero();
       
   785             // Session: not supported
       
   786             AppendFormatString( messagePtr, _L("AccCount: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TotalAccessCount() );
       
   787             AppendFormatString( messagePtr, _L("SesType: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SessionType() );
       
   788             AppendFormatString( messagePtr, _L("SvrType: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SvrSessionType() );
       
   789             AppendFormatString( messagePtr, _L("MsgCount: %d\n"),  iKernelObjectItems[iListBox->CurrentItemIndex()]->MsgCount() );
       
   790             AppendFormatString( messagePtr, _L("MsgLimit: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MsgLimit() );
       
   791             break;
       
   792             }
       
   793         case EMemSpyDriverContainerTypeLogicalDevice:
       
   794             {
       
   795             AppendFormatString( messagePtr, 
       
   796                                 _L("\nVersion: %d.%d.%d\n"), 
       
   797                                 /*
       
   798                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iMajor, TODO: To solve this
       
   799                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iMinor,
       
   800                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iBuild );
       
   801                                 */
       
   802                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
       
   803                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
       
   804                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version() );
       
   805             AppendFormatString( messagePtr, _L("ParseMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ParseMask() );
       
   806             AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UnitsMask() );
       
   807             AppendFormatString( messagePtr, _L("Open channels: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->OpenChannels() );
       
   808             break;
       
   809             }
       
   810         case EMemSpyDriverContainerTypePhysicalDevice:
       
   811             {
       
   812             AppendFormatString( messagePtr, 
       
   813                                 _L("\nVersion: %d.%d.%d\n"), 
       
   814                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
       
   815                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
       
   816                                 iKernelObjectItems[iListBox->CurrentItemIndex()]->Version() );
       
   817             AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UnitsMask() );
       
   818             AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfCodeSeg() );
       
   819             break;
       
   820             }
       
   821         case EMemSpyDriverContainerTypeLogicalChannel:
       
   822             {
       
   823             // No other details
       
   824             break;
       
   825             }
       
   826         case EMemSpyDriverContainerTypeChangeNotifier:
       
   827             {
       
   828             AppendFormatString( messagePtr, _L("\nChanges: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Changes() );
       
   829             // Thread == ThrdAddr
       
   830             AppendFormatString( messagePtr, _L("ThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
       
   831             TFullName thrName;
       
   832             thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
       
   833             AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
       
   834             thrName.Zero();
       
   835             break;
       
   836             }
       
   837         case EMemSpyDriverContainerTypeUndertaker:
       
   838             {
       
   839             // Thread == ThrdAddr
       
   840             AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
       
   841             TFullName thrName;
       
   842             thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
       
   843             AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
       
   844             thrName.Zero();
       
   845             break;
       
   846             }
       
   847         case EMemSpyDriverContainerTypeMsgQueue:
       
   848             {
       
   849             // No other details
       
   850             break;
       
   851             }
       
   852         case EMemSpyDriverContainerTypePropertyRef:
       
   853             {
       
   854             /*
       
   855             Not listing details here, as propertyRef is not listed in TaskMgr.
       
   856             Following propertyRef attributes are available at engine side. 
       
   857             
       
   858             IsReady
       
   859             Type
       
   860             Category
       
   861             Key
       
   862             RefCount
       
   863             ThreadId
       
   864             CreatorSID
       
   865             */
       
   866             break;
       
   867             }
       
   868         case EMemSpyDriverContainerTypeCondVar:
       
   869             {
       
   870             AppendFormatString( messagePtr, _L("\nResetting: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
       
   871             // Using iAddressOfOwningThread for mutex
       
   872             AppendFormatString( messagePtr, _L("Mutex: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
       
   873             // Using iNameOfOwner for mutex
       
   874             TFullName mtxName;
       
   875             mtxName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
       
   876             AppendFormatString( messagePtr, _L("Mtx: %S\n"), &mtxName );
       
   877             mtxName.Zero();
       
   878             AppendFormatString( messagePtr, _L("WaitCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->WaitCount() );
       
   879             
       
   880             RArray<TMemSpyDriverCondVarSuspendedThreadInfo> threads;
       
   881             CleanupClosePushL( threads );
       
   882             /* TODO: to solve thread cond. vars.
       
   883             iEngine.HelperCondVar().GetCondVarSuspendedThreadsL( iKernelObjectItems[iListBox->CurrentItemIndex(), threads );
       
   884             const TInt count = threads.Count();
       
   885             for ( TInt i = 0; i < count; i++ )
       
   886                 {
       
   887                 const TMemSpyDriverCondVarSuspendedThreadInfo& thr = threads[ i ];
       
   888                 AppendFormatString( messagePtr, _L("SuspThrdAddr: 0x%08X\n"), thr.iAddress );
       
   889                 TFullName thrName;
       
   890                 thrName.Copy( thr.iName );
       
   891                 AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
       
   892                 }
       
   893             CleanupStack::PopAndDestroy( &threads );
       
   894             */
       
   895             break;
       
   896             }
       
   897         default:
       
   898             {
       
   899             // Programming error
       
   900             __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
       
   901             }
       
   902         }
       
   903     
       
   904     CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog( CAknQueryDialog::ENoTone );
       
   905     dialog->PrepareLC( R_MEMSPY_KERNEL_OBJECT_DETAILS_DIALOG );
       
   906     TFileName headerText;
       
   907     headerText.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
       
   908     dialog->SetHeaderTextL( headerText );
       
   909     dialog->SetMessageTextL(messagePtr);
       
   910     dialog->RunLD();
       
   911     CleanupStack::PopAndDestroy( messageBuf );
       
   912     }
       
   913 
       
   914 
       
   915 void CMemSpyViewKernelObjects::AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... )
       
   916     {
       
   917     TBuf<KMaxInfoLength> infoString;
       
   918     VA_LIST list;
       
   919     VA_START ( list, aFmt );
       
   920     infoString.FormatList( aFmt, list );
       
   921     aPtr.Append( infoString );
       
   922     }
       
   923