kerneltest/e32test/dll/t_dlla1.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\dll\t_dlla1.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include <e32svr.h>
       
    19 
       
    20 const TInt KAmountOfBss=0x1004;
       
    21 TInt someBss[KAmountOfBss];
       
    22 
       
    23 TInt somedata=0;
       
    24 TFullName ProcessName(RProcess().FullName());
       
    25 TFullName ThreadName(RThread().FullName());
       
    26 
       
    27 
       
    28 TInt AnyOldFunction()
       
    29 	{
       
    30 	return 0x56789012;
       
    31 	}
       
    32 TInt (*function)()=&AnyOldFunction;
       
    33 
       
    34 EXPORT_C TInt AFunction()
       
    35 	{
       
    36 	if ((*function)()!=0x56789012)
       
    37 		return KErrGeneral;
       
    38 	TInt i;
       
    39 	for (i=0; i<KAmountOfBss; i++)
       
    40 		{
       
    41 		if (someBss[i]!=0)
       
    42 			{
       
    43 //			RDebug::Print(_L("i=%x addr %08x  data %08x"),i,&someBss[i], someBss[i]);
       
    44 			return KErrArgument;
       
    45 			}
       
    46 		}
       
    47 	return KErrNone;
       
    48 	}
       
    49 
       
    50 EXPORT_C TInt Inc()
       
    51 	{ return ++somedata; }
       
    52 
       
    53 EXPORT_C TFullName& GetProcessName()
       
    54 	{
       
    55 	return ProcessName;
       
    56 	}
       
    57 
       
    58 EXPORT_C TFullName& GetThreadName()
       
    59 	{
       
    60 	return ThreadName;
       
    61 	}
       
    62