os/kernelhwsrv/kernel/eka/common/win32/seh.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32\common\win32\seh.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __SEH_H__
sl@0
    19
#define __SEH_H__
sl@0
    20
sl@0
    21
#define WIN32_LEAN_AND_MEAN
sl@0
    22
#include <windows.h>
sl@0
    23
#include <excpt.h>
sl@0
    24
sl@0
    25
// Extracted from exsup.inc
sl@0
    26
sl@0
    27
/** An exception unwind is in progress */
sl@0
    28
#define	EXCEPTION_UNWINDING		2
sl@0
    29
sl@0
    30
// Special Win32 SEH code for C++ exceptions
sl@0
    31
static const DWORD EXCEPTION_MSCPP = 0xe06d7363;
sl@0
    32
sl@0
    33
/** Helper function to get current TIB record as a simple 32bit pointer */
sl@0
    34
__declspec(naked) NT_TIB* Tib()
sl@0
    35
	{
sl@0
    36
	// _FOFF(NT_TIB, Self) = 0x18
sl@0
    37
	_asm mov eax, dword ptr fs:[0x18]
sl@0
    38
	_asm ret
sl@0
    39
	}
sl@0
    40
sl@0
    41
#include <e32def.h>
sl@0
    42
__ASSERT_COMPILE(_FOFF(NT_TIB, Self) == 0x18);
sl@0
    43
sl@0
    44
#endif // __SEH_H__