dbgagents/trkagent/engine/TrkDispatchLayer.h
author ravikurupati
Tue, 02 Mar 2010 10:33:16 +0530
changeset 0 c6b0df440bee
permissions -rw-r--r--
Initial contribution of EPL licensed sources
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     1
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     2
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     3
* All rights reserved.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     4
* This component and the accompanying materials are made available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     6
* which accompanies this distribution, and is available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     8
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     9
* Initial Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    11
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    12
* Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    13
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    14
* Description: 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    15
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    16
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    17
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    18
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    19
#ifndef __TRKDISPATCHLAYER_H__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    20
#define __TRKDISPATCHLAYER_H__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    21
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    22
#include <f32file.h>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    23
#include "TrkFramingLayer.h"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    24
#include "TrkKernelDriver.h"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    25
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    26
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    27
#ifndef __TEXT_SHELL__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    28
#include <sysutil.h> 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    29
#include <etel3rdparty.h>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    30
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    31
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    32
#ifdef __OEM_TRK__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    33
#include "TrkTcbCliSession.h"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    34
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    35
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    36
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    37
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    38
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    39
// Forward declarations
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    40
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    41
class CTrkDispatchLayer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    42
class CTrkEngine;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    43
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    44
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    45
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    46
// class CExitTrapper
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    47
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    48
// Watches to see when a process exists
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    49
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    50
class CExitTrapper : public CActive
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    51
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    52
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    53
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    54
	CExitTrapper(CTrkDispatchLayer *aDispatch, TUint32 aProcessId);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    55
	~CExitTrapper();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    56
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    57
	void Watch();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    58
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    59
protected:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    60
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    61
	void RunL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    62
	void DoCancel();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    63
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    64
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    65
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    66
	RProcess iProcess;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    67
	TUint32 iProcessId;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    68
	CTrkDispatchLayer *iDispatch;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    69
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    70
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    71
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    72
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    73
// class CEventTrapper
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    74
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    75
// Listens for events like breakpoints, exceptions, panic, and library loads
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    76
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    77
class CEventTrapper : public CActive
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    78
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    79
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    80
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    81
	CEventTrapper(CTrkDispatchLayer *aDispatch);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    82
	~CEventTrapper();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    83
	void Watch();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    84
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    85
protected:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    86
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    87
	void RunL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    88
	void DoCancel();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    89
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    90
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    91
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    92
	SEventInfo iEventInfo;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    93
	CTrkDispatchLayer *iDispatch;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    94
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    95
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    96
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    97
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    98
// class CDebugProcess
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    99
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   100
// Represents a process being debugged by the user
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   101
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   102
class CDebugProcess : public CBase
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   103
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   104
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   105
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   106
	static CDebugProcess* NewL(CTrkDispatchLayer *aDispatch, TUint32 aProcessId, TUint32 aMainThreadId);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   107
	~CDebugProcess();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   108
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   109
	void ConstructL(CTrkDispatchLayer *aDispatch, TUint32 aProcessId, TUint32 aMainThreadId);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   110
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   111
	TUint32 ProcessId() { return iProcessId; }
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   112
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   113
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   114
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   115
	TBool iReadyForLibraryLoadNotification;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   116
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   117
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   118
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   119
	TUint32 iProcessId;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   120
	TUint32 iMainThreadId;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   121
	CExitTrapper *iExitTrapper;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   122
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   123
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   124
#ifndef __TEXT_SHELL__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   125
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   126
//class CPhoneInfo
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   127
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   128
//This class is used  to find the name of the Phone for eg: For Nokia 5800, the phone name is 5800 Music Express
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   129
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   130
class CPhoneInfo : public CActive
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   131
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   132
private:    
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   133
    
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   134
    CTelephony::TPhoneIdV1 iPhoneIdV1;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   135
    CTelephony::TPhoneIdV1Pckg iPhoneIdV1Pckg;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   136
    CTelephony* iTelephony;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   137
    CPhoneInfo();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   138
    void ConstructL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   139
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   140
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   141
    static CPhoneInfo* NewL();    
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   142
    void GetPhoneName(CTrkDispatchLayer* aDispatchLayer);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   143
    ~CPhoneInfo();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   144
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   145
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   146
    
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   147
    void RunL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   148
    void DoCancel();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   149
    
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   150
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   151
    CTrkDispatchLayer* iDispatchLayer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   152
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   153
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   154
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   155
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   156
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   157
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   158
// class TCreateProcessData
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   159
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   160
// Container class for information related to the creation of a new process
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   161
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   162
class TCreateProcessData
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   163
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   164
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   165
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   166
	inline TCreateProcessData()
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   167
				: iProcessId(0),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   168
				  iMainThreadId(0),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   169
				  iEntryAddr(0xFFFFFFFF),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   170
				  iCodeAddr(0xFFFFFFFF),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   171
				  iDataAddr(0xFFFFFFFF),
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   172
				  iBssAddr(0xFFFFFFFF) {};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   173
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   174
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   175
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   176
	TUint32 iProcessId;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   177
	TUint32 iMainThreadId;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   178
	TUint32 iEntryAddr;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   179
	TUint32 iCodeAddr;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   180
	TUint32 iDataAddr;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   181
	TUint32 iBssAddr;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   182
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   183
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   184
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   185
// class TProtocolVersion
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   186
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   187
// Container class for the protocol version
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   188
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   189
class TProtocolVersion
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   190
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   191
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   192
	inline TProtocolVersion() { };
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   193
	inline TProtocolVersion(TUint8 aMajor, TUint8 aMinor)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   194
				: iMajor(aMajor), 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   195
				  iMinor(aMinor) { };
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   196
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   197
	TUint8 iMajor;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   198
	TUint8 iMinor;	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   199
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   200
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   201
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   202
// class CTrkDispatchLayer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   203
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   204
// Handles messages between the kernel side driver and the framing layer
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   205
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   206
class CTrkDispatchLayer : public CBase
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   207
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   208
public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   209
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   210
	static CTrkDispatchLayer* NewL(CTrkCommPort *aPort, CTrkEngine* aEngine);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   211
	~CTrkDispatchLayer();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   212
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   213
	void Listen();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   214
	void StopListening();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   215
	static void GetVersionInfo(TInt &aMajorVersion, TInt &aMinorVersion, TInt &aMajorAPIVersion, TInt &aMinorAPIVersion, TInt &aBuildNumber);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   216
	void HandleMsg(const TDesC8& aMsg);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   217
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   218
	TBool IsDebugging() { return iIsConnected; }
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   219
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   220
	void UpdatePhoneNameInfo(TDesC16& aPhoneModel);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   221
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   222
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   223
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   224
	CTrkDispatchLayer();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   225
	void ConstructL(CTrkCommPort *aPort, CTrkEngine* aEngine);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   226
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   227
	void FindPhoneSWVersion();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   228
	void FindPhoneNameL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   229
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   230
	void DispatchMsgL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   231
	void DoConnectL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   232
	void DoDisconnectL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   233
	void DoVersionsL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   234
	void DoVersions2L();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   235
	void DoVersions3L();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   236
	void DoHostVersionsL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   237
	void DoSupportMaskL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   238
	void DoCPUTypeL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   239
	void DoReadMemoryL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   240
	void DoWriteMemoryL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   241
	void DoReadRegistersL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   242
	void DoWriteRegistersL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   243
	void DoContinueL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   244
	void DoStepL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   245
	void DoStopL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   246
	void DoSetBreakL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   247
	void DoClearBreakL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   248
	void DoModifyBreakThreadL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   249
	void DoCreateItemL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   250
	void DoDeleteItemL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   251
	void DoReadInfoL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   252
	void DoWriteInfoL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   253
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   254
	void DoOpenFileL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   255
	void OpenFileL(const TDesC& aFullPath, TUint aMode, TTime& aTime);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   256
	void DoReadFileL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   257
	TInt ReadFileL(TUint16 aLength, TPtr8& aData);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   258
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   259
	void DoWriteFileL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   260
	void WriteFileL(TDesC8& aData);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   261
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   262
	void DoPositionFileL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   263
	void PositionFileL(TSeek aSeek, TInt& aOffset);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   264
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   265
	void DoCloseFileL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   266
	void CloseFileL(const TTime& aModifiedTime);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   267
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   268
	void DoInstallFileL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   269
	void DoInstallFile2L();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   270
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   271
	void DoGetPhoneSWVersionL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   272
	void DoGetPhoneNameL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   273
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   274
	void DoCreateProcessL(TBool aRun=EFalse);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   275
	void DoCreateExeL(const TDesC& aPath, const TDesC& aArgs, TCreateProcessData& aData, TBool aRun=EFalse);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   276
	void DoKillProcessL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   277
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   278
	void DoAttachProcessL(DSOSItemTypes aAttachType=kDSOSProcAttachItem);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   279
	void DoDetachProcessL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   280
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   281
	void DoReadProcessListL(TInt32 aIndex);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   282
	void DoReadThreadListL(TInt32 aIndex);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   283
	void DoReBuildProcessList();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   284
	void DoReBuildThreadList(TUint32 aProcessid);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   285
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   286
	void DoNotifyStoppedL(TUint32 aProcessId, TUint32 aThreadId, TUint32 aCurrentPC, const TDesC8 &aDescription, TBool aAddException=false, const TUint16 aExceptionNumber=0);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   287
	void DoNotifyProcessDiedL(TUint32 aProcessId, TInt aExitCode);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   288
	void DoNotifyLibraryLoadedL(TDesC8 &aName, TUint32 aProcessId, TUint32 aThreadId, TUint32 aCodeBaseAddress, TUint32 aDataBaseAddress);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   289
	void DoNotifyLibraryUnloadedL(TDesC8 &aName, TUint32 aProcessId, TUint32 aThreadId);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   290
	void DoNotifyUserTraceL(TDesC8 &aTrace);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   291
	void DoNotifyProcessAddedL(TDesC8 &aName, TUint32 aProcessId, TUint32 aThreadId, TUint32 aUid, TUint32 aCodeBaseAddress, TUint32 aDataBaseAddress);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   292
	void DoReadLibraryInfoL(TDesC8& aFileName);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   293
	void DoReadProcessInfoL(TUint32 aUid, TDesC8& aFileName);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   294
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   295
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   296
	void GetDataFromBufferL(TAny *aData, TInt aLength);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   297
	void AddToReplyBufferL(TUint8 aData, TBool aReset = false);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   298
	void AddToReplyBufferL(TUint16 aData, TBool aReset = false);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   299
	void AddToReplyBufferL(TUint32 aData, TBool aReset = false);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   300
	void AddToReplyBufferL(const TDesC8 &aData, TBool aReset = false);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   301
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   302
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   303
	void RespondOkL() 	{ if (iReplyBuffer) iFramingLayer->RespondOkL(*iReplyBuffer); };
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   304
	void InformEventL() { if (iReplyBuffer) iFramingLayer->InformEventL(*iReplyBuffer); };
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   305
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   306
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   307
	TUint8 IsThreadSuspended(TUint32 aThreadId);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   308
	TBool IsRestrictedFolder(const TDesC& aPath);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   309
	TInt CloseCrashLogger();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   310
	TInt TerminateProcess(const TDesC& aProcessName);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   311
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   312
	void CloseTcbServer();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   313
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   314
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   315
	CTrkEngine* iEngine;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   316
	CTrkFramingLayer *iFramingLayer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   317
