Changeset 2647


Ignore:
Timestamp:
Feb 5, 2000, 2:54:33 AM (25 years ago)
Author:
sandervl
Message:

Rewrote dll entrypoint

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/comctl32/initterm.cpp

    r1402 r2647  
    1 /* $Id: initterm.cpp,v 1.8 1999-10-22 18:04:10 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.9 2000-02-05 01:53:54 sandervl Exp $ */
    22/*
    33 * COMCTL32 DLL entry point
     
    3333#include <misc.h>       /*PLF Wed  98-03-18 23:18:29*/
    3434#include <win32type.h>
     35#include <winconst.h>
    3536#include <odinlx.h>
    3637
     
    4344}
    4445
    45 /*-------------------------------------------------------------------*/
    46 /* A clean up routine registered with DosExitList must be used if    */
    47 /* runtime calls are required and the runtime is dynamically linked. */
    48 /* This will guarantee that this clean up routine is run before the  */
    49 /* library DLL is terminated.                                        */
    50 /*-------------------------------------------------------------------*/
    51 static void APIENTRY cleanup(ULONG reason);
    52 
    5346void CDECL RegisterCOMCTL32WindowClasses(unsigned long hinstDLL);
    5447void CDECL UnregisterCOMCTL32WindowClasses(void);
    5548
     49//******************************************************************************
     50//******************************************************************************
     51BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     52{
     53   switch (fdwReason)
     54   {
     55   case DLL_PROCESS_ATTACH:
     56        return TRUE;
     57
     58   case DLL_THREAD_ATTACH:
     59   case DLL_THREAD_DETACH:
     60        return TRUE;
     61
     62   case DLL_PROCESS_DETACH:
     63        /* unregister Win32 window classes */
     64        UnregisterCOMCTL32WindowClasses();
     65        _ctordtorTerm();
     66        return TRUE;
     67   }
     68   return FALSE;
     69}
    5670/****************************************************************************/
    5771/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    8498         /*******************************************************************/
    8599
    86          if(RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab) == FALSE)
     100         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    87101                return 0UL;
    88 
    89          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    90          if(rc)
    91                 return 0UL;
    92102
    93103         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
     
    109119   return 1UL;
    110120}
    111 
    112 static void APIENTRY cleanup(ULONG ulReason)
    113 {
    114    /* unregister Win32 window classes */
    115    UnregisterCOMCTL32WindowClasses();
    116    _ctordtorTerm();
    117    DosExitList(EXLST_EXIT, cleanup);
    118    return ;
    119 }
     121//******************************************************************************
     122//******************************************************************************
  • TabularUnified trunk/src/comctl32/makefile

    r1585 r2647  
    1 # $Id: makefile,v 1.18 1999-11-03 23:28:04 sandervl Exp $
     1# $Id: makefile,v 1.19 2000-02-05 01:53:54 sandervl Exp $
    22#
    33# PD-Win32 API
     
    1717CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE)
    1818CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE)
    19 
    20 RC = $(PDWIN32_TOOLS)\wrc
    21 RCFLAGS = -s -I. -I$(CPPMAIN)\include -I$(PDWIN32_INCLUDE) -I$(PDWIN32_INCLUDE)\win
    2219
    2320TARGET = comctl32
  • TabularUnified trunk/src/comdlg32/initterm.cpp

    r1548 r2647  
    1 /* $Id: initterm.cpp,v 1.8 1999-11-02 19:09:42 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.9 2000-02-05 01:54:33 sandervl Exp $ */
    22
    33/*
     
    3333#include <odin.h>
    3434#include <win32type.h>
     35#include <winconst.h>
    3536#include <odinlx.h>
    3637#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
     
    4546 BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved);
    4647}
     48//******************************************************************************
     49//******************************************************************************
     50BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     51{
     52   switch (fdwReason)
     53   {
     54   case DLL_PROCESS_ATTACH:
     55   case DLL_THREAD_ATTACH:
     56   case DLL_THREAD_DETACH:
     57        return COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
    4758
    48 /*-------------------------------------------------------------------*/
    49 /* A clean up routine registered with DosExitList must be used if    */
    50 /* runtime calls are required and the runtime is dynamically linked. */
    51 /* This will guarantee that this clean up routine is run before the  */
    52 /* library DLL is terminated.                                        */
    53 /*-------------------------------------------------------------------*/
    54 static void APIENTRY cleanup(ULONG reason);
    55 
    56 
     59   case DLL_PROCESS_DETACH:
     60        COMDLG32_DllEntryPoint(hinstDLL, fdwReason, fImpLoad);
     61        _ctordtorTerm();
     62        return TRUE;
     63   }
     64   return FALSE;
     65}
    5766/****************************************************************************/
    5867/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    8695         /*******************************************************************/
    8796
    88          if(RegisterLxDll(hModule, COMDLG32_DllEntryPoint, (PVOID)&_Resource_PEResTab) == FALSE)
     97         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    8998                return 0UL;
    90 
    91          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    92          if(rc)
    93                 return 0UL;
    9499
    95100         break;
     
    106111   return 1UL;
    107112}
    108 
    109 
    110 static void APIENTRY cleanup(ULONG ulReason)
    111 {
    112    _ctordtorTerm();
    113    DosExitList(EXLST_EXIT, cleanup);
    114    return ;
    115 }
  • TabularUnified trunk/src/comdlg32/makefile

    r2629 r2647  
    1 # $Id: makefile,v 1.12 2000-02-03 23:05:49 sandervl Exp $
     1# $Id: makefile,v 1.13 2000-02-05 01:54:33 sandervl Exp $
    22
    33#
     
    1818CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE)
    1919CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE)
    20 
    21 RC = $(PDWIN32_TOOLS)\wrc
    22 RCFLAGS = -s -I. -I$(CPPMAIN)\include -I$(PDWIN32_INCLUDE) -I$(PDWIN32_INCLUDE)\win
    23 
    2420
    2521TARGET = comdlg32
Note: See TracChangeset for help on using the changeset viewer.