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