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