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

Signal post message event semaphore in PostMessageA/W & PostThreadMessage

File:
1 edited

Legend:

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