|
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 #ifndef MEMSPYDRIVERSUSPENSIONMANAGER_H |
|
19 #define MEMSPYDRIVERSUSPENSIONMANAGER_H |
|
20 |
|
21 // System includes |
|
22 #include <e32cmn.h> |
|
23 #include <kern_priv.h> |
|
24 |
|
25 // Classes referenced |
|
26 class DMemSpyDriverDevice; |
|
27 |
|
28 |
|
29 class DMemSpySuspensionManager : public DBase |
|
30 { |
|
31 public: // Construct & destruct |
|
32 DMemSpySuspensionManager( DMemSpyDriverDevice& aDevice ); |
|
33 ~DMemSpySuspensionManager(); |
|
34 TInt Construct(); |
|
35 |
|
36 public: // API |
|
37 TBool IsSuspended( TUint aPid ) const; |
|
38 TBool IsSuspended( DThread& aThread ) const; |
|
39 TBool IsSuspended( DProcess& aProcess ) const; |
|
40 TInt SuspendAllThreadsInProcess( TUint aPid, DThread& aClientThread ); |
|
41 TInt ResumeAllThreadsInProcess( TUint aPid, DThread& aClientThread ); |
|
42 |
|
43 private: // Internal methods |
|
44 TInt DoSuspendAllThreadsInProcess( TUint aPid, DThread* aClientThread = NULL ); |
|
45 TInt DoResumeAllThreadsInProcess( TUint aPid, DThread* aClientThread = NULL ); |
|
46 TBool IsProcessTheClientThread( TUint aPid, DThread& aClientThread ) const; |
|
47 TBool CheckProcessSuspended( TUint aExpectedPid, DThread& aClientThread ) const; |
|
48 TInt OpenTempObject(TUint aId, TObjectType aType ); |
|
49 void CloseTempObject(); |
|
50 |
|
51 private: // Data members |
|
52 DMemSpyDriverDevice& iDevice; |
|
53 DObject* iTempObj; |
|
54 TBool iAlreadySuspended; |
|
55 TUint iSuspendedProcessId; |
|
56 TInt iSuspendCount; |
|
57 }; |
|
58 |
|
59 |
|
60 #endif |