Line | |
---|
1 | /* $Id: dllentry.cpp,v 1.7 2001-10-01 01:39:17 bird Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Ordinary DLL entry point
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen
|
---|
7 | * Copyright 1998 Peter Fitzsimmons
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | */
|
---|
11 |
|
---|
12 | #define INCL_DOSMODULEMGR
|
---|
13 | #define INCL_DOSPROCESS
|
---|
14 | #include <os2wrap.h> //Odin32 OS/2 api wrappers
|
---|
15 | #include <stdlib.h>
|
---|
16 | #include <stdio.h>
|
---|
17 | #include <string.h>
|
---|
18 | #include <odin.h>
|
---|
19 | #include <win32type.h>
|
---|
20 | #include <winconst.h>
|
---|
21 | #include <odinlx.h>
|
---|
22 | #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/
|
---|
23 | #include <initdll.h>
|
---|
24 |
|
---|
25 | // Win32 resource table (produced by wrc)
|
---|
26 | extern DWORD Resource_PEResTab;
|
---|
27 |
|
---|
28 | static HMODULE dllHandle = 0;
|
---|
29 |
|
---|
30 | #if 0
|
---|
31 |
|
---|
32 | // Not currently needed
|
---|
33 |
|
---|
34 | BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
---|
35 | {
|
---|
36 | switch (fdwReason)
|
---|
37 | {
|
---|
38 | case DLL_PROCESS_ATTACH:
|
---|
39 | return TRUE;
|
---|
40 |
|
---|
41 | case DLL_THREAD_ATTACH:
|
---|
42 | case DLL_THREAD_DETACH:
|
---|
43 | return TRUE;
|
---|
44 |
|
---|
45 | case DLL_PROCESS_DETACH:
|
---|
46 | return TRUE;
|
---|
47 | }
|
---|
48 |
|
---|
49 | return FALSE;
|
---|
50 | }
|
---|
51 |
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | ULONG SYSTEM DLL_Init(ULONG hModule)
|
---|
55 | {
|
---|
56 | if (DLL_InitDefault(hModule) == -1)
|
---|
57 | return -1;
|
---|
58 |
|
---|
59 | CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/
|
---|
60 | dllHandle = RegisterLxDll(hModule, NULL, (PVOID)&Resource_PEResTab);
|
---|
61 | if (dllHandle == 0)
|
---|
62 | return -1;
|
---|
63 |
|
---|
64 | return 0;
|
---|
65 | }
|
---|
66 |
|
---|
67 | void SYSTEM DLL_Term(ULONG hModule)
|
---|
68 | {
|
---|
69 | if(dllHandle)
|
---|
70 | UnregisterLxDll(dllHandle);
|
---|
71 |
|
---|
72 | DLL_TermDefault(hModule);
|
---|
73 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.