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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    /*
Note: See TracChangeset for help on using the changeset viewer.