os/kernelhwsrv/kerneltest/e32test/dll/d_ldrtst.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/dll/d_ldrtst.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,101 @@
     1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// f32test\loader\d_ldrtst.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __D_LDRTST_H__
    1.22 +#define __D_LDRTST_H__
    1.23 +#include <e32ldr.h>
    1.24 +#include <e32ldr_private.h>
    1.25 +
    1.26 +_LIT(KLdrTestLddName, "LdrTest");
    1.27 +
    1.28 +
    1.29 +#ifndef TMODULEHANDLE_DEFINED
    1.30 +#define TMODULEHANDLE_DEFINED
    1.31 +class TModuleHandle_dummy_class;
    1.32 +typedef TModuleHandle_dummy_class* TModuleHandle;
    1.33 +#endif
    1.34 +
    1.35 +/**
    1.36 +@internalComponent
    1.37 +*/
    1.38 +class TCapsTestV01
    1.39 +	{
    1.40 +public:
    1.41 +	TVersion	iVersion;
    1.42 +	};
    1.43 +
    1.44 +/**
    1.45 +@internalComponent
    1.46 +*/
    1.47 +class RLdrTest : public RBusLogicalChannel
    1.48 +	{
    1.49 +public:
    1.50 +	enum TControl
    1.51 +		{
    1.52 +		EControlGetCodeSegInfo,
    1.53 +		EControlProcessCodeSeg,
    1.54 +		EControlLibraryCodeSeg,
    1.55 +		EControlModuleCodeSeg,
    1.56 +		EControlGetCodeSegList,
    1.57 +		EControlCodeSegFromAddr,
    1.58 +		EControlModuleHandleFromAddr,
    1.59 +		EControlProcessSMPUnsafeCount,
    1.60 +		};
    1.61 +
    1.62 +/**
    1.63 +@internalComponent
    1.64 +*/
    1.65 +	struct SEntry
    1.66 +		{
    1.67 +		TAny* iHandle;
    1.68 +		TUint32 iUid3;
    1.69 +		};
    1.70 +public:
    1.71 +	inline TInt Open();
    1.72 +	inline TInt GetCodeSegInfo(TAny* aHandle, TCodeSegCreateInfo& aInfo);
    1.73 +	inline TAny* ProcessCodeSeg(TInt aProcessHandle);
    1.74 +	inline TAny* LibraryCodeSeg(TInt aLibraryHandle);
    1.75 +	inline TAny* ModuleCodeSeg(TModuleHandle aModuleHandle);
    1.76 +	inline TInt GetCodeSegList(SEntry* aList, TInt aMax);
    1.77 +	inline TAny* CodeSegFromAddr(TLinAddr aAddr);
    1.78 +	inline TModuleHandle ModuleHandleFromAddr(TLinAddr aAddr);
    1.79 +	inline TInt ProcessSMPUnsafeCount(TInt aProcessHandle);
    1.80 +	};
    1.81 +
    1.82 +#ifndef __KERNEL_MODE__
    1.83 +inline TInt RLdrTest::Open()
    1.84 +	{ return DoCreate(KLdrTestLddName, TVersion(0,1,1), KNullUnit, NULL, NULL); }
    1.85 +inline TInt RLdrTest::GetCodeSegInfo(TAny* aHandle, TCodeSegCreateInfo& aInfo)
    1.86 +	{ return DoControl(EControlGetCodeSegInfo, aHandle, &aInfo); }
    1.87 +inline TAny* RLdrTest::ProcessCodeSeg(TInt aProcessHandle)
    1.88 +	{ return (TAny*)DoControl(EControlProcessCodeSeg, (TAny*)aProcessHandle); }
    1.89 +inline TAny* RLdrTest::LibraryCodeSeg(TInt aLibraryHandle)
    1.90 +	{ return (TAny*)DoControl(EControlLibraryCodeSeg, (TAny*)aLibraryHandle); }
    1.91 +inline TAny* RLdrTest::ModuleCodeSeg(TModuleHandle aModuleHandle)
    1.92 +	{ return (TAny*)DoControl(EControlModuleCodeSeg, (TAny*)aModuleHandle); }
    1.93 +inline TInt RLdrTest::GetCodeSegList(SEntry* aList, TInt aMax)
    1.94 +	{ return DoControl(EControlGetCodeSegList, aList, (TAny*)aMax); }
    1.95 +inline TAny* RLdrTest::CodeSegFromAddr(TLinAddr aAddr)
    1.96 +	{ return (TAny*)DoControl(EControlCodeSegFromAddr, (TAny*)aAddr); }
    1.97 +inline TModuleHandle RLdrTest::ModuleHandleFromAddr(TLinAddr aAddr)
    1.98 +	{ return (TModuleHandle)DoControl(EControlModuleHandleFromAddr, (TAny*)aAddr); }
    1.99 +inline TInt RLdrTest::ProcessSMPUnsafeCount(TInt aProcessHandle)
   1.100 +	{ return DoControl(EControlProcessSMPUnsafeCount, (TAny*)aProcessHandle); }
   1.101 +#endif
   1.102 +
   1.103 +#endif
   1.104 +