Rev | Line | |
---|
[9733] | 1 | /*
|
---|
[21757] | 2 | * NTDLL DLL entry point
|
---|
[9733] | 3 | *
|
---|
| 4 | * Copyright 1998 Sander van Leeuwen
|
---|
| 5 | * Copyright 1998 Peter Fitzsimmons
|
---|
| 6 | *
|
---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 8 | */
|
---|
| 9 |
|
---|
[21584] | 10 | #include <os2.h> //Odin32 OS/2 api wrappers
|
---|
[9733] | 11 | #include <win32type.h>
|
---|
| 12 | #include <stdlib.h>
|
---|
| 13 | #include <stdio.h>
|
---|
| 14 | #include <string.h>
|
---|
| 15 | #include <odin.h>
|
---|
| 16 | #include <odinlx.h>
|
---|
| 17 | #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/
|
---|
| 18 | #include <initdll.h>
|
---|
| 19 | #include <exitlist.h>
|
---|
| 20 |
|
---|
[21757] | 21 | extern "C"
|
---|
| 22 | BOOL WIN32API NTDLL_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
---|
[9733] | 23 |
|
---|
[9776] | 24 | extern DWORD ntdll_PEResTab;
|
---|
[9733] | 25 |
|
---|
| 26 | static HMODULE dllHandle = 0;
|
---|
| 27 |
|
---|
[21757] | 28 | ULONG SYSTEM DLL_Init(ULONG hModule)
|
---|
[9733] | 29 | {
|
---|
[21757] | 30 | if (DLL_InitDefault(hModule) == -1)
|
---|
| 31 | return -1;
|
---|
[9733] | 32 |
|
---|
[21757] | 33 | //Initialize kernel32 first (circular dependency between kernel32 & ntdll)
|
---|
| 34 | if (!InitializeKernel32())
|
---|
| 35 | return -1;
|
---|
[9733] | 36 |
|
---|
[21757] | 37 | CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/
|
---|
| 38 | dllHandle = RegisterLxDll(hModule, (WIN32DLLENTRY)NTDLL_LibMain,
|
---|
| 39 | (PVOID)&ntdll_PEResTab,
|
---|
| 40 | 0, 0, 0);
|
---|
| 41 | if(dllHandle == 0)
|
---|
| 42 | return -1;
|
---|
[10041] | 43 |
|
---|
[21757] | 44 | dprintf(("NTDLL INIT %s %s (%x)", __DATE__, __TIME__, DLL_Init));
|
---|
[21799] | 45 |
|
---|
| 46 | return EXITLIST_NONCRITDLL;
|
---|
[21757] | 47 | }
|
---|
[9733] | 48 |
|
---|
[21757] | 49 | void SYSTEM DLL_Term(ULONG hModule)
|
---|
| 50 | {
|
---|
| 51 | dprintf(("NTDLL TERM"));
|
---|
[9733] | 52 |
|
---|
[21757] | 53 | UnregisterLxDll(dllHandle);
|
---|
| 54 | DLL_TermDefault(hModule);
|
---|
[9733] | 55 | }
|
---|
[21757] | 56 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.