os/kernelhwsrv/kerneltest/e32test/dll/d_import.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/dll/d_import.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,108 @@
     1.4 +// Copyright (c) 2004-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 +// e32test\mmu\d_export.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include <kernel/kern_priv.h>
    1.22 +#include "d_import.h"
    1.23 +
    1.24 +//
    1.25 +// Class definitions
    1.26 +//
    1.27 +
    1.28 +class DImportFactory : public DLogicalDevice
    1.29 +	{
    1.30 +public:
    1.31 +	~DImportFactory();
    1.32 +	virtual TInt Install();
    1.33 +	virtual void GetCaps(TDes8& aDes) const;
    1.34 +	virtual TInt Create(DLogicalChannelBase*& aChannel);
    1.35 +	};
    1.36 +
    1.37 +class DImportChannel : public DLogicalChannelBase
    1.38 +	{
    1.39 +public:
    1.40 +	DImportChannel();
    1.41 +	~DImportChannel();
    1.42 +	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
    1.43 +	virtual TInt Request(TInt aFunction, TAny* a1, TAny* a2);
    1.44 +public:
    1.45 +	DImportFactory*	iFactory;
    1.46 +	};
    1.47 +
    1.48 +//
    1.49 +// DImportFactory
    1.50 +//
    1.51 +
    1.52 +TInt DImportFactory::Install()
    1.53 +	{
    1.54 +	return SetName(&KImportTestLddName);
    1.55 +	}
    1.56 +
    1.57 +DImportFactory::~DImportFactory()
    1.58 +	{
    1.59 +	}
    1.60 +
    1.61 +void DImportFactory::GetCaps(TDes8& /*aDes*/) const
    1.62 +	{
    1.63 +	// Not used but required as DLogicalDevice::GetCaps is pure virtual
    1.64 +	}
    1.65 +
    1.66 +TInt DImportFactory::Create(DLogicalChannelBase*& aChannel)
    1.67 +	{
    1.68 +	aChannel = NULL;
    1.69 +	DImportChannel* channel=new DImportChannel;
    1.70 +	if(!channel)
    1.71 +		return KErrNoMemory;
    1.72 +	channel->iFactory = this;
    1.73 +	aChannel = channel;
    1.74 +	return KErrNone;
    1.75 +	}
    1.76 +
    1.77 +DECLARE_STANDARD_LDD()
    1.78 +	{
    1.79 +	return new DImportFactory;
    1.80 +	}
    1.81 +
    1.82 +//
    1.83 +// DImportChannel
    1.84 +//
    1.85 +
    1.86 +TInt DImportChannel::DoCreate(TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
    1.87 +	{
    1.88 +	return KErrNone;
    1.89 +	}
    1.90 +
    1.91 +DImportChannel::DImportChannel()
    1.92 +	{
    1.93 +	}
    1.94 +
    1.95 +DImportChannel::~DImportChannel()
    1.96 +	{
    1.97 +	}
    1.98 +
    1.99 +
   1.100 +TInt DImportChannel::Request(TInt aFunction, TAny* a1, TAny* a2)
   1.101 +	{
   1.102 +	TInt r=KErrNotSupported;
   1.103 +
   1.104 +	switch(aFunction)
   1.105 +		{
   1.106 +		case RImportLdd::ERunImport:
   1.107 +			r = ExportMultiplyFunction((TUint)a1, (TUint)a2);
   1.108 +			break;
   1.109 +		}
   1.110 +	return r;
   1.111 +	}