sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Name : ewsd.h sl@0: * Part of : ewsd library sl@0: * Contains the declarations of the APIs of the emulator WSD library sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef __EWSD_H__ sl@0: #define __EWSD_H__ sl@0: sl@0: #ifdef __WINSCW__ sl@0: sl@0: #include sl@0: sl@0: /** sl@0: * The following functions should not be used directly. sl@0: * Libraries that require to use the emulator WSD library sl@0: * should use the Pls() API defined in pls.h sl@0: */ sl@0: sl@0: /** sl@0: Finds and returns the PLS (Process Local Storage) object of the specified sl@0: library for the current process, if the object exists. sl@0: Takes as a parameter the TUid of the library DLL whose PLS object is to sl@0: be returned for the current process. sl@0: Returns a pointer to the PLS object if it exists, otherwise NULL sl@0: */ sl@0: IMPORT_C TAny* CheckPls(const TUid& aLibraryUid); sl@0: sl@0: /** sl@0: Sets the PLS object of the specified library, for the current process. sl@0: Takes as parameters the PLS object to be set, and the TUid of the library sl@0: DLL whose PLS object it is. sl@0: Returns KErrNone on success, and KErrNoMemory if the PLS object could not sl@0: be stored because a size limit of the WSD array has been reached sl@0: */ sl@0: IMPORT_C TInt SetPls(TAny* aPls, const TUid& aLibraryUid); sl@0: sl@0: /** sl@0: Allocates the specified number of bytes of memory from the emulator's sl@0: Virtual Address Space. sl@0: Takes as a parameter the number of bytes of memory to allocate. sl@0: Returns a pointer to the allocated memory on success, otherwise NULL sl@0: */ sl@0: IMPORT_C TAny* AllocatePls(const TInt& aSize); sl@0: sl@0: /** sl@0: Frees the specified memory in the emulator's Virtual Address Space. sl@0: Takes as a parameter the PLS object location to be freed. sl@0: Returns KErrNone on success, otherwise KErrAccessDenied sl@0: */ sl@0: IMPORT_C TInt FreePls(TAny* aPls); sl@0: sl@0: /** sl@0: Gets a handle to the mutex, waits until it obtains ownership of it sl@0: and then returns the handle. sl@0: Returns a handle to the mutex, of which the caller now has ownership. sl@0: Note that the handle is returned as a TAny* (the Windows HANDLE type sl@0: is typedefed to void*) sl@0: */ sl@0: IMPORT_C TAny* ObtainPlsMutex(); sl@0: sl@0: /** sl@0: Releases ownership of the mutex, which allows another thread sl@0: to acquire ownership of it. sl@0: Takes as a parameter a handle to the mutex sl@0: */ sl@0: IMPORT_C void ReleasePlsMutex(TAny* aMutexHandle); sl@0: sl@0: #endif // __WINSCW__ sl@0: sl@0: #endif // __EWSD_H__ sl@0: