[21871] | 1 | /* $Id: initterm.cpp,v 1.14 2001-09-05 12:12:02 bird Exp $ */
|
---|
[6375] | 2 | /*
|
---|
[21871] | 3 | * COMDLG32 DLL entry point
|
---|
[6375] | 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
|
---|
[9376] | 13 | #define INCL_WINSHELLDATA
|
---|
[6375] | 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>
|
---|
[9376] | 20 | #include <win32api.h>
|
---|
[6375] | 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 |
|
---|
[21871] | 26 | // Win32 resource table (produced by wrc)
|
---|
| 27 | extern DWORD comdlg32_PEResTab;
|
---|
[6375] | 28 |
|
---|
| 29 | static HMODULE dllHandle = 0;
|
---|
| 30 |
|
---|
[21871] | 31 | BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved);
|
---|
| 32 |
|
---|
[6375] | 33 | BOOL WINAPI LibMainComdlg32(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
---|
| 34 | {
|
---|
[21871] | 35 | switch (fdwReason)
|
---|
| 36 | {
|
---|
| 37 | case DLL_PROCESS_ATTACH:
|
---|
| 38 | return COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
|
---|
[9990] | 39 |
|
---|
[21871] | 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;
|
---|
[6375] | 47 | }
|
---|
[21871] | 48 |
|
---|
| 49 | ULONG SYSTEM DLL_InitComdlg32(ULONG hModule)
|
---|
[6375] | 50 | {
|
---|
[21871] | 51 | CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/
|
---|
[6375] | 52 |
|
---|
[21871] | 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;
|
---|
[6375] | 58 |
|
---|
[21871] | 59 | return 0;
|
---|
| 60 | }
|
---|
[9990] | 61 |
|
---|
[21871] | 62 | void SYSTEM DLL_TermComdlg32(ULONG hModule)
|
---|
| 63 | {
|
---|
| 64 | if (dllHandle)
|
---|
| 65 | UnregisterLxDll(dllHandle);
|
---|
| 66 | }
|
---|
[6375] | 67 |
|
---|
[21871] | 68 | ULONG SYSTEM DLL_Init(ULONG hModule)
|
---|
| 69 | {
|
---|
| 70 | if (DLL_InitDefault(hModule) == -1)
|
---|
| 71 | return -1;
|
---|
| 72 | return DLL_InitComdlg32(hModule);
|
---|
[6375] | 73 | }
|
---|
[21871] | 74 |
|
---|
| 75 | void SYSTEM DLL_Term(ULONG hModule)
|
---|
| 76 | {
|
---|
| 77 | DLL_TermComdlg32(hModule);
|
---|
| 78 | DLL_TermDefault(hModule);
|
---|
| 79 | }
|
---|