Changeset 10240 for trunk/src


Ignore:
Timestamp:
Aug 22, 2003, 3:16:45 PM (22 years ago)
Author:
sandervl
Message:

Ignore messages sent or posted to the desktop window; Post/SendMessage: use shared or local memory depending

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/message.cpp

    r8953 r10240  
    1 /* $Id: message.cpp,v 1.5 2002-08-01 16:04:19 sandervl Exp $ */
     1/* $Id: message.cpp,v 1.6 2003-08-22 13:16:44 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    210210        //otherwise use WinSendMsg to send it to the right process/thread
    211211        dprintf(("SendMessages (inter-process/thread) %x %x %x %x", Win32ToOS2Handle(hwnd), msg, wparam, lparam));
    212         result = OSLibSendMessage(Win32ToOS2Handle(hwnd), msg, wparam, lparam, TRUE);
     212        result = OSLibSendMessage(hwnd, Win32ToOS2Handle(hwnd), msg, wparam, lparam, TRUE);
    213213        ret = 1;
    214214    }
     
    255255        //otherwise use WinSendMsg to send it to the right process/thread
    256256        dprintf(("SendMessages (inter-process/thread) %x %x %x %x", Win32ToOS2Handle(hwnd), msg, wparam, lparam));
    257         result = OSLibSendMessage(Win32ToOS2Handle(hwnd), msg, wparam, lparam, FALSE);
     257        result = OSLibSendMessage(hwnd, Win32ToOS2Handle(hwnd), msg, wparam, lparam, FALSE);
    258258        ret = 1;
    259259    }
  • trunk/src/user32/oslibmsg.cpp

    r10216 r10240  
    1 /* $Id: oslibmsg.cpp,v 1.75 2003-08-08 13:30:19 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.76 2003-08-22 13:16:44 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    693693        default:
    694694        {
    695             pMsgPacket = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
     695            ULONG pid;
     696
     697            GetWindowThreadProcessId(hwndOdin, &pid);
     698
     699            //use shared or local memory depending on the target window
     700            //(sfree can be used for any heap)
     701            if(pid != GetCurrentProcessId()) {
     702                 pMsgPacket = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
     703            }
     704            else pMsgPacket = (POSTMSG_PACKET *)malloc(sizeof(POSTMSG_PACKET));
     705
    696706            if (!pMsgPacket)
    697707            {
     
    718728 *
    719729 * @returns
    720  * @param   hwnd        OS/2 hwnd.
     730 * @param   hwndWin32   Odin window handle.
     731 * @param   hwndOS2     OS/2 window handle
    721732 * @param   msg         Odin message id.
    722733 * @param   wParam      Message param.
     
    724735 * @param   fUnicode    Unicode indicator.
    725736 */
    726 ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode)
     737ULONG OSLibSendMessage(HWND hwndWin32, HWND hwndOS2, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode)
    727738{
    728739    ULONG           rc;                 /* return code on packing failure */
    729740    void *          pvMsgPacket;        /* packed message (shared memory) */
     741
     742    if(GetDesktopWindow() == hwndWin32) {
     743        dprintf(("Ignore messages sent to the desktop window"));
     744        return TRUE;
     745    }
    730746
    731747    /*
    732748     * Call message packer.
    733749     */
    734     pvMsgPacket = OSLibPackMessage(NULLHANDLE, hwnd, msg, wParam, lParam, fUnicode, &rc);
     750    pvMsgPacket = OSLibPackMessage(hwndWin32, hwndOS2, msg, wParam, lParam, fUnicode, &rc);
    735751    if (!pvMsgPacket)
    736752    {
     
    740756    }
    741757
    742     return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), pvMsgPacket);
     758    return (ULONG)WinSendMsg(hwndOS2, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), pvMsgPacket);
    743759}
    744760//******************************************************************************
     
    779795{
    780796    void *          pvMsgPacket;        /* packed message (shared memory) */
     797
     798    if(GetDesktopWindow() == hwndWin32) {
     799        dprintf(("Ignore messages posted to the desktop window"));
     800        return TRUE;
     801    }
    781802
    782803    /*
  • trunk/src/user32/oslibmsg.h

    r10216 r10240  
    1 /* $Id: oslibmsg.h,v 1.22 2003-08-08 13:30:19 sandervl Exp $ */
     1/* $Id: oslibmsg.h,v 1.23 2003-08-22 13:16:45 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    5353BOOL  OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode);
    5454BOOL  OSLibPostMessage(HWND hwndWin32, HWND hwndOS2, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
    55 ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
     55ULONG OSLibSendMessage(HWND hwndWin32, HWND hwndOS2, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
    5656ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend);
    5757BOOL  OSLibSendWinMessage(HWND hwnd, ULONG winmsg);
  • trunk/src/user32/pmwindow.cpp

    r10190 r10240  
    1 /* $Id: pmwindow.cpp,v 1.218 2003-07-31 15:56:44 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.219 2003-08-22 13:16:45 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    117117// WM_KEYDOWN messages come in properly.
    118118static BOOL fKeyAltGrDown = FALSE;
    119 
     119static BOOL fEnableCDPolling = FALSE;
    120120
    121121static char *PMDragExtractFiles(PDRAGINFO pDragInfo, ULONG *pcItems, ULONG *pulBytes);
     
    343343{
    344344    fDragDropDisabled = fDisabled;
     345}
     346//******************************************************************************
     347// Turn on CD Polling (window with 2 second timer to check CD disk presence)
     348//
     349// NOTE: This can cause PM hangs when executing a program for a very long time
     350//       (block in IOCtl)
     351//******************************************************************************
     352void WIN32API CustEnableCDPolling()
     353{
     354    fEnableCDPolling = TRUE;
    345355}
    346356//******************************************************************************
     
    598608
    599609        //Create CD notification window
    600         if(hwndCD == 0) {
     610        if(hwndCD == 0 && fEnableCDPolling) {
    601611            hwndCD = WinCreateWindow(HWND_DESKTOP, WIN32_CDCLASS,
    602612                                     NULL, 0, 0, 0, 0, 0,
Note: See TracChangeset for help on using the changeset viewer.