source: trunk/src/shell32/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.8 KB
RevLine 
[6375]1/*
[21860]2 * SHELL32 DLL entry point
[6375]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#define INCL_DOSMODULEMGR
11#define INCL_DOSPROCESS
12#include <os2wrap.h> //Odin32 OS/2 api wrappers
13#include <stdlib.h>
14#include <stdio.h>
15#include <string.h>
16#include <odin.h>
17#include <win32type.h>
18#include <winconst.h>
19#include <odinlx.h>
20#include <misc.h> /*PLF Wed 98-03-18 23:18:15*/
21#include <initdll.h>
22
[21860]23// Win32 resource table (produced by wrc)
24extern DWORD shell32_PEResTab;
25
[6375]26static HMODULE dllHandle = 0;
27
28BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad);
29
30BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
31{
[21860]32 BOOL ret;
[6375]33
[21860]34 switch (fdwReason)
35 {
36 case DLL_PROCESS_ATTACH:
37 case DLL_THREAD_ATTACH:
38 case DLL_THREAD_DETACH:
39 return Shell32LibMain(hinstDLL, fdwReason, fImpLoad);
[6375]40
[21860]41 case DLL_PROCESS_DETACH:
42 ret = Shell32LibMain(hinstDLL, fdwReason, fImpLoad);
43 return ret;
44 }
45 return FALSE;
[6375]46}
[21860]47
48ULONG SYSTEM DLL_InitShell32(ULONG hModule)
[6375]49{
[21860]50 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/
[6375]51
[21860]52 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&shell32_PEResTab,
53 SHELL32_MAJORIMAGE_VERSION, SHELL32_MINORIMAGE_VERSION,
54 IMAGE_SUBSYSTEM_WINDOWS_GUI);
55 if (dllHandle == 0)
56 return -1;
[6375]57
[21860]58 return 0;
59}
[6375]60
[21860]61void SYSTEM DLL_TermShell32(ULONG hModule)
62{
63 if (dllHandle)
64 UnregisterLxDll(dllHandle);
65}
[6375]66
[21860]67ULONG SYSTEM DLL_Init(ULONG hModule)
68{
69 if (DLL_InitDefault(hModule) == -1)
70 return -1;
71 return DLL_InitShell32(hModule);
72}
[6375]73
[21860]74void SYSTEM DLL_Term(ULONG hModule)
75{
76 DLL_TermShell32(hModule);
77 DLL_TermDefault(hModule);
[6375]78}
Note: See TracBrowser for help on using the repository browser.