42
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
56
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
42
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// Definitions for the security server server.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#ifndef C_SECURITY_SVR_SERVER_H
|
|
19 |
#define C_SECURITY_SVR_SERVER_H
|
|
20 |
|
|
21 |
#include <rm_debug_api.h>
|
|
22 |
#include "c_process_pair.h"
|
|
23 |
#include "c_shutdown_timer.h"
|
|
24 |
#include "rm_debug_kerneldriver.h"
|
|
25 |
|
|
26 |
_LIT(KDebugDriverFileName,"rm_debug.ldd");
|
|
27 |
class CSecuritySvrSession;
|
|
28 |
|
|
29 |
/**
|
|
30 |
Definition of a Debug Security Server. Responsible for managing all debug agent clients,
|
|
31 |
including attachment/detachment from target executables. Keeps track of which executables
|
|
32 |
are being debugged.
|
|
33 |
*/
|
|
34 |
class CSecuritySvrServer : public CServer2
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
|
|
38 |
TInt AttachProcessL(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId, const TBool aPassive);
|
|
39 |
TInt DetachProcess(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId);
|
|
40 |
void DetachAllProcesses(const TProcessId aDebugAgentProcessId);
|
|
41 |
TBool CheckAttached(const TThreadId aTargetThreadId, const RMessage2& aMessage, const TBool aPassive);
|
|
42 |
TBool CheckAttached(const TProcessId aTargetProcessId, const RMessage2& aMessage, const TBool aPassive);
|
|
43 |
TBool CheckAttachedProcess(const TDesC& aTargetProcessName, const RMessage2& aMessage, const TBool aPassive) const;
|
|
44 |
TBool IsDebugged(const TDesC& aTargetProcessName, const TBool aPassive) const;
|
|
45 |
void SessionClosed();
|
|
46 |
void SessionOpened();
|
|
47 |
static CSecuritySvrServer* NewLC();
|
|
48 |
|
|
49 |
TBool OEMTokenPermitsDebugL(const TCapabilitySet aTokenCaps, const TCapabilitySet aTargetCaps);
|
|
50 |
TBool OEMTokenPermitsFlashAccessL(const TCapabilitySet aTokenCaps);
|
|
51 |
|
|
52 |
protected:
|
|
53 |
CSecuritySvrServer(CActive::TPriority aActiveObjectPriority);
|
|
54 |
void ConstructL();
|
|
55 |
|
|
56 |
private:
|
|
57 |
~CSecuritySvrServer();
|
|
58 |
TBool IsActiveDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const;
|
|
59 |
TBool IsDebugger(const TDesC& aTargetProcessName, const TProcessId aDebugAgentProcessId) const;
|
|
60 |
TInt GetProcessIdFromMessage(TProcessId& aProcessId, const RMessage2& aMessage) const;
|
|
61 |
|
|
62 |
private:
|
|
63 |
RPointerArray<CProcessPair> iActiveDebugMap;
|
|
64 |
RPointerArray<CProcessPair> iPassiveDebugMap;
|
|
65 |
TInt iSessionCount;
|
|
66 |
CShutdownTimer iShutdown;
|
|
67 |
RRM_DebugDriver iKernelDriver;
|
|
68 |
|
|
69 |
// Declare the CSecuritySvrAsync as a friend so it can use the iKernelDriver too
|
|
70 |
friend class CSecuritySvrAsync;
|
|
71 |
friend class CSecuritySvrSession;
|
|
72 |
};
|
|
73 |
|
|
74 |
#endif // C_SECURITY_SVR_SERVER_H
|