Changeset 2649 for trunk/src


Ignore:
Timestamp:
Feb 5, 2000, 3:12:20 AM (26 years ago)
Author:
sandervl
Message:

Rewrote dll entrypoint

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/initterm.cpp

    r2513 r2649  
    1 /* $Id: initterm.cpp,v 1.33 2000-01-25 20:27:16 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.34 2000-02-05 02:01:04 sandervl Exp $ */
    22
    33/*
     
    4848#include <windllbase.h>
    4949#include "initsystem.h"
     50#include <exitlist.h>
    5051
    5152/*-------------------------------------------------------------------*/
     
    129130            /*******************************************************************/
    130131
    131             rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
     132            rc = DosExitList(EXITLIST_KERNEL32|EXLST_ADD, cleanup);
    132133            if (rc)
    133134                return 0UL;
  • trunk/src/kernel32/makefile

    r2613 r2649  
    1 # $Id: makefile,v 1.80 2000-02-03 18:56:39 sandervl Exp $
     1# $Id: makefile,v 1.81 2000-02-05 02:01:04 sandervl Exp $
    22
    33#
     
    161161    initterm.h
    162162
    163 initterm.OBJ: .\initterm.cpp initterm.h  $(PDWIN32_INCLUDE)\heapshared.h  mmap.h directory.h hmdevio.h initsystem.h $(PDWIN32_INCLUDE)\heapcode.h
     163initterm.OBJ: .\initterm.cpp initterm.h  $(PDWIN32_INCLUDE)\heapshared.h  mmap.h directory.h hmdevio.h initsystem.h $(PDWIN32_INCLUDE)\heapcode.h $(PDWIN32_INCLUDE)\exitlist.h
    164164initsystem.obj: initsystem.cpp $(PDWIN32_INCLUDE)\cpuhlp.h initsystem.h $(PDWIN32_INCLUDE)\misc.h directory.h $(PDWIN32_INCLUDE)\versionos2.h
    165165
  • trunk/src/odincrt/initterm.cpp

    r1874 r2649  
    1 /* $Id: initterm.cpp,v 1.2 1999-11-29 00:11:47 bird Exp $ */
     1/* $Id: initterm.cpp,v 1.3 2000-02-05 02:05:37 sandervl Exp $ */
    22
    33/*
     
    3333#include <odin.h>
    3434#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
     35#include <exitlist.h>
    3536
    3637extern "C" {
     
    9798         /*******************************************************************/
    9899
    99          rc = DosExitList(0x0000FF00|EXLST_ADD, cleanup);
     100         rc = DosExitList(EXITLIST_ODINCRT|EXLST_ADD, cleanup);
    100101         if(rc)
    101102                return 0UL;
  • trunk/src/odincrt/makefile

    r2178 r2649  
    1 # $Id: makefile,v 1.13 1999-12-21 12:28:07 sandervl Exp $
     1# $Id: makefile,v 1.14 2000-02-05 02:05:38 sandervl Exp $
    22
    33#
     
    3838        $(CP) $@ $(PDWIN32_LIB)
    3939
    40 initterm.obj: initterm.cpp
     40initterm.obj: initterm.cpp $(PDWIN32_INCLUDE)\exitlist.h
    4141
    4242string.obj: string.cpp
  • trunk/src/shell32/initterm.cpp

    r1252 r2649  
    1 /* $Id: initterm.cpp,v 1.9 1999-10-11 20:17:10 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.10 2000-02-05 02:10:15 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*/
     
    4849BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad);
    4950
    50 /*-------------------------------------------------------------------*/
    51 /* A clean up routine registered with DosExitList must be used if    */
    52 /* runtime calls are required and the runtime is dynamically linked. */
    53 /* This will guarantee that this clean up routine is run before the  */
    54 /* library DLL is terminated.                                        */
    55 /*-------------------------------------------------------------------*/
    56 static void APIENTRY cleanup(ULONG reason);
     51//******************************************************************************
     52//******************************************************************************
     53BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     54{
     55   switch (fdwReason)
     56   {
     57   case DLL_PROCESS_ATTACH:
     58   case DLL_THREAD_ATTACH:
     59   case DLL_THREAD_DETACH:
     60        return Shell32LibMain(hinstDLL, fdwReason, fImpLoad);
    5761
    58 
     62   case DLL_PROCESS_DETACH:
     63        Shell32LibMain(hinstDLL, fdwReason, fImpLoad);
     64        _ctordtorTerm();
     65        return TRUE;
     66   }
     67   return FALSE;
     68}
    5969/****************************************************************************/
    6070/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    8393         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    8494
    85          /*******************************************************************/
    86          /* A DosExitList routine must be used to clean up if runtime calls */
    87          /* are required and the runtime is dynamically linked.             */
    88          /*******************************************************************/
    89 
    90          if(RegisterLxDll(hModule, Shell32LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
     95         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    9196                return 0UL;
    92 
    93          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    94          if(rc)
    95                 return 0UL;
    9697
    9798         break;
     
    108109   return 1UL;
    109110}
    110 
    111 
    112 static void APIENTRY cleanup(ULONG ulReason)
    113 {
    114    _ctordtorTerm();
    115    DosExitList(EXLST_EXIT, cleanup);
    116    return ;
    117 }
     111//******************************************************************************
     112//******************************************************************************
  • trunk/src/shell32/makefile

    r2477 r2649  
    1 # $Id: makefile,v 1.18 2000-01-18 22:27:55 sandervl Exp $
     1# $Id: makefile,v 1.19 2000-02-05 02:10:16 sandervl Exp $
    22
    33#
     
    1818CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE)
    1919CXXFLAGS = $(CXXFLAGS) -I$(PDWIN32_INCLUDE)
    20 
    21 
    22 RC = $(PDWIN32_TOOLS)\wrc
    23 RCFLAGS = -s -I. -I$(CPPMAIN)\include -I$(PDWIN32_INCLUDE) -I$(PDWIN32_INCLUDE)\win
    2420
    2521TARGET = shell32
     
    6056
    6157
    62 initterm.obj:     initterm.cpp
     58initterm.obj:     initterm.cpp $(PDWIN32_INCLUDE)\exitlist.h
    6359brsfolder.obj:    brsfolder.cpp
    6460classes.obj:      classes.cpp
  • trunk/src/twain_32/initterm.cpp

    r2455 r2649  
    1 /* $Id: initterm.cpp,v 1.7 2000-01-15 22:02:07 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.8 2000-02-05 02:11:41 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*/
     
    4950extern int WINAPI PROFILE_GetOdinIniInt(LPCSTR section,LPCSTR key_name,int def);
    5051TW_UINT16 (APIENTRY *TWAINOS2_DSM_Entry)( pTW_IDENTITY, pTW_IDENTITY,
    51            TW_UINT32, TW_UINT16, TW_UINT16, TW_MEMREF) = 0;
     52                                          TW_UINT32, TW_UINT16, TW_UINT16, TW_MEMREF) = 0;
    5253static HINSTANCE hTWAIN = 0;
    5354
    5455}
     56//******************************************************************************
     57//******************************************************************************
     58BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     59{
     60   switch (fdwReason)
     61   {
     62   case DLL_PROCESS_ATTACH:
     63        return TRUE;
    5564
    56 /*-------------------------------------------------------------------*/
    57 /* A clean up routine registered with DosExitList must be used if    */
    58 /* runtime calls are required and the runtime is dynamically linked. */
    59 /* This will guarantee that this clean up routine is run before the  */
    60 /* library DLL is terminated.                                        */
    61 /*-------------------------------------------------------------------*/
    62 static void APIENTRY cleanup(ULONG reason);
     65   case DLL_THREAD_ATTACH:
     66   case DLL_THREAD_DETACH:
     67        return TRUE;
    6368
    64 
     69   case DLL_PROCESS_DETACH:
     70        _ctordtorTerm();
     71        return TRUE;
     72   }
     73   return FALSE;
     74}
    6575/****************************************************************************/
    6676/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    133143         }
    134144        }
    135          /*******************************************************************/
    136          /* A DosExitList routine must be used to clean up if runtime calls */
    137          /* are required and the runtime is dynamically linked.             */
    138          /*******************************************************************/
    139 
    140          if(RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab) == FALSE)
     145         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    141146                return 0UL;
    142 
    143          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    144          if(rc)
    145                 return 0UL;
    146147
    147148         break;
     
    161162   return 1UL;
    162163}
    163 
    164 
    165 static void APIENTRY cleanup(ULONG ulReason)
    166 {
    167    _ctordtorTerm();
    168    DosExitList(EXLST_EXIT, cleanup);
    169    return ;
    170 }
     164//******************************************************************************
     165//******************************************************************************
  • trunk/src/user32/Makefile

    r2636 r2649  
    1 # $Id: Makefile,v 1.60 2000-02-04 17:17:56 cbratschi Exp $
     1# $Id: Makefile,v 1.61 2000-02-05 02:12:20 sandervl Exp $
    22
    33#
     
    9696hook.obj: hook.cpp $(PDWIN32_INCLUDE)\win\hook.h
    9797defwndproc.obj: defwndproc.cpp syscolor.h win32wmdiclient.h win32wbase.h win32wnd.h win32dlg.h
    98 initterm.obj: initterm.cpp $(PDWIN32_INCLUDE)\spy.h pmwindow.h initterm.h
     98initterm.obj: initterm.cpp $(PDWIN32_INCLUDE)\spy.h pmwindow.h initterm.h $(PDWIN32_INCLUDE)\exitlist.h
    9999uitools.obj: uitools.cpp win32wbase.h
    100100unknown.obj: unknown.cpp
     
    147147oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h
    148148oslibdos.obj:   oslibdos.cpp oslibdos.h
    149 dc.obj:         dc.cpp win32wbase.h dc.h dcdata.h
     149dc.obj:         dc.cpp win32wbase.h dc.h $(PDWIN32_INCLUDE)\dcdata.h
    150150timer.obj:      timer.cpp win32wbase.h timer.h
    151 caret.obj:      caret.cpp win32wbase.h caret.h dcdata.h
     151caret.obj:      caret.cpp win32wbase.h caret.h $(PDWIN32_INCLUDE)\dcdata.h
    152152text.obj:       text.cpp
    153153
  • trunk/src/user32/initterm.cpp

    r2582 r2649  
    1 /* $Id: initterm.cpp,v 1.19 2000-01-31 22:30:51 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.20 2000-02-05 02:12:20 sandervl Exp $ */
    22
    33/*
     
    4242#include "syscolor.h"
    4343#include "initterm.h"
     44#include <exitlist.h>
    4445
    4546/*-------------------------------------------------------------------*/
     
    9697         /*******************************************************************/
    9798
    98          rc = DosExitList(0x00008000|EXLST_ADD, cleanup);
     99         rc = DosExitList(EXITLIST_USER32|EXLST_ADD, cleanup);
    99100         if(rc)
    100101                return 0UL;
Note: See TracChangeset for help on using the changeset viewer.