Ignore:
Timestamp:
Sep 2, 2000, 11:14:50 PM (25 years ago)
Author:
bird
Message:

Optimizations for Win32k.sys.

File:
1 edited

Legend:

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

    r3993 r4167  
    1 /* $Id: initterm.cpp,v 1.44 2000-08-11 10:56:16 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.45 2000-09-02 21:14:50 bird Exp $ */
    22
    33/*
     
    5151#include "oslibdos.h"
    5252#include <cpuhlp.h>
    53 
    54 #define DBG_LOCALLOG    DBG_initterm
     53#include <Win32k.h>
     54
     55#define DBG_LOCALLOG    DBG_initterm
    5556#include "dbglocal.h"
     57
    5658
    5759/*-------------------------------------------------------------------*/
     
    107109    {
    108110        case 0 :
    109         {
    110             ParseLogStatus();
     111        {
     112            libWin32kInit();
     113
     114            ParseLogStatus();
    111115
    112116            loadNr = globLoadNr++;
    113117
    114             strcpy(kernel32Path, OSLibGetDllName(hModule));
    115             char *endofpath = strrchr(kernel32Path, '\\');
    116             *(endofpath+1) = 0;
     118            strcpy(kernel32Path, OSLibGetDllName(hModule));
     119            char *endofpath = strrchr(kernel32Path, '\\');
     120            *(endofpath+1) = 0;
    117121            dprintf(("kernel32 init\n"));
    118122            _ctordtorInit();
     
    120124            CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    121125
    122             OpenPrivateLogFiles();
    123 
    124             if(InitializeSharedHeap() == FALSE)
    125                 return 0UL;
    126 
    127             if(InitializeCodeHeap() == FALSE)
     126            OpenPrivateLogFiles();
     127
     128            if (InitializeSharedHeap() == FALSE)
     129                return 0UL;
     130
     131            if (InitializeCodeHeap() == FALSE)
    128132                return 0UL;
    129133
    130134            PROFILE_LoadOdinIni();
    131135            dllHandle = RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab);
    132             if(dllHandle == 0)
    133                 return 0UL;
    134 
    135             //SvL: Kernel32 is a special case; pe.exe loads it, so increase
     136            if (dllHandle == 0)
     137                return 0UL;
     138
     139            //SvL: Kernel32 is a special case; pe.exe loads it, so increase
    136140            //     the reference count here
    137             Win32DllBase *module = Win32DllBase::findModule(dllHandle);
    138             if(module) {
    139                 module->AddRef();
    140                 module->DisableUnload();
    141             }
     141            Win32DllBase *module = Win32DllBase::findModule(dllHandle);
     142            if (module)
     143            {
     144                module->AddRef();
     145                module->DisableUnload();
     146            }
    142147
    143148            /*******************************************************************/
     
    156161                flAllocMem = PAG_ANY;      // high memory support. Let's use it!
    157162                ulMaxAddr = ulSysinfo * (1024*1024);
    158                 OSLibInitWSeBFileIO();
     163                OSLibInitWSeBFileIO();
    159164            }
    160165            else
    161166                flAllocMem = 0;        // no high memory support
    162167
    163             OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES);
     168            OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES);
    164169
    165170            //SvL: Do it here instead of during the exe object creation
    166171            //(std handles can be used in win32 dll initialization routines
    167172            HMInitialize();             /* store standard handles within HandleManager */
    168             InitializeTIB(TRUE);        //MUST be done after HMInitialize!
     173            InitializeTIB(TRUE);    //MUST be done after HMInitialize!
    169174            InitDirectories();
    170175            RegisterDevices();
    171             Win32DllBase::setDefaultRenaming();
     176            Win32DllBase::setDefaultRenaming();
    172177            rc = DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &ulSysinfo, sizeof(ulSysinfo));
    173             if (rc != 0) 
    174                 ulSysinfo = 1;
     178            if (rc != 0)
     179                ulSysinfo = 1;
    175180
    176181            InitSystemInfo(ulSysinfo);
    177             //Set up environment as found in NT
     182            //Set up environment as found in NT
    178183            InitEnvironment(ulSysinfo);
    179184            break;
    180         }
     185        }
     186
    181187        case 1 :
    182             if(dllHandle) {
    183                 UnregisterLxDll(dllHandle);
    184             }
    185             break;
     188        if (dllHandle)
     189        {
     190            UnregisterLxDll(dllHandle);
     191        }
     192        break;
     193
    186194        default  :
    187195            return 0UL;
Note: See TracChangeset for help on using the changeset viewer.