testexecfw/stf/stfext/testmodules/teftestmod/teftestmodulefw/wrapperutils/src/fileservplugin.cpp
changeset 2 8bb370ba6d1d
equal deleted inserted replaced
1:bbd31066657e 2:8bb370ba6d1d
       
     1 /*
       
     2 * Copyright (c) 2005-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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <e32std.h>
       
    21 #include "fileservplugin.h"
       
    22 
       
    23 CFileServPlugin* CFileServPlugin::NewL()
       
    24 	{
       
    25 	CFileServPlugin* self = new(ELeave) CFileServPlugin();
       
    26 	return self;
       
    27 	}
       
    28 
       
    29 CFileServPlugin::CFileServPlugin()
       
    30 	{
       
    31 	}
       
    32 
       
    33 CFileServPlugin::~CFileServPlugin()
       
    34 	{
       
    35 	
       
    36 	}
       
    37 
       
    38 TDriveNumber CFileServPlugin::GetSystemDrive()
       
    39 	{
       
    40 	TDriveNumber defaultSysDrive(EDriveC);
       
    41 	RFs fileServer;
       
    42 	TVersionName version(fileServer.Version().Name());
       
    43 	if (fileServer.Version().iMajor >= 2 &&
       
    44 		fileServer.Version().iBuild >= 1100)
       
    45 		{
       
    46 		_LIT(KFileSrvDll, "efsrv.dll");
       
    47 
       
    48 		RLibrary pluginLibrary;
       
    49 		TInt pluginErr = pluginLibrary.Load(KFileSrvDll);
       
    50 
       
    51 		if (pluginErr == KErrNone)
       
    52 			{
       
    53 			typedef TDriveNumber(*fun1)();
       
    54 			fun1 sysdrive;
       
    55 
       
    56 	#ifdef __EABI__
       
    57 			sysdrive = (fun1)pluginLibrary.Lookup(336);
       
    58 	#else
       
    59 			sysdrive = (fun1)pluginLibrary.Lookup(304);
       
    60 	#endif
       
    61 			defaultSysDrive = sysdrive();
       
    62 			}
       
    63 		pluginLibrary.Close();
       
    64 		}
       
    65 	
       
    66 	return defaultSysDrive;
       
    67 	}