[21900] | 1 | /* $Id: initterm.cpp,v 1.8 2003-10-24 13:10:03 sandervl Exp $
|
---|
[6857] | 2 | *
|
---|
[21900] | 3 | * WININET DLL entry point
|
---|
[6857] | 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 |
|
---|
[21900] | 24 | // Win32 resource table (produced by wrc)
|
---|
| 25 | extern DWORD wininet_PEResTab;
|
---|
[6857] | 26 |
|
---|
| 27 | static HMODULE dllHandle = 0;
|
---|
| 28 |
|
---|
| 29 | BOOL WINAPI WININET_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
---|
| 30 |
|
---|
| 31 | BOOL WINAPI WininetLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
---|
| 32 | {
|
---|
[21900] | 33 | BOOL ret;
|
---|
[6857] | 34 |
|
---|
[21900] | 35 | switch (fdwReason)
|
---|
| 36 | {
|
---|
| 37 | case DLL_PROCESS_ATTACH:
|
---|
| 38 | case DLL_THREAD_ATTACH:
|
---|
| 39 | case DLL_THREAD_DETACH:
|
---|
| 40 | return WININET_LibMain(hinstDLL, fdwReason, fImpLoad);
|
---|
[6857] | 41 |
|
---|
[21900] | 42 | case DLL_PROCESS_DETACH:
|
---|
| 43 | ret = WININET_LibMain(hinstDLL, fdwReason, fImpLoad);
|
---|
| 44 | return ret;
|
---|
| 45 | }
|
---|
| 46 | return FALSE;
|
---|
[6857] | 47 | }
|
---|
| 48 |
|
---|
[21900] | 49 | ULONG SYSTEM DLL_InitWinInet(ULONG hModule)
|
---|
[6857] | 50 | {
|
---|
[21900] | 51 | CheckVersionFromHMOD(PE2LX_VERSION, hModule);/* PLF Wed 98-03-18 05:28:48*/
|
---|
[6857] | 52 |
|
---|
[21900] | 53 | dllHandle = RegisterLxDll(hModule, WininetLibMain, (PVOID)&wininet_PEResTab);
|
---|
| 54 | if (dllHandle == 0)
|
---|
| 55 | return -1;
|
---|
[6857] | 56 |
|
---|
[21900] | 57 | return 0;
|
---|
| 58 | }
|
---|
[6857] | 59 |
|
---|
[21900] | 60 | void SYSTEM DLL_TermWinInet(ULONG hModule)
|
---|
| 61 | {
|
---|
| 62 | if (dllHandle)
|
---|
| 63 | UnregisterLxDll(dllHandle);
|
---|
| 64 | }
|
---|
[6857] | 65 |
|
---|
[21900] | 66 | ULONG SYSTEM DLL_Init(ULONG hModule)
|
---|
| 67 | {
|
---|
| 68 | if (DLL_InitDefault(hModule) == -1)
|
---|
| 69 | return -1;
|
---|
| 70 | return DLL_InitWinInet(hModule);
|
---|
| 71 | }
|
---|
[6857] | 72 |
|
---|
[21900] | 73 | void SYSTEM DLL_Term(ULONG hModule)
|
---|
| 74 | {
|
---|
| 75 | DLL_TermWinInet(hModule);
|
---|
| 76 | DLL_TermDefault(hModule);
|
---|
[6857] | 77 | }
|
---|