Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\dll\t_oeexport_wins.cpp
16 // Emulator version that tests it is possible to retrieve the 0th
17 // ordinal from exes and dlls that are marked as having named
18 // symbol export data.
22 // - Test reading 0th ordinal from a dll which has a E32EmulExpSymInfoHdr
23 // struct at the 0th ordinal and verify the contents of the header
24 // - Test NULL is returned on attempts to get the 0th ordinal from a
25 // dll without the named symbol data
26 // - Test reading the named symbol data from an exe that contains a
27 // E32EmulExpSymInfoHdr struct at the 0th ordinal and verify the contents
28 // - Test NULL is returned when attempting to read the 0th ordinal of
29 // an exe that doesn't contain a E32EmulExpSymInfoHdr
30 // Platforms/Drives/Compatibility:
32 // Assumptions/Requirement/Pre-requisites:
33 // Failures and causes:
34 // Base Port information:
43 RTest test(_L("T_OEEXPORT"));
45 LOCAL_D void VerifyHdr(E32EmulExpSymInfoHdr& aExpectedHdr, E32EmulExpSymInfoHdr &aReadHdr)
47 test(aExpectedHdr.iSymCount == aReadHdr.iSymCount);
48 test(aExpectedHdr.iDllCount == aReadHdr.iDllCount);
55 test.Start(_L("Test retrieving 0th ordinal and therefore named symbol export data"));
57 E32EmulExpSymInfoHdr tmpHdr;
58 E32EmulExpSymInfoHdr *readHdr;
61 // The values for the header of the dll with a 0th ordinal
62 tmpHdr.iSymCount = 0x0;
63 tmpHdr.iDllCount = 0x3;
64 test(library.Load(_L("t_oedll.dll")) == KErrNone);
65 test.Next(_L("Attempt to retrieve named symbol data from t_oedll.dll"));
66 readHdr = (E32EmulExpSymInfoHdr*)library.Lookup(0);
68 //#define PRINT_ZEROTH
70 test.Printf(_L("iSymCount=%08x;iDllCounts=%08x\n"),readHdr->iSymCount,readHdr->iDllCount);
72 test.Next(_L("Verify export data of t_oedll.dll is that expected"));
73 VerifyHdr(tmpHdr, *readHdr);
76 test.Next(_L("Verify lookup on dll without oe export data returns NULL"));
77 test(library.Load(_L("t_dll1.dll")) == KErrNone);
78 readHdr = (E32EmulExpSymInfoHdr*)library.Lookup(0);
79 test(readHdr == NULL);
82 // The values for the header of the exe of the current process with a 0th ordinal
83 tmpHdr.iSymCount = 0x3;
84 tmpHdr.iDllCount = 0x5;
85 test.Next(_L("Attempt to retrieve named symbol data from current process"));
86 readHdr = (E32EmulExpSymInfoHdr*)(RProcess::ExeExportData());
88 test.Next(_L("Verify export data 0th ordinal data of this exe is that expected"));
90 test.Printf(_L("iSymCount=%08x;iDllCounts=%08x;\n"),readHdr->iSymCount,readHdr->iDllCount);
92 VerifyHdr(tmpHdr, *readHdr);
95 On Emulator can't examine fixups & depdencies via export data as data not included
96 in E32EmulExpSymInfoHdr. This is all handled by the MS loader.