Update contrib.
1 // Copyright (c) 1999-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\system\d_kucopy.h
18 #if !defined(__D_KUCOPY_H__)
19 #define __D_KUCOPY_H__
21 #ifndef __KERNEL_MODE__
25 _LIT(KKUCopyLddName,"KUCopy");
36 : iPtr(NULL), iOffset(0), iLength(0)
38 SCopyInfo(const TUint8* aPtr, TInt aOffset, TInt aLength)
39 : iPtr(aPtr), iOffset(aOffset), iLength(aLength)
49 : iPtr(NULL), iLength(0), iValue(0)
51 SSetInfo(TUint8* aPtr, TInt aLength, TUint8 aValue)
52 : iPtr(aPtr), iLength(aLength), iValue(aValue)
66 class RKUCopy : public RBusLogicalChannel
87 EControlRequestComplete,
88 EControlRequestCompleteLocal,
89 EControlQueueRequestComplete,
92 #ifndef __KERNEL_MODE__
94 inline void Put(TUint8* aDest, TInt aOffset, TInt aLength);
95 inline void Get(const TUint8* aSrc, TInt aOffset, TInt aLength);
96 inline void Put32(TUint32* aDest, TInt aOffset, TInt aLength);
97 inline void Get32(const TUint32* aSrc, TInt aOffset, TInt aLength);
98 inline void Set(TUint8* aDest, TInt aLength, TUint8 aValue);
100 inline void Read(TUint8* aDest);
101 inline TInt RandomLength();
102 inline void ReadRandom(TUint8* aDest);
103 inline void DesPut(TDes8& aDest, const TDesC8& aSrc);
104 inline void DesGet(TDes8& aDest, const TDesC8& aSrc);
105 inline void DesInfo(const TDesC8& aDes, SDesInfo& aInfo);
106 inline void DesPut(TDes16& aDest, const TDesC16& aSrc);
107 inline void DesGet(TDes16& aDest, const TDesC16& aSrc);
108 inline void DesInfo(const TDesC16& aDes, SDesInfo& aInfo);
109 inline TUint8* KernelBufferAddress();
110 inline void RequestComplete(TRequestStatus* status);
111 inline void RequestCompleteLocal(TRequestStatus* status);
112 inline TInt QueueRequestComplete(TRequestStatus* status);
116 #ifndef __KERNEL_MODE__
117 inline TInt RKUCopy::Open()
118 { return DoCreate(KKUCopyLddName,TVersion(1,0,0),KNullUnit,NULL,NULL); }
120 inline void RKUCopy::Put(TUint8* aDest, TInt aOffset, TInt aLength)
121 { SCopyInfo info(aDest,aOffset,aLength); DoControl(EControlPut,&info); }
123 inline void RKUCopy::Get(const TUint8* aSrc, TInt aOffset, TInt aLength)
124 { SCopyInfo info(aSrc,aOffset,aLength); DoControl(EControlGet,&info); }
126 inline void RKUCopy::Put32(TUint32* aDest, TInt aOffset, TInt aLength)
127 { SCopyInfo info((const TUint8*)aDest,aOffset,aLength); DoControl(EControlPut32,&info); }
129 inline void RKUCopy::Get32(const TUint32* aSrc, TInt aOffset, TInt aLength)
130 { SCopyInfo info((const TUint8*)aSrc,aOffset,aLength); DoControl(EControlGet32,&info); }
132 inline void RKUCopy::Set(TUint8* aDest, TInt aLength, TUint8 aValue)
133 { SSetInfo info(aDest,aLength,aValue); DoControl(EControlSet,&info); }
135 inline TInt RKUCopy::Length()
136 { return DoControl(EControlLength); }
138 inline void RKUCopy::Read(TUint8* aDest)
139 { DoControl(EControlRead,aDest); }
141 inline TInt RKUCopy::RandomLength()
142 { return DoControl(EControlRandomLength); }
144 inline void RKUCopy::ReadRandom(TUint8* aDest)
145 { DoControl(EControlReadRandom,aDest); }
147 inline void RKUCopy::DesPut(TDes8& aDest, const TDesC8& aSrc)
148 { DoControl(EControlDesPut8, &aDest, (TAny*)&aSrc); }
150 inline void RKUCopy::DesGet(TDes8& aDest, const TDesC8& aSrc)
151 { DoControl(EControlDesGet8, &aDest, (TAny*)&aSrc); }
153 inline void RKUCopy::DesInfo(const TDesC8& aDes, SDesInfo& aInfo)
154 { DoControl(EControlDesInfo8, (TAny*)&aDes, &aInfo); }
156 inline void RKUCopy::DesPut(TDes16& aDest, const TDesC16& aSrc)
157 { DoControl(EControlDesPut16, &aDest, (TAny*)&aSrc); }
159 inline void RKUCopy::DesGet(TDes16& aDest, const TDesC16& aSrc)
160 { DoControl(EControlDesGet16, &aDest, (TAny*)&aSrc); }
162 inline void RKUCopy::DesInfo(const TDesC16& aDes, SDesInfo& aInfo)
163 { DoControl(EControlDesInfo16, (TAny*)&aDes, &aInfo); }
165 inline TUint8* RKUCopy::KernelBufferAddress()
166 { return (TUint8*)DoControl(EControlKernBufAddr); }
168 inline void RKUCopy::RequestComplete(TRequestStatus* status)
169 { DoControl(EControlRequestComplete, status); }
171 inline void RKUCopy::RequestCompleteLocal(TRequestStatus* status)
172 { DoControl(EControlRequestCompleteLocal, status); }
174 inline TInt RKUCopy::QueueRequestComplete(TRequestStatus* status)
175 { return DoControl(EControlQueueRequestComplete, status); }