memana/analyzetoolclient/kerneleventhandler/inc/analyzetoolchannel.h
changeset 2 6a82cd05fb1e
parent 1 3ff3fecb12fe
equal deleted inserted replaced
1:3ff3fecb12fe 2:6a82cd05fb1e
     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:  Declaration of the class DAnalyzeToolChannel
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __ANALYZETOOLCHANNEL_H__
       
    20 #define __ANALYZETOOLCHANNEL_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <analyzetool/analyzetool.h>
       
    24 #include <kernel/kernel.h>
       
    25 #ifdef __WINSCW__
       
    26 #include <memmodel/emul/win32/memmodel.h>
       
    27 #endif // __WINSCW__
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class DAnalyzeToolEventHandler;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * The implementation of the abstract base class for a logical channel.
       
    36 */
       
    37 class DAnalyzeToolChannel : public DLogicalChannel
       
    38 	{
       
    39 	public:
       
    40 		
       
    41         /**
       
    42         * C++ default constructor.
       
    43         */
       
    44 		DAnalyzeToolChannel();
       
    45 		
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49 		~DAnalyzeToolChannel();
       
    50 		
       
    51 	protected: // from DLogicalChannel
       
    52 		
       
    53         /**
       
    54         * Creates the logical channel.
       
    55         * @param aUnit A unit of the device.
       
    56         * @param anInfo A pointer to an explicit 8-bit descriptor containing 
       
    57         			    extra information for the physical device
       
    58         * @param aVer The required version of the logical device
       
    59         * @return TInt Returns KErrNone, if successful
       
    60         			   otherwise one of the other system-wide error codes
       
    61         */
       
    62 		virtual TInt DoCreate( TInt aUnit, 
       
    63 							   const TDesC8* anInfo, 
       
    64 							   const TVersion &aVer );
       
    65     
       
    66         /**
       
    67         * Handles a client request.
       
    68         * @param aFunction The requested function.
       
    69         * @param a1 A 32-bit value passed to the kernel-side. Its meaning 
       
    70         			  depends on the device driver requirements
       
    71         * @param a2 A 32-bit value passed to the kernel-side. Its meaning
       
    72         			  depends on the device driver requirements
       
    73         * @return TInt Returns KErrNone, if successful
       
    74         			   otherwise one of the other system-wide error codes
       
    75         */
       
    76 		virtual TInt DoControl( TInt aFunction, TAny* a1, TAny* a2, TThreadMessage& aMessage );	
       
    77 		
       
    78 		/**
       
    79 		* Processes a message for this logical channel.
       
    80 		* This function is called in the context of a DFC thread.
       
    81 		* @param aMsg  The message to process.
       
    82 		*/
       
    83 		virtual void HandleMsg( TMessageBase* aMsg );
       
    84 		
       
    85         /**
       
    86         * Handles a client asynchronous request.
       
    87         * @param aFunction The requested function.
       
    88         * @param aStatus Pointer to client TRequestStatus.
       
    89         * @param a1 A 32-bit value passed to the kernel-side. Its meaning 
       
    90         			  depends on the device driver requirements
       
    91         * @param a2 A 32-bit value passed to the kernel-side. Its meaning
       
    92         			  depends on the device driver requirements
       
    93         * @param aMessage Reference to received thread message.
       
    94         * @return TInt Returns KErrNone, if successful
       
    95         			   otherwise one of the other system-wide error codes
       
    96         */
       
    97 		virtual TInt DoRequest( TInt aFunction, 
       
    98 								TRequestStatus* aStatus, 
       
    99 								TAny* a1, 
       
   100 								TAny* a2, 
       
   101 								TThreadMessage& aMessage );
       
   102 		
       
   103         /**
       
   104         * Cancels outstanding asynchronous request.
       
   105         */
       
   106 		virtual void DoCancel();
       
   107 
       
   108 	private:
       
   109 		
       
   110         /**
       
   111         * Acquires current process information
       
   112         * @param aProcessInfo Pointer to the TProcessIdentityParams object.
       
   113         * @return TInt Returns KErrNone, if successful
       
   114         			   otherwise one of the other system-wide error codes
       
   115         */
       
   116 		TInt GetProcessInfo( TAny* aProcessInfo, TThreadMessage& aMessage );
       
   117 		
       
   118         /**
       
   119         * Acquires codeseg information.
       
   120         * @param aCodesegInfo Pointer to the TCodesegInfo object.
       
   121         * @return TInt Returns KErrNone, if successful
       
   122         			   otherwise one of the other system-wide error codes
       
   123         */
       
   124 		TInt GetCodesegInfo( TAny* aCodesegInfo, TThreadMessage& aMessage );
       
   125 		
       
   126         /**
       
   127         * Acquires library information.
       
   128         * @param aLibraryInfo Pointer to the TLibraryInfo object.
       
   129         * @return TInt Returns KErrNone, if successful
       
   130         			   otherwise one of the other system-wide error codes
       
   131         */
       
   132 		TInt GetLibraryInfo( TAny* aLibraryInfo, TThreadMessage& aMessage );
       
   133 	
       
   134         /**
       
   135         * Acquires information about process main thread RAllocator.
       
   136         * @param aMainThreadParams Pointer to the TMainThreadParams object.
       
   137         * @return TInt Returns KErrNone, if successful
       
   138         			   otherwise one of the other system-wide error codes
       
   139         */
       
   140 		TInt MainThreadAllocator( TAny* aMainThreadParams, 
       
   141 								  TThreadMessage& aMessage );
       
   142 		
       
   143 		/**
       
   144 		* Acquires main thread stack address.
       
   145 		* @param aThreadStack Pointer to the TThreadParams object.
       
   146 		* @return TInt Returns KErrNone, if successful
       
   147 					   otherwise one of the other system-wide error codes
       
   148 		*/
       
   149 		TInt ThreadStack( TAny* aThreadStack, 
       
   150 						  TThreadMessage& aMessage );
       
   151 
       
   152         /**
       
   153         * Acquires information about process global handles.
       
   154         * @param aProcessHandleInfo Pointer to the TProcessHandleInfo object.
       
   155         * @return TInt Returns KErrNone, if successful
       
   156         			   otherwise one of the other system-wide error codes
       
   157         */
       
   158 		TInt GetProcessHandleInfo( TAny* aProcessHandleInfo, 
       
   159 								   TThreadMessage& aMessage );
       
   160 
       
   161         /**
       
   162         * Acquires a process's current handle count.
       
   163         * @param aProcessHandles Pointer to the TATProcessHandles object.
       
   164         * @return TInt Returns KErrNone, if successful
       
   165                        otherwise one of the other system-wide error codes
       
   166         */
       
   167         TInt GetCurrentHandleCount( TAny* aProcessHandles, 
       
   168 									TThreadMessage& aMessage );
       
   169         
       
   170         /**
       
   171 		* Acquires the count of current device driver users.
       
   172 		* @param aClientCount A reference to TInt variable
       
   173 		* @return TInt Returns KErrNone, if successful
       
   174         *               otherwise one of the other system-wide error codes
       
   175 		*/			
       
   176         TInt ClientCount( TAny* aClientCount, 
       
   177 						  TThreadMessage& aMessage );
       
   178 		
       
   179         /**
       
   180          * Acquires memory model system uses.
       
   181          * @return TInt Returns KErrNone, if successful
       
   182          *              otherwise one of the other system-wide error codes
       
   183          */
       
   184         TInt GetMemoryModel( TAny* aMemoryModel,
       
   185                             TThreadMessage& aMessage );
       
   186         
       
   187         #ifdef __WINSCW__
       
   188         /**
       
   189 		* Gets module dependencies
       
   190 		* @param aModule Module handle
       
   191 		*/
       
   192         void GetModuleDependencies( HMODULE aModule );
       
   193         #endif // __WINSCW__
       
   194         
       
   195 	private: //Member variables
       
   196 		
       
   197 		/* Handler which receives kernel events */
       
   198 		DAnalyzeToolEventHandler* iEventHandler;
       
   199 		
       
   200 		#ifdef __WINSCW__
       
   201 		/* Code segment array */
       
   202 		RArray<TCodesegInfo> iCodeSeg;
       
   203 		#endif // __WINSCW__
       
   204 		
       
   205 		/* A DFC queue for communication */
       
   206 		TDynamicDfcQue* iOwnDfcQ;
       
   207 
       
   208 	};
       
   209 
       
   210 #endif // #ifndef __ANALYZETOOLCHANNEL_H__
       
   211 
       
   212 // End of File