Changeset 8953 for trunk/src


Ignore:
Timestamp:
Aug 1, 2002, 6:04:19 PM (23 years ago)
Author:
sandervl
Message:

Signal post message event semaphore in PostMessageA/W & PostThreadMessage

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r8629 r8953  
    1 /* $Id: message.cpp,v 1.4 2002-06-10 09:12:35 sandervl Exp $ */
     1/* $Id: message.cpp,v 1.5 2002-08-01 16:04:19 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    320320    RELEASE_WNDOBJ(window);
    321321    DebugPrintMessage(hwnd, msg, wParam, lParam, FALSE, TRUE);
    322     return OSLibPostMessage(hwndOS2, msg, wParam, lParam, FALSE);
     322    return OSLibPostMessage(hwnd, hwndOS2, msg, wParam, lParam, FALSE);
    323323}
    324324//******************************************************************************
     
    355355    RELEASE_WNDOBJ(window);
    356356    DebugPrintMessage(hwnd, msg, wParam, lParam, TRUE, TRUE);
    357     return OSLibPostMessage(hwndOS2, msg, wParam, lParam, TRUE);
     357    return OSLibPostMessage(hwnd, hwndOS2, msg, wParam, lParam, TRUE);
    358358}
    359359//******************************************************************************
  • trunk/src/user32/oslibmsg.cpp

    r8908 r8953  
    1 /* $Id: oslibmsg.cpp,v 1.59 2002-07-23 11:04:18 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.60 2002-08-01 16:04:19 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    611611//******************************************************************************
    612612//******************************************************************************
    613 BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode)
     613BOOL OSLibPostMessage(HWND hwndWin32, HWND hwndOS2, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode)
    614614{
    615615    POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    616  
     616    BOOL ret;
     617
    617618    if (NULL == packet)
    618619    {
     
    623624        return FALSE;
    624625    }
     626    TEB *teb = GetTEBFromThreadId(GetWindowThreadProcessId(hwndWin32, NULL));
     627
    625628    packet->wParam   = wParam;
    626629    packet->lParam   = lParam;
    627     return WinPostMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
     630    ret = WinPostMsg(hwndOS2, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
     631
     632    if(teb && (teb->o.odin.dwWakeMask & QS_POSTMESSAGE_W)) {
     633        //thread is blocked in MsgWaitForMultipleObjects waiting for
     634        //posted messages
     635        dprintf(("PostMessage: Wake up thread %x which is blocked in MsgWaitForMultipleObjects", teb->o.odin.threadId));
     636        SetEvent(teb->o.odin.hPostMsgEvent);
     637    }
     638    return ret;
    628639}
    629640//******************************************************************************
     
    668679       return FALSE;
    669680    }
     681
     682    if(teb->o.odin.dwWakeMask & QS_POSTMESSAGE_W) {
     683        //thread is blocked in MsgWaitForMultipleObjects waiting for
     684        //posted messages
     685        dprintf(("PostMessage: Wake up thread %x which is blocked in MsgWaitForMultipleObjects", teb->o.odin.threadId));
     686        SetEvent(teb->o.odin.hPostMsgEvent);
     687    }
     688
    670689    SetLastError(ERROR_SUCCESS_W);
    671690    return TRUE;
  • trunk/src/user32/oslibmsg.h

    r7195 r8953  
    1 /* $Id: oslibmsg.h,v 1.16 2001-10-24 15:41:53 sandervl Exp $ */
     1/* $Id: oslibmsg.h,v 1.17 2002-08-01 16:04:19 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    4343
    4444BOOL  OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode);
    45 BOOL  OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
     45BOOL  OSLibPostMessage(HWND hwndWin32, HWND hwndOS2, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
    4646ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode);
    4747ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend);
Note: See TracChangeset for help on using the changeset viewer.