williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
* Name : ewsd.h
|
williamr@2
|
16 |
* Part of : ewsd library
|
williamr@2
|
17 |
* Contains the declarations of the APIs of the emulator WSD library
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
*/
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#ifndef __EWSD_H__
|
williamr@2
|
24 |
#define __EWSD_H__
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#ifdef __WINSCW__
|
williamr@2
|
27 |
|
williamr@4
|
28 |
#include <e32std.h>
|
williamr@4
|
29 |
|
williamr@2
|
30 |
/**
|
williamr@2
|
31 |
* The following functions should not be used directly.
|
williamr@2
|
32 |
* Libraries that require to use the emulator WSD library
|
williamr@2
|
33 |
* should use the Pls() API defined in pls.h
|
williamr@2
|
34 |
*/
|
williamr@2
|
35 |
|
williamr@2
|
36 |
/**
|
williamr@2
|
37 |
Finds and returns the PLS (Process Local Storage) object of the specified
|
williamr@2
|
38 |
library for the current process, if the object exists.
|
williamr@2
|
39 |
Takes as a parameter the TUid of the library DLL whose PLS object is to
|
williamr@2
|
40 |
be returned for the current process.
|
williamr@2
|
41 |
Returns a pointer to the PLS object if it exists, otherwise NULL
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
IMPORT_C TAny* CheckPls(const TUid& aLibraryUid);
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
Sets the PLS object of the specified library, for the current process.
|
williamr@2
|
47 |
Takes as parameters the PLS object to be set, and the TUid of the library
|
williamr@2
|
48 |
DLL whose PLS object it is.
|
williamr@2
|
49 |
Returns KErrNone on success, and KErrNoMemory if the PLS object could not
|
williamr@2
|
50 |
be stored because a size limit of the WSD array has been reached
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
IMPORT_C TInt SetPls(TAny* aPls, const TUid& aLibraryUid);
|
williamr@2
|
53 |
|
williamr@2
|
54 |
/**
|
williamr@2
|
55 |
Allocates the specified number of bytes of memory from the emulator's
|
williamr@2
|
56 |
Virtual Address Space.
|
williamr@2
|
57 |
Takes as a parameter the number of bytes of memory to allocate.
|
williamr@2
|
58 |
Returns a pointer to the allocated memory on success, otherwise NULL
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
IMPORT_C TAny* AllocatePls(const TInt& aSize);
|
williamr@2
|
61 |
|
williamr@2
|
62 |
/**
|
williamr@2
|
63 |
Frees the specified memory in the emulator's Virtual Address Space.
|
williamr@2
|
64 |
Takes as a parameter the PLS object location to be freed.
|
williamr@2
|
65 |
Returns KErrNone on success, otherwise KErrAccessDenied
|
williamr@2
|
66 |
*/
|
williamr@2
|
67 |
IMPORT_C TInt FreePls(TAny* aPls);
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/**
|
williamr@2
|
70 |
Gets a handle to the mutex, waits until it obtains ownership of it
|
williamr@2
|
71 |
and then returns the handle.
|
williamr@2
|
72 |
Returns a handle to the mutex, of which the caller now has ownership.
|
williamr@2
|
73 |
Note that the handle is returned as a TAny* (the Windows HANDLE type
|
williamr@2
|
74 |
is typedefed to void*)
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
IMPORT_C TAny* ObtainPlsMutex();
|
williamr@2
|
77 |
|
williamr@2
|
78 |
/**
|
williamr@2
|
79 |
Releases ownership of the mutex, which allows another thread
|
williamr@2
|
80 |
to acquire ownership of it.
|
williamr@2
|
81 |
Takes as a parameter a handle to the mutex
|
williamr@2
|
82 |
*/
|
williamr@2
|
83 |
IMPORT_C void ReleasePlsMutex(TAny* aMutexHandle);
|
williamr@2
|
84 |
|
williamr@2
|
85 |
#endif // __WINSCW__
|
williamr@2
|
86 |
|
williamr@2
|
87 |
#endif // __EWSD_H__
|
williamr@2
|
88 |
|