source: branches/swt/src/usp10/initterm.cpp@ 22103

Last change on this file since 22103 was 22103, checked in by rousseau, 10 years ago

usp10: Enable console-debug for usp10 init-term

File size: 1.7 KB
Line 
1/* $Id: initterm.cpp,v 1.1 2002-04-10 18:35:18 bird Exp $ */
2/*
3 * USP10 DLL entry point
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
24// Win32 resource table (produced by wrc)
25extern DWORD usp10_PEResTab;
26
27static HMODULE dllHandle = 0;
28
29BOOL WINAPI LibMainUsp10(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
30{
31 switch (fdwReason)
32 {
33 case DLL_PROCESS_ATTACH:
34 case DLL_THREAD_ATTACH:
35 case DLL_THREAD_DETACH:
36 case DLL_PROCESS_DETACH:
37 return TRUE;
38 }
39 return FALSE;
40}
41
42ULONG SYSTEM DLL_InitUsp10(ULONG hModule)
43{
44 __con_debug(2,"%s::%s@%08X(%08X)\n","USP10",__FUNCTION__,DLL_InitUsp10,hModule);
45 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/
46
47 dllHandle = RegisterLxDll(hModule, LibMainUsp10, (PVOID)&usp10_PEResTab);
48 if (dllHandle == 0)
49 return -1;
50
51 return 0;
52}
53
54void SYSTEM DLL_TermUsp10(ULONG hModule)
55{
56 __con_debug(2,"%s::%s@%08X(%08X)\n","USP10",__FUNCTION__,DLL_TermUsp10,hModule);
57 if (dllHandle)
58 UnregisterLxDll(dllHandle);
59}
60
61ULONG SYSTEM DLL_Init(ULONG hModule)
62{
63 if (DLL_InitDefault(hModule) == -1)
64 return -1;
65 return DLL_InitUsp10(hModule);
66}
67
68void SYSTEM DLL_Term(ULONG hModule)
69{
70 DLL_TermUsp10(hModule);
71 DLL_TermDefault(hModule);
72}
Note: See TracBrowser for help on using the repository browser.