kernel/eka/euser/epoc/win32/uc_epoc.cpp
author Stephane Lenclud <tortoisehg@lenclud.com>
Thu, 29 Apr 2010 17:37:22 +0200
branchanywhere
changeset 101 86a1781f0e9b
parent 96 428c5911a502
permissions -rw-r--r--
Working on AO support.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     2
// All rights reserved.
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     3
// This component and the accompanying materials are made available
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     5
// which accompanies this distribution, and is available
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     7
//
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     8
// Initial Contributors:
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
     9
// Nokia Corporation - initial contribution.
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    10
//
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    11
// Contributors:
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    12
//
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    13
// Description:
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    14
// e32\euser\epoc\win32\uc_epoc.cpp
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    15
// 
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    16
//
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    17
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    18
#include <e32std.h>
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    19
#include <e32std_private.h>
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    20
#include <e32wins.h>
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    21
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    22
//#include <e32cmn.h>
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    23
#include <nwdl.h>
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    24
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    25
#if defined __SYMC__
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    26
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    27
//SL: Empty on FCL ?
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    28
//For now we use this for basic testing on our SYMC implementation
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    29
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    30
101
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
    31
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    32
class CBaseTest: public CBase
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    33
	{
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    34
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    35
	};
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    36
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    37
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    38
GLDEF_C void MainL()
101
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
    39
	{	
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    40
	CBase* other=new(ELeave) CBase();
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    41
	CleanupStack::PushL(other);
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    42
	CBase* base=new(ELeave) CBase();
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    43
	CleanupStack::PushL(base);
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    44
	CleanupStack::PopAndDestroy(2,other);
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    45
	//delete base;
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    46
	
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    47
	//Testing cleanup stack
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    48
	TRAPD(err,
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    49
	base=new(ELeave) CBase();
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    50
	CleanupStack::PushL(base);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    51
	User::Leave(KErrCancel);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    52
	);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    53
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    54
	ASSERT(err==KErrCancel);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    55
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    56
	//Testing alloc failure
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    57
	TRAP(err,
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    58
	TUint8* test=new(ELeave) TUint8[1024*1024*10];
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    59
	delete[] test;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    60
	);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    61
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    62
	ASSERT(err==KErrNoMemory);
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    63
	
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    64
	//Testing unbalanced cleanup stack
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    65
	//base=new(ELeave) CBase();
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    66
	//CleanupStack::PushL(base);
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    67
	}
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    68
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    69
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    70
GLDEF_C TInt E32Main()
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    71
	{
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    72
	//What do we do then
101
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
    73
	//SetReturnedHandle
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    74
	
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    75
	__UHEAP_MARK;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    76
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    77
	//CBase* base=new(ELeave) CBase();
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    78
	CBase* base=new CBase();
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    79
	delete base;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    80
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    81
	CBaseTest* baseTest=new CBaseTest();
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    82
	delete baseTest;
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    83
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    84
	HBufC* buf=HBufC::New(10);
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    85
	delete buf;
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    86
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    87
	CArrayFix<TInt>* active=new CArrayFixFlat<TInt>(10);
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    88
	delete active;
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
    89
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    90
	TUint8* test=new TUint8[1024*9];
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    91
	delete[] test;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    92
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    93
	CTrapCleanup* cleanupStack = CTrapCleanup::New();
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    94
	if (!cleanupStack)
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    95
		{
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    96
		return KErrNoMemory;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    97
		}
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
    98
101
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
    99
	CActiveScheduler* activeScheduler = new CActiveScheduler;
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   100
	if (!activeScheduler)
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   101
		{
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   102
		return KErrNoMemory;
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   103
		}
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   104
	CActiveScheduler::Install(activeScheduler);
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   105
96
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
   106
	TInt err=KErrNone;
428c5911a502 Fixing issue with default C++ delete operator being called instead of Symbian C++ delete replacement with CBase derived classes from euser. Getting ride of SEH stuff used for WINS fixes our trap/leave runtime issues.
Slion
parents: 95
diff changeset
   107
	TRAP(err,MainL());
101
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   108
	
86a1781f0e9b Working on AO support.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 96
diff changeset
   109
	delete activeScheduler;
95
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   110
	delete cleanupStack;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   111
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   112
	__UHEAP_MARKEND;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   113
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   114
	return err;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   115
	}
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   116
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   117
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   118
TInt main()
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   119
	{
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   120
	User::InitProcess();
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   121
	//BootEpoc(ETrue);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   122
	E32Main();
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   123
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   124
	User::Exit(0);
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   125
	return 0;
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   126
	}
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   127
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   128
#endif
f561f9ae805b Trying to get trap/leave to work properly but the whole WINS stuff seems over complicated with a lot of assembly in the middle and it's not working on my compiler. When the throw happens the debugger complains about uncaught exception when I'm definitly inside a catch implemented by our TRAP.
Stephane Lenclud <tortoisehg@lenclud.com>
parents: 94
diff changeset
   129