sl@0: /* sl@0: * Copyright (c) 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: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: #include <_ansi.h> sl@0: #include sl@0: #include "gmodule_wsd.h" sl@0: #include sl@0: #include sl@0: sl@0: #if EMULATOR sl@0: sl@0: #include // For emulator WSD API sl@0: const TUid KLibgmoduleUid3 = {0x10281F3B}; // This is the UID of the library sl@0: sl@0: G_BEGIN_DECLS sl@0: sl@0: int InitializeWsd(struct global_struct* g) sl@0: { sl@0: memset(g,0,sizeof(struct global_struct)); sl@0: sl@0: GStaticRecMutex temp_init_mutex = G_STATIC_REC_MUTEX_INIT; sl@0: memcpy(&(g->VARIABLE_NAME(g_module_global_lock, gmodule)), &temp_init_mutex, sizeof(GStaticMutex)); sl@0: return KErrNone; sl@0: } sl@0: sl@0: struct global_struct *Gmodule_ImpurePtr() sl@0: { sl@0: #if defined(__WINSCW__) || defined(__WINS__) sl@0: sl@0: // Access the PLS of this process sl@0: struct global_struct* p = Pls(KLibgmoduleUid3, &InitializeWsd); sl@0: return p; sl@0: sl@0: #else sl@0: sl@0: return NULL; sl@0: sl@0: #endif sl@0: sl@0: } sl@0: sl@0: sl@0: G_END_DECLS sl@0: #endif /* EMULATOR */ sl@0: