Ignore:
Timestamp:
Jun 18, 2009, 11:53:26 AM (16 years ago)
Author:
ydario
Message:

Kernel32 updates.

File:
1 edited

Legend:

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

    r10606 r21302  
    6060#include <stats.h>
    6161#include <heapshared.h>
    62 #include <heapstring.h>
     62#include <_ras.h>
    6363
    6464#define DBG_LOCALLOG    DBG_initterm
     
    7171 extern DWORD kernel32_PEResTab;
    7272}
    73 
    74 extern PFN pfnImSetMsgQueueProperty;
    7573
    7674       ULONG   flAllocMem = 0;    /* flag to optimize DosAllocMem to use all the memory on SMP machines */
     
    8179       BOOL    fInit     = FALSE;
    8280       BOOL    fWin32k   = FALSE;
    83        HMODULE imHandle = 0;
    84        char    szModName[ 256 ] = "";
    8581
    8682/****************************************************************************/
     
    113109        case 0 :
    114110        {
     111            // This always must be the first thing to do.
     112            RasInitialize (hModule);
     113#ifdef RAS
     114            extern void rasInitVirtual (void);
     115            rasInitVirtual ();
     116#endif
     117
    115118            ParseLogStatusKERNEL32();
    116119
     
    221224            CODEPAGE_Init();
    222225
    223             if( IsDBCSEnv() && DosLoadModule( szModName, sizeof( szModName ), "OS2IM.DLL", &imHandle ) == 0 )
    224                 DosQueryProcAddr( imHandle, 140, NULL, &pfnImSetMsgQueueProperty );
    225 
    226226            InitSystemInfo(ulSysinfo);
    227227            //Set up environment as found in NT
     
    237237            SetProcessAffinityMask(GetCurrentProcess(), dwSystemAffinityMask);
    238238
     239            //Activate current timezone information
     240            TIME_ZONE_INFORMATION tzone;
     241            GetTimeZoneInformation(&tzone);
     242            SetTimeZoneInformation(&tzone);
     243
    239244            //Set default paths for PE & NE loaders
    240245            InitLoaders();
     246           
     247            RasEntry (RAS_EVENT_Kernel32InitComplete, &dllHandle, sizeof (dllHandle));
     248           
    241249            break;
    242250        }
     
    264272    dprintf(("kernel32 exit %d\n", ulReason));
    265273
    266     if( IsDBCSEnv() && imHandle )
    267         DosFreeModule( imHandle );
    268 
    269274    //Flush and delete all open memory mapped files
    270275    Win32MemMap::deleteAll();
    271276    WinExe = NULL;
     277
     278    FinalizeMemMaps();
    272279
    273280    WriteOutProfiles();
     
    281288
    282289    HMTerminate(); /* shutdown handlemanager */
     290
     291#ifdef DEBUG
     292    extern void printCriticalSectionStatistic (void);
     293    printCriticalSectionStatistic ();
     294#endif
    283295
    284296#if defined(DEBUG) && defined(__IBMCPP__) && __IBMCPP__ == 300
     
    298310    //NOTE: Must be done after DestroyTIB
    299311    ClosePrivateLogFiles();
     312
     313#ifndef DEBUG
     314    //if we do a dump of the shared heap, then we'll need the logging facility
     315    //for a little while longer
    300316    CloseLogFile();
     317#endif
    301318
    302319    /*
     
    305322    libWin32kSetEnvironment(NULL, 0, 0);
    306323    libWin32kTerm();
     324
     325    RasUninitialize ();
     326   
    307327    return ;
    308328}
Note: See TracChangeset for help on using the changeset viewer.