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