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