kerneltest/e32test/dll/d_ldrtst.h
changeset 0 a41df078684a
child 6 0173bcd7697c
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1998-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 // f32test\loader\d_ldrtst.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __D_LDRTST_H__
       
    19 #define __D_LDRTST_H__
       
    20 #include <e32ldr.h>
       
    21 
       
    22 _LIT(KLdrTestLddName, "LdrTest");
       
    23 
       
    24 
       
    25 #ifndef TMODULEHANDLE_DEFINED
       
    26 #define TMODULEHANDLE_DEFINED
       
    27 class TModuleHandle_dummy_class;
       
    28 typedef TModuleHandle_dummy_class* TModuleHandle;
       
    29 #endif
       
    30 
       
    31 /**
       
    32 @internalComponent
       
    33 */
       
    34 class TCapsTestV01
       
    35 	{
       
    36 public:
       
    37 	TVersion	iVersion;
       
    38 	};
       
    39 
       
    40 /**
       
    41 @internalComponent
       
    42 */
       
    43 class RLdrTest : public RBusLogicalChannel
       
    44 	{
       
    45 public:
       
    46 	enum TControl
       
    47 		{
       
    48 		EControlGetCodeSegInfo,
       
    49 		EControlProcessCodeSeg,
       
    50 		EControlLibraryCodeSeg,
       
    51 		EControlModuleCodeSeg,
       
    52 		EControlGetCodeSegList,
       
    53 		EControlCodeSegFromAddr,
       
    54 		EControlModuleHandleFromAddr,
       
    55 		EControlProcessSMPUnsafeCount,
       
    56 		};
       
    57 
       
    58 /**
       
    59 @internalComponent
       
    60 */
       
    61 	struct SEntry
       
    62 		{
       
    63 		TAny* iHandle;
       
    64 		TUint32 iUid3;
       
    65 		};
       
    66 public:
       
    67 	inline TInt Open();
       
    68 	inline TInt GetCodeSegInfo(TAny* aHandle, TCodeSegCreateInfo& aInfo);
       
    69 	inline TAny* ProcessCodeSeg(TInt aProcessHandle);
       
    70 	inline TAny* LibraryCodeSeg(TInt aLibraryHandle);
       
    71 	inline TAny* ModuleCodeSeg(TModuleHandle aModuleHandle);
       
    72 	inline TInt GetCodeSegList(SEntry* aList, TInt aMax);
       
    73 	inline TAny* CodeSegFromAddr(TLinAddr aAddr);
       
    74 	inline TModuleHandle ModuleHandleFromAddr(TLinAddr aAddr);
       
    75 	inline TInt ProcessSMPUnsafeCount(TInt aProcessHandle);
       
    76 	};
       
    77 
       
    78 #ifndef __KERNEL_MODE__
       
    79 inline TInt RLdrTest::Open()
       
    80 	{ return DoCreate(KLdrTestLddName, TVersion(0,1,1), KNullUnit, NULL, NULL); }
       
    81 inline TInt RLdrTest::GetCodeSegInfo(TAny* aHandle, TCodeSegCreateInfo& aInfo)
       
    82 	{ return DoControl(EControlGetCodeSegInfo, aHandle, &aInfo); }
       
    83 inline TAny* RLdrTest::ProcessCodeSeg(TInt aProcessHandle)
       
    84 	{ return (TAny*)DoControl(EControlProcessCodeSeg, (TAny*)aProcessHandle); }
       
    85 inline TAny* RLdrTest::LibraryCodeSeg(TInt aLibraryHandle)
       
    86 	{ return (TAny*)DoControl(EControlLibraryCodeSeg, (TAny*)aLibraryHandle); }
       
    87 inline TAny* RLdrTest::ModuleCodeSeg(TModuleHandle aModuleHandle)
       
    88 	{ return (TAny*)DoControl(EControlModuleCodeSeg, (TAny*)aModuleHandle); }
       
    89 inline TInt RLdrTest::GetCodeSegList(SEntry* aList, TInt aMax)
       
    90 	{ return DoControl(EControlGetCodeSegList, aList, (TAny*)aMax); }
       
    91 inline TAny* RLdrTest::CodeSegFromAddr(TLinAddr aAddr)
       
    92 	{ return (TAny*)DoControl(EControlCodeSegFromAddr, (TAny*)aAddr); }
       
    93 inline TModuleHandle RLdrTest::ModuleHandleFromAddr(TLinAddr aAddr)
       
    94 	{ return (TModuleHandle)DoControl(EControlModuleHandleFromAddr, (TAny*)aAddr); }
       
    95 inline TInt RLdrTest::ProcessSMPUnsafeCount(TInt aProcessHandle)
       
    96 	{ return DoControl(EControlProcessSMPUnsafeCount, (TAny*)aProcessHandle); }
       
    97 #endif
       
    98 
       
    99 #endif
       
   100