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@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 |
* Redistribution and use in source and binary forms, with or without
|
williamr@2
|
19 |
* modification, are permitted provided that the following conditions are met:
|
williamr@2
|
20 |
* Redistributions of source code must retain the above copyright notice, this
|
williamr@2
|
21 |
* list of conditions and the following disclaimer.
|
williamr@2
|
22 |
* Redistributions in binary form must reproduce the above copyright notice,
|
williamr@2
|
23 |
* this list of conditions and the following disclaimer in the documentation
|
williamr@2
|
24 |
* and/or other materials provided with the distribution.
|
williamr@2
|
25 |
* Neither the name of the <ORGANIZATION> nor the names of its contributors
|
williamr@2
|
26 |
* may be used to endorse or promote products derived from this software
|
williamr@2
|
27 |
* without specific prior written permission.
|
williamr@2
|
28 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
williamr@2
|
29 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
williamr@2
|
30 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
williamr@2
|
31 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
williamr@2
|
32 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
williamr@2
|
33 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
williamr@2
|
34 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
williamr@2
|
35 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
williamr@2
|
36 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
williamr@2
|
37 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
williamr@2
|
38 |
*
|
williamr@2
|
39 |
*/
|
williamr@2
|
40 |
|
williamr@2
|
41 |
|
williamr@2
|
42 |
|
williamr@2
|
43 |
#ifndef __EWSD_H__
|
williamr@2
|
44 |
#define __EWSD_H__
|
williamr@2
|
45 |
|
williamr@2
|
46 |
#ifdef __WINSCW__
|
williamr@2
|
47 |
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
* The following functions should not be used directly.
|
williamr@2
|
50 |
* Libraries that require to use the emulator WSD library
|
williamr@2
|
51 |
* should use the Pls() API defined in pls.h
|
williamr@2
|
52 |
*/
|
williamr@2
|
53 |
|
williamr@2
|
54 |
/**
|
williamr@2
|
55 |
Finds and returns the PLS (Process Local Storage) object of the specified
|
williamr@2
|
56 |
library for the current process, if the object exists.
|
williamr@2
|
57 |
Takes as a parameter the TUid of the library DLL whose PLS object is to
|
williamr@2
|
58 |
be returned for the current process.
|
williamr@2
|
59 |
Returns a pointer to the PLS object if it exists, otherwise NULL
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
IMPORT_C TAny* CheckPls(const TUid& aLibraryUid);
|
williamr@2
|
62 |
|
williamr@2
|
63 |
/**
|
williamr@2
|
64 |
Sets the PLS object of the specified library, for the current process.
|
williamr@2
|
65 |
Takes as parameters the PLS object to be set, and the TUid of the library
|
williamr@2
|
66 |
DLL whose PLS object it is.
|
williamr@2
|
67 |
Returns KErrNone on success, and KErrNoMemory if the PLS object could not
|
williamr@2
|
68 |
be stored because a size limit of the WSD array has been reached
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
IMPORT_C TInt SetPls(TAny* aPls, const TUid& aLibraryUid);
|
williamr@2
|
71 |
|
williamr@2
|
72 |
/**
|
williamr@2
|
73 |
Allocates the specified number of bytes of memory from the emulator's
|
williamr@2
|
74 |
Virtual Address Space.
|
williamr@2
|
75 |
Takes as a parameter the number of bytes of memory to allocate.
|
williamr@2
|
76 |
Returns a pointer to the allocated memory on success, otherwise NULL
|
williamr@2
|
77 |
*/
|
williamr@2
|
78 |
IMPORT_C TAny* AllocatePls(const TInt& aSize);
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
Frees the specified memory in the emulator's Virtual Address Space.
|
williamr@2
|
82 |
Takes as a parameter the PLS object location to be freed.
|
williamr@2
|
83 |
Returns KErrNone on success, otherwise KErrAccessDenied
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
IMPORT_C TInt FreePls(TAny* aPls);
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/**
|
williamr@2
|
88 |
Gets a handle to the mutex, waits until it obtains ownership of it
|
williamr@2
|
89 |
and then returns the handle.
|
williamr@2
|
90 |
Returns a handle to the mutex, of which the caller now has ownership.
|
williamr@2
|
91 |
Note that the handle is returned as a TAny* (the Windows HANDLE type
|
williamr@2
|
92 |
is typedefed to void*)
|
williamr@2
|
93 |
*/
|
williamr@2
|
94 |
IMPORT_C TAny* ObtainPlsMutex();
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/**
|
williamr@2
|
97 |
Releases ownership of the mutex, which allows another thread
|
williamr@2
|
98 |
to acquire ownership of it.
|
williamr@2
|
99 |
Takes as a parameter a handle to the mutex
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
IMPORT_C void ReleasePlsMutex(TAny* aMutexHandle);
|
williamr@2
|
102 |
|
williamr@2
|
103 |
#endif // __WINSCW__
|
williamr@2
|
104 |
|
williamr@2
|
105 |
#endif // __EWSD_H__
|
williamr@2
|
106 |
|