source: trunk/src/comdlg32/initterm.cpp

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

Merge branch gcc-kmk to trunk.

File size: 1.9 KB
Line 
1/* $Id: initterm.cpp,v 1.14 2001-09-05 12:12:02 bird Exp $ */
2/*
3 * COMDLG32 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#define INCL_WINSHELLDATA
14#include <os2wrap.h> //Odin32 OS/2 api wrappers
15#include <stdlib.h>
16#include <stdio.h>
17#include <string.h>
18#include <odin.h>
19#include <win32type.h>
20#include <win32api.h>
21#include <winconst.h>
22#include <odinlx.h>
23#include <misc.h> /*PLF Wed 98-03-18 23:18:15*/
24#include <initdll.h>
25
26// Win32 resource table (produced by wrc)
27extern DWORD comdlg32_PEResTab;
28
29static HMODULE dllHandle = 0;
30
31BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved);
32
33BOOL WINAPI LibMainComdlg32(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
34{
35 switch (fdwReason)
36 {
37 case DLL_PROCESS_ATTACH:
38 return COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
39
40 case DLL_THREAD_ATTACH:
41 case DLL_THREAD_DETACH:
42 case DLL_PROCESS_DETACH:
43 COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
44 return TRUE;
45 }
46 return FALSE;
47}
48
49ULONG SYSTEM DLL_InitComdlg32(ULONG hModule)
50{
51 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/
52
53 dllHandle = RegisterLxDll(hModule, LibMainComdlg32, (PVOID)&comdlg32_PEResTab,
54 COMDLG32_MAJORIMAGE_VERSION, COMDLG32_MINORIMAGE_VERSION,
55 IMAGE_SUBSYSTEM_WINDOWS_GUI);
56 if (dllHandle == 0)
57 return -1;
58
59 return 0;
60}
61
62void SYSTEM DLL_TermComdlg32(ULONG hModule)
63{
64 if (dllHandle)
65 UnregisterLxDll(dllHandle);
66}
67
68ULONG SYSTEM DLL_Init(ULONG hModule)
69{
70 if (DLL_InitDefault(hModule) == -1)
71 return -1;
72 return DLL_InitComdlg32(hModule);
73}
74
75void SYSTEM DLL_Term(ULONG hModule)
76{
77 DLL_TermComdlg32(hModule);
78 DLL_TermDefault(hModule);
79}
Note: See TracBrowser for help on using the repository browser.