#ifndef __TEXT_SHELL__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   318
	CPhoneInfo* iPhoneInfo;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   319
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   320
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   321
	HBufC8 *iInputBuffer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   322
	HBufC8 *iReplyBuffer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   323
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   324
#ifndef __TEXT_SHELL__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   325
	TBuf8 <KSysUtilVersionTextLength> iPhoneVersion;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   326
    TBuf8 <CTelephony::KPhoneModelIdSize> iPhoneModel;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   327
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   328
    
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   329
    enum TFileState
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   330
	{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   331
		EFileOpened = 0,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   332
		EFileReading = 1,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   333
		EFileWriting = 2,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   334
		EFileClosed = 3,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   335
		EFileUnknown = -1		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   336
	};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   337
	RFile iFile;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   338
	RFs iFs;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   339
	TFileState iFileState;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   340
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   341
	RPointerArray<CDebugProcess> iDebugProcessList;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   342
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   343
	RArray<TMetroTrkTaskInfo> iProcessList;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   344
	RArray<TMetroTrkTaskInfo> iThreadList;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   345
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   346
	RArray<TUint> iSuspendedThreadList;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   347
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   348
	CEventTrapper *iEventTrapper;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   349
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   350
	RMetroTrkDriver iKernelDriver;	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   351
	TBool iIsConnected;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   352
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   353
	TBool iPhoneNameInfoAvailable; 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   354
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   355
#ifdef __OEM_TRK__	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   356
	RTrkTcbCliSession iTrkTcbSession;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   357
	TBool iUseTcbServer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   358
#endif
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   359
	TProtocolVersion iHostVersion;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   360
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   361
	friend class CEventTrapper;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   362
	friend class CExitTrapper;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   363
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   364
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   365
#endif // __TRKDISPATCHLAYER_H__