source: trunk/src/ntdll/initterm.cpp@ 22012

Last change on this file since 22012 was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 1.3 KB
Line 
1/*
2 * NTDLL DLL entry point
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
10#include <os2.h> //Odin32 OS/2 api wrappers
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
21extern "C"
22BOOL WIN32API NTDLL_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
23
24extern DWORD ntdll_PEResTab;
25
26static HMODULE dllHandle = 0;
27
28ULONG SYSTEM DLL_Init(ULONG hModule)
29{
30 if (DLL_InitDefault(hModule) == -1)
31 return -1;
32
33 //Initialize kernel32 first (circular dependency between kernel32 & ntdll)
34 if (!InitializeKernel32())
35 return -1;
36
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;
43
44 dprintf(("NTDLL INIT %s %s (%x)", __DATE__, __TIME__, DLL_Init));
45
46 return EXITLIST_NONCRITDLL;
47}
48
49void SYSTEM DLL_Term(ULONG hModule)
50{
51 dprintf(("NTDLL TERM"));
52
53 UnregisterLxDll(dllHandle);
54 DLL_TermDefault(hModule);
55}
56
Note: See TracBrowser for help on using the repository browser.