|
1 // Copyright (c) 1997-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 "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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // dummy PPPMISC.CPP |
|
15 // |
|
16 // |
|
17 |
|
18 #include <f32file.h> |
|
19 #include "PPPBASE.H" |
|
20 |
|
21 // |
|
22 // PPP Link Interface Support |
|
23 // |
|
24 |
|
25 MPppRecvr::MPppRecvr(CPppLcp* , TPppPhase , TUint ):iPppId(0),iActivePhase(EPppPhaseTerminate), |
|
26 iPppLcp(NULL),iPppAbortCode(0),iPppRecvrListLink() |
|
27 { |
|
28 } |
|
29 |
|
30 MPppRecvr::~MPppRecvr() |
|
31 { |
|
32 } |
|
33 |
|
34 void MPppRecvr::FlowOn() |
|
35 { |
|
36 } |
|
37 |
|
38 void MPppRecvr::LowerLayerUp() |
|
39 { |
|
40 } |
|
41 |
|
42 void MPppRecvr::LowerLayerDown(TInt) |
|
43 { |
|
44 } |
|
45 |
|
46 void MPppRecvr::Deque() |
|
47 { |
|
48 } |
|
49 |
|
50 void MPppRecvr::Register(TUint ) |
|
51 { |
|
52 } |
|
53 |
|
54 void MPppRecvr::Reregister(TUint , TPppPhase ) |
|
55 { |
|
56 } |
|
57 |
|
58 void MPppRecvr::Deregister() |
|
59 { |
|
60 } |
|
61 |
|
62 |
|
63 typedef CNifFactory* (*TPppFactoryNewL)(void); |
|
64 CNifFactory* MPppRecvr::FindPppFactoryL(const TDesC& aFilename, TUid aUid2, CObjectCon& aCon) |
|
65 // |
|
66 // Basically this is all the stuff required to load a DLL appart from the |
|
67 // Factory->CreatMe call |
|
68 // |
|
69 { |
|
70 CNifFactory* Factory=NULL; |
|
71 TParse parse; |
|
72 User::LeaveIfError(parse.Set(aFilename, 0, 0)); |
|
73 |
|
74 TName dummy1; |
|
75 TInt find=0; |
|
76 |
|
77 if(aCon.FindByName(find, parse.Name(), dummy1)!=KErrNone) |
|
78 { |
|
79 |
|
80 // Else load the module |
|
81 TAutoClose<RLibrary> lib; |
|
82 User::LeaveIfError(lib.iObj.Load(aFilename)); |
|
83 lib.PushL(); |
|
84 |
|
85 // The Uid check |
|
86 if(lib.iObj.Type()[1]!=aUid2) |
|
87 User::Leave(KErrBadLibraryEntryPoint); |
|
88 |
|
89 TPppFactoryNewL libEntry=(TPppFactoryNewL)lib.iObj.Lookup(1); |
|
90 if (libEntry==NULL) |
|
91 User::Leave(KErrNoMemory); |
|
92 |
|
93 Factory =(*libEntry)(); // Opens CObject |
|
94 if (!Factory) |
|
95 User::Leave(KErrBadDriver); |
|
96 |
|
97 CleanupStack::PushL(TCleanupItem(CNifFactory::Cleanup, Factory)); |
|
98 Factory->InitL(lib.iObj, aCon); // Transfers the library object if successful |
|
99 |
|
100 // Can pop the library now - auto close will have no effect because handle is null |
|
101 CleanupStack::Pop(); |
|
102 lib.Pop(); |
|
103 |
|
104 } |
|
105 else |
|
106 { |
|
107 Factory=(CNifFactory*)aCon.At(find); |
|
108 Factory->Open(); |
|
109 } |
|
110 return Factory; |
|
111 } |
|
112 |
|
113 |