|
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 * @param aMessage Reference to received thread message. |
|
74 * @return TInt Returns KErrNone, if successful |
|
75 otherwise one of the other system-wide error codes |
|
76 */ |
|
77 virtual TInt DoControl( TInt aFunction, TAny* a1, TAny* a2, TThreadMessage& aMessage ); |
|
78 |
|
79 /** |
|
80 * Processes a message for this logical channel. |
|
81 * This function is called in the context of a DFC thread. |
|
82 * @param aMsg The message to process. |
|
83 */ |
|
84 virtual void HandleMsg( TMessageBase* aMsg ); |
|
85 |
|
86 /** |
|
87 * Handles a client asynchronous request. |
|
88 * @param aFunction The requested function. |
|
89 * @param aStatus Pointer to client TRequestStatus. |
|
90 * @param a1 A 32-bit value passed to the kernel-side. Its meaning |
|
91 depends on the device driver requirements |
|
92 * @param a2 A 32-bit value passed to the kernel-side. Its meaning |
|
93 depends on the device driver requirements |
|
94 * @param aMessage Reference to received thread message. |
|
95 * @return TInt Returns KErrNone, if successful |
|
96 otherwise one of the other system-wide error codes |
|
97 */ |
|
98 virtual TInt DoRequest( TInt aFunction, |
|
99 TRequestStatus* aStatus, |
|
100 TAny* a1, |
|
101 TAny* a2, |
|
102 TThreadMessage& aMessage ); |
|
103 |
|
104 /** |
|
105 * Cancels outstanding asynchronous request. |
|
106 */ |
|
107 virtual void DoCancel(); |
|
108 |
|
109 private: |
|
110 |
|
111 /** |
|
112 * Acquires current process information |
|
113 * @param aProcessInfo Pointer to the TProcessIdentityParams object. |
|
114 * @return TInt Returns KErrNone, if successful |
|
115 otherwise one of the other system-wide error codes |
|
116 */ |
|
117 TInt GetProcessInfo( TAny* aProcessInfo, TThreadMessage& aMessage ); |
|
118 |
|
119 /** |
|
120 * Acquires codeseg information. |
|
121 * @param aCodesegInfo Pointer to the TCodesegInfo object. |
|
122 * @return TInt Returns KErrNone, if successful |
|
123 otherwise one of the other system-wide error codes |
|
124 */ |
|
125 TInt GetCodesegInfo( TAny* aCodesegInfo, TThreadMessage& aMessage ); |
|
126 |
|
127 /** |
|
128 * Acquires library information. |
|
129 * @param aLibraryInfo Pointer to the TLibraryInfo object. |
|
130 * @return TInt Returns KErrNone, if successful |
|
131 otherwise one of the other system-wide error codes |
|
132 */ |
|
133 TInt GetLibraryInfo( TAny* aLibraryInfo, TThreadMessage& aMessage ); |
|
134 |
|
135 /** |
|
136 * Acquires information about process main thread RAllocator. |
|
137 * @param aMainThreadParams Pointer to the TMainThreadParams object. |
|
138 * @return TInt Returns KErrNone, if successful |
|
139 otherwise one of the other system-wide error codes |
|
140 */ |
|
141 TInt MainThreadAllocator( TAny* aMainThreadParams, |
|
142 TThreadMessage& aMessage ); |
|
143 |
|
144 /** |
|
145 * Acquires main thread stack address. |
|
146 * @param aThreadStack Pointer to the TThreadParams object. |
|
147 * @return TInt Returns KErrNone, if successful |
|
148 otherwise one of the other system-wide error codes |
|
149 */ |
|
150 TInt ThreadStack( TAny* aThreadStack, |
|
151 TThreadMessage& aMessage ); |
|
152 |
|
153 /** |
|
154 * Acquires information about process global handles. |
|
155 * @param aProcessHandleInfo Pointer to the TProcessHandleInfo object. |
|
156 * @return TInt Returns KErrNone, if successful |
|
157 otherwise one of the other system-wide error codes |
|
158 */ |
|
159 TInt GetProcessHandleInfo( TAny* aProcessHandleInfo, |
|
160 TThreadMessage& aMessage ); |
|
161 |
|
162 /** |
|
163 * Acquires a process's current handle count. |
|
164 * @param aProcessHandles Pointer to the TATProcessHandles object. |
|
165 * @return TInt Returns KErrNone, if successful |
|
166 otherwise one of the other system-wide error codes |
|
167 */ |
|
168 TInt GetCurrentHandleCount( TAny* aProcessHandles, |
|
169 TThreadMessage& aMessage ); |
|
170 |
|
171 /** |
|
172 * Acquires the count of current device driver users. |
|
173 * @param aClientCount A reference to TInt variable |
|
174 * @return TInt Returns KErrNone, if successful |
|
175 * otherwise one of the other system-wide error codes |
|
176 */ |
|
177 TInt ClientCount( TAny* aClientCount, |
|
178 TThreadMessage& aMessage ); |
|
179 |
|
180 /** |
|
181 * Acquires memory model system uses. |
|
182 * @return TInt Returns KErrNone, if successful |
|
183 * otherwise one of the other system-wide error codes |
|
184 */ |
|
185 TInt GetMemoryModel( TAny* aMemoryModel, |
|
186 TThreadMessage& aMessage ); |
|
187 |
|
188 #ifdef __WINSCW__ |
|
189 /** |
|
190 * Gets module dependencies |
|
191 * @param aModule Module handle |
|
192 */ |
|
193 void GetModuleDependencies( HMODULE aModule ); |
|
194 #endif // __WINSCW__ |
|
195 |
|
196 private: //Member variables |
|
197 |
|
198 /* Handler which receives kernel events */ |
|
199 DAnalyzeToolEventHandler* iEventHandler; |
|
200 |
|
201 #ifdef __WINSCW__ |
|
202 /* Code segment array */ |
|
203 RArray<TCodesegInfo> iCodeSeg; |
|
204 #endif // __WINSCW__ |
|
205 |
|
206 /* A DFC queue for communication */ |
|
207 TDynamicDfcQue* iOwnDfcQ; |
|
208 |
|
209 }; |
|
210 |
|
211 #endif // #ifndef __ANALYZETOOLCHANNEL_H__ |
|
212 |
|
213 // End of File |