Changeset 21308 for trunk/src/kernel32


Ignore:
Timestamp:
Jun 18, 2009, 6:27:45 PM (16 years ago)
Author:
ydario
Message:

Minor updates, backout imm changes.

Location:
trunk/src/kernel32
Files:
5 edited

Legend:

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

    r21302 r21308  
    6060#include <stats.h>
    6161#include <heapshared.h>
     62#include <heapstring.h>
    6263#include <_ras.h>
    6364
     
    7172 extern DWORD kernel32_PEResTab;
    7273}
     74
     75extern PFN pfnImSetMsgQueueProperty;
    7376
    7477       ULONG   flAllocMem = 0;    /* flag to optimize DosAllocMem to use all the memory on SMP machines */
     
    7982       BOOL    fInit     = FALSE;
    8083       BOOL    fWin32k   = FALSE;
     84       HMODULE imHandle = 0;
     85       char    szModName[ 256 ] = "";
    8186
    8287/****************************************************************************/
     
    224229            CODEPAGE_Init();
    225230
     231            if( IsDBCSEnv() && DosLoadModule( szModName, sizeof( szModName ), "OS2IM.DLL", &imHandle ) == 0 )
     232                DosQueryProcAddr( imHandle, 140, NULL, &pfnImSetMsgQueueProperty );
     233
    226234            InitSystemInfo(ulSysinfo);
    227235            //Set up environment as found in NT
     
    272280    dprintf(("kernel32 exit %d\n", ulReason));
    273281
     282    if( IsDBCSEnv() && imHandle )
     283        DosFreeModule( imHandle );
     284
    274285    //Flush and delete all open memory mapped files
    275286    Win32MemMap::deleteAll();
  • trunk/src/kernel32/oslibmisc.cpp

    r21302 r21308  
    2828#include "dbglocal.h"
    2929
     30typedef APIRET ( APIENTRY *PFN_IMSETMSGQUEUEPROPERTY )( HMQ, ULONG );
     31
     32PFN_IMSETMSGQUEUEPROPERTY pfnImSetMsgQueueProperty = NULL;
     33
    3034//******************************************************************************
    3135//TODO: not reentrant!
     
    351355//******************************************************************************
    352356//******************************************************************************
    353 
     357ULONG OSLibImSetMsgQueueProperty( ULONG hmq, ULONG ulFlag )
     358{
     359    USHORT sel;
     360    APIRET rc;
     361
     362    if( !pfnImSetMsgQueueProperty )
     363        return 1;
     364
     365    sel = RestoreOS2FS();
     366    rc = pfnImSetMsgQueueProperty( hmq, ulFlag );
     367    SetFS( sel );
     368
     369    return rc;
     370}
     371//******************************************************************************
     372//******************************************************************************
     373
  • trunk/src/kernel32/oslibmisc.h

    r21302 r21308  
    103103void OSLibQueryBeginLibpath(char *lpszBeginlibpath, int size);
    104104
     105ULONG OSLibImSetMsgQueueProperty( ULONG hmq, ULONG ulFlag );
     106
    105107#ifdef __cplusplus
    106108}
  • trunk/src/kernel32/thread.cpp

    r21302 r21308  
    3434#include <handlemanager.h>
    3535#include <codepage.h>
     36#include <heapstring.h>
    3637
    3738#include "hmhandle.h"
     
    4849
    4950static ULONG priorityclass = NORMAL_PRIORITY_CLASS;
     51
     52#define MQP_INSTANCE_PERMQ              0x00000001 // from os2im.h
    5053
    5154//******************************************************************************
     
    689692    dprintf(("Win32ThreadProc: hab %x hmq %x", winteb->o.odin.hab, winteb->o.odin.hmq));
    690693    dprintf(("Stack top 0x%x, stack end 0x%x", winteb->stack_top, winteb->stack_low));
     694
     695    if( IsDBCSEnv())
     696        /* IM instace is created per message queue, that is, thread */
     697        OSLibImSetMsgQueueProperty( winteb->o.odin.hmq, MQP_INSTANCE_PERMQ );
    691698
    692699    //Note: The Win32 exception structure referenced by FS:[0] is the same
  • trunk/src/kernel32/windllbase.cpp

    r21302 r21308  
    708708        PROFILE_SetOdinIniString(DLLRENAMEOS2_SECTION, "CRTDLL32", "CRTDLL");
    709709    }
     710    if(PROFILE_GetOdinIniString(DLLRENAMEWIN_SECTION, "IMM32", "", renameddll,
     711                                sizeof(renameddll)-1) <= 1)
     712    {
     713        PROFILE_SetOdinIniString(DLLRENAMEWIN_SECTION, "IMM32", "IMM32OS2");
     714        PROFILE_SetOdinIniString(DLLRENAMEOS2_SECTION, "IMM32OS2", "IMM32");
     715    }
    710716}
    711717//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.